diff options
author | Jeremias Maerki <jeremias@apache.org> | 2010-12-13 14:49:56 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2010-12-13 14:49:56 +0000 |
commit | ce6d9e1eeef5f7b17fada9f07145e7e430586bf1 (patch) | |
tree | 1cf77ef1eee183895d06be19c30628b5a79cbefb /src/java/org/apache/fop/afp | |
parent | ad93316e324520818ebfd4f4e02644f681c31812 (diff) | |
download | xmlgraphics-fop-ce6d9e1eeef5f7b17fada9f07145e7e430586bf1.tar.gz xmlgraphics-fop-ce6d9e1eeef5f7b17fada9f07145e7e430586bf1.zip |
Adjust to changes in XML Graphics Commons:
- equals() to ColorUtil.isSameColor()
- ICCColorSpaceExt to ICCColorSpaceWithIntent
- int to RenderingIntent enum
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_Color@1045155 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/afp')
-rw-r--r-- | src/java/org/apache/fop/afp/modca/GraphicsObject.java | 9 | ||||
-rw-r--r-- | src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java | 4 |
2 files changed, 10 insertions, 3 deletions
diff --git a/src/java/org/apache/fop/afp/modca/GraphicsObject.java b/src/java/org/apache/fop/afp/modca/GraphicsObject.java index b677a0f7c..350a602bf 100644 --- a/src/java/org/apache/fop/afp/modca/GraphicsObject.java +++ b/src/java/org/apache/fop/afp/modca/GraphicsObject.java @@ -26,6 +26,7 @@ import java.util.Iterator; import java.util.List; import org.apache.xmlgraphics.java2d.color.ColorConverter; +import org.apache.xmlgraphics.java2d.color.ColorUtil; import org.apache.fop.afp.AFPDataObjectInfo; import org.apache.fop.afp.AFPObjectAreaInfo; @@ -82,6 +83,7 @@ public class GraphicsObject extends AbstractDataObject { } /** {@inheritDoc} */ + @Override public void setViewport(AFPDataObjectInfo dataObjectInfo) { super.setViewport(dataObjectInfo); @@ -145,7 +147,7 @@ public class GraphicsObject extends AbstractDataObject { * @param color the active color to use */ public void setColor(Color color) { - if (!color.equals(graphicsState.color)) { + if (!ColorUtil.isSameColor(color, graphicsState.color)) { addObject(new GraphicsSetProcessColor(colorConverter.convert(color))); graphicsState.color = color; } @@ -341,6 +343,7 @@ public class GraphicsObject extends AbstractDataObject { } /** {@inheritDoc} */ + @Override public String toString() { return "GraphicsObject: " + getName(); } @@ -354,6 +357,7 @@ public class GraphicsObject extends AbstractDataObject { } /** {@inheritDoc} */ + @Override public void setComplete(boolean complete) { Iterator it = objects.iterator(); while (it.hasNext()) { @@ -364,6 +368,7 @@ public class GraphicsObject extends AbstractDataObject { } /** {@inheritDoc} */ + @Override protected void writeStart(OutputStream os) throws IOException { super.writeStart(os); byte[] data = new byte[17]; @@ -372,12 +377,14 @@ public class GraphicsObject extends AbstractDataObject { } /** {@inheritDoc} */ + @Override protected void writeContent(OutputStream os) throws IOException { super.writeContent(os); writeObjects(objects, os); } /** {@inheritDoc} */ + @Override protected void writeEnd(OutputStream os) throws IOException { byte[] data = new byte[17]; copySF(data, Type.END, Category.GRAPHICS); diff --git a/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java b/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java index 054292cc1..2962dc76c 100644 --- a/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java +++ b/src/java/org/apache/fop/afp/ptoca/PtocaBuilder.java @@ -27,6 +27,7 @@ import java.io.OutputStream; import org.apache.commons.io.output.ByteArrayOutputStream; import org.apache.xmlgraphics.java2d.color.CIELabColorSpace; +import org.apache.xmlgraphics.java2d.color.ColorUtil; import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives; /** @@ -314,8 +315,7 @@ public abstract class PtocaBuilder implements PtocaConstants { * @throws IOException if an I/O error occurs */ public void setExtendedTextColor(Color col) throws IOException { - //Check in both directions - if (col.equals(currentColor) && currentColor.equals(col)) { + if (ColorUtil.isSameColor(col, currentColor)) { return; } if (col instanceof ColorWithAlternatives) { |