From ebbdc63b2618a96bcc0a7b6ce29fe75b973e6e9f Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 29 Jun 2010 15:46:41 +0000 Subject: Added support for CID-keyed TrueType fonts in PostScript output git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript@959012 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/render/ps/PSDocumentHandler.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src/java/org/apache/fop/render/ps/PSDocumentHandler.java') diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index d55e0724b..1e0411aa5 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -200,7 +200,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { gen.writeDSCComment(DSCConstants.BEGIN_SETUP); PSRenderingUtil.writeSetupCodeList(gen, setupCodeList, "SetupCode"); if (!psUtil.isOptimizeResources()) { - this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo)); + this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo, + PSEventProducer.Provider.get(getUserAgent().getEventBroadcaster()))); } else { gen.commentln("%FOPFontSetup"); //Place-holder, will be replaced in the second pass } @@ -538,8 +539,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { * @param key the font key ("F*") * @return the matching PSResource */ - protected PSResource getPSResourceForFontKey(String key) { - return this.fontResources.getPSResourceForFontKey(key); + protected PSFontResource getPSResourceForFontKey(String key) { + return this.fontResources.getFontResourceForFontKey(key); } /** -- cgit v1.2.3 From 1080c61fb2f07d5995bd1671751f2f4bd11b1f3e Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 31 Aug 2010 14:20:22 +0000 Subject: Do not issue a warning if renderer configured to output PostScript level 3. Throw an error instead when it is not the case. Pass the event producer around. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_TrueTypeInPostScript@991203 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/ps/PSDocumentHandler.java | 16 ++++++---- .../org/apache/fop/render/ps/PSEventProducer.java | 8 ++--- .../org/apache/fop/render/ps/PSEventProducer.xml | 2 +- src/java/org/apache/fop/render/ps/PSFontUtils.java | 37 ++++++++++++++++++---- .../org/apache/fop/render/ps/ResourceHandler.java | 10 ++++-- 5 files changed, 52 insertions(+), 21 deletions(-) (limited to 'src/java/org/apache/fop/render/ps/PSDocumentHandler.java') diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index 1e0411aa5..f5f0fbd24 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -49,6 +49,7 @@ import org.apache.xmlgraphics.ps.dsc.ResourceTracker; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentBoundingBox; import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox; +import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; import org.apache.fop.render.intermediate.IFContext; @@ -104,6 +105,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { private static final int COMMENT_DOCUMENT_TRAILER = 1; private static final int COMMENT_PAGE_TRAILER = 2; + private PSEventProducer eventProducer; + /** * Default constructor. */ @@ -123,7 +126,9 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { /** {@inheritDoc} */ public void setContext(IFContext context) { super.setContext(context); - this.psUtil = new PSRenderingUtil(context.getUserAgent()); + FOUserAgent userAgent = context.getUserAgent(); + this.psUtil = new PSRenderingUtil(userAgent); + eventProducer = PSEventProducer.Provider.get(userAgent.getEventBroadcaster()); } /** {@inheritDoc} */ @@ -142,7 +147,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { try { OutputStream out; if (psUtil.isOptimizeResources()) { - this.tempFile = File.createTempFile("fop", null); + this.tempFile = File.createTempFile("fop", ".ps"); out = new java.io.FileOutputStream(this.tempFile); out = new java.io.BufferedOutputStream(out); } else { @@ -200,8 +205,7 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { gen.writeDSCComment(DSCConstants.BEGIN_SETUP); PSRenderingUtil.writeSetupCodeList(gen, setupCodeList, "SetupCode"); if (!psUtil.isOptimizeResources()) { - this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo, - PSEventProducer.Provider.get(getUserAgent().getEventBroadcaster()))); + this.fontResources.addAll(PSFontUtils.writeFontDict(gen, fontInfo, eventProducer)); } else { gen.commentln("%FOPFontSetup"); //Place-holder, will be replaced in the second pass } @@ -256,8 +260,8 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { in = new java.io.BufferedInputStream(in); try { try { - ResourceHandler handler = new ResourceHandler(getUserAgent(), this.fontInfo, - resTracker, this.formResources); + ResourceHandler handler = new ResourceHandler(getUserAgent(), eventProducer, + this.fontInfo, resTracker, this.formResources); handler.process(in, this.outputStream, this.currentPageNumber, this.documentBoundingBox); this.outputStream.flush(); diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.java b/src/java/org/apache/fop/render/ps/PSEventProducer.java index d702a5701..bffdf2236 100644 --- a/src/java/org/apache/fop/render/ps/PSEventProducer.java +++ b/src/java/org/apache/fop/render/ps/PSEventProducer.java @@ -29,7 +29,7 @@ public interface PSEventProducer extends EventProducer { /** Provider class for the event producer. */ final class Provider { - + private Provider() { } @@ -54,10 +54,10 @@ public interface PSEventProducer extends EventProducer { void postscriptDictionaryParseError(Object source, String content, Exception e); /** - * PostScript Level 3 features are being used. + * PostScript Level 3 features are necessary. * * @param source the event source - * @event.severity WARN + * @event.severity FATAL */ - void postscriptLevel3Used(Object source); + void postscriptLevel3Needed(Object source); } diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.xml b/src/java/org/apache/fop/render/ps/PSEventProducer.xml index 213e74e27..64b22d1a4 100644 --- a/src/java/org/apache/fop/render/ps/PSEventProducer.xml +++ b/src/java/org/apache/fop/render/ps/PSEventProducer.xml @@ -1,5 +1,5 @@ Failed to parse dictionary string. Reason: {e}, content = "{content}" - PostScript Level 3 features are needed to handle this document. Please make sure that your printer supports PostScript Level 3. + PostScript Level 3 features are needed to handle this document. diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java index 07ca0e4b5..5272dccac 100644 --- a/src/java/org/apache/fop/render/ps/PSFontUtils.java +++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java @@ -77,9 +77,19 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { */ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo) throws IOException { - return writeFontDict(gen, fontInfo, (PSEventProducer) null); + return writeFontDict(gen, fontInfo, null); } + /** + * Generates the PostScript code for the font dictionary. This method should only be + * used if no "resource optimization" is performed, i.e. when the fonts are not embedded + * in a second pass. + * @param gen PostScript generator to use for output + * @param fontInfo available fonts + * @param eventProducer to report events + * @return a Map of PSResource instances representing all defined fonts (key: font key) + * @throws IOException in case of an I/O problem + */ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, PSEventProducer eventProducer) throws IOException { return writeFontDict(gen, fontInfo, fontInfo.getFonts(), true, eventProducer); @@ -92,12 +102,13 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { * @param gen PostScript generator to use for output * @param fontInfo available fonts * @param fonts the set of fonts to work with + * @param eventProducer the event producer * @return a Map of PSResource instances representing all defined fonts (key: font key) * @throws IOException in case of an I/O problem */ - public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts) - throws IOException { - return writeFontDict(gen, fontInfo, fonts, false, null); + public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts, + PSEventProducer eventProducer) throws IOException { + return writeFontDict(gen, fontInfo, fonts, false, eventProducer); } /** @@ -224,14 +235,12 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { if (in != null) { if (fontType == FontType.TYPE0) { if (gen.embedIdentityH()) { + checkPostScriptVersion(gen, eventProducer); /* * First CID-keyed font to be embedded; add * %%IncludeResource: comment for ProcSet CIDInit. */ gen.includeProcsetCIDInitResource(); - if (eventProducer != null) { - eventProducer.postscriptLevel3Used(gen); - } } PSResource cidFontResource = embedCIDFont(gen, (MultiByteFont) tf, in); fontResource = PSFontResource.createFontResource(fontRes, @@ -268,6 +277,19 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { return fontResource; } + private static void checkPostScriptVersion(PSGenerator gen, PSEventProducer eventProducer) { + if (gen.getPSLevel() < 3) { + if (eventProducer != null) { + eventProducer.postscriptLevel3Needed(gen); + } else { + throw new IllegalStateException("PostScript Level 3 is" + + " required to use TrueType fonts," + + " configured level is " + + gen.getPSLevel()); + } + } + } + private static void embedTrueTypeFont(PSGenerator gen, SingleByteFont font, InputStream fontStream) throws IOException { /* See Adobe Technical Note #5012, "The Type 42 Font Format Specification" */ @@ -607,6 +629,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils { private static PSResource defineDerivedTrueTypeFont(PSGenerator gen, PSEventProducer eventProducer, String baseFontName, String fontName, SingleByteEncoding encoding, List cmaps) throws IOException { + checkPostScriptVersion(gen, eventProducer); PSResource res = new PSResource(PSResource.TYPE_FONT, fontName); gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE, res); gen.commentln("%XGCDependencies: font " + baseFontName); diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java index 502242c17..5594897ba 100644 --- a/src/java/org/apache/fop/render/ps/ResourceHandler.java +++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java @@ -83,6 +83,8 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors { private FOUserAgent userAgent; private FontInfo fontInfo; + private PSEventProducer eventProducer; + private ResourceTracker resTracker; //key: URI, values PSImageFormResource @@ -93,13 +95,15 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors { /** * Main constructor. * @param userAgent the FO user agent + * @param eventProducer the event producer * @param fontInfo the font information * @param resTracker the resource tracker to use * @param formResources Contains all forms used by this document (maintained by PSRenderer) */ - public ResourceHandler(FOUserAgent userAgent, FontInfo fontInfo, - ResourceTracker resTracker, Map formResources) { + public ResourceHandler(FOUserAgent userAgent, PSEventProducer eventProducer, + FontInfo fontInfo, ResourceTracker resTracker, Map formResources) { this.userAgent = userAgent; + this.eventProducer = eventProducer; this.fontInfo = fontInfo; this.resTracker = resTracker; determineInlineForms(formResources); @@ -222,7 +226,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors { if (fontSetupPlaceholder == null) { throw new DSCException("Didn't find %FOPFontSetup comment in stream"); } - PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts()); + PSFontUtils.writeFontDict(gen, fontInfo, fontInfo.getUsedFonts(), eventProducer); generateForms(globalFormResources, gen); //Skip the prolog and to the first page -- cgit v1.2.3 From eff48e4a891b2c8159ac81d13cae4e65e444cce2 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Fri, 2 Mar 2012 22:19:46 +0000 Subject: enable UnusedImports rule; fix violations git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1296496 13f79535-47bb-0310-9956-ffa450edef68 --- checkstyle-5.5.xml | 2 +- .../java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java | 1 - src/java/org/apache/fop/afp/AFPGraphics2D.java | 1 - src/java/org/apache/fop/afp/modca/AbstractAFPObject.java | 1 - src/java/org/apache/fop/afp/modca/ImageObject.java | 1 - src/java/org/apache/fop/afp/modca/PresentationTextData.java | 1 - src/java/org/apache/fop/afp/ptoca/PtocaProducer.java | 2 -- src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java | 2 -- src/java/org/apache/fop/apps/FOUserAgent.java | 1 - src/java/org/apache/fop/area/AreaTreeObject.java | 1 - src/java/org/apache/fop/area/MainReference.java | 1 - src/java/org/apache/fop/area/inline/FilledArea.java | 2 -- src/java/org/apache/fop/complexscripts/bidi/InlineRun.java | 2 -- src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java | 1 - .../org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java | 4 ---- .../apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java | 2 -- .../org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java | 2 -- src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java | 1 - .../fop/complexscripts/scripts/DevanagariScriptProcessor.java | 1 - .../apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java | 1 - .../apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java | 1 - src/java/org/apache/fop/complexscripts/util/GlyphSequence.java | 2 -- src/java/org/apache/fop/fo/FOTreeBuilder.java | 1 - src/java/org/apache/fop/fo/flow/BidiOverride.java | 6 ------ src/java/org/apache/fop/fo/flow/InlineContainer.java | 1 - src/java/org/apache/fop/fo/pagination/RegionBody.java | 1 - src/java/org/apache/fop/fonts/FontReader.java | 1 - src/java/org/apache/fop/fonts/apps/TTFReader.java | 1 - src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java | 1 - .../org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java | 1 - src/java/org/apache/fop/layoutmgr/BreakElement.java | 2 -- src/java/org/apache/fop/layoutmgr/KnuthPenalty.java | 2 -- src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java | 1 - .../layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java | 2 -- .../org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java | 1 - src/java/org/apache/fop/layoutmgr/table/RowPainter.java | 1 - src/java/org/apache/fop/pdf/PDFColor.java | 1 - src/java/org/apache/fop/pdf/PDFStructElem.java | 1 - src/java/org/apache/fop/render/AbstractRenderer.java | 1 - src/java/org/apache/fop/render/ImageHandler.java | 1 - src/java/org/apache/fop/render/afp/AFPDocumentHandler.java | 1 - .../org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java | 2 -- .../apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java | 1 - src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java | 2 -- .../org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java | 1 - .../org/apache/fop/render/bitmap/BitmapRendererConfigurator.java | 1 - src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java | 1 - src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java | 1 - .../apache/fop/render/intermediate/AbstractIFDocumentHandler.java | 3 --- src/java/org/apache/fop/render/intermediate/IFRenderer.java | 1 - src/java/org/apache/fop/render/intermediate/IFUtil.java | 1 - src/java/org/apache/fop/render/java2d/Base14FontCollection.java | 2 -- src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java | 1 - src/java/org/apache/fop/render/java2d/InstalledFontCollection.java | 1 - src/java/org/apache/fop/render/java2d/Java2DPainter.java | 1 - src/java/org/apache/fop/render/java2d/Java2DUtil.java | 2 -- src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java | 1 - src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java | 1 - src/java/org/apache/fop/render/pcl/PCLPainter.java | 1 - src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java | 1 - src/java/org/apache/fop/render/ps/PSDocumentHandler.java | 1 - src/java/org/apache/fop/svg/PDFAElementBridge.java | 1 - src/java/org/apache/fop/traits/MinOptMax.java | 3 --- src/java/org/apache/fop/traits/TraitEnum.java | 2 -- src/java/org/apache/fop/util/ColorExt.java | 2 -- src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java | 1 - src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java | 1 - 67 files changed, 1 insertion(+), 95 deletions(-) (limited to 'src/java/org/apache/fop/render/ps/PSDocumentHandler.java') diff --git a/checkstyle-5.5.xml b/checkstyle-5.5.xml index 0e361ba8b..fd934eff3 100644 --- a/checkstyle-5.5.xml +++ b/checkstyle-5.5.xml @@ -242,7 +242,7 @@ - + diff --git a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java index 6b1222011..c38b39c68 100644 --- a/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java +++ b/src/codegen/unicode/java/org/apache/fop/complexscripts/bidi/GenerateBidiClass.java @@ -20,7 +20,6 @@ package org.apache.fop.complexscripts.bidi; import java.io.BufferedReader; -import java.io.FileReader; import java.io.FileWriter; import java.io.InputStreamReader; import java.io.PrintWriter; diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index d0f1b41b0..41be79160 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -26,7 +26,6 @@ import java.awt.Dimension; import java.awt.Font; import java.awt.FontMetrics; import java.awt.Graphics; -import java.awt.Graphics2D; import java.awt.GraphicsConfiguration; import java.awt.Image; import java.awt.Paint; diff --git a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java index 1dd14b124..2c612092e 100644 --- a/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java +++ b/src/java/org/apache/fop/afp/modca/AbstractAFPObject.java @@ -20,7 +20,6 @@ package org.apache.fop.afp.modca; import java.io.IOException; -import java.io.InputStream; import java.io.OutputStream; import java.util.Collection; import java.util.Iterator; diff --git a/src/java/org/apache/fop/afp/modca/ImageObject.java b/src/java/org/apache/fop/afp/modca/ImageObject.java index 2f075ce33..c6cfa3808 100644 --- a/src/java/org/apache/fop/afp/modca/ImageObject.java +++ b/src/java/org/apache/fop/afp/modca/ImageObject.java @@ -29,7 +29,6 @@ import org.apache.xmlgraphics.util.MimeConstants; import org.apache.fop.afp.AFPDataObjectInfo; import org.apache.fop.afp.AFPImageObjectInfo; import org.apache.fop.afp.Factory; -import org.apache.fop.afp.ioca.IDEStructureParameter; import org.apache.fop.afp.ioca.ImageSegment; /** diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/afp/modca/PresentationTextData.java index 2b56caf1a..9b1c2eeda 100644 --- a/src/java/org/apache/fop/afp/modca/PresentationTextData.java +++ b/src/java/org/apache/fop/afp/modca/PresentationTextData.java @@ -24,7 +24,6 @@ import java.io.OutputStream; import org.apache.commons.io.output.ByteArrayOutputStream; -import org.apache.fop.afp.ptoca.PtocaBuilder; import org.apache.fop.afp.ptoca.PtocaConstants; import org.apache.fop.afp.util.BinaryUtils; diff --git a/src/java/org/apache/fop/afp/ptoca/PtocaProducer.java b/src/java/org/apache/fop/afp/ptoca/PtocaProducer.java index 504c49658..9b6d97dec 100644 --- a/src/java/org/apache/fop/afp/ptoca/PtocaProducer.java +++ b/src/java/org/apache/fop/afp/ptoca/PtocaProducer.java @@ -21,8 +21,6 @@ package org.apache.fop.afp.ptoca; import java.io.IOException; -import org.apache.fop.afp.modca.PresentationTextObject; - /** * Producer interface that is passed to a {@link PresentationTextObject} to produce PTOCA control * sequences using a {@link PtocaBuilder}. diff --git a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java index 053db01af..f379546e2 100644 --- a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java +++ b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java @@ -31,8 +31,6 @@ import javax.xml.transform.stream.StreamSource; import org.apache.commons.io.IOUtils; import org.apache.fop.apps.FOUserAgent; -import org.apache.fop.apps.FopFactory; -import org.apache.fop.fonts.FontManager; /** * Default implementation of the {@link ResourceAccessor} interface for use inside FOP. diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index c13a624cf..665c1abf8 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -48,7 +48,6 @@ import org.apache.fop.events.EventListener; import org.apache.fop.events.FOPEventListenerProxy; import org.apache.fop.events.LoggingEventListener; import org.apache.fop.fo.FOEventHandler; -import org.apache.fop.fonts.FontManager; import org.apache.fop.render.Renderer; import org.apache.fop.render.RendererFactory; import org.apache.fop.render.XMLHandlerRegistry; diff --git a/src/java/org/apache/fop/area/AreaTreeObject.java b/src/java/org/apache/fop/area/AreaTreeObject.java index dbbfc5744..ebd88b887 100644 --- a/src/java/org/apache/fop/area/AreaTreeObject.java +++ b/src/java/org/apache/fop/area/AreaTreeObject.java @@ -20,7 +20,6 @@ package org.apache.fop.area; import java.util.Collections; -import java.util.Iterator; import java.util.List; import java.util.Map; diff --git a/src/java/org/apache/fop/area/MainReference.java b/src/java/org/apache/fop/area/MainReference.java index 44f4cc8c8..154e9523c 100644 --- a/src/java/org/apache/fop/area/MainReference.java +++ b/src/java/org/apache/fop/area/MainReference.java @@ -22,7 +22,6 @@ package org.apache.fop.area; import org.apache.fop.traits.WritingModeTraitsGetter; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; /** diff --git a/src/java/org/apache/fop/area/inline/FilledArea.java b/src/java/org/apache/fop/area/inline/FilledArea.java index dfb3af58b..786b0265d 100644 --- a/src/java/org/apache/fop/area/inline/FilledArea.java +++ b/src/java/org/apache/fop/area/inline/FilledArea.java @@ -20,9 +20,7 @@ package org.apache.fop.area.inline; import java.util.ArrayList; -import java.util.Iterator; import java.util.List; -import java.util.ListIterator; /** * Filled area. diff --git a/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java b/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java index 6ea62494a..7897770f8 100644 --- a/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java +++ b/src/java/org/apache/fop/complexscripts/bidi/InlineRun.java @@ -31,10 +31,8 @@ import org.apache.fop.area.inline.InlineViewport; import org.apache.fop.area.inline.Leader; import org.apache.fop.area.inline.Space; import org.apache.fop.area.inline.SpaceArea; -import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.UnresolvedPageNumber; import org.apache.fop.area.inline.WordArea; -import org.apache.fop.traits.Direction; import org.apache.fop.util.CharUtilities; // CSOFF: EmptyForIteratorPadCheck diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java index 60ba6f864..02498af25 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphClassTable.java @@ -19,7 +19,6 @@ package org.apache.fop.complexscripts.fonts; -import java.util.Arrays; import java.util.List; import java.util.Iterator; diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java index d5cd04615..62a502eb0 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphDefinitionTable.java @@ -19,13 +19,9 @@ package org.apache.fop.complexscripts.fonts; -import java.nio.CharBuffer; - -import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; import java.util.List; -import java.util.Map; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java index 4325a3547..cb87faff4 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningSubtable.java @@ -19,8 +19,6 @@ package org.apache.fop.complexscripts.fonts; -import java.util.List; - import org.apache.fop.complexscripts.util.GlyphSequence; import org.apache.fop.complexscripts.util.ScriptContextTester; diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java index b6db2fb47..e17c8012c 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java @@ -19,8 +19,6 @@ package org.apache.fop.complexscripts.fonts; -import java.nio.CharBuffer; - import java.util.ArrayList; import java.util.Iterator; import java.util.List; diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java index 427973359..1667e26f1 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphTable.java @@ -21,7 +21,6 @@ package org.apache.fop.complexscripts.fonts; import java.util.Arrays; import java.util.ArrayList; -import java.util.Collection; import java.util.Iterator; import java.util.LinkedHashMap; import java.util.LinkedList; diff --git a/src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java index 58bfae734..624c5b153 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/DevanagariScriptProcessor.java @@ -23,7 +23,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.complexscripts.util.GlyphSequence; -import org.apache.fop.complexscripts.util.ScriptContextTester; // CSOFF: AvoidNestedBlocksCheck // CSOFF: NoWhitespaceAfterCheck diff --git a/src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java index 7d1af5366..fd68d4b7c 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/GujaratiScriptProcessor.java @@ -23,7 +23,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.fop.complexscripts.util.GlyphSequence; -import org.apache.fop.complexscripts.util.ScriptContextTester; // CSOFF: AvoidNestedBlocksCheck // CSOFF: NoWhitespaceAfterCheck diff --git a/src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java index f5be626a0..efe8791b9 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/GurmukhiScriptProcessor.java @@ -24,7 +24,6 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.complexscripts.fonts.GlyphDefinitionTable; import org.apache.fop.complexscripts.util.GlyphSequence; -import org.apache.fop.complexscripts.util.ScriptContextTester; // CSOFF: AvoidNestedBlocksCheck // CSOFF: NoWhitespaceAfterCheck diff --git a/src/java/org/apache/fop/complexscripts/util/GlyphSequence.java b/src/java/org/apache/fop/complexscripts/util/GlyphSequence.java index e4316d596..47b158491 100644 --- a/src/java/org/apache/fop/complexscripts/util/GlyphSequence.java +++ b/src/java/org/apache/fop/complexscripts/util/GlyphSequence.java @@ -26,8 +26,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; -import org.apache.fop.util.CharUtilities; - // CSOFF: InnerAssignmentCheck // CSOFF: LineLengthCheck // CSOFF: WhitespaceAfterCheck diff --git a/src/java/org/apache/fop/fo/FOTreeBuilder.java b/src/java/org/apache/fop/fo/FOTreeBuilder.java index 938efb8f9..e312a8038 100644 --- a/src/java/org/apache/fop/fo/FOTreeBuilder.java +++ b/src/java/org/apache/fop/fo/FOTreeBuilder.java @@ -37,7 +37,6 @@ import org.apache.fop.accessibility.fo.FO2StructureTreeConverter; import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.apps.FormattingResults; -import org.apache.fop.area.AreaTreeHandler; import org.apache.fop.fo.ElementMapping.Maker; import org.apache.fop.fo.extensions.ExtensionElementMapping; import org.apache.fop.fo.pagination.Root; diff --git a/src/java/org/apache/fop/fo/flow/BidiOverride.java b/src/java/org/apache/fop/fo/flow/BidiOverride.java index d38df90c7..0c14688b7 100644 --- a/src/java/org/apache/fop/fo/flow/BidiOverride.java +++ b/src/java/org/apache/fop/fo/flow/BidiOverride.java @@ -22,18 +22,12 @@ package org.apache.fop.fo.flow; import java.util.Iterator; import java.util.Stack; -import org.xml.sax.Locator; - import org.apache.fop.apps.FOPException; import org.apache.fop.complexscripts.bidi.DelimitedTextRange; -import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; -import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.PropertyList; -import org.apache.fop.fo.ValidationException; import org.apache.fop.fo.properties.Property; -import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.util.CharUtilities; /** diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java index a52801c3f..b79d66bb0 100644 --- a/src/java/org/apache/fop/fo/flow/InlineContainer.java +++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java @@ -36,7 +36,6 @@ import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.traits.Direction; import org.apache.fop.traits.WritingMode; import org.apache.fop.traits.WritingModeTraits; -import org.apache.fop.traits.WritingModeTraitsGetter; /** * Class modelling the diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index 9eb38c260..1fa260ff5 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -32,7 +32,6 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.properties.CommonMarginBlock; -import org.apache.fop.traits.WritingMode; /** * Class modelling the diff --git a/src/java/org/apache/fop/fonts/FontReader.java b/src/java/org/apache/fop/fonts/FontReader.java index 0f0348fc1..9d75ad74f 100644 --- a/src/java/org/apache/fop/fonts/FontReader.java +++ b/src/java/org/apache/fop/fonts/FontReader.java @@ -34,7 +34,6 @@ import org.xml.sax.Attributes; import org.xml.sax.InputSource; import org.xml.sax.Locator; import org.xml.sax.SAXException; -import org.xml.sax.SAXParseException; import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; diff --git a/src/java/org/apache/fop/fonts/apps/TTFReader.java b/src/java/org/apache/fop/fonts/apps/TTFReader.java index 9a12e888c..7159a60b7 100644 --- a/src/java/org/apache/fop/fonts/apps/TTFReader.java +++ b/src/java/org/apache/fop/fonts/apps/TTFReader.java @@ -21,7 +21,6 @@ package org.apache.fop.fonts.apps; import java.io.IOException; import java.util.Iterator; -import java.util.List; import java.util.Map; import java.util.Set; diff --git a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java index e081734be..d400c0bfd 100644 --- a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java +++ b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java @@ -22,7 +22,6 @@ package org.apache.fop.fonts.truetype; import java.io.IOException; import java.util.Iterator; import java.util.Map; -import java.util.Set; /** diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java index 0eae6fa9c..2bcdb6127 100644 --- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java @@ -22,7 +22,6 @@ package org.apache.fop.layoutmgr; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.apache.fop.fo.Constants; import org.apache.fop.traits.MinOptMax; /** diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java index 7208a585f..1c89c2009 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakElement.java +++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java @@ -21,8 +21,6 @@ package org.apache.fop.layoutmgr; import java.util.List; -import org.apache.fop.fo.Constants; - /** * This class represents an unresolved break possibility. */ diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java index 22a74485e..2d4e1f2be 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java @@ -19,8 +19,6 @@ package org.apache.fop.layoutmgr; -import org.apache.fop.fo.Constants; - /** * An instance of this class represents information about a feasible * breaking point; it does not represent any piece of content. diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java index 4b6638300..3d45812d8 100644 --- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java @@ -20,7 +20,6 @@ package org.apache.fop.layoutmgr; import java.util.ArrayList; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; import java.util.ListIterator; diff --git a/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java index aba137115..b9110de9e 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/AbstractPageNumberCitationLayoutManager.java @@ -19,12 +19,10 @@ package org.apache.fop.layoutmgr.inline; -import org.apache.fop.area.PageViewport; import org.apache.fop.area.Resolvable; import org.apache.fop.area.Trait; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.inline.TextArea; -import org.apache.fop.area.inline.UnresolvedPageNumber; import org.apache.fop.fo.flow.AbstractPageNumberCitation; import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontInfo; diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java index 72e4e227a..291def4c3 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java @@ -20,7 +20,6 @@ package org.apache.fop.layoutmgr.list; import java.util.LinkedList; -import java.util.List; import org.apache.fop.area.Area; import org.apache.fop.area.Block; diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java index b3cb06582..f6c831b3f 100644 --- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java +++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java @@ -46,7 +46,6 @@ import org.apache.fop.layoutmgr.KnuthPossPosIter; import org.apache.fop.layoutmgr.LayoutContext; import org.apache.fop.layoutmgr.SpaceResolver; import org.apache.fop.layoutmgr.TraitSetter; -import org.apache.fop.traits.BorderProps; class RowPainter { private static Log log = LogFactory.getLog(RowPainter.class); diff --git a/src/java/org/apache/fop/pdf/PDFColor.java b/src/java/org/apache/fop/pdf/PDFColor.java index 781012cfa..8eea7e390 100644 --- a/src/java/org/apache/fop/pdf/PDFColor.java +++ b/src/java/org/apache/fop/pdf/PDFColor.java @@ -19,7 +19,6 @@ package org.apache.fop.pdf; -import java.awt.Color; import java.awt.color.ColorSpace; import java.util.ArrayList; import java.util.List; diff --git a/src/java/org/apache/fop/pdf/PDFStructElem.java b/src/java/org/apache/fop/pdf/PDFStructElem.java index 160d55384..e35a860d9 100644 --- a/src/java/org/apache/fop/pdf/PDFStructElem.java +++ b/src/java/org/apache/fop/pdf/PDFStructElem.java @@ -21,7 +21,6 @@ package org.apache.fop.pdf; import java.io.IOException; import java.io.OutputStream; -import java.io.Writer; import java.util.ArrayList; import java.util.List; import java.util.Locale; diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index 639f8590b..a2d74bd8d 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -25,7 +25,6 @@ import java.awt.geom.AffineTransform; import java.awt.geom.Rectangle2D; import java.io.IOException; import java.io.OutputStream; -import java.util.Iterator; import java.util.List; import java.util.Locale; import java.util.Set; diff --git a/src/java/org/apache/fop/render/ImageHandler.java b/src/java/org/apache/fop/render/ImageHandler.java index 0078e37bd..fe6952de1 100644 --- a/src/java/org/apache/fop/render/ImageHandler.java +++ b/src/java/org/apache/fop/render/ImageHandler.java @@ -23,7 +23,6 @@ import java.awt.Rectangle; import java.io.IOException; import org.apache.xmlgraphics.image.loader.Image; -import org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM; /** * This interface is a service provider interface for image handlers. diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java index 29f689555..cddcc7b84 100644 --- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java @@ -53,7 +53,6 @@ import org.apache.fop.render.afp.extensions.AFPPageSegmentElement; import org.apache.fop.render.afp.extensions.AFPPageSetup; import org.apache.fop.render.afp.extensions.ExtensionPlacement; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java index 06c7cbc9d..842456f69 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java @@ -25,8 +25,6 @@ import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; -import org.apache.fop.fo.extensions.ExtensionAttachment; - /** * This extension allows to include an AFP form map resource. It is implemented as an extension * attachment ({@link ExtensionAttachment}). diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java index 719d8c765..37f818f64 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java @@ -30,7 +30,6 @@ import org.apache.fop.fo.Constants; import org.apache.fop.fo.FONode; import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.extensions.ExtensionAttachment; -import org.apache.fop.fo.extensions.ExtensionObj; /** * This class extends the {@link ExtensionObj} class. It represents the "include-form-map" diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java index a82fe3457..0900d40b4 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java @@ -23,8 +23,6 @@ import org.xml.sax.ContentHandler; import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; -import org.apache.fop.fo.extensions.ExtensionAttachment; - /** * This extension allows to include an AFP Page Overlay resource. It is implemented as an extension * attachment ({@link ExtensionAttachment}). diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java index 0577a737a..c98c05a8e 100644 --- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java @@ -40,7 +40,6 @@ import org.apache.fop.apps.FopFactoryConfigurator; import org.apache.fop.fonts.FontInfo; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; import org.apache.fop.render.intermediate.IFContext; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; diff --git a/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigurator.java b/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigurator.java index 296d4628a..2ca0a172b 100644 --- a/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigurator.java +++ b/src/java/org/apache/fop/render/bitmap/BitmapRendererConfigurator.java @@ -19,7 +19,6 @@ package org.apache.fop.render.bitmap; -import java.awt.Graphics2D; import java.awt.image.BufferedImage; import java.util.List; diff --git a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java index 77a024436..05c44a1a6 100644 --- a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java @@ -20,7 +20,6 @@ package org.apache.fop.render.bitmap; import org.apache.fop.apps.MimeConstants; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** diff --git a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java index a212d0e9e..4b7fa3c2d 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java @@ -20,7 +20,6 @@ package org.apache.fop.render.bitmap; import org.apache.fop.apps.MimeConstants; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** diff --git a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java index ad4e6ad0e..2b90e4a7b 100644 --- a/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java +++ b/src/java/org/apache/fop/render/intermediate/AbstractIFDocumentHandler.java @@ -21,9 +21,6 @@ package org.apache.fop.render.intermediate; import java.util.Locale; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - import org.apache.fop.accessibility.DummyStructureTreeEventHandler; import org.apache.fop.accessibility.StructureTreeEventHandler; import org.apache.fop.apps.FOUserAgent; diff --git a/src/java/org/apache/fop/render/intermediate/IFRenderer.java b/src/java/org/apache/fop/render/intermediate/IFRenderer.java index 64633bfab..5940fb661 100644 --- a/src/java/org/apache/fop/render/intermediate/IFRenderer.java +++ b/src/java/org/apache/fop/render/intermediate/IFRenderer.java @@ -61,7 +61,6 @@ import org.apache.fop.area.BlockViewport; import org.apache.fop.area.BookmarkData; import org.apache.fop.area.CTM; import org.apache.fop.area.DestinationData; -import org.apache.fop.area.LineArea; import org.apache.fop.area.OffDocumentExtensionAttachment; import org.apache.fop.area.OffDocumentItem; import org.apache.fop.area.PageSequence; diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java index fa1e87780..a384461ac 100644 --- a/src/java/org/apache/fop/render/intermediate/IFUtil.java +++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java @@ -23,7 +23,6 @@ import java.awt.Rectangle; import java.awt.geom.AffineTransform; import org.apache.fop.apps.FOPException; -import org.apache.fop.apps.FopFactory; import org.apache.fop.fonts.FontInfo; import org.apache.fop.util.DecimalFormatCache; diff --git a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java index 578745281..b9b6d12e6 100644 --- a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java +++ b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java @@ -19,8 +19,6 @@ package org.apache.fop.render.java2d; -import java.awt.Graphics2D; - import org.apache.fop.fonts.Font; import org.apache.fop.fonts.FontCollection; import org.apache.fop.fonts.FontInfo; diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java index 6540d6e37..5d964cbbf 100644 --- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java @@ -30,7 +30,6 @@ import javax.xml.transform.Source; import javax.xml.transform.stream.StreamSource; import org.apache.fop.fonts.CustomFont; -import org.apache.fop.fonts.FontMetrics; import org.apache.fop.fonts.FontType; import org.apache.fop.fonts.LazyFont; import org.apache.fop.fonts.Typeface; diff --git a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java index f41dd4d92..65e82f7b3 100644 --- a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java +++ b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java @@ -19,7 +19,6 @@ package org.apache.fop.render.java2d; -import java.awt.Graphics2D; import java.awt.GraphicsEnvironment; import java.util.Set; diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java index c7fa1adc5..dd830a15b 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java @@ -40,7 +40,6 @@ import org.apache.fop.render.RenderingContext; import org.apache.fop.render.intermediate.AbstractIFPainter; import org.apache.fop.render.intermediate.IFContext; import org.apache.fop.render.intermediate.IFException; -import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.render.intermediate.IFState; import org.apache.fop.render.intermediate.IFUtil; import org.apache.fop.traits.BorderProps; diff --git a/src/java/org/apache/fop/render/java2d/Java2DUtil.java b/src/java/org/apache/fop/render/java2d/Java2DUtil.java index 961d64ad2..924460bd8 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DUtil.java +++ b/src/java/org/apache/fop/render/java2d/Java2DUtil.java @@ -19,8 +19,6 @@ package org.apache.fop.render.java2d; -import java.awt.Graphics2D; - import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fonts.FontCollection; import org.apache.fop.fonts.FontEventAdapter; diff --git a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java index fac436909..06c975b86 100644 --- a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java @@ -20,7 +20,6 @@ package org.apache.fop.render.java2d; // Java -import java.awt.Graphics2D; import java.util.Map; import java.util.Set; diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java index 5af0fd179..52e522c7a 100644 --- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java +++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java @@ -37,7 +37,6 @@ import org.apache.fop.apps.MimeConstants; import org.apache.fop.fonts.FontInfo; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; import org.apache.fop.render.intermediate.IFContext; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index 53e3d77da..9fc575456 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -49,7 +49,6 @@ import org.apache.fop.render.RenderingContext; import org.apache.fop.render.intermediate.AbstractIFPainter; import org.apache.fop.render.intermediate.IFContext; import org.apache.fop.render.intermediate.IFException; -import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.render.intermediate.IFState; import org.apache.fop.render.intermediate.IFUtil; import org.apache.fop.render.java2d.FontMetricsMapper; diff --git a/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java b/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java index 84608b685..bc4cdc567 100644 --- a/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java +++ b/src/java/org/apache/fop/render/pcl/PCLRendererConfigurator.java @@ -19,7 +19,6 @@ package org.apache.fop.render.pcl; -import java.awt.Graphics2D; import java.util.List; import org.apache.avalon.framework.configuration.Configuration; diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index d55e0724b..490e42b2d 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -52,7 +52,6 @@ import org.apache.xmlgraphics.ps.dsc.events.DSCCommentHiResBoundingBox; import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.AbstractBinaryWritingIFDocumentHandler; import org.apache.fop.render.intermediate.IFContext; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java index c68578d63..eed567447 100644 --- a/src/java/org/apache/fop/svg/PDFAElementBridge.java +++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java @@ -26,7 +26,6 @@ import org.w3c.dom.svg.SVGAElement; import org.apache.batik.bridge.AbstractGraphicsNodeBridge; import org.apache.batik.bridge.BridgeContext; -import org.apache.batik.gvt.CompositeGraphicsNode; import org.apache.batik.gvt.GraphicsNode; /** diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java index 45b55695f..022f3c214 100644 --- a/src/java/org/apache/fop/traits/MinOptMax.java +++ b/src/java/org/apache/fop/traits/MinOptMax.java @@ -21,9 +21,6 @@ package org.apache.fop.traits; import java.io.Serializable; -import org.apache.fop.fo.properties.LengthRangeProperty; -import org.apache.fop.fo.properties.SpaceProperty; - /** * This class holds the resolved (as mpoints) form of a {@link LengthRangeProperty LengthRange} or * {@link SpaceProperty Space} type property value. diff --git a/src/java/org/apache/fop/traits/TraitEnum.java b/src/java/org/apache/fop/traits/TraitEnum.java index c473228cb..18fdffaab 100644 --- a/src/java/org/apache/fop/traits/TraitEnum.java +++ b/src/java/org/apache/fop/traits/TraitEnum.java @@ -21,8 +21,6 @@ package org.apache.fop.traits; import java.io.Serializable; -import org.apache.fop.fo.Constants; - /** Base class for enumeration classes representing traits. */ public abstract class TraitEnum implements Serializable { diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java index bd4aee340..d0ac6767c 100644 --- a/src/java/org/apache/fop/util/ColorExt.java +++ b/src/java/org/apache/fop/util/ColorExt.java @@ -23,8 +23,6 @@ import java.awt.Color; import java.awt.color.ColorSpace; import java.util.Arrays; -import org.apache.xmlgraphics.java2d.color.ColorWithAlternatives; - /** * Color helper class. *

diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java index 6c775f177..ef0d9f301 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java @@ -48,7 +48,6 @@ import org.apache.commons.io.IOUtils; import org.apache.fop.render.bitmap.BitmapRendererEventProducer; import org.apache.fop.render.bitmap.MultiFileRenderingUtil; import org.apache.fop.render.intermediate.DelegatingFragmentContentHandler; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.util.GenerationHelperContentHandler; diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java index e5832eba1..10be9588e 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java @@ -27,7 +27,6 @@ import org.xml.sax.SAXException; import org.xml.sax.helpers.AttributesImpl; import org.apache.fop.render.intermediate.IFConstants; -import org.apache.fop.render.intermediate.IFDocumentHandler; import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.util.XMLUtil; -- cgit v1.2.3 From 72ba7e572dccdb5ab1930ed9f20c9db7f720ae50 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Sun, 27 May 2012 17:39:49 +0000 Subject: Add extension to place code just before PostScript %PageTrailer. Submitted by Luis Bernardo. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1343072 13f79535-47bb-0310-9956-ffa450edef68 --- .../apache/fop/render/ps/PSDocumentHandler.java | 13 ++++- .../ps/extensions/PSExtensionElementMapping.java | 7 +++ .../render/ps/extensions/PSExtensionHandler.java | 3 ++ .../ps/extensions/PSPageTrailerCodeBefore.java | 50 ++++++++++++++++++++ .../extensions/PSPageTrailerCodeBeforeElement.java | 55 ++++++++++++++++++++++ status.xml | 3 ++ .../fop/render/ps/PSRenderingUtilTestCase.java | 45 ++++++++++++++++++ 7 files changed, 174 insertions(+), 2 deletions(-) create mode 100644 src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java create mode 100644 src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java create mode 100644 test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java (limited to 'src/java/org/apache/fop/render/ps/PSDocumentHandler.java') diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index 490e42b2d..95647d820 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -26,6 +26,7 @@ import java.io.File; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; +import java.util.ArrayList; import java.util.Collection; import java.util.List; import java.util.Map; @@ -57,6 +58,7 @@ import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.render.ps.extensions.PSCommentAfter; import org.apache.fop.render.ps.extensions.PSCommentBefore; +import org.apache.fop.render.ps.extensions.PSPageTrailerCodeBefore; import org.apache.fop.render.ps.extensions.PSSetPageDevice; import org.apache.fop.render.ps.extensions.PSSetupCode; @@ -98,10 +100,11 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { private PSPageDeviceDictionary pageDeviceDictionary; /** This is a collection holding all document header comments */ - private Collection[] comments = new Collection[3]; + private Collection[] comments = new Collection[4]; private static final int COMMENT_DOCUMENT_HEADER = 0; private static final int COMMENT_DOCUMENT_TRAILER = 1; private static final int COMMENT_PAGE_TRAILER = 2; + private static final int PAGE_TRAILER_CODE_BEFORE = 3; /** * Default constructor. @@ -443,8 +446,9 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { /** {@inheritDoc} */ public void startPageTrailer() throws IFException { - super.startPageTrailer(); try { + writeExtensions(PAGE_TRAILER_CODE_BEFORE); + super.startPageTrailer(); gen.writeDSCComment(DSCConstants.PAGE_TRAILER); } catch (IOException ioe) { throw new IFException("I/O error in startPageTrailer()", ioe); @@ -526,6 +530,11 @@ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { comments[targetCollection] = new java.util.ArrayList(); } comments[targetCollection].add(extension); + } else if (extension instanceof PSPageTrailerCodeBefore) { + if (comments[PAGE_TRAILER_CODE_BEFORE] == null) { + comments[PAGE_TRAILER_CODE_BEFORE] = new ArrayList(); + } + comments[PAGE_TRAILER_CODE_BEFORE].add(extension); } } catch (IOException ioe) { throw new IFException("I/O error in handleExtensionObject()", ioe); diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java index 00d0594f2..5721afaf6 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java @@ -41,6 +41,7 @@ public class PSExtensionElementMapping extends ElementMapping { foObjs = new java.util.HashMap(); foObjs.put(PSSetupCodeElement.ELEMENT, new PSSetupCodeMaker()); foObjs.put(PSPageSetupCodeElement.ELEMENT, new PSPageSetupCodeMaker()); + foObjs.put(PSPageTrailerCodeBefore.ELEMENT, new PSPageTrailerCodeBeforeMaker()); foObjs.put(PSSetPageDeviceElement.ELEMENT, new PSSetPageDeviceMaker()); foObjs.put(PSCommentBefore.ELEMENT, new PSCommentBeforeMaker()); foObjs.put(PSCommentAfter.ELEMENT, new PSCommentAfterMaker()); @@ -59,6 +60,12 @@ public class PSExtensionElementMapping extends ElementMapping { } } + static class PSPageTrailerCodeBeforeMaker extends ElementMapping.Maker { + public FONode make(FONode parent) { + return new PSPageTrailerCodeBeforeElement(parent); + } + } + static class PSSetPageDeviceMaker extends ElementMapping.Maker { public FONode make(FONode parent) { return new PSSetPageDeviceElement(parent); diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java index d499ef6ab..b520d8736 100644 --- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java +++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java @@ -53,6 +53,7 @@ public class PSExtensionHandler extends DefaultHandler lastAttributes = new AttributesImpl(attributes); handled = false; if (localName.equals(PSSetupCode.ELEMENT) + || localName.equals(PSPageTrailerCodeBefore.ELEMENT) || localName.equals(PSSetPageDevice.ELEMENT) || localName.equals(PSCommentBefore.ELEMENT) || localName.equals(PSCommentAfter.ELEMENT)) { @@ -84,6 +85,8 @@ public class PSExtensionHandler extends DefaultHandler this.returnedObject = new PSCommentBefore(content.toString()); } else if (PSCommentAfter.ELEMENT.equals(localName)) { this.returnedObject = new PSCommentAfter(content.toString()); + } else if (PSPageTrailerCodeBefore.ELEMENT.equals(localName)) { + this.returnedObject = new PSPageTrailerCodeBefore(content.toString()); } } content.setLength(0); //Reset text buffer (see characters()) diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java new file mode 100644 index 000000000..f28f0003e --- /dev/null +++ b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBefore.java @@ -0,0 +1,50 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.render.ps.extensions; + + +public class PSPageTrailerCodeBefore extends PSExtensionAttachment { + + /** The element name */ + protected static final String ELEMENT = "ps-page-trailer-code-before"; + + /** + * Default constructor + * @param content the actual comment + */ + public PSPageTrailerCodeBefore(String content) { + super(content); + } + + /** + * Constructor + */ + public PSPageTrailerCodeBefore() { + super(); + } + + /** + * @return element name + */ + protected String getElement() { + return ELEMENT; + } + +} diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java new file mode 100644 index 000000000..65a22eadd --- /dev/null +++ b/src/java/org/apache/fop/render/ps/extensions/PSPageTrailerCodeBeforeElement.java @@ -0,0 +1,55 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.render.ps.extensions; + +import org.apache.fop.fo.FONode; +import org.apache.fop.fo.extensions.ExtensionAttachment; + +/** + * Comment before element + */ +public class PSPageTrailerCodeBeforeElement extends AbstractPSCommentElement { + + /** the element name */ + protected static final String ELEMENT = "ps-page-trailer-code-before"; + + /** + * Main constructor + * @param parent parent node + */ + public PSPageTrailerCodeBeforeElement(FONode parent) { + super(parent); + } + + /** + * @return local name + * @see org.apache.fop.fo.FONode#getLocalName() + */ + public String getLocalName() { + return PSPageTrailerCodeBefore.ELEMENT; + } + + /** + * @return instance of its extension attachment object + */ + protected ExtensionAttachment instantiateExtensionAttachment() { + return new PSPageTrailerCodeBefore(); + } +} diff --git a/status.xml b/status.xml index 22654f61c..a18de8fca 100644 --- a/status.xml +++ b/status.xml @@ -63,6 +63,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Add extension to place code just before PostScript %PageTrailer. + Fix invalid PostScript file being created when font-size is 0. diff --git a/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java b/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java new file mode 100644 index 000000000..3f1088fe1 --- /dev/null +++ b/test/java/org/apache/fop/render/ps/PSRenderingUtilTestCase.java @@ -0,0 +1,45 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/* $Id$ */ + +package org.apache.fop.render.ps; + +import java.io.IOException; + +import org.junit.Test; + +import org.apache.xmlgraphics.ps.PSGenerator; + +import org.apache.fop.render.ps.extensions.PSPageTrailerCodeBefore; + +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.verify; + +public class PSRenderingUtilTestCase { + + private final String content = "<< /MyEntry 0 >> command"; + private final PSPageTrailerCodeBefore ptcb = new PSPageTrailerCodeBefore(content); + private final PSGenerator gen = mock(PSGenerator.class); + + @Test + public void testWriteEnclosedExtensionAttachment() throws IOException { + PSRenderingUtil.writeEnclosedExtensionAttachment(gen, ptcb); + verify(gen).writeln(content); + } + +} -- cgit v1.2.3 From e7181a7fdfa0336e688d8ed9e27f0304c741d7d2 Mon Sep 17 00:00:00 2001 From: Glenn Adams Date: Mon, 4 Jun 2012 05:42:06 +0000 Subject: Eliminate javadocs warnings. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1345838 13f79535-47bb-0310-9956-ffa450edef68 --- src/java/org/apache/fop/afp/AFPGraphics2D.java | 4 +- src/java/org/apache/fop/afp/modca/ImageObject.java | 6 ++- .../apache/fop/afp/modca/PresentationTextData.java | 2 +- .../fop/afp/util/DefaultFOPResourceAccessor.java | 3 +- src/java/org/apache/fop/apps/FOUserAgent.java | 5 +- .../fonts/GlyphPositioningTable.java | 2 +- .../scripts/IndicScriptProcessor.java | 2 +- src/java/org/apache/fop/fo/FOEventHandler.java | 14 +++-- .../BalancingColumnBreakingAlgorithm.java | 16 +++--- .../org/apache/fop/layoutmgr/BreakElement.java | 34 ++++++++---- .../org/apache/fop/layoutmgr/KnuthPenalty.java | 7 ++- src/java/org/apache/fop/pdf/PDFColor.java | 2 +- src/java/org/apache/fop/pdf/PDFEmbeddedFile.java | 5 +- src/java/org/apache/fop/pdf/PDFObject.java | 6 --- src/java/org/apache/fop/render/ImageHandler.java | 3 +- .../apache/fop/render/afp/AFPDocumentHandler.java | 3 +- .../render/afp/extensions/AFPIncludeFormMap.java | 2 +- .../afp/extensions/AFPIncludeFormMapElement.java | 4 +- .../fop/render/afp/extensions/AFPPageOverlay.java | 2 +- .../bitmap/AbstractBitmapDocumentHandler.java | 3 +- .../fop/render/bitmap/PNGDocumentHandler.java | 3 +- .../fop/render/bitmap/TIFFDocumentHandler.java | 3 +- .../apache/fop/render/intermediate/IFContext.java | 4 +- .../org/apache/fop/render/intermediate/IFUtil.java | 8 +-- .../fop/render/java2d/CustomFontMetricsMapper.java | 2 +- .../apache/fop/render/java2d/Java2DPainter.java | 3 +- .../apache/fop/render/pcl/PCLDocumentHandler.java | 3 +- src/java/org/apache/fop/render/pcl/PCLPainter.java | 3 +- .../apache/fop/render/ps/NativeTextHandler.java | 6 --- .../apache/fop/render/ps/PSDocumentHandler.java | 3 +- src/java/org/apache/fop/svg/PDFAElementBridge.java | 2 +- src/java/org/apache/fop/traits/MinOptMax.java | 5 +- src/java/org/apache/fop/traits/TraitEnum.java | 4 +- src/java/org/apache/fop/util/ColorExt.java | 2 +- .../org/apache/fop/render/mif/MIFHandler.java | 60 ++++++++++++++-------- .../apache/fop/render/svg/SVGDocumentHandler.java | 3 +- .../fop/render/svg/SVGPrintDocumentHandler.java | 3 +- status.xml | 3 ++ 38 files changed, 149 insertions(+), 96 deletions(-) (limited to 'src/java/org/apache/fop/render/ps/PSDocumentHandler.java') diff --git a/src/java/org/apache/fop/afp/AFPGraphics2D.java b/src/java/org/apache/fop/afp/AFPGraphics2D.java index e9a269ac4..7172b0ee3 100644 --- a/src/java/org/apache/fop/afp/AFPGraphics2D.java +++ b/src/java/org/apache/fop/afp/AFPGraphics2D.java @@ -67,7 +67,7 @@ import org.apache.fop.svg.NativeImageHandler; /** * This is a concrete implementation of {@link AbstractGraphics2D} (and - * therefore of {@link Graphics2D}) which is able to generate GOCA byte + * therefore of {@link java.awt.Graphics2D}) which is able to generate GOCA byte * codes. * * @see org.apache.xmlgraphics.java2d.AbstractGraphics2D @@ -165,7 +165,7 @@ public class AFPGraphics2D extends AbstractGraphics2D implements NativeImageHand } /** - * Returns the AFP resource manager associated with this {@link Graphics2D} instance. + * Returns the AFP resource manager associated with this {@link java.awt.Graphics2D} instance. * @return the resource manager */ public AFPResourceManager getResourceManager() { diff --git a/src/java/org/apache/fop/afp/modca/ImageObject.java b/src/java/org/apache/fop/afp/modca/ImageObject.java index adb56e626..e42639248 100644 --- a/src/java/org/apache/fop/afp/modca/ImageObject.java +++ b/src/java/org/apache/fop/afp/modca/ImageObject.java @@ -119,7 +119,8 @@ public class ImageObject extends AbstractDataObject { * Sets the image IDE color model. * * @param colorModel the IDE color model. - * @deprecated Use {@link IDEStructureParameter#setColorModel(byte)} instead. + * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setColorModel(byte)} + * instead. */ public void setIDEColorModel(byte colorModel) { getImageSegment().setIDEColorModel(colorModel); @@ -128,7 +129,8 @@ public class ImageObject extends AbstractDataObject { /** * Set either additive or subtractive mode (used for ASFLAG). * @param subtractive true for subtractive mode, false for additive mode - * @deprecated Use {@link IDEStructureParameter#setSubtractive(boolean)} instead. + * @deprecated Use {@link org.apache.fop.afp.ioca.IDEStructureParameter#setSubtractive(boolean)} + * instead. */ public void setSubtractive(boolean subtractive) { getImageSegment().setSubtractive(subtractive); diff --git a/src/java/org/apache/fop/afp/modca/PresentationTextData.java b/src/java/org/apache/fop/afp/modca/PresentationTextData.java index b68131413..c0934b1e5 100644 --- a/src/java/org/apache/fop/afp/modca/PresentationTextData.java +++ b/src/java/org/apache/fop/afp/modca/PresentationTextData.java @@ -46,7 +46,7 @@ import org.apache.fop.afp.util.BinaryUtils; * which signal an alternate mode of processing for the content of the current * Presentation Text data. *

- * The content for this object can be created using {@link PtocaBuilder}. + * The content for this object can be created using {@link org.apache.fop.afp.ptoca.PtocaBuilder}. */ public class PresentationTextData extends AbstractAFPObject implements PtocaConstants { diff --git a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java index f379546e2..2872976b6 100644 --- a/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java +++ b/src/java/org/apache/fop/afp/util/DefaultFOPResourceAccessor.java @@ -44,7 +44,8 @@ public class DefaultFOPResourceAccessor extends SimpleResourceAccessor { * Constructor for resource to be accessed via the {@link FOUserAgent}. This contructor * can take two base URIs: the category base URI is the one to use when differentiating between * normal resources (ex. images) and font resources. So, if fonts need to be accessed, you can - * set the {@link FontManager}'s base URI instead of the one on the {@link FopFactory}. + * set the {@link org.apache.fop.fonts.FontManager}'s base URI instead of the one on the + * {@link org.apache.fop.apps.FopFactory}. * @param userAgent the FO user agent * @param categoryBaseURI the category base URI (may be null) * @param baseURI the custom base URI to resolve relative URIs against (may be null) diff --git a/src/java/org/apache/fop/apps/FOUserAgent.java b/src/java/org/apache/fop/apps/FOUserAgent.java index 665c1abf8..035b6f1a1 100644 --- a/src/java/org/apache/fop/apps/FOUserAgent.java +++ b/src/java/org/apache/fop/apps/FOUserAgent.java @@ -355,7 +355,7 @@ public class FOUserAgent { /** * Sets font base URL. * @param fontBaseUrl font base URL - * @deprecated Use {@link FontManager#setFontBaseURL(String)} instead. + * @deprecated Use {@link org.apache.fop.fonts.FontManager#setFontBaseURL(String)} instead. */ public void setFontBaseURL(String fontBaseUrl) { try { @@ -500,7 +500,8 @@ public class FOUserAgent { /** * Returns the font base URL. * @return the font base URL - * @deprecated Use {@link FontManager#getFontBaseURL()} instead. This method is not used by FOP. + * @deprecated Use {@link org.apache.fop.fonts.FontManager#getFontBaseURL()} instead. + * This method is not used by FOP. */ public String getFontBaseURL() { String fontBase = getFactory().getFontManager().getFontBaseURL(); diff --git a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java index 3b7c14b0e..6db6be726 100644 --- a/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java +++ b/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java @@ -1783,9 +1783,9 @@ public class GlyphPositioningTable extends GlyphTable { * Find device adjustment. * @param fontSize the font size to search for * @return an adjustment if font size matches an entry - * @asf.todo at present, assumes that 1 device unit equals one point */ public int findAdjustment ( int fontSize ) { + // [TODO] at present, assumes that 1 device unit equals one point int fs = fontSize / 1000; if ( fs < startSize ) { return 0; diff --git a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java index ce4585828..26249bc22 100644 --- a/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java +++ b/src/java/org/apache/fop/complexscripts/scripts/IndicScriptProcessor.java @@ -360,7 +360,7 @@ public class IndicScriptProcessor extends DefaultScriptProcessor { } /** Abstract syllabizer. */ - protected abstract static class Syllabizer { + protected abstract static class Syllabizer implements Comparable { private String script; private String language; Syllabizer ( String script, String language ) { diff --git a/src/java/org/apache/fop/fo/FOEventHandler.java b/src/java/org/apache/fop/fo/FOEventHandler.java index 743708b72..11b6d4a2f 100644 --- a/src/java/org/apache/fop/fo/FOEventHandler.java +++ b/src/java/org/apache/fop/fo/FOEventHandler.java @@ -123,11 +123,17 @@ public abstract class FOEventHandler { public void endDocument() throws SAXException { } - /** {@inheritDoc} */ + /** + * Called upon start of root element. + * @param root element + */ public void startRoot(Root root) { } - /** {@inheritDoc} */ + /** + * Called upon end of root element. + * @param root element + */ public void endRoot(Root root) { } @@ -413,9 +419,9 @@ public abstract class FOEventHandler { /** * Process end of a Static. - * @param statisContent StaticContent that is ending + * @param staticContent StaticContent that is ending */ - public void endStatic(StaticContent statisContent) { + public void endStatic(StaticContent staticContent) { } diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java index 2bcdb6127..03c159843 100644 --- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java +++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java @@ -41,12 +41,16 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm { * @param topLevelLM the top level layout manager * @param pageProvider the page provider * @param layoutListener the layout listener - * @param alignment alignment of the paragraph/page. One of {@link Constants#EN_START}, - * {@link Constants#EN_JUSTIFY}, {@link Constants#EN_CENTER}, - * {@link Constants#EN_END}. - * For pages, {@link Constants#EN_BEFORE} and {@link Constants#EN_AFTER} - * are mapped to the corresponding inline properties, - * {@link Constants#EN_START} and {@link Constants#EN_END}. + * @param alignment alignment of the paragraph/page. One of + * {@link org.apache.fop.fo.Constants#EN_START}, + * {@link org.apache.fop.fo.Constants#EN_JUSTIFY}, + * {@link org.apache.fop.fo.Constants#EN_CENTER}, + * {@link org.apache.fop.fo.Constants#EN_END}. + * For pages, {@link org.apache.fop.fo.Constants#EN_BEFORE} and + * {@link org.apache.fop.fo.Constants#EN_AFTER} + * are mapped to the corresponding inline properties, + * {@link org.apache.fop.fo.Constants#EN_START} and + * {@link org.apache.fop.fo.Constants#EN_END}. * @param alignmentLast alignment of the paragraph's last line * @param footnoteSeparatorLength length of footnote separator * @param partOverflowRecovery {@code true} if too long elements should be moved to diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java index 1c89c2009..77e7f140b 100644 --- a/src/java/org/apache/fop/layoutmgr/BreakElement.java +++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java @@ -46,8 +46,11 @@ public class BreakElement extends UnresolvedListElement { * Create a new BreakElement for the given {@code position}, {@code penaltyValue} * and {@code breakClass}. (Used principally to generate break-possibilities in * ranges of content that must be kept together within the context corresponding - * to the {@code breakClass}; expected to be one of {@link Constants#EN_AUTO}, - * {@link Constants#EN_LINE}, {@link Constants#EN_COLUMN} or {@link Constants#EN_PAGE}) + * to the {@code breakClass}; expected to be one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_LINE}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN} or + * {@link org.apache.fop.fo.Constants#EN_PAGE}) * @param position the corresponding {@link Position} * @param penaltyValue the penalty value * @param breakClass the break class @@ -64,9 +67,12 @@ public class BreakElement extends UnresolvedListElement { * @param position the Position instance needed by the addAreas stage of the LMs. * @param penaltyWidth the penalty width * @param penaltyValue the penalty value for the penalty element to be constructed - * @param breakClass the break class of this penalty (one of {@link Constants#EN_AUTO}, - * {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE}, - * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}) + * @param breakClass the break class of this penalty (one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}) * @param context the layout context which contains the pending conditional elements */ public BreakElement(Position position, int penaltyWidth, int penaltyValue, @@ -120,9 +126,12 @@ public class BreakElement extends UnresolvedListElement { /** * Returns the break class of this penalty. * - * @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, - * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, - * {@link Constants#EN_ODD_PAGE} + * @return one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}. */ public int getBreakClass() { return breakClass; @@ -131,9 +140,12 @@ public class BreakElement extends UnresolvedListElement { /** * Sets the break class. * - * @param breakClass one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, - * {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, - * {@link Constants#EN_ODD_PAGE} + * @param breakClass one of + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}. */ public void setBreakClass(int breakClass) { this.breakClass = breakClass; diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java index 2d4e1f2be..220f9c35d 100644 --- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java +++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java @@ -72,8 +72,11 @@ public class KnuthPenalty extends KnuthElement { * @param penalty the penalty value of this penalty * @param penaltyFlagged is this penalty flagged? * @param breakClass the break class of this penalty (one of - * {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE}, - * {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}) + * {@link org.apache.fop.fo.Constants#EN_AUTO}, + * {@link org.apache.fop.fo.Constants#EN_COLUMN}, + * {@link org.apache.fop.fo.Constants#EN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_EVEN_PAGE}, + * {@link org.apache.fop.fo.Constants#EN_ODD_PAGE}). * @param pos the Position stored in this penalty * @param isAuxiliary is this penalty auxiliary? */ diff --git a/src/java/org/apache/fop/pdf/PDFColor.java b/src/java/org/apache/fop/pdf/PDFColor.java index 8eea7e390..1fb544368 100644 --- a/src/java/org/apache/fop/pdf/PDFColor.java +++ b/src/java/org/apache/fop/pdf/PDFColor.java @@ -30,7 +30,7 @@ import org.apache.xmlgraphics.java2d.color.DeviceCMYKColorSpace; * image. And in this context, only RGB and Gray values are used. *

* Use of this class is discouraged. {@link PDFColorHandler} is now used for in-content color - * selection. For masked bitmaps, it may be wiser to switch to {@link Color} in the long run. + * selection. For masked bitmaps, it may be wiser to switch to {@link java.awt.Color} in the long run. */ public class PDFColor extends PDFPathPaint { // could be 3.0 as well. diff --git a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java index dc0681405..ae6893944 100644 --- a/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java +++ b/src/java/org/apache/fop/pdf/PDFEmbeddedFile.java @@ -38,7 +38,10 @@ public class PDFEmbeddedFile extends PDFStream { put("Params", params); } - /** {@inheritDoc} */ + /** + * Determine if should encode on the fly. + * @return true if should encode on the fly + */ protected boolean isEncodingOnTheFly() { //Acrobat doesn't like an indirect /Length object in this case, //but only when the embedded file is a PDF file. diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index 1b9c4eea7..e0f950154 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -22,7 +22,6 @@ package org.apache.fop.pdf; // Java import java.io.IOException; import java.io.OutputStream; -import java.io.Writer; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -210,11 +209,6 @@ public abstract class PDFObject implements PDFWritable { return pdf.length; } - /** {@inheritDoc} */ - public void outputInline(OutputStream out, Writer writer) throws IOException { - throw new UnsupportedOperationException("Don't use anymore: " + getClass().getName()); - } - /** {@inheritDoc} */ public void outputInline(OutputStream out, StringBuilder textBuffer) throws IOException { if (hasObjectNumber()) { diff --git a/src/java/org/apache/fop/render/ImageHandler.java b/src/java/org/apache/fop/render/ImageHandler.java index fe6952de1..190d7c5d6 100644 --- a/src/java/org/apache/fop/render/ImageHandler.java +++ b/src/java/org/apache/fop/render/ImageHandler.java @@ -33,7 +33,8 @@ public interface ImageHandler extends ImageHandlerBase { * Indicates whether the image handler is compatible with the indicated target represented * by the rendering context object and with the image to be processed. The image is also * passed as a parameter because a handler might not support every subtype of image that is - * presented. For example: in the case of {@link ImageXMLDOM}, the image might carry an SVG + * presented. For example: in the case of + * {@link org.apache.xmlgraphics.image.loader.impl.ImageXMLDOM}, the image might carry an SVG * or some other XML format. One handler might only handle SVG but no other XML format. * @param targetContext the target rendering context * @param image the image to be processed (or null if only to check based on the rendering diff --git a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java index 7823a2ce6..2ae95dd4c 100644 --- a/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java +++ b/src/java/org/apache/fop/render/afp/AFPDocumentHandler.java @@ -58,7 +58,8 @@ import org.apache.fop.render.intermediate.IFException; import org.apache.fop.render.intermediate.IFPainter; /** - * {@link IFDocumentHandler} implementation that produces AFP (MO:DCA). + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation that + * produces AFP (MO:DCA). */ public class AFPDocumentHandler extends AbstractBinaryWritingIFDocumentHandler implements AFPCustomizable { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java index 842456f69..824ecbabb 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMap.java @@ -27,7 +27,7 @@ import org.xml.sax.helpers.AttributesImpl; /** * This extension allows to include an AFP form map resource. It is implemented as an extension - * attachment ({@link ExtensionAttachment}). + * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}). */ public class AFPIncludeFormMap extends AFPExtensionAttachment { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java index 37f818f64..c5079b2bd 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPIncludeFormMapElement.java @@ -32,8 +32,8 @@ import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.extensions.ExtensionAttachment; /** - * This class extends the {@link ExtensionObj} class. It represents the "include-form-map" - * extension in the FO tree. + * This class extends the {@link org.apache.fop.fo.extensions.ExtensionObj} class. + * It represents the "include-form-map" extension in the FO tree. */ public class AFPIncludeFormMapElement extends AbstractAFPExtensionObject { diff --git a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java index 0900d40b4..1e6aee7d5 100644 --- a/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java +++ b/src/java/org/apache/fop/render/afp/extensions/AFPPageOverlay.java @@ -25,7 +25,7 @@ import org.xml.sax.helpers.AttributesImpl; /** * This extension allows to include an AFP Page Overlay resource. It is implemented as an extension - * attachment ({@link ExtensionAttachment}). + * attachment ({@link org.apache.fop.fo.extensions.ExtensionAttachment}). */ public class AFPPageOverlay extends AFPExtensionAttachment { diff --git a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java index c98c05a8e..0c6ebde56 100644 --- a/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/AbstractBitmapDocumentHandler.java @@ -47,7 +47,8 @@ import org.apache.fop.render.java2d.Java2DPainter; import org.apache.fop.render.java2d.Java2DUtil; /** - * Abstract {@link IFDocumentHandler} implementation for producing bitmap images. + * Abstract {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * for producing bitmap images. */ public abstract class AbstractBitmapDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { diff --git a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java index 05c44a1a6..ed92b852f 100644 --- a/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/PNGDocumentHandler.java @@ -23,7 +23,8 @@ import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** - * {@link IFDocumentHandler} implementation that produces PNG files. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PNG files. */ public class PNGDocumentHandler extends AbstractBitmapDocumentHandler { diff --git a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java index 4b7fa3c2d..1c9a39bbe 100644 --- a/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java +++ b/src/java/org/apache/fop/render/bitmap/TIFFDocumentHandler.java @@ -23,7 +23,8 @@ import org.apache.fop.apps.MimeConstants; import org.apache.fop.render.intermediate.IFDocumentHandlerConfigurator; /** - * {@link IFDocumentHandler} implementation that produces TIFF files. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces TIFF files. */ public class TIFFDocumentHandler extends AbstractBitmapDocumentHandler { diff --git a/src/java/org/apache/fop/render/intermediate/IFContext.java b/src/java/org/apache/fop/render/intermediate/IFContext.java index c59a02ba8..681b996e4 100644 --- a/src/java/org/apache/fop/render/intermediate/IFContext.java +++ b/src/java/org/apache/fop/render/intermediate/IFContext.java @@ -145,7 +145,7 @@ public class IFContext { /** * Resets the current structure tree element. - * @see #setStructureTreeElement(String) + * @see #setStructureTreeElement(StructureTreeElement) */ public void resetStructureTreeElement() { setStructureTreeElement(null); @@ -154,7 +154,7 @@ public class IFContext { /** * Returns the current structure tree element. * @return the structure tree element (or null if no element is active) - * @see #setStructureTreeElement(String) + * @see #setStructureTreeElement(StructureTreeElement) */ public StructureTreeElement getStructureTreeElement() { return this.structureTreeElement; diff --git a/src/java/org/apache/fop/render/intermediate/IFUtil.java b/src/java/org/apache/fop/render/intermediate/IFUtil.java index e8651a3df..c4f681936 100644 --- a/src/java/org/apache/fop/render/intermediate/IFUtil.java +++ b/src/java/org/apache/fop/render/intermediate/IFUtil.java @@ -147,8 +147,8 @@ public final class IFUtil { /** * Sets up the fonts on a document handler. If the document handler provides a configurator - * object the configuration from the {@link FopFactory} will be used. Otherwise, - * a default font configuration will be set up. + * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used. + * Otherwise, a default font configuration will be set up. * @param documentHandler the document handler * @param fontInfo the font info object (may be null) * @throws FOPException if an error occurs while setting up the fonts @@ -175,8 +175,8 @@ public final class IFUtil { /** * Sets up the fonts on a document handler. If the document handler provides a configurator - * object the configuration from the {@link FopFactory} will be used. Otherwise, - * a default font configuration will be set up. + * object the configuration from the {@link org.apache.fop.apps.FopFactory} will be used. + * Otherwise, a default font configuration will be set up. * @param documentHandler the document handler * @throws FOPException if an error occurs while setting up the fonts */ diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java index 5d964cbbf..36df00f20 100644 --- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java +++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java @@ -36,7 +36,7 @@ import org.apache.fop.fonts.Typeface; /** * FontMetricsMapper that delegates most methods to an underlying - * {@link FontMetrics} instance. This class was designed to allow + * {@link org.apache.fop.fonts.FontMetrics} instance. This class was designed to allow * the underlying {@link Font} to be loaded from a * user-configured file not registered in the current graphics environment. */ diff --git a/src/java/org/apache/fop/render/java2d/Java2DPainter.java b/src/java/org/apache/fop/render/java2d/Java2DPainter.java index dd830a15b..575242d38 100644 --- a/src/java/org/apache/fop/render/java2d/Java2DPainter.java +++ b/src/java/org/apache/fop/render/java2d/Java2DPainter.java @@ -47,7 +47,8 @@ import org.apache.fop.traits.RuleStyle; import org.apache.fop.util.CharUtilities; /** - * {@link IFPainter} implementation that paints on a Graphics2D instance. + * {@link org.apache.fop.render.intermediate.IFPainter} implementation + * that paints on a Graphics2D instance. */ public class Java2DPainter extends AbstractIFPainter { diff --git a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java index 52e522c7a..332b4a77d 100644 --- a/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java +++ b/src/java/org/apache/fop/render/pcl/PCLDocumentHandler.java @@ -45,7 +45,8 @@ import org.apache.fop.render.java2d.Java2DUtil; import org.apache.fop.render.pcl.extensions.PCLElementMapping; /** - * {@link IFDocumentHandler} implementation that produces PCL 5. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PCL 5. */ public class PCLDocumentHandler extends AbstractBinaryWritingIFDocumentHandler implements PCLConstants { diff --git a/src/java/org/apache/fop/render/pcl/PCLPainter.java b/src/java/org/apache/fop/render/pcl/PCLPainter.java index 9fc575456..0d630826c 100644 --- a/src/java/org/apache/fop/render/pcl/PCLPainter.java +++ b/src/java/org/apache/fop/render/pcl/PCLPainter.java @@ -58,7 +58,8 @@ import org.apache.fop.traits.RuleStyle; import org.apache.fop.util.CharUtilities; /** - * {@link IFPainter} implementation that produces PCL 5. + * {@link org.apache.fop.render.intermediate.IFPainter} implementation + * that produces PCL 5. */ public class PCLPainter extends AbstractIFPainter implements PCLConstants { diff --git a/src/java/org/apache/fop/render/ps/NativeTextHandler.java b/src/java/org/apache/fop/render/ps/NativeTextHandler.java index 33adcb8d7..e8f123dc5 100644 --- a/src/java/org/apache/fop/render/ps/NativeTextHandler.java +++ b/src/java/org/apache/fop/render/ps/NativeTextHandler.java @@ -100,12 +100,6 @@ public class NativeTextHandler implements PSTextHandler { //nop } - /** {@inheritDoc} */ - public void drawString(String text, float x, float y) throws IOException { - // TODO Remove me after removing the deprecated method in TextHandler. - throw new UnsupportedOperationException("Deprecated method!"); - } - /** * Draw a string to the PostScript document. The text is painted using * text operations. diff --git a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java index 95647d820..dc785ea18 100644 --- a/src/java/org/apache/fop/render/ps/PSDocumentHandler.java +++ b/src/java/org/apache/fop/render/ps/PSDocumentHandler.java @@ -63,7 +63,8 @@ import org.apache.fop.render.ps.extensions.PSSetPageDevice; import org.apache.fop.render.ps.extensions.PSSetupCode; /** - * {@link IFDocumentHandler} implementation that produces PostScript. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that produces PostScript. */ public class PSDocumentHandler extends AbstractBinaryWritingIFDocumentHandler { diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java index cd70bed34..c2a481af9 100644 --- a/src/java/org/apache/fop/svg/PDFAElementBridge.java +++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java @@ -64,7 +64,7 @@ public class PDFAElementBridge extends AbstractGraphicsNodeBridge { } /** - * Creates a {@link CompositeGraphicsNode}. + * Creates a {@link org.apache.batik.gvt.CompositeGraphicsNode}. * @return a new PDFANode */ protected GraphicsNode instantiateGraphicsNode() { diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java index 022f3c214..84fb0156a 100644 --- a/src/java/org/apache/fop/traits/MinOptMax.java +++ b/src/java/org/apache/fop/traits/MinOptMax.java @@ -22,8 +22,9 @@ package org.apache.fop.traits; import java.io.Serializable; /** - * This class holds the resolved (as mpoints) form of a {@link LengthRangeProperty LengthRange} or - * {@link SpaceProperty Space} type property value. + * This class holds the resolved (as mpoints) form of a + * {@link org.apache.fop.fo.properties.LengthRangeProperty} or + * {@link org.apache.fop.fo.properties.SpaceProperty} type property value. *

* Instances of this class are immutable. All arithmetic methods like {@link #plus(MinOptMax) plus}, * {@link #minus(MinOptMax) minus} or {@link #mult(int) mult} return a different instance. So it is diff --git a/src/java/org/apache/fop/traits/TraitEnum.java b/src/java/org/apache/fop/traits/TraitEnum.java index 18fdffaab..0d664a6df 100644 --- a/src/java/org/apache/fop/traits/TraitEnum.java +++ b/src/java/org/apache/fop/traits/TraitEnum.java @@ -30,7 +30,7 @@ public abstract class TraitEnum implements Serializable { /** * Constructor to add a new named item. * @param name Name of the item. - * @param enumValue the {@link Constants}.EN_* value + * @param enumValue the {@link org.apache.fop.fo.Constants}.EN_* value */ protected TraitEnum(String name, int enumValue) { this.name = name; @@ -46,7 +46,7 @@ public abstract class TraitEnum implements Serializable { } /** - * Returns the enumeration value (one of {@link Constants}.EN_*). + * Returns the enumeration value (one of {@link org.apache.fop.fo.Constants}.EN_*). * @return the enumeration value */ public int getEnumValue() { diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java index d0ac6767c..f92e7c2a6 100644 --- a/src/java/org/apache/fop/util/ColorExt.java +++ b/src/java/org/apache/fop/util/ColorExt.java @@ -28,7 +28,7 @@ import java.util.Arrays; *

* This class extends java.awt.Color class keeping track of the original color * property values specified by the fo user in a rgb-icc call. - * @deprecated Replaced by {@link ColorWithAlternatives} + * @deprecated Replaced by {@link org.apache.xmlgraphics.java2d.color.ColorWithAlternatives} */ @Deprecated public final class ColorExt extends Color { diff --git a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java index cfc86edc7..5ef4c0940 100644 --- a/src/sandbox/org/apache/fop/render/mif/MIFHandler.java +++ b/src/sandbox/org/apache/fop/render/mif/MIFHandler.java @@ -29,8 +29,10 @@ import org.apache.commons.logging.LogFactory; import org.apache.fop.apps.FOUserAgent; import org.apache.fop.fo.FOEventHandler; +import org.apache.fop.fo.FOText; import org.apache.fop.fo.flow.BasicLink; import org.apache.fop.fo.flow.Block; +import org.apache.fop.fo.flow.Character; import org.apache.fop.fo.flow.ExternalGraphic; import org.apache.fop.fo.flow.Footnote; import org.apache.fop.fo.flow.FootnoteBody; @@ -39,6 +41,8 @@ import org.apache.fop.fo.flow.InstreamForeignObject; import org.apache.fop.fo.flow.Leader; import org.apache.fop.fo.flow.ListBlock; import org.apache.fop.fo.flow.ListItem; +import org.apache.fop.fo.flow.ListItemBody; +import org.apache.fop.fo.flow.ListItemLabel; import org.apache.fop.fo.flow.PageNumber; import org.apache.fop.fo.flow.table.Table; import org.apache.fop.fo.flow.table.TableBody; @@ -51,6 +55,7 @@ import org.apache.fop.fo.pagination.Flow; import org.apache.fop.fo.pagination.PageSequence; import org.apache.fop.fo.pagination.PageSequenceMaster; import org.apache.fop.fo.pagination.SimplePageMaster; +import org.apache.fop.fo.pagination.StaticContent; import org.apache.fop.fonts.FontSetup; import org.apache.fop.render.DefaultFontResolver; @@ -267,27 +272,27 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void startListLabel() { + public void startListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void endListLabel() { + public void endListLabel(ListItemLabel listItemLabel) { } /** {@inheritDoc} */ - public void startListBody() { + public void startListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void endListBody() { + public void endListBody(ListItemBody listItemBody) { } /** {@inheritDoc} */ - public void startStatic() { + public void startStatic(StaticContent staticContent) { } /** {@inheritDoc} */ - public void endStatic() { + public void endStatic(StaticContent staticContent) { } /** {@inheritDoc} */ @@ -303,7 +308,7 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void endLink() { + public void endLink(BasicLink basicLink) { } /** {@inheritDoc} */ @@ -315,7 +320,11 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void foreignObject(InstreamForeignObject ifo) { + public void startInstreamForeignObject(InstreamForeignObject ifo) { + } + + /** {@inheritDoc} */ + public void endInstreamForeignObject(InstreamForeignObject ifo) { } /** {@inheritDoc} */ @@ -335,19 +344,37 @@ public class MIFHandler extends FOEventHandler { } /** {@inheritDoc} */ - public void leader(Leader l) { + public void startLeader(Leader l) { + } + + /** {@inheritDoc} */ + public void endLeader(Leader l) { + } + + public void character(Character c) { + appendCharacters ( new String ( new char[] {c.getCharacter()} ) ); + } + + /** {@inheritDoc} */ + public void characters(FOText foText) { + appendCharacters ( foText.getCharSequence().toString() ); + } + + /** {@inheritDoc} */ + public void startPageNumber(PageNumber pagenum) { } /** {@inheritDoc} */ - public void characters(char[] data, int start, int length) { + public void endPageNumber(PageNumber pagenum) { + } + + private void appendCharacters ( String str ) { if (para != null) { - String str = new String(data, start, length); str = str.trim(); // break into nice length chunks if (str.length() == 0) { return; } - MIFElement line = new MIFElement("ParaLine"); MIFElement prop = new MIFElement("TextRectID"); prop.setValue("2"); @@ -355,17 +382,8 @@ public class MIFHandler extends FOEventHandler { prop = new MIFElement("String"); prop.setValue("\"" + str + "\""); line.addElement(prop); - para.addElement(line); } } - - /** {@inheritDoc} */ - public void startPageNumber(PageNumber pagenum) { - } - - /** {@inheritDoc} */ - public void endPageNumber(PageNumber pagenum) { - } } diff --git a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java index ef0d9f301..6fd4d3618 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGDocumentHandler.java @@ -54,7 +54,8 @@ import org.apache.fop.util.GenerationHelperContentHandler; import org.apache.fop.util.XMLUtil; /** - * {@link IFDocumentHandler} implementation that writes SVG 1.1. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that writes SVG 1.1. */ public class SVGDocumentHandler extends AbstractSVGDocumentHandler { diff --git a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java index 10be9588e..8ec374731 100644 --- a/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java +++ b/src/sandbox/org/apache/fop/render/svg/SVGPrintDocumentHandler.java @@ -32,7 +32,8 @@ import org.apache.fop.render.intermediate.IFPainter; import org.apache.fop.util.XMLUtil; /** - * {@link IFDocumentHandler} implementation that writes SVG Print. + * {@link org.apache.fop.render.intermediate.IFDocumentHandler} implementation + * that writes SVG Print. */ public class SVGPrintDocumentHandler extends AbstractSVGDocumentHandler { diff --git a/status.xml b/status.xml index d6a04cd29..c632d3305 100644 --- a/status.xml +++ b/status.xml @@ -63,6 +63,9 @@ documents. Example: the fix of marks layering will be such a case when it's done. --> + + Eliminate javadocs warnings. + Update xmlgraphics common jar to reflect recent fixes in XGC. -- cgit v1.2.3