aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org/apache/fop/render/intermediate
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/java/org/apache/fop/render/intermediate
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/java/org/apache/fop/render/intermediate')
-rw-r--r--src/java/org/apache/fop/render/intermediate/BorderPainter.java7
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFConstants.java17
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFContentHandler.java12
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java8
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFGraphicContext.java40
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFRenderer.java6
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFSerializer.java7
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFState.java8
-rw-r--r--src/java/org/apache/fop/render/intermediate/IFUtil.java5
9 files changed, 101 insertions, 9 deletions
diff --git a/src/java/org/apache/fop/render/intermediate/BorderPainter.java b/src/java/org/apache/fop/render/intermediate/BorderPainter.java
index 75f773291..ad37b1dc1 100644
--- a/src/java/org/apache/fop/render/intermediate/BorderPainter.java
+++ b/src/java/org/apache/fop/render/intermediate/BorderPainter.java
@@ -41,7 +41,7 @@ public abstract class BorderPainter {
* @param bpsEnd the border specification on the end side
* @throws IOException if an I/O error occurs while creating the borders
*/
- public void drawBorders(Rectangle borderRect,
+ public void drawBorders(Rectangle borderRect, // CSOK: MethodLength
BorderProps bpsBefore, BorderProps bpsAfter,
BorderProps bpsStart, BorderProps bpsEnd) throws IOException {
int startx = borderRect.x;
@@ -217,8 +217,9 @@ public abstract class BorderPainter {
* @param color the border color
* @throws IOException if an I/O error occurs
*/
- protected abstract void drawBorderLine(int x1, int y1, int x2, int y2,
- boolean horz, boolean startOrBefore, int style, Color color) throws IOException;
+ protected abstract void drawBorderLine // CSOK: ParameterNumber
+ (int x1, int y1, int x2, int y2,
+ boolean horz, boolean startOrBefore, int style, Color color) throws IOException;
/**
* Draws a line/rule.
diff --git a/src/java/org/apache/fop/render/intermediate/IFConstants.java b/src/java/org/apache/fop/render/intermediate/IFConstants.java
index fa234b4db..34fe2bd2c 100644
--- a/src/java/org/apache/fop/render/intermediate/IFConstants.java
+++ b/src/java/org/apache/fop/render/intermediate/IFConstants.java
@@ -33,22 +33,39 @@ public interface IFConstants extends XMLConstants {
/** XML namespace of the intermediate format. */
String NAMESPACE = "http://xmlgraphics.apache.org/fop/intermediate";
+ /** element name document */
String EL_DOCUMENT = "document";
+ /** element name header */
String EL_HEADER = "header";
+ /** element name trailer */
String EL_TRAILER = "trailer";
+ /** element name page-sequence */
String EL_PAGE_SEQUENCE = "page-sequence";
+ /** element name page */
String EL_PAGE = "page";
+ /** element name page-header */
String EL_PAGE_HEADER = "page-header";
+ /** element name page-trailer */
String EL_PAGE_TRAILER = "page-trailer";
+ /** element name content */
String EL_PAGE_CONTENT = "content";
+ /** element name viewport */
String EL_VIEWPORT = "viewport";
+ /** element name group */
String EL_GROUP = "g";
+ /** element name image */
String EL_IMAGE = "image";
+ /** element name clip-rect */
String EL_CLIP_RECT = "clip-rect";
+ /** element name rect */
String EL_RECT = "rect";
+ /** element name line */
String EL_LINE = "line";
+ /** element name border-rect */
String EL_BORDER_RECT = "border-rect";
+ /** element name font */
String EL_FONT = "font";
+ /** element name text */
String EL_TEXT = "text";
/** Parent element of the logical structure tree. */
String EL_STRUCTURE_TREE = "structure-tree";
diff --git a/src/java/org/apache/fop/render/intermediate/IFContentHandler.java b/src/java/org/apache/fop/render/intermediate/IFContentHandler.java
index 55c65d82a..ac7feb269 100644
--- a/src/java/org/apache/fop/render/intermediate/IFContentHandler.java
+++ b/src/java/org/apache/fop/render/intermediate/IFContentHandler.java
@@ -24,62 +24,74 @@ import org.xml.sax.ContentHandler;
import org.xml.sax.Locator;
import org.xml.sax.SAXException;
+/** intermediate format content handler */
public class IFContentHandler implements ContentHandler {
+ /** {@inheritDoc} */
public void characters(char[] arg0, int arg1, int arg2) throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void endDocument() throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void endElement(String arg0, String arg1, String arg2)
throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void endPrefixMapping(String arg0) throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void ignorableWhitespace(char[] arg0, int arg1, int arg2)
throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void processingInstruction(String arg0, String arg1)
throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void setDocumentLocator(Locator arg0) {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void skippedEntity(String arg0) throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void startDocument() throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void startElement(String arg0, String arg1, String arg2,
Attributes arg3) throws SAXException {
// TODO Auto-generated method stub
}
+ /** {@inheritDoc} */
public void startPrefixMapping(String arg0, String arg1)
throws SAXException {
// TODO Auto-generated method stub
diff --git a/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java b/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java
index eef13e105..09a641ce2 100644
--- a/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java
+++ b/src/java/org/apache/fop/render/intermediate/IFDocumentNavigationHandler.java
@@ -45,8 +45,16 @@ public interface IFDocumentNavigationHandler {
*/
void renderBookmarkTree(BookmarkTree tree) throws IFException;
+ /**
+ * @param link a link
+ * @throws IFException of not caught
+ */
void renderLink(Link link) throws IFException;
+ /**
+ * @param action an action
+ * @throws IFException of not caught
+ */
void addResolvedAction(AbstractAction action) throws IFException;
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
index 34ac0bcb2..6e431e513 100644
--- a/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
+++ b/src/java/org/apache/fop/render/intermediate/IFGraphicContext.java
@@ -56,6 +56,7 @@ public class IFGraphicContext extends GraphicContext {
return new IFGraphicContext(this);
}
+ /** @param group a group */
public void pushGroup(Group group) {
//this.groupDepth++;
this.groupList.add(group);
@@ -64,44 +65,66 @@ public class IFGraphicContext extends GraphicContext {
}
}
+ /** @return array of groups */
public Group[] getGroups() {
return (Group[])this.groupList.toArray(new Group[getGroupStackSize()]);
}
+ /** @return array of groups after clearing group list */
public Group[] dropGroups() {
Group[] groups = getGroups();
this.groupList.clear();
return groups;
}
+ /** @return size of group list */
public int getGroupStackSize() {
return this.groupList.size();
}
+ /** a group */
public static class Group {
private AffineTransform[] transforms;
+ /**
+ * Construct a Group.
+ * @param transforms an array of transforms
+ */
public Group(AffineTransform[] transforms) {
this.transforms = transforms;
}
+ /**
+ * Construct a Group.
+ * @param transform a transform
+ */
public Group(AffineTransform transform) {
this(new AffineTransform[] {transform});
}
+ /** Default constructor. */
public Group() {
this(EMPTY_TRANSFORM_ARRAY);
}
+ /** @return array of transforms */
public AffineTransform[] getTransforms() {
return this.transforms;
}
+ /**
+ * @param painter a painter
+ * @throws IFException in not caught
+ */
public void start(IFPainter painter) throws IFException {
painter.startGroup(transforms);
}
+ /**
+ * @param painter a painter
+ * @throws IFException in not caught
+ */
public void end(IFPainter painter) throws IFException {
painter.endGroup();
}
@@ -115,33 +138,50 @@ public class IFGraphicContext extends GraphicContext {
}
+ /** a viewport */
public static class Viewport extends Group {
private Dimension size;
private Rectangle clipRect;
+ /**
+ * Construct a viewport.
+ * @param transforms an array of transforms
+ * @param size a dimension
+ * @param clipRect a clip rectangle
+ */
public Viewport(AffineTransform[] transforms, Dimension size, Rectangle clipRect) {
super(transforms);
this.size = size;
this.clipRect = clipRect;
}
+ /**
+ * Construct a viewport.
+ * @param transform a transform
+ * @param size a dimension
+ * @param clipRect a clip rectangle
+ */
public Viewport(AffineTransform transform, Dimension size, Rectangle clipRect) {
this(new AffineTransform[] {transform}, size, clipRect);
}
+ /** @return the viewport's size */
public Dimension getSize() {
return this.size;
}
+ /** @return the clip rectangle */
public Rectangle getClipRect() {
return this.clipRect;
}
+ /** {@inheritDoc} */
public void start(IFPainter painter) throws IFException {
painter.startViewport(getTransforms(), size, clipRect);
}
+ /** {@inheritDoc} */
public void end(IFPainter painter) throws IFException {
painter.endViewport();
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java
index 13ac401a7..23a5da3e3 100644
--- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java
@@ -1238,7 +1238,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
}
/** {@inheritDoc} */
- protected void drawBorders(float startx, float starty,
+ protected void drawBorders // CSOK: ParameterNumber
+ (float startx, float starty,
float width, float height,
BorderProps bpsBefore, BorderProps bpsAfter,
BorderProps bpsStart, BorderProps bpsEnd) {
@@ -1251,7 +1252,8 @@ public class IFRenderer extends AbstractPathOrientedRenderer {
}
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz,
+ protected void drawBorderLine // CSOK: ParameterNumber
+ (float x1, float y1, float x2, float y2, boolean horz,
boolean startOrBefore, int style, Color col) {
//Simplified implementation that is only used by renderTextDecoration()
//drawBorders() is overridden and uses the Painter's high-level method drawBorderRect()
diff --git a/src/java/org/apache/fop/render/intermediate/IFSerializer.java b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
index 37806cb8e..edeef9766 100644
--- a/src/java/org/apache/fop/render/intermediate/IFSerializer.java
+++ b/src/java/org/apache/fop/render/intermediate/IFSerializer.java
@@ -633,8 +633,11 @@ public class IFSerializer extends AbstractXMLWritingIFDocumentHandler
}
}
- /** {@inheritDoc} */
- protected RenderingContext createRenderingContext() {
+ /**
+ * @return a new rendering context
+ * @throws IllegalStateException unless overridden
+ */
+ protected RenderingContext createRenderingContext() throws IllegalStateException {
throw new IllegalStateException("Should never be called!");
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFState.java b/src/java/org/apache/fop/render/intermediate/IFState.java
index aa073d03c..c13382192 100644
--- a/src/java/org/apache/fop/render/intermediate/IFState.java
+++ b/src/java/org/apache/fop/render/intermediate/IFState.java
@@ -21,7 +21,8 @@ package org.apache.fop.render.intermediate;
import java.awt.Color;
-public class IFState {
+/** a state class for intermediate format data */
+public final class IFState {
private IFState parent;
@@ -50,22 +51,27 @@ public class IFState {
this.textColor = parent.textColor;
}
+ /** @return create state */
public static IFState create() {
return new IFState();
}
+ /** @return push state */
public IFState push() {
return new IFState(this);
}
+ /** @return pop state */
public IFState pop() {
return this.parent;
}
+ /** @return true if font changed */
public boolean isFontChanged() {
return this.fontChanged;
}
+ /** reset font changed */
public void resetFontChanged() {
this.fontChanged = false;
}
diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java
index 955193000..1867b0294 100644
--- a/src/java/org/apache/fop/render/intermediate/IFUtil.java
+++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java
@@ -30,7 +30,10 @@ import org.apache.fop.util.DecimalFormatCache;
/**
* Utility functions for the intermediate format.
*/
-public class IFUtil {
+public final class IFUtil {
+
+ private IFUtil() {
+ }
private static String format(double value) {
if (value == -0.0) {