aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/org
diff options
context:
space:
mode:
authorAdrian Cumiskey <acumiskey@apache.org>2008-10-22 14:12:18 +0000
committerAdrian Cumiskey <acumiskey@apache.org>2008-10-22 14:12:18 +0000
commit967e74f75c2daae570ab89baffce34b005ee6503 (patch)
treed732c6ee150d25539a61dfe85a41f0e5e979ce6b /src/java/org
parentec60c4057d1ab14e0fad13b7fc53b246807f839b (diff)
downloadxmlgraphics-fop-967e74f75c2daae570ab89baffce34b005ee6503.tar.gz
xmlgraphics-fop-967e74f75c2daae570ab89baffce34b005ee6503.zip
Merged revisions 706319,706570,707083 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk ........ r706319 | jeremias | 2008-10-20 16:11:08 +0100 (Mon, 20 Oct 2008) | 2 lines Bugzilla #45956: Minimal support for leader-pattern="rule" for PCL output. ........ r706570 | jeremias | 2008-10-21 11:13:27 +0100 (Tue, 21 Oct 2008) | 1 line Reluctantly added a note about how to clear the image cache. ........ r707083 | acumiskey | 2008-10-22 15:05:56 +0100 (Wed, 22 Oct 2008) | 2 lines Been hanging around here unused since 2002 and no longer relevant as far as I can tell. ........ git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@707084 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org')
-rw-r--r--src/java/org/apache/fop/render/pcl/PCLRenderer.java34
1 files changed, 33 insertions, 1 deletions
diff --git a/src/java/org/apache/fop/render/pcl/PCLRenderer.java b/src/java/org/apache/fop/render/pcl/PCLRenderer.java
index 72d698bfe..5faeb834d 100644
--- a/src/java/org/apache/fop/render/pcl/PCLRenderer.java
+++ b/src/java/org/apache/fop/render/pcl/PCLRenderer.java
@@ -59,6 +59,7 @@ import org.apache.xmlgraphics.image.loader.util.ImageUtil;
import org.apache.xmlgraphics.java2d.GraphicContext;
import org.apache.xmlgraphics.java2d.Graphics2DImagePainter;
import org.apache.xmlgraphics.util.QName;
+import org.apache.xmlgraphics.util.UnitConv;
import org.apache.fop.apps.FOPException;
import org.apache.fop.apps.MimeConstants;
@@ -74,6 +75,7 @@ import org.apache.fop.area.inline.AbstractTextArea;
import org.apache.fop.area.inline.ForeignObject;
import org.apache.fop.area.inline.Image;
import org.apache.fop.area.inline.InlineArea;
+import org.apache.fop.area.inline.Leader;
import org.apache.fop.area.inline.SpaceArea;
import org.apache.fop.area.inline.TextArea;
import org.apache.fop.area.inline.Viewport;
@@ -97,7 +99,6 @@ import org.apache.fop.render.java2d.InstalledFontCollection;
import org.apache.fop.render.java2d.Java2DRenderer;
import org.apache.fop.render.pcl.extensions.PCLElementMapping;
import org.apache.fop.traits.BorderProps;
-import org.apache.xmlgraphics.util.UnitConv;
/* Note:
* There are some commonalities with AbstractPathOrientedRenderer but it's not possible
@@ -1658,6 +1659,37 @@ public class PCLRenderer extends PrintRenderer {
}
}
+ /** {@inheritDoc} */
+ public void renderLeader(Leader area) {
+ renderInlineAreaBackAndBorders(area);
+
+ saveGraphicsState();
+ int style = area.getRuleStyle();
+ float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
+ float starty = (currentBPPosition + area.getOffset()) / 1000f;
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ + area.getIPD()) / 1000f;
+ float ruleThickness = area.getRuleThickness() / 1000f;
+ Color col = (Color)area.getTrait(Trait.COLOR);
+
+ switch (style) {
+ case EN_SOLID:
+ case EN_DASHED: //TODO Improve me and following (this is just a quick-fix ATM)
+ case EN_DOUBLE:
+ case EN_DOTTED:
+ case EN_GROOVE:
+ case EN_RIDGE:
+ updateFillColor(col);
+ fillRect(startx, starty, endx - startx, ruleThickness);
+ break;
+ default:
+ throw new UnsupportedOperationException("rule style not supported");
+ }
+
+ restoreGraphicsState();
+ super.renderLeader(area);
+ }
+
/**
* Controls whether all text should be generated as bitmaps or only text for which there's
* no native font.