aboutsummaryrefslogtreecommitdiffstats
path: root/src/sandbox/org/apache/fop/render/mif
diff options
context:
space:
mode:
authorJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
committerJeremias Maerki <jeremias@apache.org>2010-08-14 17:17:00 +0000
commit29e8badcec8bd40eca2ef4940133f08eeefdda11 (patch)
tree7b44a2d058ae8a60ff278f5d26f243eb674e54c6 /src/sandbox/org/apache/fop/render/mif
parentc81729764a0692e9f5e31ec28722403b603ee5aa (diff)
downloadxmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.tar.gz
xmlgraphics-fop-29e8badcec8bd40eca2ef4940133f08eeefdda11.zip
Bugzilla #49733:
Resolved compilation (safe one), Checkstyle and many Javadoc warnings. Submitted by: Glenn Adams <glenn.at.skynav.com> Changes to patch: - Restored the deprecated Graphics2DAdapter method (to be removed after Barcode4J 2.1 is released). - Restored Renderer.startPageSequence(LineArea) pending discussion about removal. - build.xml: set max VM to 1024MB instead of 2048MB to allow for 32-bit JVMs. - build.xml: restored longer taskdef names. - Restored Checkstyle 4 file for people running older IDEs. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@985537 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/sandbox/org/apache/fop/render/mif')
-rw-r--r--src/sandbox/org/apache/fop/render/mif/MIFElement.java19
-rw-r--r--src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java6
-rw-r--r--src/sandbox/org/apache/fop/render/mif/MIFFile.java21
-rw-r--r--src/sandbox/org/apache/fop/render/mif/MIFHandler.java226
-rw-r--r--src/sandbox/org/apache/fop/render/mif/PGFElement.java4
-rw-r--r--src/sandbox/org/apache/fop/render/mif/RefElement.java9
-rw-r--r--src/sandbox/org/apache/fop/render/mif/RulingElement.java3
7 files changed, 114 insertions, 174 deletions
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFElement.java b/src/sandbox/org/apache/fop/render/mif/MIFElement.java
index 8c749366f..b0aa7d5f5 100644
--- a/src/sandbox/org/apache/fop/render/mif/MIFElement.java
+++ b/src/sandbox/org/apache/fop/render/mif/MIFElement.java
@@ -31,24 +31,32 @@ import java.util.List;
* to an output stream including sub-elements or a single value.
*/
public class MIFElement {
+ /** name */
protected String name;
+ /** value string */
protected String valueStr = null;
+ /** value elements */
protected List valueElements = null;
-
+ /** true if started */
protected boolean started = false;
+ /** true if finishing */
protected boolean finish = false;
+ /** true if finished */
protected boolean finished = false;
/**
+ * @param name a name
*/
- public MIFElement(String n) {
- name = n;
+ public MIFElement(String name) {
+ this.name = name;
}
+ /** @param str a string value */
public void setValue(String str) {
valueStr = str;
}
+ /** @param el an MIF element */
public void addElement(MIFElement el) {
if (valueElements == null) {
valueElements = new java.util.ArrayList();
@@ -62,6 +70,10 @@ public class MIFElement {
* This method can be called again to continue from the previous point.
* An element that contains child elements will only be finished when
* the finish method is called.
+ * @param os output stream
+ * @param indent indentation
+ * @return true if finished
+ * @throws IOException if not caught
*/
public boolean output(OutputStream os, int indent) throws IOException {
if (finished) {
@@ -105,6 +117,7 @@ public class MIFElement {
return true;
}
+ /** @param deep if true, also perform finish over value elements */
public void finish(boolean deep) {
finish = true;
if (deep && valueElements != null) {
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java b/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java
index 01357c18d..31ce03dc3 100644
--- a/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java
+++ b/src/sandbox/org/apache/fop/render/mif/MIFFOEventHandlerMaker.java
@@ -34,17 +34,17 @@ public class MIFFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_MIF};
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker */
+ /** {@inheritDoc} */
public FOEventHandler makeFOEventHandler(FOUserAgent ua, OutputStream out) {
return new MIFHandler(ua, out);
}
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#needsOutputStream() */
+ /** {@inheritDoc} */
public boolean needsOutputStream() {
return true;
}
- /** @see org.apache.fop.render.AbstractFOEventHandlerMaker#getSupportedMimeTypes() */
+ /** {@inheritDoc} */
public String[] getSupportedMimeTypes() {
return MIMES;
}
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFFile.java b/src/sandbox/org/apache/fop/render/mif/MIFFile.java
index 131db5c2b..d0fa27023 100644
--- a/src/sandbox/org/apache/fop/render/mif/MIFFile.java
+++ b/src/sandbox/org/apache/fop/render/mif/MIFFile.java
@@ -33,23 +33,39 @@ import java.util.List;
*/
public class MIFFile extends MIFElement {
+ /** colorCatalog */
protected MIFElement colorCatalog = null;
+ /** pgfCatalog */
protected PGFElement pgfCatalog = null;
+ /** fontCatalog */
protected MIFElement fontCatalog = null;
+ /** rulingCatalog */
protected RulingElement rulingCatalog = null;
+ /** tblCatalog */
protected MIFElement tblCatalog = null;
+ /** views */
protected MIFElement views = null;
+ /** variableFormats */
protected MIFElement variableFormats = null;
+ /** xRefFormats */
protected MIFElement xRefFormats = null;
+ /** document */
protected MIFElement document = null;
+ /** bookComponent */
protected MIFElement bookComponent = null;
+ /** initialAutoNums */
protected MIFElement initialAutoNums = null;
+ /** aFrames */
protected MIFElement aFrames = null;
+ /** tbls */
protected MIFElement tbls = null;
+ /** pages */
protected List pages = new java.util.ArrayList();
+ /** textFlows */
protected List textFlows = null;
+ /** default constructor */
public MIFFile() {
super("");
valueElements = new java.util.ArrayList();
@@ -104,6 +120,10 @@ public class MIFFile extends MIFElement {
}
+ /**
+ * @param os output stream
+ * @throws IOException if not caught
+ */
public void output(OutputStream os) throws IOException {
if (finished) {
return;
@@ -130,6 +150,7 @@ public class MIFFile extends MIFElement {
}
}
+ /** @param p a page element to add */
public void addPage(MIFElement p) {
pages.add(p);
addElement(p);
diff --git a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
index ca36ab174..0adf8bf5b 100644
--- a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
+++ b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java
@@ -42,6 +42,8 @@ import org.apache.fop.fo.flow.table.Table;
import org.apache.fop.fo.flow.table.TableBody;
import org.apache.fop.fo.flow.table.TableCell;
import org.apache.fop.fo.flow.table.TableColumn;
+import org.apache.fop.fo.flow.table.TableFooter;
+import org.apache.fop.fo.flow.table.TableHeader;
import org.apache.fop.fo.flow.table.TableRow;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.pagination.PageSequence;
@@ -85,9 +87,7 @@ public class MIFHandler extends FOEventHandler {
FontSetup.setup(fontInfo, null, new DefaultFontResolver(ua));
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startDocument()
- */
+ /** {@inheritDoc} */
public void startDocument() throws SAXException {
log.fatal("The MIF Handler is non-functional at this time. Please help resurrect it!");
mifFile = new MIFFile();
@@ -98,9 +98,7 @@ public class MIFHandler extends FOEventHandler {
}
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endDocument()
- */
+ /** {@inheritDoc} */
public void endDocument() throws SAXException {
// finish all open elements
mifFile.finish(true);
@@ -112,19 +110,15 @@ public class MIFHandler extends FOEventHandler {
}
}
- /**
- * Start the page sequence.
- * This creates the pages in the MIF document that will be used
- * by the following flows and static areas.
- * @see org.apache.fop.fo.FOEventHandler
- */
+ /** {@inheritDoc} */
public void startPageSequence(PageSequence pageSeq) {
// get the layout master set
// setup the pages for this sequence
String name = pageSeq.getMasterReference();
SimplePageMaster spm = pageSeq.getRoot().getLayoutMasterSet().getSimplePageMaster(name);
if (spm == null) {
- PageSequenceMaster psm = pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(name);
+ PageSequenceMaster psm
+ = pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(name);
} else {
// create simple master with regions
MIFElement prop = new MIFElement("PageType");
@@ -160,284 +154,190 @@ public class MIFHandler extends FOEventHandler {
}
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endPageSequence(PageSequence)
- */
+ /** {@inheritDoc} */
public void endPageSequence(PageSequence pageSeq) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startFlow(Flow)
- */
+ /** {@inheritDoc} */
public void startFlow(Flow fl) {
// start text flow in body region
textFlow = new MIFElement("TextFlow");
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endFlow(Flow)
- */
+ /** {@inheritDoc} */
public void endFlow(Flow fl) {
textFlow.finish(true);
mifFile.addElement(textFlow);
textFlow = null;
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startBlock(Block)
- */
+ /** {@inheritDoc} */
public void startBlock(Block bl) {
para = new MIFElement("Para");
// get font
textFlow.addElement(para);
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endBlock(Block)
- */
+ /** {@inheritDoc} */
public void endBlock(Block bl) {
para.finish(true);
para = null;
}
- /**
- *
- * @param inl Inline that is starting.
- */
- public void startInline(Inline inl){
+ /** {@inheritDoc} */
+ public void startInline(Inline inl) {
}
- /**
- *
- * @param inl Inline that is ending.
- */
- public void endInline(Inline inl){
+ /** {@inheritDoc} */
+ public void endInline(Inline inl) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startTable(Table)
- */
+ /** {@inheritDoc} */
public void startTable(Table tbl) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endTable(Table)
- */
+ /** {@inheritDoc} */
public void endTable(Table tbl) {
}
- /**
- *
- * @param tc TableColumn that is starting;
- */
+ /** {@inheritDoc} */
public void startColumn(TableColumn tc) {
}
- /**
- *
- * @param tc TableColumn that is ending;
- */
+ /** {@inheritDoc} */
public void endColumn(TableColumn tc) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startHeader(TableBody)
- */
- public void startHeader(TableBody th) {
+ /** {@inheritDoc} */
+ public void startHeader(TableHeader th) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endHeader(TableBody)
- */
- public void endHeader(TableBody th) {
+ /** {@inheritDoc} */
+ public void endHeader(TableHeader th) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startFooter(TableBody)
- */
- public void startFooter(TableBody tf) {
+ /** {@inheritDoc} */
+ public void startFooter(TableFooter tf) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endFooter(TableBody)
- */
- public void endFooter(TableBody tf) {
+ /** {@inheritDoc} */
+ public void endFooter(TableFooter tf) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startBody(TableBody)
- */
+ /** {@inheritDoc} */
public void startBody(TableBody tb) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endBody(TableBody)
- */
+ /** {@inheritDoc} */
public void endBody(TableBody tb) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startRow(TableRow)
- */
+ /** {@inheritDoc} */
public void startRow(TableRow tr) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endRow(TableRow)
- */
+ /** {@inheritDoc} */
public void endRow(TableRow tr) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startCell(TableCell)
- */
+ /** {@inheritDoc} */
public void startCell(TableCell tc) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endCell(TableCell)
- */
+ /** {@inheritDoc} */
public void endCell(TableCell tc) {
}
- // Lists
- /**
- * @see org.apache.fop.fo.FOEventHandler#startList(ListBlock)
- */
+ /** {@inheritDoc} */
public void startList(ListBlock lb) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endList(ListBlock)
- */
+ /** {@inheritDoc} */
public void endList(ListBlock lb) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startListItem(ListItem)
- */
+ /** {@inheritDoc} */
public void startListItem(ListItem li) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endListItem(ListItem)
- */
+ /** {@inheritDoc} */
public void endListItem(ListItem li) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startListLabel()
- */
+ /** {@inheritDoc} */
public void startListLabel() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endListLabel()
- */
+ /** {@inheritDoc} */
public void endListLabel() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startListBody()
- */
+ /** {@inheritDoc} */
public void startListBody() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endListBody()
- */
+ /** {@inheritDoc} */
public void endListBody() {
}
- // Static Regions
- /**
- * @see org.apache.fop.fo.FOEventHandler#startStatic()
- */
+ /** {@inheritDoc} */
public void startStatic() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endStatic()
- */
+ /** {@inheritDoc} */
public void endStatic() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startMarkup()
- */
+ /** {@inheritDoc} */
public void startMarkup() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endMarkup()
- */
+ /** {@inheritDoc} */
public void endMarkup() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startLink(BasicLink basicLink)
- */
+ /** {@inheritDoc} */
public void startLink(BasicLink basicLink) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endLink()
- */
+ /** {@inheritDoc} */
public void endLink() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#image(ExternalGraphic)
- */
+ /** {@inheritDoc} */
public void image(ExternalGraphic eg) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#pageRef()
- */
+ /** {@inheritDoc} */
public void pageRef() {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#foreignObject(InstreamForeignObject)
- */
+ /** {@inheritDoc} */
public void foreignObject(InstreamForeignObject ifo) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startFootnote(Footnote)
- */
+ /** {@inheritDoc} */
public void startFootnote(Footnote footnote) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endFootnote(Footnote)
- */
+ /** {@inheritDoc} */
public void endFootnote(Footnote footnote) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#startFootnoteBody(FootnoteBody)
- */
+ /** {@inheritDoc} */
public void startFootnoteBody(FootnoteBody body) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#endFootnoteBody(FootnoteBody)
- */
+ /** {@inheritDoc} */
public void endFootnoteBody(FootnoteBody body) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#leader(Leader)
- */
+ /** {@inheritDoc} */
public void leader(Leader l) {
}
- /**
- * @see org.apache.fop.fo.FOEventHandler#characters(char[], int, int)
- */
- public void characters(char data[], int start, int length) {
+ /** {@inheritDoc} */
+ public void characters(char[] data, int start, int length) {
if (para != null) {
String str = new String(data, start, length);
str = str.trim();
@@ -458,17 +358,11 @@ public class MIFHandler extends FOEventHandler {
}
}
- /**
- *
- * @param pagenum PageNumber that is starting.
- */
+ /** {@inheritDoc} */
public void startPageNumber(PageNumber pagenum) {
}
- /**
- *
- * @param pagenum PageNumber that is ending.
- */
+ /** {@inheritDoc} */
public void endPageNumber(PageNumber pagenum) {
}
}
diff --git a/src/sandbox/org/apache/fop/render/mif/PGFElement.java b/src/sandbox/org/apache/fop/render/mif/PGFElement.java
index 6aa253ac2..958518fac 100644
--- a/src/sandbox/org/apache/fop/render/mif/PGFElement.java
+++ b/src/sandbox/org/apache/fop/render/mif/PGFElement.java
@@ -33,6 +33,10 @@ public class PGFElement extends RefElement {
super("PgfCatalog");
}
+ /**
+ * @param key an object
+ * @return an MIF element
+ */
public MIFElement lookupElement(Object key) {
if (key == null) {
MIFElement pgf = new MIFElement("Pgf");
diff --git a/src/sandbox/org/apache/fop/render/mif/RefElement.java b/src/sandbox/org/apache/fop/render/mif/RefElement.java
index c6b5d0ec5..b23dffa2b 100644
--- a/src/sandbox/org/apache/fop/render/mif/RefElement.java
+++ b/src/sandbox/org/apache/fop/render/mif/RefElement.java
@@ -31,12 +31,17 @@ package org.apache.fop.render.mif;
public class RefElement extends MIFElement {
/**
+ * @param name a name
* @see org.apache.fop.render.mif.MIFElement#MIFElement(String)
*/
- public RefElement(String n) {
- super(n);
+ public RefElement(String name) {
+ super(name);
}
+ /**
+ * @param key a key
+ * @return an mif element
+ */
public MIFElement lookupElement(Object key) {
return null;
}
diff --git a/src/sandbox/org/apache/fop/render/mif/RulingElement.java b/src/sandbox/org/apache/fop/render/mif/RulingElement.java
index 2c2765bad..c811a01a4 100644
--- a/src/sandbox/org/apache/fop/render/mif/RulingElement.java
+++ b/src/sandbox/org/apache/fop/render/mif/RulingElement.java
@@ -19,12 +19,15 @@
package org.apache.fop.render.mif;
+/** a ruling element */
public class RulingElement extends RefElement {
+ /** default constructor */
public RulingElement() {
super("RulingCatalog");
}
+ /** {@inheritDoc} */
public MIFElement lookupElement(Object key) {
if (key == null) {
MIFElement rul = new MIFElement("Ruling");