From 92df262a0778ee539c849454be2810621dac1b7e Mon Sep 17 00:00:00 2001
From: Vincent Hennebert
* JAXP is the standard method of embedding FOP in Java programs.
- * Please check our
+ * Please check our
* embedding page
- * for samples (these are also available within the distribution in
+ * for samples (these are also available within the distribution in
* FOP_DIR\examples\embedding)
*
* Methods within FOUserAgent are available to customize portions of the
- * process. For example, a specific Renderer object can be specified,
+ * process. For example, a specific Renderer object can be specified,
* also ElementMappings which determine elements in the FO that can be
* processed) can be added.
*
@@ -58,7 +58,7 @@ public class Fop {
private FOTreeBuilder foTreeBuilder = null;
/**
- * Constructor for use with already-created FOUserAgents. It uses MIME types to select the
+ * Constructor for use with already-created FOUserAgents. It uses MIME types to select the
* output format (ex. "application/pdf" for PDF).
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param ua FOUserAgent object
@@ -72,9 +72,9 @@ public class Fop {
if (foUserAgent == null) {
foUserAgent = FopFactory.newInstance().newFOUserAgent();
}
-
+
this.stream = stream;
-
+
createDefaultHandler();
}
@@ -119,7 +119,7 @@ public class Fop {
* page-sequence. Call this method only after the rendering process is
* finished. Note that the results are only available for output formats
* which make use of FOP's layout engine (PDF, PS, etc.).
- * @return the results of the rendering process, or null for flow-oriented
+ * @return the results of the rendering process, or null for flow-oriented
* output formats like RTF and MIF.
*/
public FormattingResults getResults() {
diff --git a/src/java/org/apache/fop/apps/FopFactory.java b/src/java/org/apache/fop/apps/FopFactory.java
index 2d4029da8..883afdcfa 100644
--- a/src/java/org/apache/fop/apps/FopFactory.java
+++ b/src/java/org/apache/fop/apps/FopFactory.java
@@ -537,7 +537,7 @@ public class FopFactory implements ImageContext {
/**
* Gets the default page-height to use as fallback,
* in case page-height="auto"
- *
+ *
* @return the page-height, as a String
*/
public String getPageHeight() {
@@ -547,7 +547,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the page-height to use as fallback, in case
* page-height="auto"
- *
+ *
* @param pageHeight page-height as a String
*/
public void setPageHeight(String pageHeight) {
@@ -560,7 +560,7 @@ public class FopFactory implements ImageContext {
/**
* Gets the default page-width to use as fallback,
* in case page-width="auto"
- *
+ *
* @return the page-width, as a String
*/
public String getPageWidth() {
@@ -570,7 +570,7 @@ public class FopFactory implements ImageContext {
/**
* Sets the page-width to use as fallback, in case
* page-width="auto"
- *
+ *
* @param pageWidth page-width as a String
*/
public void setPageWidth(String pageWidth) {
@@ -729,13 +729,13 @@ public class FopFactory implements ImageContext {
/**
* Create (if needed) and return an ICC ColorSpace instance.
- *
+ *
* The ICC profile source is taken from the src attribute of the color-profile FO element.
* If the ICC ColorSpace is not yet in the cache a new one is created and stored in the cache.
- *
+ *
* The FOP URI resolver is used to try and locate the ICC file.
* If that fails null is returned.
- *
+ *
* @param baseUri a base URI to resolve relative URIs
* @param iccProfileSrc ICC Profile source to return a ColorSpace for
* @return ICC ColorSpace object or null if ColorSpace could not be created
diff --git a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
index ffcc1332b..e71173845 100644
--- a/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
+++ b/src/java/org/apache/fop/apps/FopFactoryConfigurator.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/apps/FormattingResults.java b/src/java/org/apache/fop/apps/FormattingResults.java
index af421f4ac..0c0cddcc6 100644
--- a/src/java/org/apache/fop/apps/FormattingResults.java
+++ b/src/java/org/apache/fop/apps/FormattingResults.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/apps/MimeConstants.java b/src/java/org/apache/fop/apps/MimeConstants.java
index cdd30c0e1..02a7ba81b 100644
--- a/src/java/org/apache/fop/apps/MimeConstants.java
+++ b/src/java/org/apache/fop/apps/MimeConstants.java
@@ -26,38 +26,38 @@ public interface MimeConstants {
/** Portable Document Format */
String MIME_PDF = "application/pdf";
-
+
/** PostScript */
String MIME_POSTSCRIPT = "application/postscript";
/** Encapsulated PostScript (same MIME type as PostScript) */
String MIME_EPS = MIME_POSTSCRIPT;
-
+
/** HP's PCL */
String MIME_PCL = "application/x-pcl";
/** HP's PCL (alternative MIME type) */
String MIME_PCL_ALT = "application/vnd.hp-PCL";
-
+
/** IBM's AFP */
String MIME_AFP = "application/x-afp";
/** IBM's AFP (alternative MIME type) */
String MIME_AFP_ALT = "application/vnd.ibm.modcap";
-
+
/** Plain text */
String MIME_PLAIN_TEXT = "text/plain";
-
+
/** Rich text format */
String MIME_RTF = "application/rtf";
/** Rich text format (alternative 1) */
String MIME_RTF_ALT1 = "text/richtext";
/** Rich text format (alternative 2) */
String MIME_RTF_ALT2 = "text/rtf";
-
+
/** FrameMaker's MIF */
String MIME_MIF = "application/mif";
-
+
/** Scalable Vector Graphics */
String MIME_SVG = "image/svg+xml";
-
+
/** GIF images */
String MIME_GIF = "image/gif";
/** PNG images */
@@ -66,7 +66,7 @@ public interface MimeConstants {
String MIME_JPEG = "image/jpeg";
/** TIFF images */
String MIME_TIFF = "image/tiff";
-
+
/** Apache FOP's AWT preview (non-standard MIME type) */
String MIME_FOP_AWT_PREVIEW = "application/X-fop-awt-preview";
/** Apache FOP's Direct Printing (non-standard MIME type) */
@@ -76,5 +76,5 @@ public interface MimeConstants {
/** Proposed but non-registered MIME type for XSL-FO */
String MIME_XSL_FO = "text/xsl";
-
+
}
diff --git a/src/java/org/apache/fop/apps/PageSequenceResults.java b/src/java/org/apache/fop/apps/PageSequenceResults.java
index 16c74f66b..241f4a5f9 100644
--- a/src/java/org/apache/fop/apps/PageSequenceResults.java
+++ b/src/java/org/apache/fop/apps/PageSequenceResults.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/area/AbstractOffDocumentItem.java b/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
index 94cfa9e09..bdec281d4 100644
--- a/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
+++ b/src/java/org/apache/fop/area/AbstractOffDocumentItem.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
/**
@@ -51,10 +51,10 @@ public abstract class AbstractOffDocumentItem implements OffDocumentItem {
*/
public static final int START_OF_DOC = 2;
-
+
/** Indicates in what phase the item should be processed. */
protected int whenToProcess = IMMEDIATELY;
-
+
/**
* Get an indicator of when this item should be processed
* @return int constant (IMMEDIATELY, AFTER_PAGE, START_OF_DOC, END_OF_DOC)
diff --git a/src/java/org/apache/fop/area/Area.java b/src/java/org/apache/fop/area/Area.java
index 30911700f..1379e566d 100644
--- a/src/java/org/apache/fop/area/Area.java
+++ b/src/java/org/apache/fop/area/Area.java
@@ -165,9 +165,9 @@ public class Area extends AreaTreeObject implements Serializable {
}
/**
- * Get the inline progression dimension of the content rectangle
+ * Get the inline progression dimension of the content rectangle
* for this area.
- *
+ *
* @return the inline progression dimension
* @see ipd
*/
@@ -216,7 +216,7 @@ public class Area extends AreaTreeObject implements Serializable {
* @return the total BPD allocation for this area
*/
public int getAllocBPD() {
- return getSpaceBefore() + getBorderAndPaddingWidthBefore() + getBPD()
+ return getSpaceBefore() + getBorderAndPaddingWidthBefore() + getBPD()
+ getBorderAndPaddingWidthAfter() + getSpaceAfter();
}
@@ -231,7 +231,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_BEFORE);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -239,7 +239,7 @@ public class Area extends AreaTreeObject implements Serializable {
return margin;
}
-
+
/**
* Return the sum of region border- and padding-after
*
@@ -247,12 +247,12 @@ public class Area extends AreaTreeObject implements Serializable {
*/
public int getBorderAndPaddingWidthAfter() {
int margin = 0;
-
+
BorderProps bps = (BorderProps) getTrait(Trait.BORDER_AFTER);
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_AFTER);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -272,7 +272,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_START);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -292,7 +292,7 @@ public class Area extends AreaTreeObject implements Serializable {
if (bps != null) {
margin = bps.width;
}
-
+
Integer padWidth = (Integer) getTrait(Trait.PADDING_END);
if (padWidth != null) {
margin += padWidth.intValue();
@@ -314,7 +314,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space after
*
@@ -328,7 +328,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space start
*
@@ -342,7 +342,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Returns the space end
*
@@ -356,7 +356,7 @@ public class Area extends AreaTreeObject implements Serializable {
}
return margin;
}
-
+
/**
* Add a child to this area.
* The default is to do nothing. Subclasses must override
@@ -393,7 +393,7 @@ public class Area extends AreaTreeObject implements Serializable {
public boolean hasTraits() {
return (this.props != null);
}
-
+
/**
* Get a trait from this area.
*
@@ -403,7 +403,7 @@ public class Area extends AreaTreeObject implements Serializable {
public Object getTrait(Object oTraitCode) {
return (props != null ? props.get(oTraitCode) : null);
}
-
+
/**
* Checks whether a certain trait is set on this area.
* @param oTraitCode the trait key
@@ -412,7 +412,7 @@ public class Area extends AreaTreeObject implements Serializable {
public boolean hasTrait(Object oTraitCode) {
return (getTrait(oTraitCode) != null);
}
-
+
/**
* Get a boolean trait from this area.
* @param oTraitCode the trait key
@@ -438,10 +438,10 @@ public class Area extends AreaTreeObject implements Serializable {
+ " could not be converted to an integer");
}
}
-
+
/**
* {@inheritDoc}
- * @return ipd and bpd of area
+ * @return ipd and bpd of area
* */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
diff --git a/src/java/org/apache/fop/area/AreaEventProducer.java b/src/java/org/apache/fop/area/AreaEventProducer.java
index 7747d2d79..325367199 100644
--- a/src/java/org/apache/fop/area/AreaEventProducer.java
+++ b/src/java/org/apache/fop/area/AreaEventProducer.java
@@ -31,7 +31,7 @@ public interface AreaEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -51,7 +51,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity WARN
*/
void unresolvedIDReference(Object source, String type, String id);
-
+
/**
* An unresolved ID reference was encountered on a page.
* @param source the event source
@@ -60,7 +60,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity WARN
*/
void unresolvedIDReferenceOnPage(Object source, String page, String id);
-
+
/**
* A page could not be loaded/deserialized from a file.
* @param source the event source
@@ -69,7 +69,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageLoadError(Object source, String page, Exception e);
-
+
/**
* A page could not be saved/serialized to a file.
* @param source the event source
@@ -78,7 +78,7 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageSaveError(Object source, String page, Exception e);
-
+
/**
* A page could not be rendered.
* @param source the event source
@@ -87,5 +87,5 @@ public interface AreaEventProducer extends EventProducer {
* @event.severity ERROR
*/
void pageRenderingError(Object source, String page, Exception e);
-
+
}
diff --git a/src/java/org/apache/fop/area/AreaTreeHandler.java b/src/java/org/apache/fop/area/AreaTreeHandler.java
index d3ea41554..59995741b 100644
--- a/src/java/org/apache/fop/area/AreaTreeHandler.java
+++ b/src/java/org/apache/fop/area/AreaTreeHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -49,7 +49,7 @@ import org.apache.fop.layoutmgr.TopLevelLayoutManager;
/**
* Area tree handler for formatting objects.
- *
+ *
* Concepts: The area tree is to be as small as possible. With minimal classes
* and data to fully represent an area tree for formatting objects. The area
* tree needs to be simple to render and follow the spec closely. This area tree
@@ -61,7 +61,7 @@ import org.apache.fop.layoutmgr.TopLevelLayoutManager;
* type of renderer.
*/
public class AreaTreeHandler extends FOEventHandler {
-
+
private static Log log = LogFactory.getLog(AreaTreeHandler.class);
// Recorder of debug statistics
@@ -78,7 +78,7 @@ public class AreaTreeHandler extends FOEventHandler {
// The fo:root node of the document
private Root rootFObj;
-
+
// The formatting results to be handed back to the caller.
private FormattingResults results = new FormattingResults();
@@ -88,7 +88,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Constructor.
- *
+ *
* @param userAgent FOUserAgent object for process
* @param outputFormat the MIME type of the output format to use (ex.
* "application/pdf").
@@ -107,7 +107,7 @@ public class AreaTreeHandler extends FOEventHandler {
}
idTracker = new IDTracker();
-
+
if (log.isDebugEnabled()) {
statistics = new Statistics();
}
@@ -115,7 +115,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Sets up the AreaTreeModel instance for use by the AreaTreeHandler.
- *
+ *
* @param userAgent FOUserAgent object for process
* @param outputFormat the MIME type of the output format to use (ex.
* "application/pdf").
@@ -129,7 +129,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the area tree model for this area tree.
- *
+ *
* @return AreaTreeModel the model being used for this area tree
*/
public AreaTreeModel getAreaTreeModel() {
@@ -138,7 +138,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the LayoutManager maker for this area tree.
- *
+ *
* @return LayoutManagerMaker the LayoutManager maker being used for this
* area tree
*/
@@ -148,7 +148,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the IDTracker for this area tree.
- *
+ *
* @return IDTracker used to track reference ids for items in this area tree
*/
public IDTracker getIDTracker() {
@@ -157,7 +157,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get information about the rendered output, like number of pages created.
- *
+ *
* @return the results structure
*/
public FormattingResults getResults() {
@@ -167,7 +167,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Prepare AreaTreeHandler for document processing This is called from
* FOTreeBuilder.startDocument()
- *
+ *
* @throws SAXException
* if there is an error
*/
@@ -193,7 +193,7 @@ public class AreaTreeHandler extends FOEventHandler {
public void startPageSequence(PageSequence pageSequence) {
startAbstractPageSequence(pageSequence);
}
-
+
private void startAbstractPageSequence(AbstractPageSequence pageSequence) {
rootFObj = pageSequence.getRoot();
finishPrevPageSequence(pageSequence.getInitialPageNumber());
@@ -217,7 +217,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* End the PageSequence. The PageSequence formats Pages and adds them to the
* AreaTree. The area tree then handles what happens with the pages.
- *
+ *
* @param pageSequence the page sequence ending
*/
public void endPageSequence(PageSequence pageSequence) {
@@ -248,20 +248,20 @@ public class AreaTreeHandler extends FOEventHandler {
if (statistics != null) {
statistics.end();
}
-
+
ExternalDocumentLayoutManager edLM;
edLM = getLayoutManagerMaker().makeExternalDocumentLayoutManager(this, document);
edLM.activateLayout();
// preserve the current PageSequenceLayoutManger for the
// force-page-count check at the beginning of the next PageSequence
prevPageSeqLM = edLM;
-
+
}
/**
* Called by the PageSequenceLayoutManager when it is finished with a
* page-sequence.
- *
+ *
* @param pageSequence the page-sequence just finished
* @param pageCount The number of pages generated for the page-sequence
*/
@@ -275,7 +275,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* End the document.
- *
+ *
* @throws SAXException if there is some error
*/
public void endDocument() throws SAXException {
@@ -313,7 +313,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Add a OffDocumentItem to the area tree model. This checks if the
* OffDocumentItem is resolvable and attempts to resolve or add the
* resolvable ids for later resolution.
- *
+ *
* @param odi the OffDocumentItem to add.
*/
private void addOffDocumentItem(OffDocumentItem odi) {
@@ -342,7 +342,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Generates and returns a unique key for a page viewport.
- *
+ *
* @return the generated key.
*/
public String generatePageViewportKey() {
@@ -354,7 +354,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Tie a PageViewport with an ID found on a child area of the PV. Note that
* an area with a given ID may be on more than one PV, hence an ID may have
* more than one PV associated with it.
- *
+ *
* @param id the property ID of the area
* @param pv a page viewport that contains the area with this ID
* @deprecated use getIdTracker().associateIDWithPageViewport(id, pv) instead
@@ -367,7 +367,7 @@ public class AreaTreeHandler extends FOEventHandler {
* This method tie an ID to the areaTreeHandler until this one is ready to
* be processed. This is used in page-number-citation-last processing so we
* know when an id can be resolved.
- *
+ *
* @param id the id of the object being processed
* @deprecated use getIdTracker().signalPendingID(id) instead
*/
@@ -379,7 +379,7 @@ public class AreaTreeHandler extends FOEventHandler {
* Signals that all areas for the formatting object with the given ID have
* been generated. This is used to determine when page-number-citation-last
* ref-ids can be resolved.
- *
+ *
* @param id the id of the formatting object which was just finished
* @deprecated use getIdTracker().signalIDProcessed(id) instead
*/
@@ -389,7 +389,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Check if an ID has already been resolved
- *
+ *
* @param id the id to check
* @return true if the ID has been resolved
* @deprecated use getIdTracker().alreadyResolvedID(id) instead
@@ -400,7 +400,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Tries to resolve all unresolved ID references on the given page.
- *
+ *
* @param pv page viewport whose ID refs to resolve
* @deprecated use getIdTracker().tryIDResolution(pv) instead
*/
@@ -410,7 +410,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Get the list of page viewports that have an area with a given id.
- *
+ *
* @param id the id to lookup
* @return the list of PageViewports
* @deprecated use getIdTracker().getPageViewportsContainingID(id) instead
@@ -421,7 +421,7 @@ public class AreaTreeHandler extends FOEventHandler {
/**
* Add an Resolvable object with an unresolved idref
- *
+ *
* @param idref the idref whose target id has not yet been located
* @param res the Resolvable object needing the idref to be resolved
* @deprecated use getIdTracker().addUnresolvedIDRef(idref, res) instead
@@ -429,7 +429,7 @@ public class AreaTreeHandler extends FOEventHandler {
public void addUnresolvedIDRef(String idref, Resolvable res) {
idTracker.addUnresolvedIDRef(idref, res);
}
-
+
private class Statistics {
// for statistics gathering
private Runtime runtime;
diff --git a/src/java/org/apache/fop/area/AreaTreeModel.java b/src/java/org/apache/fop/area/AreaTreeModel.java
index c43db31bb..acf51b913 100644
--- a/src/java/org/apache/fop/area/AreaTreeModel.java
+++ b/src/java/org/apache/fop/area/AreaTreeModel.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
// Java
@@ -80,7 +80,7 @@ public class AreaTreeModel {
}
/**
- * Handle an OffDocumentItem
+ * Handle an OffDocumentItem
* @param ext the extension to handle
*/
public void handleOffDocumentItem(OffDocumentItem ext) {};
@@ -98,7 +98,7 @@ public class AreaTreeModel {
public PageSequence getCurrentPageSequence() {
return this.currentPageSequence;
}
-
+
/**
* Get the page sequence count.
* @return the number of page sequences in the document.
diff --git a/src/java/org/apache/fop/area/AreaTreeObject.java b/src/java/org/apache/fop/area/AreaTreeObject.java
index 1c2269a01..83e7727db 100644
--- a/src/java/org/apache/fop/area/AreaTreeObject.java
+++ b/src/java/org/apache/fop/area/AreaTreeObject.java
@@ -32,7 +32,7 @@ public abstract class AreaTreeObject {
/** Foreign attributes */
protected Map foreignAttributes = null;
-
+
/**
* Sets a foreign attribute.
* @param name the qualified name of the attribute
@@ -44,7 +44,7 @@ public abstract class AreaTreeObject {
}
this.foreignAttributes.put(name, value);
}
-
+
/**
* Set foreign attributes from a Map.
* @param atts a Map with attributes (keys: QName, values: String)
@@ -57,11 +57,11 @@ public abstract class AreaTreeObject {
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
String value = (String)entry.getValue();
- //The casting is only to ensure type safety (too bad we can't use generics, yet)
+ //The casting is only to ensure type safety (too bad we can't use generics, yet)
setForeignAttribute((QName)entry.getKey(), value);
}
}
-
+
/**
* Returns the value of a foreign attribute on the area.
* @param name the qualified name of the attribute
@@ -74,7 +74,7 @@ public abstract class AreaTreeObject {
return null;
}
}
-
+
/** @return the foreign attributes associated with this area */
public Map getForeignAttributes() {
if (this.foreignAttributes != null) {
@@ -83,6 +83,6 @@ public abstract class AreaTreeObject {
return Collections.EMPTY_MAP;
}
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/area/AreaTreeParser.java b/src/java/org/apache/fop/area/AreaTreeParser.java
index e4de505b0..ab41b4214 100644
--- a/src/java/org/apache/fop/area/AreaTreeParser.java
+++ b/src/java/org/apache/fop/area/AreaTreeParser.java
@@ -85,7 +85,7 @@ public class AreaTreeParser {
/** Logger instance */
protected static Log log = LogFactory.getLog(AreaTreeParser.class);
- private static SAXTransformerFactory tFactory
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
/**
@@ -96,11 +96,11 @@ public class AreaTreeParser {
* @param userAgent the user agent
* @throws TransformerException if an error occurs while parsing the area tree XML
*/
- public void parse(Source src, AreaTreeModel treeModel, FOUserAgent userAgent)
+ public void parse(Source src, AreaTreeModel treeModel, FOUserAgent userAgent)
throws TransformerException {
Transformer transformer = tFactory.newTransformer();
transformer.setErrorListener(new DefaultErrorListener(log));
-
+
SAXResult res = new SAXResult(getContentHandler(treeModel, userAgent));
transformer.transform(src, res);
@@ -131,7 +131,7 @@ public class AreaTreeParser {
private CharBuffer content = CharBuffer.allocate(64);
private boolean ignoreCharacters = true;
-
+
private PageViewport currentPageViewport;
private Map pageViewportsByKey = new java.util.HashMap();
// set of "ID firsts" that have already been assigned to a PV:
@@ -328,7 +328,7 @@ public class AreaTreeParser {
public void endElement() {
//nop
}
-
+
public boolean ignoreCharacters() {
return true;
}
@@ -409,7 +409,7 @@ public class AreaTreeParser {
currentPageViewport = null;
}
}
-
+
private class RegionViewportMaker extends AbstractMaker {
public void startElement(Attributes attributes) {
@@ -427,10 +427,10 @@ public class AreaTreeParser {
setTraits(attributes, rv, SUBSET_COLOR);
areaStack.push(rv);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), RegionViewport.class);
- }
+ }
}
private class RegionBeforeMaker extends AbstractMaker {
@@ -438,7 +438,7 @@ public class AreaTreeParser {
public void startElement(Attributes attributes) {
pushNewRegionReference(attributes, Constants.FO_REGION_BEFORE);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), RegionReference.class);
}
@@ -465,7 +465,7 @@ public class AreaTreeParser {
assertObjectOfClass(areaStack.pop(), RegionReference.class);
}
}
-
+
private class RegionEndMaker extends AbstractMaker {
public void startElement(Attributes attributes) {
@@ -488,7 +488,7 @@ public class AreaTreeParser {
int columnCount = getAttributeAsInteger(attributes, "columnCount", 1);
int columnGap = getAttributeAsInteger(attributes, "columnGap", 0);
RegionViewport rv = getCurrentRegionViewport();
- body = new BodyRegion(Constants.FO_REGION_BODY,
+ body = new BodyRegion(Constants.FO_REGION_BODY,
regionName, rv, columnCount, columnGap);
transferForeignObjects(attributes, body);
body.setCTM(getAttributeAsCTM(attributes, "ctm"));
@@ -498,10 +498,10 @@ public class AreaTreeParser {
Constants.FO_REGION_BODY, rv);
areaStack.push(body);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), BodyRegion.class);
- }
+ }
}
private class FlowMaker extends AbstractMaker {
@@ -518,12 +518,12 @@ public class AreaTreeParser {
setAreaAttributes(attributes, flow);
areaStack.push(flow);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), NormalFlow.class);
- }
+ }
}
-
+
private class MainReferenceMaker extends AbstractMaker {
public void startElement(Attributes attributes) {
@@ -540,7 +540,7 @@ public class AreaTreeParser {
int ipd = getAttributeAsInteger(attributes, "ipd", 0);
int columnCount = getAttributeAsInteger(attributes, "columnCount", 1);
BodyRegion body = getCurrentBodyRegion();
- Span span = new Span(columnCount,
+ Span span = new Span(columnCount,
body.getColumnGap(), ipd);
transferForeignObjects(attributes, span);
setAreaAttributes(attributes, span);
@@ -557,20 +557,20 @@ public class AreaTreeParser {
fn.setTop(getAttributeAsInteger(attributes, "top-offset", 0));
areaStack.push(fn);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), Footnote.class);
- }
+ }
}
private class BeforeFloatMaker extends AbstractMaker {
public void startElement(Attributes attributes) {
- BeforeFloat bf = getCurrentBodyRegion().getBeforeFloat();
+ BeforeFloat bf = getCurrentBodyRegion().getBeforeFloat();
transferForeignObjects(attributes, bf);
areaStack.push(bf);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), BeforeFloat.class);
}
@@ -622,7 +622,7 @@ public class AreaTreeParser {
parent.addChildArea(block);
areaStack.push(block);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), Block.class);
}
@@ -702,7 +702,7 @@ public class AreaTreeParser {
parent.addChildArea(ibp);
areaStack.push(ibp);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), InlineBlockParent.class);
}
@@ -724,13 +724,13 @@ public class AreaTreeParser {
text.setOffset(getAttributeAsInteger(attributes, "offset", 0));
text.setTextLetterSpaceAdjust(getAttributeAsInteger(attributes,
"tlsadjust", 0));
- text.setTextWordSpaceAdjust(getAttributeAsInteger(attributes,
+ text.setTextWordSpaceAdjust(getAttributeAsInteger(attributes,
"twsadjust", 0));
Area parent = (Area)areaStack.peek();
parent.addChildArea(text);
areaStack.push(text);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), TextArea.class);
}
@@ -740,7 +740,7 @@ public class AreaTreeParser {
public void endElement() {
int offset = getAttributeAsInteger(lastAttributes, "offset", 0);
- int[] letterAdjust
+ int[] letterAdjust
= ConversionUtils.toIntArray(
lastAttributes.getValue("letter-adjust"), "\\s");
content.flip();
@@ -749,14 +749,14 @@ public class AreaTreeParser {
word.setParentArea(text);
text.addChildArea(word);
}
-
+
public boolean ignoreCharacters() {
return false;
}
}
private class SpaceMaker extends AbstractMaker {
-
+
public void endElement() {
int offset = getAttributeAsInteger(lastAttributes, "offset", 0);
//TODO the isAdjustable parameter is currently not used/implemented
@@ -778,7 +778,7 @@ public class AreaTreeParser {
parent.addChildArea(space);
}
}
-
+
public boolean ignoreCharacters() {
return false;
}
@@ -822,12 +822,12 @@ public class AreaTreeParser {
parent.addChildArea(viewport);
areaStack.push(viewport);
}
-
+
public void endElement() {
assertObjectOfClass(areaStack.pop(), Viewport.class);
}
}
-
+
private class ImageMaker extends AbstractMaker {
public void startElement(Attributes attributes) {
@@ -839,12 +839,12 @@ public class AreaTreeParser {
getCurrentViewport().setContent(image);
}
}
-
+
private class ForeignObjectMaker extends AbstractMaker {
public void startElement(Attributes attributes) throws SAXException {
String ns = attributes.getValue("ns");
- domImplementation
+ domImplementation
= elementMappingRegistry.getDOMImplementationForNamespace(ns);
if (domImplementation == null) {
throw new SAXException("No DOMImplementation could be"
@@ -941,11 +941,11 @@ public class AreaTreeParser {
private void assertObjectOfClass(Object obj, Class clazz) {
if (!clazz.isInstance(obj)) {
- throw new IllegalStateException("Object is not an instance of "
+ throw new IllegalStateException("Object is not an instance of "
+ clazz.getName() + " but of " + obj.getClass().getName());
}
}
-
+
/**
* Handles objects created by "sub-parsers" that implement the ObjectSource interface.
* An example of object handled here are ExtensionAttachments.
@@ -969,7 +969,7 @@ public class AreaTreeParser {
area.setIPD(Integer.parseInt(attributes.getValue("ipd")));
area.setBPD(Integer.parseInt(attributes.getValue("bpd")));
}
-
+
private static final Object[] SUBSET_COMMON = new Object[] {
Trait.PROD_ID};
private static final Object[] SUBSET_LINK = new Object[] {
@@ -1078,7 +1078,7 @@ public class AreaTreeParser {
}
}
- private static int getAttributeAsInteger(Attributes attributes, String name,
+ private static int getAttributeAsInteger(Attributes attributes, String name,
int defaultValue) {
String s = attributes.getValue(name);
if (s == null) {
@@ -1123,7 +1123,7 @@ public class AreaTreeParser {
}
}
}
-
+
/** {@inheritDoc} */
public void characters(char[] ch, int start, int length) throws SAXException {
if (delegate != null) {
@@ -1132,7 +1132,7 @@ public class AreaTreeParser {
int maxLength = this.content.capacity() - this.content.position();
if (maxLength < length) {
// allocate a larger buffer and transfer content
- CharBuffer newContent
+ CharBuffer newContent
= CharBuffer.allocate(this.content.position() + length);
this.content.flip();
newContent.put(this.content);
diff --git a/src/java/org/apache/fop/area/BeforeFloat.java b/src/java/org/apache/fop/area/BeforeFloat.java
index 9fc048af1..490476368 100644
--- a/src/java/org/apache/fop/area/BeforeFloat.java
+++ b/src/java/org/apache/fop/area/BeforeFloat.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
/**
diff --git a/src/java/org/apache/fop/area/Block.java b/src/java/org/apache/fop/area/Block.java
index 21fa7c49d..7a2465859 100644
--- a/src/java/org/apache/fop/area/Block.java
+++ b/src/java/org/apache/fop/area/Block.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
@@ -59,7 +59,7 @@ public class Block extends BlockParent {
private int positioning = STACK;
protected transient boolean allowBPDUpdate = true;
-
+
// a block with may contain the dominant styling info in
// terms of most lines or blocks with info
@@ -120,7 +120,7 @@ public class Block extends BlockParent {
public boolean isStacked() {
return (getPositioning() == Block.STACK || getPositioning() == Block.RELATIVE);
}
-
+
/**
* @return the start-indent trait
*/
diff --git a/src/java/org/apache/fop/area/BlockParent.java b/src/java/org/apache/fop/area/BlockParent.java
index 8e4f71250..1be0b785d 100644
--- a/src/java/org/apache/fop/area/BlockParent.java
+++ b/src/java/org/apache/fop/area/BlockParent.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
import java.util.ArrayList;
@@ -60,7 +60,7 @@ public class BlockParent extends Area {
}
children.add(childArea);
}
-
+
/**
* Add the block area to this block parent.
*
diff --git a/src/java/org/apache/fop/area/BlockViewport.java b/src/java/org/apache/fop/area/BlockViewport.java
index 167e7c5b3..60bf1fb22 100644
--- a/src/java/org/apache/fop/area/BlockViewport.java
+++ b/src/java/org/apache/fop/area/BlockViewport.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
/**
diff --git a/src/java/org/apache/fop/area/BodyRegion.java b/src/java/org/apache/fop/area/BodyRegion.java
index dc63ae778..7b183a188 100644
--- a/src/java/org/apache/fop/area/BodyRegion.java
+++ b/src/java/org/apache/fop/area/BodyRegion.java
@@ -55,7 +55,7 @@ public class BodyRegion extends RegionReference {
* @param columnCount the number of columns
* @param columnGap the gap between columns
*/
- public BodyRegion(int regionClass, String regionName, RegionViewport parent,
+ public BodyRegion(int regionClass, String regionName, RegionViewport parent,
int columnCount, int columnGap) {
super(regionClass, regionName, parent);
this.columnCount = columnCount;
@@ -76,7 +76,7 @@ public class BodyRegion extends RegionReference {
public int getColumnGap() {
return this.columnGap;
}
-
+
/**
* Get the main reference area.
*
@@ -135,14 +135,14 @@ public class BodyRegion extends RegionReference {
}
return getBPD() - usedBPD;
}
-
+
/**
* Clone this object.
*
* @return a shallow copy of this object
*/
public Object clone() {
- BodyRegion br = new BodyRegion(getRegionClass(), getRegionName(), regionViewport,
+ BodyRegion br = new BodyRegion(getRegionClass(), getRegionName(), regionViewport,
getColumnCount(), getColumnGap());
br.setCTM(getCTM());
br.setIPD(getIPD());
diff --git a/src/java/org/apache/fop/area/BookmarkData.java b/src/java/org/apache/fop/area/BookmarkData.java
index 07290824e..d009cb425 100644
--- a/src/java/org/apache/fop/area/BookmarkData.java
+++ b/src/java/org/apache/fop/area/BookmarkData.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
import java.util.Collection;
@@ -33,7 +33,7 @@ import org.apache.fop.fo.pagination.bookmarks.BookmarkTree;
* child bookmark-items under it.
*/
public class BookmarkData extends AbstractOffDocumentItem implements Resolvable {
-
+
private List subData = new java.util.ArrayList();
// bookmark-title for this fo:bookmark
@@ -92,7 +92,7 @@ public class BookmarkData extends AbstractOffDocumentItem implements Resolvable
}
refs.add(bd);
}
-
+
/**
* Create a new bookmark data root object.
* This constructor is called by the AreaTreeParser when the
diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java
index c9fb52311..099ab38fa 100644
--- a/src/java/org/apache/fop/area/CTM.java
+++ b/src/java/org/apache/fop/area/CTM.java
@@ -5,9 +5,9 @@
* 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.
@@ -133,7 +133,7 @@ public class CTM implements Serializable {
switch (wm) {
case Constants.EN_LR_TB:
return new CTM(CTM_LRTB);
- case Constants.EN_RL_TB:
+ case Constants.EN_RL_TB:
wmctm = new CTM(CTM_RLTB);
wmctm.e = ipd;
return wmctm;
@@ -269,7 +269,7 @@ public class CTM implements Serializable {
public AffineTransform toAffineTransform() {
return new AffineTransform(toArray());
}
-
+
/**
* Construct a coordinate transformation matrix (CTM).
* @param absRefOrient absolute reference orientation
diff --git a/src/java/org/apache/fop/area/CachedRenderPagesModel.java b/src/java/org/apache/fop/area/CachedRenderPagesModel.java
index b34a7e8d1..f522b978b 100644
--- a/src/java/org/apache/fop/area/CachedRenderPagesModel.java
+++ b/src/java/org/apache/fop/area/CachedRenderPagesModel.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
import java.io.BufferedInputStream;
@@ -52,7 +52,7 @@ public class CachedRenderPagesModel extends RenderPagesModel {
/** Base directory to save temporary file in, typically points to the user's temp dir. */
protected File baseDir;
-
+
/**
* Main Constructor
* @param userAgent FOUserAgent object for process
@@ -61,14 +61,14 @@ public class CachedRenderPagesModel extends RenderPagesModel {
* @param stream OutputStream
* @throws FOPException if the renderer cannot be properly initialized
*/
- public CachedRenderPagesModel (FOUserAgent userAgent, String outputFormat,
+ public CachedRenderPagesModel (FOUserAgent userAgent, String outputFormat,
FontInfo fontInfo, OutputStream stream) throws FOPException {
super(userAgent, outputFormat, fontInfo, stream);
this.baseDir = new File(System.getProperty("java.io.tmpdir"));
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected boolean checkPreparedPages(PageViewport newpage, boolean renderUnresolved) {
for (Iterator iter = prepared.iterator(); iter.hasNext();) {
diff --git a/src/java/org/apache/fop/area/DestinationData.java b/src/java/org/apache/fop/area/DestinationData.java
index 2cff02ef4..cb2d6eccb 100644
--- a/src/java/org/apache/fop/area/DestinationData.java
+++ b/src/java/org/apache/fop/area/DestinationData.java
@@ -5,9 +5,9 @@
* 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.
@@ -56,7 +56,7 @@ public class DestinationData extends AbstractOffDocumentItem implements Resolvab
this.idRef = idRef;
this.idRefs = new String[] {idRef};
}
-
+
/**
* Get the idref for this destination
*
diff --git a/src/java/org/apache/fop/area/Footnote.java b/src/java/org/apache/fop/area/Footnote.java
index 0366740b0..a25f5467e 100644
--- a/src/java/org/apache/fop/area/Footnote.java
+++ b/src/java/org/apache/fop/area/Footnote.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
// may combine with before float into a conditional area
diff --git a/src/java/org/apache/fop/area/IDTracker.java b/src/java/org/apache/fop/area/IDTracker.java
index e8b53b20c..9f9023717 100644
--- a/src/java/org/apache/fop/area/IDTracker.java
+++ b/src/java/org/apache/fop/area/IDTracker.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@ import org.apache.commons.logging.LogFactory;
* on a PageViewport level.
*/
public class IDTracker {
-
+
private static Log log = LogFactory.getLog(IDTracker.class);
// HashMap of ID's whose area is located on one or more consecutive
@@ -50,12 +50,12 @@ public class IDTracker {
private Set unfinishedIDs = new HashSet();
private Set alreadyResolvedIDs = new HashSet();
-
+
/**
* Tie a PageViewport with an ID found on a child area of the PV. Note that
* an area with a given ID may be on more than one PV, hence an ID may have
* more than one PV associated with it.
- *
+ *
* @param id the property ID of the area
* @param pv a page viewport that contains the area with this ID
*/
@@ -78,7 +78,7 @@ public class IDTracker {
tryIDResolution(id, pv, pvList);
}
} else {
- /* TODO: The check is a quick-fix to avoid a waste
+ /* TODO: The check is a quick-fix to avoid a waste
* when adding inline-ids to the page */
if (!pvList.contains(pv)) {
pvList.add(pv);
@@ -90,7 +90,7 @@ public class IDTracker {
* This method tie an ID to the areaTreeHandler until this one is ready to
* be processed. This is used in page-number-citation-last processing so we
* know when an id can be resolved.
- *
+ *
* @param id the id of the object being processed
*/
public void signalPendingID(String id) {
@@ -104,7 +104,7 @@ public class IDTracker {
* Signals that all areas for the formatting object with the given ID have
* been generated. This is used to determine when page-number-citation-last
* ref-ids can be resolved.
- *
+ *
* @param id the id of the formatting object which was just finished
*/
public void signalIDProcessed(String id) {
@@ -128,20 +128,20 @@ public class IDTracker {
unresolvedIDRefs.remove(id);
}
}
-
+
/**
* Check if an ID has already been resolved
- *
+ *
* @param id the id to check
* @return true if the ID has been resolved
*/
public boolean alreadyResolvedID(String id) {
return (alreadyResolvedIDs.contains(id));
}
-
+
/**
* Tries to resolve all unresolved ID references on the given page.
- *
+ *
* @param id ID to resolve
* @param pv page viewport whose ID refs to resolve
* @param pvList of PageViewports
@@ -164,7 +164,7 @@ public class IDTracker {
/**
* Tries to resolve all unresolved ID references on the given page.
- *
+ *
* @param pv page viewport whose ID refs to resolve
*/
public void tryIDResolution(PageViewport pv) {
@@ -178,20 +178,20 @@ public class IDTracker {
}
}
}
-
+
/**
* Get the list of page viewports that have an area with a given id.
- *
+ *
* @param id the id to lookup
* @return the list of PageViewports
*/
public List getPageViewportsContainingID(String id) {
return (List) idLocations.get(id);
}
-
+
/**
* Add an Resolvable object with an unresolved idref
- *
+ *
* @param idref the idref whose target id has not yet been located
* @param res the Resolvable object needing the idref to be resolved
*/
@@ -203,5 +203,5 @@ public class IDTracker {
}
// add Resolvable object to this HashSet
todo.add(res);
- }
+ }
}
diff --git a/src/java/org/apache/fop/area/LineArea.java b/src/java/org/apache/fop/area/LineArea.java
index 449a5d915..bbf947499 100644
--- a/src/java/org/apache/fop/area/LineArea.java
+++ b/src/java/org/apache/fop/area/LineArea.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.area;
import org.apache.fop.area.inline.InlineArea;
@@ -44,7 +44,7 @@ public class LineArea extends Area {
private int availableShrink;
private double variationFactor;
private boolean bAddedToAreaTree;
-
+
private LineAdjustingInfo(int alignment, int diff,
int stretch, int shrink) {
lineAlignment = alignment;
@@ -55,7 +55,7 @@ public class LineArea extends Area {
bAddedToAreaTree = false;
}
}
-
+
private LineAdjustingInfo adjustingInfo = null;
// this class can contain the dominant char styling info
@@ -67,7 +67,7 @@ public class LineArea extends Area {
* default constructor:
* nothing to do
*/
- public LineArea() {
+ public LineArea() {
}
/**
@@ -142,7 +142,7 @@ public class LineArea extends Area {
setIPD(ipd);
setBPD(bpd);
}
-
+
/**
* receive notification about the ipd variation of a descendant area
* and perform the needed adjustment, according to the alignment;
@@ -151,12 +151,12 @@ public class LineArea extends Area {
*
* To support relative numerics internally in the expresion parser and
- * during evaulation one additional methods exists: isAbsolute() which
+ * during evaulation one additional methods exists: isAbsolute() which
* return true for absolute numerics and false for relative numerics.
*/
public interface Numeric {
@@ -40,7 +40,7 @@ public interface Numeric {
* @throws PropertyException
*/
double getNumericValue() throws PropertyException;
-
+
/**
* Return the value of this Numeric
* @param context The context for the length calculation (for percentage based lengths)
@@ -78,10 +78,10 @@ public interface Numeric {
public int getValue(PercentBaseContext context);
/**
- * Return the resolved value. This method will becalled during evaluation
- * of the expression tree and relative numerics can then return a
+ * Return the resolved value. This method will becalled during evaluation
+ * of the expression tree and relative numerics can then return a
* resolved absolute Numeric. Absolute numerics can just return themself.
- *
+ *
* @return A resolved value.
* @throws PropertyException
*/
diff --git a/src/java/org/apache/fop/datatypes/PercentBase.java b/src/java/org/apache/fop/datatypes/PercentBase.java
index 6452086de..6bc9ac939 100644
--- a/src/java/org/apache/fop/datatypes/PercentBase.java
+++ b/src/java/org/apache/fop/datatypes/PercentBase.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,28 +26,28 @@ import org.apache.fop.fo.expr.PropertyException;
* computations
*/
public interface PercentBase {
-
+
/**
* Determines whether a numeric property is created or one with a percentage
* base.
* @return 0 for length, 1 for percentage
*/
int getDimension();
-
+
/**
- * @return the base value (this will be used as the base to which a percentage will be
+ * @return the base value (this will be used as the base to which a percentage will be
* applied to compute the length of the referencing item)
*/
double getBaseValue();
/**
* @param context The context for percentage evaluation
- * @return the integer size in millipoints of the object (this will be used
- * as the base to which a percentage will be applied to compute the length
+ * @return the integer size in millipoints of the object (this will be used
+ * as the base to which a percentage will be applied to compute the length
* of the referencing item)
* @throws PropertyException if a problem occurs during evaluation of this
* value.
*/
int getBaseLength(PercentBaseContext context) throws PropertyException;
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/PercentBaseContext.java b/src/java/org/apache/fop/datatypes/PercentBaseContext.java
index bf01482f0..9744f417e 100644
--- a/src/java/org/apache/fop/datatypes/PercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/PercentBaseContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id $ */
-
+
package org.apache.fop.datatypes;
import org.apache.fop.fo.FObj;
@@ -37,5 +37,5 @@ public interface PercentBaseContext {
* @return The base length value of the given kind
*/
public int getBaseLength(int lengthBase, FObj fobj);
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java b/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
index 3b3c87525..271702f4e 100644
--- a/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/SimplePercentBaseContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -25,14 +25,14 @@ import org.apache.fop.fo.FObj;
* Class to implement a simple lookup context for a single percent base value.
*/
public class SimplePercentBaseContext implements PercentBaseContext {
-
+
private PercentBaseContext parentContext;
private int lengthBase;
private int lengthBaseValue;
/**
* @param parentContext the context to be used for all percentages other than lengthBase
- * @param lengthBase the particular percentage length base for which this context provides
+ * @param lengthBase the particular percentage length base for which this context provides
* a value
* @param lengthBaseValue the value to be returned for requests to the given lengthBase
*/
@@ -46,7 +46,7 @@ public class SimplePercentBaseContext implements PercentBaseContext {
/**
* Returns the value for the given lengthBase.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getBaseLength(int lengthBase, FObj fobj) {
// if its for us return our value otherwise delegate to parent context
diff --git a/src/java/org/apache/fop/datatypes/URISpecification.java b/src/java/org/apache/fop/datatypes/URISpecification.java
index 99d445b4d..9311851ea 100644
--- a/src/java/org/apache/fop/datatypes/URISpecification.java
+++ b/src/java/org/apache/fop/datatypes/URISpecification.java
@@ -57,19 +57,19 @@ public class URISpecification {
private static final String PUNCT = ",;:$&+=";
private static final String RESERVED = PUNCT + "?/[]@";
-
+
private static boolean isValidURIChar(char ch) {
return true;
}
-
+
private static boolean isDigit(char ch) {
return (ch >= '0' && ch <= '9');
}
-
+
private static boolean isAlpha(char ch) {
return (ch >= 'A' && ch <= 'Z') || (ch >= 'A' && ch <= 'z');
}
-
+
private static boolean isHexDigit(char ch) {
return (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f');
}
@@ -83,7 +83,7 @@ public class URISpecification {
}
return false;
}
-
+
private static boolean isUnreserved(char ch) {
if (isDigit(ch) || isAlpha(ch)) {
return true;
@@ -93,7 +93,7 @@ public class URISpecification {
}
return false;
}
-
+
private final static char[] HEX_DIGITS = {
'0', '1', '2', '3', '4', '5', '6', '7',
'8', '9', 'A', 'B', 'C', 'D', 'E', 'F'
@@ -137,5 +137,5 @@ public class URISpecification {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
index 6301c4d85..dba6d89ff 100644
--- a/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
+++ b/src/java/org/apache/fop/datatypes/ValidationPercentBaseContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,11 +26,11 @@ import org.apache.fop.fo.FObj;
* but should still already be checked. The actual value returned is not so important in this
* case. But it's important that zero and non-zero values can be distinguished.
*
- * Example: A table with collapsing border model has no padding. The Table FO should be able
+ * Example: A table with collapsing border model has no padding. The Table FO should be able
* to check if non-zero values (even percentages) have been specified.
*/
public final class ValidationPercentBaseContext implements PercentBaseContext {
-
+
/**
* Main constructor.
*/
@@ -39,7 +39,7 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
/**
* Returns the value for the given lengthBase.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getBaseLength(int lengthBase, FObj fobj) {
//Simply return a dummy value which produces a non-zero value when a non-zero percentage
@@ -48,7 +48,7 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
}
private static PercentBaseContext pseudoContextForValidation = null;
-
+
/** @return a base context for validation purposes. See class description. */
public static PercentBaseContext getPseudoContext() {
if (pseudoContextForValidation == null) {
@@ -56,5 +56,5 @@ public final class ValidationPercentBaseContext implements PercentBaseContext {
}
return pseudoContextForValidation;
}
-
+
}
diff --git a/src/java/org/apache/fop/events/CompositeEventListener.java b/src/java/org/apache/fop/events/CompositeEventListener.java
index a65728b71..2b5cbffb2 100644
--- a/src/java/org/apache/fop/events/CompositeEventListener.java
+++ b/src/java/org/apache/fop/events/CompositeEventListener.java
@@ -27,7 +27,7 @@ import java.util.List;
public class CompositeEventListener implements EventListener {
private List listeners = new java.util.ArrayList();
-
+
/**
* Adds an event listener to the broadcaster. It is appended to the list of previously
* registered listeners (the order of registration defines the calling order).
@@ -49,7 +49,7 @@ public class CompositeEventListener implements EventListener {
private synchronized int getListenerCount() {
return this.listeners.size();
}
-
+
/**
* Indicates whether any listeners have been registered with the broadcaster.
* @return true if listeners are present, false otherwise
@@ -57,7 +57,7 @@ public class CompositeEventListener implements EventListener {
public boolean hasEventListeners() {
return (getListenerCount() > 0);
}
-
+
/** {@inheritDoc} */
public synchronized void processEvent(Event event) {
for (int i = 0, c = getListenerCount(); i < c; i++) {
diff --git a/src/java/org/apache/fop/events/DefaultEventBroadcaster.java b/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
index bb1752a72..cd415a8d7 100644
--- a/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
+++ b/src/java/org/apache/fop/events/DefaultEventBroadcaster.java
@@ -42,7 +42,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
/** Holds all registered event listeners */
protected CompositeEventListener listeners = new CompositeEventListener();
-
+
/** {@inheritDoc} */
public void addEventListener(EventListener listener) {
this.listeners.addEventListener(listener);
@@ -57,7 +57,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
public boolean hasEventListeners() {
return this.listeners.hasEventListeners();
}
-
+
/** {@inheritDoc} */
public void broadcastEvent(Event event) {
this.listeners.processEvent(event);
@@ -65,7 +65,7 @@ public class DefaultEventBroadcaster implements EventBroadcaster {
private static List/* Note: this works only after getNextKuthElements on the
* corresponding TableCellLM have been called! Note: this works only after getNextKuthElements on the
* corresponding TableCellLM have been called! If the source does contain explicit fo:table-row elements, then the
* {@link #endTableRow()} method will be called instead.
- * The set of active nodes can be traversed by
+ * The set of active nodes can be traversed by
*
@@ -60,7 +60,7 @@ public class KeepUtil {
getKeepStrength(keep.getWithinPage()),
getKeepStrength(keep.getWithinColumn()));
}
-
+
/**
* Indicates whether a keep strength indicates a keep constraint.
* @param strength the keep strength
@@ -69,7 +69,7 @@ public class KeepUtil {
public static boolean hasKeep(int strength) {
return strength > BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Returns the penalty value to be used for a certain keep strength.
* Additional functionality makes sure that surplus instances that are requested by the
* page breaker are properly discarded, especially in situations where hard breaks cause
- * blank pages. The reason for that: The page breaker sometimes needs to preallocate
+ * blank pages. The reason for that: The page breaker sometimes needs to preallocate
* additional pages since it doesn't know exactly until the end how many pages it really needs.
* Note: The area's IPD and BPD must be set before calling this method. TODO the regular
* {@link #addBackground(Area, CommonBorderPaddingBackground, PercentBaseContext)}
* method should be used instead, and a means to retrieve the original area's
* dimensions must be found. TODO the placement of images in the x- or y-direction will be incorrect if
* background-repeat is set for that direction. In the collapsing-border model, the borders of a cell that spans over several
* rows or columns are drawn separately for each grid unit. Therefore we must know the
* height of each grid row spanned over by the cell. Also, if the cell is broken over
* two pages we must know which spanned grid rows are present on the current page.
- * Note: This class is only useful for simple cases with no namespaces.
+ * Note: This class is only useful for simple cases with no namespaces.
*/
public class EasyGenerationContentHandlerProxy implements ContentHandler {
@@ -64,8 +64,8 @@ public class EasyGenerationContentHandlerProxy implements ContentHandler {
/**
* Sends the notification of the beginning of an element.
* @param name Name for the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
* @throws SAXException Any SAX exception, possibly wrapping another exception.
*/
public void startElement(String name, Attributes atts) throws SAXException {
@@ -108,8 +108,8 @@ public class EasyGenerationContentHandlerProxy implements ContentHandler {
* Sends notifications for a whole element with some String content.
* @param name Name for the element.
* @param value Content of the element.
- * @param atts The attributes attached to the element. If there are no
- * attributes, it shall be an empty Attributes object.
+ * @param atts The attributes attached to the element. If there are no
+ * attributes, it shall be an empty Attributes object.
* @throws SAXException Any SAX exception, possibly wrapping another exception.
*/
public void element(String name, String value, Attributes atts) throws SAXException {
@@ -165,7 +165,7 @@ public class EasyGenerationContentHandlerProxy implements ContentHandler {
/**
* @see org.xml.sax.ContentHandler#startElement(String, String, String, Attributes)
*/
- public void startElement(String namespaceURI, String localName,
+ public void startElement(String namespaceURI, String localName,
String qName, Attributes atts) throws SAXException {
target.startElement(namespaceURI, localName, qName, atts);
}
@@ -174,7 +174,7 @@ public class EasyGenerationContentHandlerProxy implements ContentHandler {
/**
* @see org.xml.sax.ContentHandler#endElement(String, String, String)
*/
- public void endElement(String namespaceURI, String localName, String qName)
+ public void endElement(String namespaceURI, String localName, String qName)
throws SAXException {
target.endElement(namespaceURI, localName, qName);
}
diff --git a/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java b/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
index ccd86ab25..dc8e16202 100644
--- a/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
+++ b/examples/hyphenation/src/org/apache/fop/hyphenation/HyphenationTreeAnalysis.java
@@ -33,15 +33,15 @@ import java.util.zip.ZipFile;
import java.util.zip.ZipEntry;
/**
- * This class provides some useful methods to print the structure of a HyphenationTree object
+ * This class provides some useful methods to print the structure of a HyphenationTree object
*/
public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
/**
- * The HyphenationTree object to analyse
+ * The HyphenationTree object to analyse
*/
protected HyphenationTree ht;
-
+
/**
* @param ht the HyphenationTree object
*/
@@ -49,7 +49,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
super(ht);
this.ht = ht;
}
-
+
/**
* Class representing a node of the HyphenationTree object
*/
@@ -65,7 +65,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
value = readValue().toString();
}
}
-
+
private StringBuffer readValue() {
StringBuffer s = new StringBuffer();
int i = (int) ht.eq[index];
@@ -100,7 +100,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
return super.toNodeString();
}
}
-
+
/* (non-Javadoc)
* @see org.apache.fop.hyphenation.TernaryTreeAnalysis.Node#toCompactString()
*/
@@ -118,7 +118,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
return super.toCompactString();
}
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -130,7 +130,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
}
private void addNode(int nodeIndex, List strings, NodeString ns) {
@@ -182,7 +182,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
tree.append(indentString);
tree.append(ns.string + "\n");
-
+
if (i + 1 == strings.size()) {
continue;
}
@@ -199,10 +199,10 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
tree.append(indentString + "\n");
}
-
+
return tree.toString();
}
-
+
/**
* Construct the tree representation of the HyphenationTree object
* @return the string representing the tree
@@ -214,7 +214,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
addNode(1, strings, ns);
return toTree(strings);
}
-
+
/**
* Construct the compact node representation of the HyphenationTree object
* @return the string representing the tree
@@ -229,7 +229,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the node representation of the HyphenationTree object
* @return the string representing the tree
@@ -244,17 +244,17 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the printed representation of the HyphenationTree object
* @return the string representing the tree
*/
public String toString() {
StringBuffer s = new StringBuffer();
-
+
s.append("classes: \n");
s.append((new TernaryTreeAnalysis(ht.classmap)).toString());
-
+
s.append("\npatterns: \n");
s.append(super.toString());
s.append("vspace: ");
@@ -275,12 +275,12 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
return s.toString();
}
/**
- * Provide interactive access to a HyphenationTree object and its representation methods
+ * Provide interactive access to a HyphenationTree object and its representation methods
* @param args the arguments
*/
public static void main(String[] args) {
@@ -327,7 +327,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
System.out.print("Object file name: ");
token = in.readLine().trim();
try {
- String[] parts = token.split(":");
+ String[] parts = token.split(":");
InputStream is = null;
if (parts.length == 1) {
is = new FileInputStream(token);
@@ -399,7 +399,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
try {
BufferedReader reader = new BufferedReader(new FileReader(token));
String line;
-
+
starttime = System.currentTimeMillis();
while ((line = reader.readLine()) != null) {
// System.out.print("\nline: ");
@@ -422,7 +422,7 @@ public class HyphenationTreeAnalysis extends TernaryTreeAnalysis {
long result = endtime - starttime;
System.out.println(counter + " words in " + result
+ " Milliseconds hyphenated");
-
+
} else if (token.equals("q")) {
break;
}
diff --git a/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java b/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
index 9ac6ff804..a783716a5 100644
--- a/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
+++ b/examples/hyphenation/src/org/apache/fop/hyphenation/TernaryTreeAnalysis.java
@@ -23,15 +23,15 @@ import java.util.ArrayList;
import java.util.List;
/**
- * This class provides some useful methods to print the structure of a TernaryTree object
+ * This class provides some useful methods to print the structure of a TernaryTree object
*/
public class TernaryTreeAnalysis {
/**
- * The TernaryTree object to analyse
+ * The TernaryTree object to analyse
*/
protected TernaryTree tt;
-
+
/**
* @param tt the TernaryTree object
*/
@@ -43,27 +43,27 @@ public class TernaryTreeAnalysis {
* Class representing a string of nodes in the tree representation of a TernaryTree
*/
public static class NodeString {
-
+
/**
- * The node string being constructed
+ * The node string being constructed
*/
public StringBuffer string = new StringBuffer();
-
+
/**
- * The indent of the node string
+ * The indent of the node string
*/
public int indent;
-
+
/**
- * The list of branchpoints into the high direction
+ * The list of branchpoints into the high direction
*/
public List high = new ArrayList();
-
+
/**
- * The list of branchpoints into the low direction
+ * The list of branchpoints into the low direction
*/
public List low = new ArrayList();
-
+
/**
* @param indent the indent of the nodestring
*/
@@ -78,34 +78,34 @@ public class TernaryTreeAnalysis {
* Class representing a node of the TernaryTree object
*/
protected class Node {
-
+
/**
- * The index of the node
+ * The index of the node
*/
protected int index = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int high = 0;
-
+
/**
- * The index of the high node
+ * The index of the high node
*/
protected int low = 0;
-
+
/**
- * The index of the equal node
+ * The index of the equal node
*/
protected int equal = 0;
-
+
/**
- * The key following the node
+ * The key following the node
*/
protected String key = null;
-
+
/**
- * True if this is a leaf node
+ * True if this is a leaf node
*/
protected boolean isLeafNode = false;
@@ -132,7 +132,7 @@ public class TernaryTreeAnalysis {
equal = tt.eq[index];
}
}
-
+
private StringBuffer readKey() {
StringBuffer s = new StringBuffer();
int i = (int) tt.lo[index];
@@ -160,7 +160,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the compact string representation of the node
* @return the string representing the node
@@ -184,7 +184,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -204,9 +204,9 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
}
-
+
/**
* Construct the compact node representation of the TernaryTree object
* @return the string representing the tree
@@ -221,7 +221,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
/**
* Construct the node representation of the TernaryTree object
* @return the string representing the tree
@@ -236,7 +236,7 @@ public class TernaryTreeAnalysis {
}
return s.toString();
}
-
+
private static StringBuffer toString(char[] c) {
StringBuffer s = new StringBuffer();
for (int i = 0; i < c.length; ++i) {
@@ -244,8 +244,8 @@ public class TernaryTreeAnalysis {
s.append(",");
}
return s;
- }
-
+ }
+
/* (non-Javadoc)
* @see java.lang.Object#toString()
*/
@@ -255,15 +255,15 @@ public class TernaryTreeAnalysis {
s.append("hi: ");
s.append(toString(tt.hi));
s.append("\n");
-
+
s.append("eq: ");
s.append(toString(tt.eq));
s.append("\n");
-
+
s.append("lo: ");
s.append(toString(tt.lo));
s.append("\n");
-
+
s.append("sc: ");
for (int i = 0; i < tt.sc.length; ++i) {
if (tt.sc[i] == 0) {
@@ -275,7 +275,7 @@ public class TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
s.append("kv: ");
for (int i = 0; i < tt.kv.length(); ++i) {
if (tt.kv.get(i) == 0) {
@@ -285,17 +285,17 @@ public class TernaryTreeAnalysis {
}
}
s.append("\n");
-
+
s.append("freenode: ");
s.append((int) tt.freenode);
s.append("\n");
-
+
s.append("root: ");
s.append((int) tt.root);
s.append("\n");
-
+
return s.toString();
}
-
+
}
diff --git a/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java b/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java
index b0e94222a..cac43c721 100644
--- a/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java
+++ b/examples/mathml/src/org/apache/fop/mathml/ImageLoaderFactoryMathML.java
@@ -5,9 +5,9 @@
* 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.
@@ -30,28 +30,28 @@ public class ImageLoaderFactoryMathML extends AbstractImageLoaderFactory {
/** MathML MIME type */
public static final String MIME_MATHML = "text/mathml";
-
+
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.GRAPHICS2D};
-
+
private static final String[] MIMES = new String[] {
MIME_MATHML};
-
+
/** {@inheritDoc} */
public String[] getSupportedMIMETypes() {
return MIMES;
}
-
+
/** {@inheritDoc} */
public ImageFlavor[] getSupportedFlavors(String mime) {
return FLAVORS;
}
-
+
/** {@inheritDoc} */
public ImageLoader newImageLoader(ImageFlavor targetFlavor) {
return new ImageLoaderMathML(targetFlavor);
}
-
+
/** {@inheritDoc} */
public int getUsagePenalty(String mime, ImageFlavor flavor) {
return 0;
diff --git a/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java b/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java
index 900b9d614..d110ca3dc 100644
--- a/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java
+++ b/examples/mathml/src/org/apache/fop/mathml/ImageLoaderMathML.java
@@ -5,9 +5,9 @@
* 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.
@@ -47,7 +47,7 @@ public class ImageLoaderMathML extends AbstractImageLoader {
}
this.targetFlavor = targetFlavor;
}
-
+
/** {@inheritDoc} */
public ImageFlavor getTargetFlavor() {
return this.targetFlavor;
diff --git a/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java b/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java
index 82bd85a17..9bd326f2b 100644
--- a/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java
+++ b/examples/mathml/src/org/apache/fop/mathml/MathMLElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.mathml;
import java.awt.Color;
@@ -59,9 +59,9 @@ public class MathMLElement extends MathMLObj {
}
/** {@inheritDoc} */
- public void processNode(String elementName,
- Locator locator,
- Attributes attlist,
+ public void processNode(String elementName,
+ Locator locator,
+ Attributes attlist,
PropertyList propertyList) throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
createBasicDocument();
diff --git a/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java b/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java
index fdfa0b5c7..c9854d1c7 100644
--- a/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java
+++ b/examples/mathml/src/org/apache/fop/mathml/MathMLElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.mathml;
import java.util.HashMap;
@@ -32,7 +32,7 @@ import org.apache.fop.fo.FONode;
public class MathMLElementMapping extends ElementMapping {
/** MathML Namespace */
- public static final String NAMESPACE = "http://www.w3.org/1998/Math/MathML";
+ public static final String NAMESPACE = "http://www.w3.org/1998/Math/MathML";
/** Main constructor. */
public MathMLElementMapping() {
diff --git a/examples/mathml/src/org/apache/fop/mathml/MathMLObj.java b/examples/mathml/src/org/apache/fop/mathml/MathMLObj.java
index 9d2b78047..f2f5317e3 100644
--- a/examples/mathml/src/org/apache/fop/mathml/MathMLObj.java
+++ b/examples/mathml/src/org/apache/fop/mathml/MathMLObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.mathml;
// FOP
diff --git a/examples/mathml/src/org/apache/fop/mathml/PreloaderMathML.java b/examples/mathml/src/org/apache/fop/mathml/PreloaderMathML.java
index 3015462ce..193ccf6e3 100644
--- a/examples/mathml/src/org/apache/fop/mathml/PreloaderMathML.java
+++ b/examples/mathml/src/org/apache/fop/mathml/PreloaderMathML.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.mathml;
import java.awt.Dimension;
@@ -58,8 +58,8 @@ public class PreloaderMathML extends AbstractImagePreloader {
private static Log log = LogFactory.getLog(PreloaderMathML.class);
private boolean jeuclidAvailable = true;
-
- /** {@inheritDoc} */
+
+ /** {@inheritDoc} */
public ImageInfo preloadImage(String uri, Source src, ImageContext context)
throws IOException {
if (!ImageUtil.hasInputStream(src)) {
@@ -89,21 +89,21 @@ public class PreloaderMathML extends AbstractImagePreloader {
* class.
*/
class Loader {
-
+
private ImageInfo getImage(String uri, Source src, ImageContext context) {
InputStream in = new UnclosableInputStream(ImageUtil.needInputStream(src));
try {
int length = in.available();
in.mark(length + 1);
-
+
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
Source source = new StreamSource(in);
SAXMathBuilder mathBuilder = new SAXMathBuilder();
SAXResult res = new SAXResult(mathBuilder);
transformer.transform(source, res);
-
+
String fontname = "Helvetica";
int fontstyle = 0;
int displayfontsize = 12;
@@ -122,7 +122,7 @@ public class PreloaderMathML extends AbstractImagePreloader {
mathBuilder.getMathRootElement(),
fontname, fontstyle, inlinefontsize,
displayfontsize);
-
+
ImageInfo info = new ImageInfo(uri, "text/mathml");
final ImageSize size = new ImageSize();
size.setSizeInMillipoints(
@@ -142,13 +142,13 @@ public class PreloaderMathML extends AbstractImagePreloader {
public void paint(Graphics2D g2d, Rectangle2D area) {
base.paint(g2d);
}
-
+
};
-
+
//The whole image had to be loaded for this, so keep it
Image image = new ImageGraphics2D(info, painter);
info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, image);
-
+
return info;
} catch (NoClassDefFoundError ncdfe) {
try {
diff --git a/examples/plan/src/org/apache/fop/plan/ActionInfo.java b/examples/plan/src/org/apache/fop/plan/ActionInfo.java
index 350ccce8f..1535ed5ec 100644
--- a/examples/plan/src/org/apache/fop/plan/ActionInfo.java
+++ b/examples/plan/src/org/apache/fop/plan/ActionInfo.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,13 +16,13 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.util.Date;
public class ActionInfo {
-
+
public static final int TASK = 1;
public static final int MILESTONE = 2;
public static final int GROUPING = 3;
diff --git a/examples/plan/src/org/apache/fop/plan/EventList.java b/examples/plan/src/org/apache/fop/plan/EventList.java
index 188c9975a..53b32f7c0 100644
--- a/examples/plan/src/org/apache/fop/plan/EventList.java
+++ b/examples/plan/src/org/apache/fop/plan/EventList.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,13 +16,13 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.util.List;
public class EventList {
-
+
private List data = new java.util.ArrayList();
public void addGroupInfo(GroupInfo set) {
diff --git a/examples/plan/src/org/apache/fop/plan/GroupInfo.java b/examples/plan/src/org/apache/fop/plan/GroupInfo.java
index e94170d76..a83228197 100644
--- a/examples/plan/src/org/apache/fop/plan/GroupInfo.java
+++ b/examples/plan/src/org/apache/fop/plan/GroupInfo.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,13 +16,13 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.util.List;
public class GroupInfo {
-
+
private String name;
private List actions = new java.util.ArrayList();
diff --git a/examples/plan/src/org/apache/fop/plan/Main.java b/examples/plan/src/org/apache/fop/plan/Main.java
index c2b1a5ad5..7b6f5a05e 100644
--- a/examples/plan/src/org/apache/fop/plan/Main.java
+++ b/examples/plan/src/org/apache/fop/plan/Main.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.io.InputStream;
diff --git a/examples/plan/src/org/apache/fop/plan/PlanDrawer.java b/examples/plan/src/org/apache/fop/plan/PlanDrawer.java
index 8398659e0..7f79bb737 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanDrawer.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanDrawer.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.util.HashMap;
@@ -27,7 +27,7 @@ import org.w3c.dom.Document;
* This interface defines how a plan drawer is converted.
*/
public interface PlanDrawer {
-
+
Document createDocument(EventList data, float w, float h,
HashMap hints);
}
diff --git a/examples/plan/src/org/apache/fop/plan/PlanElement.java b/examples/plan/src/org/apache/fop/plan/PlanElement.java
index d910076c6..e7fb8a1e7 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanElement.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.awt.geom.Point2D;
@@ -48,7 +48,7 @@ public class PlanElement extends PlanObj {
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList)
throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
@@ -67,7 +67,7 @@ public class PlanElement extends PlanObj {
svgDoc = pr.createSVGDocument(doc);
width = pr.getWidth();
height = pr.getHeight();
-
+
doc = svgDoc;
}
} catch (Throwable t) {
diff --git a/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java b/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java
index c33c25edf..781fd8371 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import org.w3c.dom.DOMImplementation;
@@ -30,7 +30,7 @@ import org.apache.fop.fo.FONode;
public class PlanElementMapping extends ElementMapping {
/** Plan Namespace */
- public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/plan";
+ public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/plan";
/** Main constructor. */
public PlanElementMapping() {
diff --git a/examples/plan/src/org/apache/fop/plan/PlanHints.java b/examples/plan/src/org/apache/fop/plan/PlanHints.java
index 0411262ab..2a2c1333a 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanHints.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanHints.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
/**
* This interface defines some constants for use in the plan package.
*/
public interface PlanHints {
-
+
/** Border attribute */
public static final String PLAN_BORDER = "border";
/** Legend attribute */
diff --git a/examples/plan/src/org/apache/fop/plan/PlanObj.java b/examples/plan/src/org/apache/fop/plan/PlanObj.java
index 36f3243a6..ca26a8039 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanObj.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
// FOP
diff --git a/examples/plan/src/org/apache/fop/plan/PlanRenderer.java b/examples/plan/src/org/apache/fop/plan/PlanRenderer.java
index 0b592adc6..8b7978259 100644
--- a/examples/plan/src/org/apache/fop/plan/PlanRenderer.java
+++ b/examples/plan/src/org/apache/fop/plan/PlanRenderer.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
@@ -34,9 +34,9 @@ import org.w3c.dom.NodeList;
import org.apache.batik.dom.svg.SVGDOMImplementation;
public class PlanRenderer {
-
+
private static final String SVG_NAMESPACE = SVGDOMImplementation.SVG_NAMESPACE_URI;
-
+
private String fontFamily = "sansserif";
private float fontSize = 12;
private String type = "";
diff --git a/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java b/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
index 58d5be477..b8a7a612c 100644
--- a/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
+++ b/examples/plan/src/org/apache/fop/plan/PreloaderPlan.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.io.IOException;
@@ -52,7 +52,7 @@ public class PreloaderPlan extends AbstractImagePreloader {
/** Logger instance */
private static Log log = LogFactory.getLog(PreloaderPlan.class);
- /** {@inheritDoc} */
+ /** {@inheritDoc} */
public ImageInfo preloadImage(String uri, Source src, ImageContext context)
throws IOException {
if (!ImageUtil.hasInputStream(src)) {
@@ -75,13 +75,13 @@ public class PreloaderPlan extends AbstractImagePreloader {
Source source = new StreamSource(in);
DOMResult res = new DOMResult();
transformer.transform(source, res);
-
+
//Have to render the plan to know its size
PlanRenderer pr = new PlanRenderer();
Document svgDoc = pr.createSVGDocument((Document)res.getNode());
float width = pr.getWidth();
float height = pr.getHeight();
-
+
//Return converted SVG image
ImageInfo info = new ImageInfo(uri, "image/svg+xml");
final ImageSize size = new ImageSize();
@@ -97,7 +97,7 @@ public class PreloaderPlan extends AbstractImagePreloader {
Image image = new ImageXMLDOM(info, svgDoc,
svgDoc.getDocumentElement().getNamespaceURI());
info.getCustomObjects().put(ImageInfo.ORIGINAL_IMAGE, image);
-
+
return info;
} catch (TransformerException e) {
try {
diff --git a/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java b/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java
index 71025f15b..b49256a31 100644
--- a/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java
+++ b/examples/plan/src/org/apache/fop/plan/SimplePlanDrawer.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.plan;
import java.text.DateFormat;
@@ -35,9 +35,9 @@ import org.apache.fop.svg.SVGUtilities;
* Simple plan drawer implementation.
*/
public class SimplePlanDrawer implements PlanDrawer {
-
+
private static final String SVG_NAMESPACE = SVGDOMImplementation.SVG_NAMESPACE_URI;
-
+
private float fontSize;
private HashMap hints;
private java.awt.Font font = null;
@@ -91,8 +91,8 @@ public class SimplePlanDrawer implements PlanDrawer {
svgRoot.setAttributeNS(null, "width", "" + width);
svgRoot.setAttributeNS(null, "height", "" + height);
svgRoot.setAttributeNS(null, "style",
- "font-size:" + 8
- + ";font-family:"
+ "font-size:" + 8
+ + ";font-family:"
+ hints.get(PlanHints.FONT_FAMILY));
font = new java.awt.Font((String)hints.get(PlanHints.FONT_FAMILY),
@@ -249,8 +249,8 @@ public class SimplePlanDrawer implements PlanDrawer {
taskGraphic = SVGUtilities.createRect(doc,
left + daysToStart * 300 / (totalDays - 2),
topEdge + 2, days * 300 / (totalDays - 2), 10);
- taskGraphic.setAttributeNS(null,
- "style",
+ taskGraphic.setAttributeNS(null,
+ "style",
"stroke:black;fill:blue;stroke-width:1;clip-path:url(#clip3)");
g.appendChild(taskGraphic);
break;
@@ -259,8 +259,8 @@ public class SimplePlanDrawer implements PlanDrawer {
"m " + (left
+ daysToStart * 300 / (totalDays - 2) - 6)
+ " " + (topEdge + 6) + "l6 6l6-6l-6-6z");
- taskGraphic.setAttributeNS(null,
- "style",
+ taskGraphic.setAttributeNS(null,
+ "style",
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
g.appendChild(taskGraphic);
text = SVGUtilities.createText(doc,
@@ -271,7 +271,7 @@ public class SimplePlanDrawer implements PlanDrawer {
break;
case ActionInfo.GROUPING:
taskGraphic = SVGUtilities.createPath(doc,
- "m " + (left
+ "m " + (left
+ daysToStart * 300 / (totalDays - 2) - 6)
+ " " + (topEdge + 6) + "l6 -6l"
+ (days * 300 / (totalDays - 2))
@@ -279,7 +279,7 @@ public class SimplePlanDrawer implements PlanDrawer {
+ -(days * 300 / (totalDays - 2) - 8)
+ " 0l-4 4l-6-6z");
taskGraphic.setAttributeNS(null,
- "style",
+ "style",
"stroke:black;fill:black;stroke-width:1;clip-path:url(#clip3)");
g.appendChild(taskGraphic);
break;
diff --git a/src/codegen/java/org/apache/fop/tools/EventConventionException.java b/src/codegen/java/org/apache/fop/tools/EventConventionException.java
index 27a7fcd50..363850b95 100644
--- a/src/codegen/java/org/apache/fop/tools/EventConventionException.java
+++ b/src/codegen/java/org/apache/fop/tools/EventConventionException.java
@@ -33,5 +33,5 @@ public class EventConventionException extends Exception {
public EventConventionException(String message) {
super(message);
}
-
+
}
diff --git a/src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java b/src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java
index 532e6a44b..cb0288334 100644
--- a/src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java
+++ b/src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java
@@ -1,13 +1,13 @@
-/*
+/*
* 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.
@@ -67,7 +67,7 @@ public class GenerateLineBreakUtils {
* table for the table driven line breaking algorithm described in
* UTR #14.
* TODO: Code points above the base plane are simply ignored.
- *
+ *
* @param lineBreakFileName Name of line break property file (part of Unicode files).
* @param propertyValueFileName Name of property values alias file (part of Unicode files).
* @param breakPairFileName Name of pair table file (not part of the unicode files).
@@ -109,7 +109,7 @@ public class GenerateLineBreakUtils {
if (line != null) {
lineTokens = line.split("\\s+");
byte columnNumber = 0;
-
+
for (int i = 0; i < lineTokens.length; ++i) {
name = lineTokens[i];
if (name.length() > 0) {
@@ -481,7 +481,7 @@ public class GenerateLineBreakUtils {
* Read line break property value names and the actual properties for the Unicode
* characters from the respective Unicode files.
* TODO: Code points above the base plane are simply ignored.
- *
+ *
* @param lineBreakFileName Name of line break property file.
* @param propertyValueFileName Name of property values alias file.
* @throws Exception in case anything goes wrong.
@@ -600,7 +600,7 @@ public class GenerateLineBreakUtils {
* Determine a good block size for the two stage optimized storage of the
* line breaking properties. Note: the memory utilization calculation is a rule of thumb,
* don't take it too serious.
- *
+ *
* @param lineBreakFileName Name of line break property file.
* @param propertyValueFileName Name of property values alias file.
* @throws Exception in case anything goes wrong.
diff --git a/src/documentation/content/xdocs/DnI/BookMaker.java b/src/documentation/content/xdocs/DnI/BookMaker.java
index 3f8366b4b..5a70cb030 100644
--- a/src/documentation/content/xdocs/DnI/BookMaker.java
+++ b/src/documentation/content/xdocs/DnI/BookMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -75,7 +75,7 @@ import org.apache.fop.apps.FOPException;
import org.apache.fop.messaging.MessageHandler;
/**
- * This class converts an XML file to PDF using
+ * This class converts an XML file to PDF using
* JAXP (XSLT) and FOP (XSL:FO).
*/
public class BookMaker implements ErrorHandler {
@@ -113,7 +113,7 @@ public class BookMaker implements ErrorHandler {
throw e;
}
- public void makeBook()
+ public void makeBook()
throws IOException, FOPException, TransformerException,
FactoryConfigurationError,
ParserConfigurationException, SAXException {
@@ -160,7 +160,7 @@ public class BookMaker implements ErrorHandler {
+ " as SAX parser");
xmlReader.setErrorHandler(this);
xmlReader.setEntityResolver(resolver);
-
+
// Setup SAX source
fis = new FileInputStream(xmlFile);
is = new InputSource(fis);
@@ -175,7 +175,7 @@ public class BookMaker implements ErrorHandler {
+ " as SAX parser");
xmlReader.setErrorHandler(this);
xmlReader.setEntityResolver(resolver);
-
+
// Setup SAX source
fis = new FileInputStream(xsltFile);
is = new InputSource(fis);
@@ -210,7 +210,7 @@ public class BookMaker implements ErrorHandler {
+ " as TrAX transformer");
// Set the value of parameters, if any, defined for stylesheet
- if (xsltParams != null) {
+ if (xsltParams != null) {
for (int i = 0; i < xsltParams.size(); i += 2) {
transformer.setParameter
((String) xsltParams.elementAt(i),
@@ -299,7 +299,7 @@ public class BookMaker implements ErrorHandler {
}
if (cl.hasOption("xsl")) {
app.xsltFile = new File(cl.getOptionValue("xsl"));
- }
+ }
if (cl.hasOption("out")) {
app.outFile = new File(cl.getOptionValue("out"));
}
@@ -323,9 +323,9 @@ public class BookMaker implements ErrorHandler {
}
app.logger.info("");
app.logger.info("Transforming...");
-
+
app.makeBook();
-
+
app.logger.info("Transforming done");
} catch (Exception e) {
app.logger.error(ExceptionUtil.printStackTrace(e));
diff --git a/src/java/org/apache/fop/Version.java b/src/java/org/apache/fop/Version.java
index 7e421ad29..86861a60b 100644
--- a/src/java/org/apache/fop/Version.java
+++ b/src/java/org/apache/fop/Version.java
@@ -25,7 +25,7 @@ package org.apache.fop;
* as this package equals the one specified in the manifest.
*/
public final class Version {
-
+
private Version() { }
/**
@@ -40,11 +40,11 @@ public final class Version {
}
if (version == null) {
//Fallback if FOP is used in a development environment
- String headURL
+ String headURL
= "$HeadURL$";
version = headURL;
final String pathPrefix = "/xmlgraphics/fop/";
- int pos = version.indexOf(pathPrefix);
+ int pos = version.indexOf(pathPrefix);
if (pos >= 0) {
version = version.substring(pos + pathPrefix.length() - 1, version.length() - 2);
pos = version.indexOf("/src/");
@@ -57,5 +57,5 @@ public final class Version {
}
return version;
}
-
+
}
diff --git a/src/java/org/apache/fop/apps/FOPException.java b/src/java/org/apache/fop/apps/FOPException.java
index d8ac2e2f7..ef84cc5fa 100644
--- a/src/java/org/apache/fop/apps/FOPException.java
+++ b/src/java/org/apache/fop/apps/FOPException.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ public class FOPException extends SAXException {
private String systemId;
private int line;
private int column;
-
+
private String localizedMessage;
/**
@@ -80,7 +80,7 @@ public class FOPException extends SAXException {
/**
* Constructs a new exception with the specified detail message and cause.
* @param message the detail message
- * @param cause the cause
+ * @param cause the cause
*/
public FOPException(String message, Exception cause) {
super(message, cause);
@@ -212,7 +212,7 @@ public class FOPException extends SAXException {
}
}
}
-
+
/**
* Sets the localized message for this exception.
* @param msg the localized message
@@ -230,6 +230,6 @@ public class FOPException extends SAXException {
}
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/apps/FOURIResolver.java b/src/java/org/apache/fop/apps/FOURIResolver.java
index 878a2745a..9a49b28f1 100644
--- a/src/java/org/apache/fop/apps/FOURIResolver.java
+++ b/src/java/org/apache/fop/apps/FOURIResolver.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,7 +42,7 @@ import org.apache.fop.util.DataURIResolver;
/**
* Provides FOP specific URI resolution. This is the default URIResolver
* {@link FOUserAgent} will use unless overidden.
- *
+ *
* @see javax.xml.transform.URIResolver
*/
public class FOURIResolver implements javax.xml.transform.URIResolver {
@@ -96,7 +96,7 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
/**
* Additional constructor
- *
+ *
* @param throwExceptions
* true if exceptions are to be thrown if the URIs cannot be
* resolved.
@@ -107,7 +107,7 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
/**
* Handles resolve exceptions appropriately.
- *
+ *
* @param errorStr
* error string
* @param strict
@@ -133,7 +133,7 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
* If the method is successful it will return a Source of type
* {@link javax.xml.transform.stream.StreamSource} with its SystemID set to
* the resolved URL used to open the underlying InputStream.
- *
+ *
* @param href
* An href attribute, which may be relative or absolute.
* @param base
@@ -212,13 +212,13 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
/*
* This piece of code is based on the following statement in
* RFC2396 section 5.2:
- *
+ *
* 3) If the scheme component is defined, indicating that
* the reference starts with a scheme name, then the
* reference is interpreted as an absolute URI and we are
* done. Otherwise, the reference URI's scheme is inherited
* from the base URI's scheme component.
- *
+ *
* Due to a loophole in prior specifications [RFC1630], some
* parsers allow the scheme name to be present in a relative
* URI if it is the same as the base URI scheme.
@@ -228,7 +228,7 @@ public class FOURIResolver implements javax.xml.transform.URIResolver {
* removing the scheme if it matches that of the base URI
* and the scheme is known to always use the false
if SAX Locators should be disabled
*/
public void setLocatorEnabled(boolean enableLocator) {
diff --git a/src/java/org/apache/fop/apps/Fop.java b/src/java/org/apache/fop/apps/Fop.java
index d1a56789f..0527ea290 100644
--- a/src/java/org/apache/fop/apps/Fop.java
+++ b/src/java/org/apache/fop/apps/Fop.java
@@ -5,9 +5,9 @@
* 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.
@@ -30,13 +30,13 @@ import org.apache.fop.fo.FOTreeBuilder;
* Primary class that activates the FOP process for embedded usage.
* FOTreeBuilder
constructor
- *
+ *
* @param outputFormat the MIME type of the output format to use (ex. "application/pdf").
* @param foUserAgent the {@link FOUserAgent} in effect for this process
* @param stream the OutputStream
to direct the results to
* @throws FOPException if the FOTreeBuilder
cannot be properly created
*/
public FOTreeBuilder(
- String outputFormat,
+ String outputFormat,
FOUserAgent foUserAgent,
- OutputStream stream)
+ OutputStream stream)
throws FOPException {
this.userAgent = foUserAgent;
- this.elementMappingRegistry = userAgent.getFactory().getElementMappingRegistry();
+ this.elementMappingRegistry = userAgent.getFactory().getElementMappingRegistry();
//This creates either an AreaTreeHandler and ultimately a Renderer, or
//one of the RTF-, MIF- etc. Handlers.
foEventHandler = foUserAgent.getRendererFactory().createFOEventHandler(
@@ -116,16 +116,16 @@ public class FOTreeBuilder extends DefaultHandler {
public void setDocumentLocator(Locator locator) {
this.locator = locator;
}
-
- /**
+
+ /**
* @return a {@link Locator} instance if it is available and not disabled
*/
protected Locator getEffectiveLocator() {
return (userAgent.isLocatorEnabled() ? this.locator : null);
}
-
+
/** {@inheritDoc} */
- public void characters(char[] data, int start, int length)
+ public void characters(char[] data, int start, int length)
throws SAXException {
delegate.characters(data, start, length);
}
@@ -136,7 +136,7 @@ public class FOTreeBuilder extends DefaultHandler {
throw new IllegalStateException("FOTreeBuilder (and the Fop class) cannot be reused."
+ " Please instantiate a new instance.");
}
-
+
used = true;
empty = true;
rootFObj = null; // allows FOTreeBuilder to be reused
@@ -204,7 +204,7 @@ public class FOTreeBuilder extends DefaultHandler {
/**
* Provides access to the underlying {@link FOEventHandler} object.
- *
+ *
* @return the FOEventHandler object
*/
public FOEventHandler getEventHandler() {
@@ -215,30 +215,30 @@ public class FOTreeBuilder extends DefaultHandler {
* Returns the results of the rendering process. Information includes
* the total number of pages generated and the number of pages per
* page-sequence.
- *
+ *
* @return the results of the rendering process.
*/
public FormattingResults getResults() {
if (getEventHandler() instanceof AreaTreeHandler) {
return ((AreaTreeHandler) getEventHandler()).getResults();
} else {
- //No formatting results available for output formats no
+ //No formatting results available for output formats no
//involving the layout engine.
return null;
}
}
-
+
/**
* Main DefaultHandler
implementation which builds the FO tree.
*/
private class MainFOHandler extends DefaultHandler {
-
+
/** Current formatting object being handled */
protected FONode currentFObj = null;
/** Current propertyList for the node being handled */
protected PropertyList currentPropertyList;
-
+
/** Current marker nesting-depth */
private int nestedMarkerDepth = 0;
@@ -253,7 +253,7 @@ public class FOTreeBuilder extends DefaultHandler {
// Check to ensure first node encountered is an fo:root
if (rootFObj == null) {
empty = false;
- if (!namespaceURI.equals(FOElementMapping.URI)
+ if (!namespaceURI.equals(FOElementMapping.URI)
|| !localName.equals("root")) {
FOValidationEventProducer eventProducer
= FOValidationEventProducer.Provider.get(
@@ -267,7 +267,7 @@ public class FOTreeBuilder extends DefaultHandler {
currentFObj.validateChildNode(locator, namespaceURI, localName);
}
}
-
+
ElementMapping.Maker fobjMaker = findFOMaker(namespaceURI, localName);
try {
@@ -279,7 +279,7 @@ public class FOTreeBuilder extends DefaultHandler {
}
propertyList = foNode.createPropertyList(
currentPropertyList, foEventHandler);
- foNode.processNode(localName, getEffectiveLocator(),
+ foNode.processNode(localName, getEffectiveLocator(),
attlist, propertyList);
if (foNode.getNameId() == Constants.FO_MARKER) {
if (builderContext.inMarker()) {
@@ -295,19 +295,19 @@ public class FOTreeBuilder extends DefaultHandler {
ContentHandlerFactory chFactory = foNode.getContentHandlerFactory();
if (chFactory != null) {
ContentHandler subHandler = chFactory.createContentHandler();
- if (subHandler instanceof ObjectSource
+ if (subHandler instanceof ObjectSource
&& foNode instanceof ObjectBuiltListener) {
((ObjectSource) subHandler).setObjectBuiltListener(
(ObjectBuiltListener) foNode);
}
-
+
subHandler.startDocument();
- subHandler.startElement(namespaceURI, localName,
+ subHandler.startElement(namespaceURI, localName,
rawName, attlist);
depth = 1;
delegate = subHandler;
}
-
+
if (currentFObj != null) {
currentFObj.addChildNode(foNode);
}
@@ -330,28 +330,28 @@ public class FOTreeBuilder extends DefaultHandler {
throws SAXException {
if (currentFObj == null) {
throw new SAXException(
- "endElement() called for " + rawName
+ "endElement() called for " + rawName
+ " where there is no current element.");
- } else if (!currentFObj.getLocalName().equals(localName)
+ } else if (!currentFObj.getLocalName().equals(localName)
|| !currentFObj.getNamespaceURI().equals(uri)) {
- throw new SAXException("Mismatch: " + currentFObj.getLocalName()
- + " (" + currentFObj.getNamespaceURI()
+ throw new SAXException("Mismatch: " + currentFObj.getLocalName()
+ + " (" + currentFObj.getNamespaceURI()
+ ") vs. " + localName + " (" + uri + ")");
}
-
+
// fo:characters can potentially be removed during
// white-space handling.
// Do not notify the FOEventHandler.
if (currentFObj.getNameId() != Constants.FO_CHARACTER) {
currentFObj.endOfNode();
}
-
+
if (currentPropertyList != null
&& currentPropertyList.getFObj() == currentFObj
&& !builderContext.inMarker()) {
currentPropertyList = currentPropertyList.getParentPropertyList();
}
-
+
if (currentFObj.getNameId() == Constants.FO_MARKER) {
if (nestedMarkerDepth == 0) {
builderContext.switchMarkerContext(false);
@@ -359,19 +359,19 @@ public class FOTreeBuilder extends DefaultHandler {
nestedMarkerDepth--;
}
}
-
+
if (currentFObj.getParent() == null) {
log.debug("endElement for top-level " + currentFObj.getName());
}
-
+
currentFObj = currentFObj.getParent();
}
/** {@inheritDoc} */
- public void characters(char[] data, int start, int length)
+ public void characters(char[] data, int start, int length)
throws FOPException {
if (currentFObj != null) {
- currentFObj.addCharacters(data, start, length,
+ currentFObj.addCharacters(data, start, length,
currentPropertyList, getEffectiveLocator());
}
}
@@ -380,10 +380,10 @@ public class FOTreeBuilder extends DefaultHandler {
public void endDocument() throws SAXException {
currentFObj = null;
}
-
+
/**
* Finds the {@link Maker} used to create {@link FONode} objects of a particular type
- *
+ *
* @param namespaceURI URI for the namespace of the element
* @param localName name of the Element
* @return the ElementMapping.Maker that can create an FO object for this element
diff --git a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
index 0cbdd7797..870b2b599 100644
--- a/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
+++ b/src/java/org/apache/fop/fo/FOTreeBuilderContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ public class FOTreeBuilderContext {
* This is used so we know if the FO tree contains duplicates.
*/
private Set idReferences = new HashSet();
-
+
/**
* The property list maker.
*/
@@ -42,12 +42,12 @@ public class FOTreeBuilderContext {
* The XMLWhitespaceHandler for this tree
*/
protected XMLWhiteSpaceHandler whiteSpaceHandler = new XMLWhiteSpaceHandler();
-
+
/**
* Indicates whether processing descendants of a marker
*/
private boolean inMarker = false;
-
+
/**
* Returns the set of ID references.
* @return the ID references
@@ -58,22 +58,22 @@ public class FOTreeBuilderContext {
/**
* Return the propertyListMaker.
- *
+ *
* @return the currently active {@link PropertyListMaker}
*/
public PropertyListMaker getPropertyListMaker() {
return propertyListMaker;
}
-
+
/**
* Set a new propertyListMaker.
- *
+ *
* @param propertyListMaker the new {@link PropertyListMaker} to use
*/
public void setPropertyListMaker(PropertyListMaker propertyListMaker) {
this.propertyListMaker = propertyListMaker;
}
-
+
/**
* Return the XMLWhiteSpaceHandler
* @return the whiteSpaceHandler
@@ -86,22 +86,22 @@ public class FOTreeBuilderContext {
* Switch to or from marker context
* (used by FOTreeBuilder when processing
* a marker)
- *
- * @param inMarker true if a marker is being processed;
+ *
+ * @param inMarker true if a marker is being processed;
* false otherwise
*
*/
protected void switchMarkerContext(boolean inMarker) {
this.inMarker = inMarker;
}
-
+
/**
* Check whether in marker context
- *
+ *
* @return true if a marker is being processed
*/
protected boolean inMarker() {
return this.inMarker;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/FOValidationEventProducer.java b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
index 61bd68340..889bf706a 100644
--- a/src/java/org/apache/fop/fo/FOValidationEventProducer.java
+++ b/src/java/org/apache/fop/fo/FOValidationEventProducer.java
@@ -37,7 +37,7 @@ public interface FOValidationEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -55,12 +55,12 @@ public interface FOValidationEventProducer extends EventProducer {
* @param elementName the name of the context node
* @param offendingNode the offending node
* @param loc the location of the error or null
- * @throws ValidationException the validation error provoked by the method call
+ * @throws ValidationException the validation error provoked by the method call
* @event.severity FATAL
*/
void tooManyNodes(Object source, String elementName, QName offendingNode,
Locator loc) throws ValidationException;
-
+
/**
* The node order is wrong.
* @param source the event source
@@ -74,7 +74,7 @@ public interface FOValidationEventProducer extends EventProducer {
void nodeOutOfOrder(Object source, String elementName,
String tooLateNode, String tooEarlyNode, boolean canRecover,
Locator loc) throws ValidationException;
-
+
/**
* An invalid child was encountered.
* @param source the event source
@@ -112,7 +112,7 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void missingProperty(Object source, String elementName, String propertyName,
Locator loc) throws ValidationException;
-
+
/**
* An id was used twice in a document.
* @param source the event source
@@ -334,7 +334,7 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void invalidFORoot(Object source, String elementName,
Locator loc) throws ValidationException;
-
+
/**
* No FO document was found.
* @param source the event source
@@ -342,7 +342,7 @@ public interface FOValidationEventProducer extends EventProducer {
* @event.severity FATAL
*/
void emptyDocument(Object source) throws ValidationException;
-
+
/**
* An unknown/unsupported formatting object has been encountered.
* @param source the event source
@@ -353,5 +353,5 @@ public interface FOValidationEventProducer extends EventProducer {
*/
void unknownFormattingObject(Object source, String elementName,
QName offendingNode, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/fo/FObj.java b/src/java/org/apache/fop/fo/FObj.java
index 45b89dc8a..3e369b934 100644
--- a/src/java/org/apache/fop/fo/FObj.java
+++ b/src/java/org/apache/fop/fo/FObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,22 +42,22 @@ import org.apache.fop.fo.properties.PropertyMaker;
* All standard formatting object classes extend this class.
*/
public abstract class FObj extends FONode implements Constants {
-
+
/** the list of property makers */
private static final PropertyMaker[] propertyListTable
= FOPropertyMapping.getGenericMappings();
-
- /**
+
+ /**
* pointer to the descendant subtree
*/
protected FONode firstChild;
-
+
/** The list of extension attachments, null if none */
private List extensionAttachments = null;
-
+
/** The map of foreign attributes, null if none */
private Map foreignAttributes = null;
-
+
/** Used to indicate if this FO is either an Out Of Line FO (see rec)
* or a descendant of one. Used during FO validation.
*/
@@ -65,7 +65,7 @@ public abstract class FObj extends FONode implements Constants {
/** Markers added to this element. */
private Map markers = null;
-
+
// The value of properties relevant for all fo objects
private String id = null;
// End of property values
@@ -77,7 +77,7 @@ public abstract class FObj extends FONode implements Constants {
*/
public FObj(FONode parent) {
super(parent);
-
+
// determine if isOutOfLineFODescendant should be set
if (parent != null && parent instanceof FObj) {
if (((FObj) parent).getIsOutOfLineFODescendant()) {
@@ -101,7 +101,7 @@ public abstract class FObj extends FONode implements Constants {
}
return fobj;
}
-
+
/**
* Returns the PropertyMaker for a given property ID.
* @param propId the property ID
@@ -112,8 +112,8 @@ public abstract class FObj extends FONode implements Constants {
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
- Attributes attlist, PropertyList pList)
+ public void processNode(String elementName, Locator locator,
+ Attributes attlist, PropertyList pList)
throws FOPException {
setLocator(locator);
pList.addAttributesToList(attlist);
@@ -125,10 +125,10 @@ public abstract class FObj extends FONode implements Constants {
}
/**
- * Create a default property list for this element.
+ * Create a default property list for this element.
* {@inheritDoc}
*/
- protected PropertyList createPropertyList(PropertyList parent,
+ protected PropertyList createPropertyList(PropertyList parent,
FOEventHandler foEventHandler) throws FOPException {
return getBuilderContext().getPropertyListMaker().make(this, parent);
}
@@ -158,7 +158,7 @@ public abstract class FObj extends FONode implements Constants {
* Setup the id for this formatting object.
* Most formatting objects can have an id that can be referenced.
* This methods checks that the id isn't already used by another FO
- *
+ *
* @param id the id to check
* @throws ValidationException if the ID is already defined elsewhere
* (strict validation only)
@@ -186,11 +186,11 @@ public abstract class FObj extends FONode implements Constants {
protected void addChildNode(FONode child) throws FOPException {
if (child.getNameId() == FO_MARKER) {
addMarker((Marker) child);
- } else {
+ } else {
ExtensionAttachment attachment = child.getExtensionAttachment();
if (attachment != null) {
- /* This removes the element from the normal children,
- * so no layout manager is being created for them
+ /* This removes the element from the normal children,
+ * so no layout manager is being created for them
* as they are only additional information.
*/
addExtensionAttachment(attachment);
@@ -215,11 +215,11 @@ public abstract class FObj extends FONode implements Constants {
* @param parent the (cloned) parent node
* @throws FOPException when the child could not be added to the parent
*/
- protected static void addChildTo(FONode child, FObj parent)
+ protected static void addChildTo(FONode child, FObj parent)
throws FOPException {
parent.addChildNode(child);
}
-
+
/** {@inheritDoc} */
public void removeChild(FONode child) {
FONode nextChild = null;
@@ -239,7 +239,7 @@ public abstract class FObj extends FONode implements Constants {
}
}
}
-
+
/**
* Find the nearest parent, grandparent, etc. FONode that is also an FObj
* @return FObj the nearest ancestor FONode that is an FObj
@@ -276,7 +276,7 @@ public abstract class FObj extends FONode implements Constants {
public boolean hasChildren() {
return this.firstChild != null;
}
-
+
/**
* Return an iterator over the object's childNodes starting
* at the passed-in node (= first call to iterator.next() will
@@ -307,7 +307,7 @@ public abstract class FObj extends FONode implements Constants {
/**
* Notifies a FObj that one of it's children is removed.
- * This method is subclassed by Block to clear the
+ * This method is subclassed by Block to clear the
* firstInlineChild variable in case it doesn't generate
* any areas (see addMarker()).
* @param node the node that was removed
@@ -315,7 +315,7 @@ public abstract class FObj extends FONode implements Constants {
void notifyChildRemoval(FONode node) {
//nop
}
-
+
/**
* Add the marker to this formatting object.
* If this object can contain markers it checks that the marker
@@ -392,7 +392,7 @@ public abstract class FObj extends FONode implements Constants {
return null;
}
}
-
+
/** {@inheritDoc} */
protected String gatherContextInfo() {
if (getLocator() != null) {
@@ -422,11 +422,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%block;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isBlockItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("block".equals(lName)
|| "table".equals(lName)
|| "table-and-caption".equals(lName)
@@ -441,11 +441,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%inline;" parameter entity
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isInlineItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("bidi-override".equals(lName)
|| "character".equals(lName)
|| "external-graphic".equals(lName)
@@ -470,7 +470,7 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the "%block;" parameter entity
* or "%inline;" parameter entity
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
protected boolean isBlockOrInlineItem(String nsURI, String lName) {
@@ -482,11 +482,11 @@ public abstract class FObj extends FONode implements Constants {
* incoming node is a member of the neutral item list
* as defined in Sect. 6.2 of the XSL 1.0 & 1.1 Recommendations
* @param nsURI namespace URI of incoming node
- * @param lName local name (i.e., no prefix) of incoming node
+ * @param lName local name (i.e., no prefix) of incoming node
* @return true if a member, false if not
*/
boolean isNeutralItem(String nsURI, String lName) {
- return (FO_URI.equals(nsURI)
+ return (FO_URI.equals(nsURI)
&& ("multi-switch".equals(lName)
|| "multi-properties".equals(lName)
|| "wrapper".equals(lName)
@@ -494,12 +494,12 @@ public abstract class FObj extends FONode implements Constants {
|| "retrieve-marker".equals(lName)
|| "retrieve-table-marker".equals(lName)));
}
-
+
/**
* Convenience method for validity checking. Checks if the
* current node has an ancestor of a given name.
* @param ancestorID ID of node name to check for (e.g., FO_ROOT)
- * @return number of levels above FO where ancestor exists,
+ * @return number of levels above FO where ancestor exists,
* -1 if not found
*/
protected int findAncestor(int ancestorID) {
@@ -514,19 +514,19 @@ public abstract class FObj extends FONode implements Constants {
}
return -1;
}
-
+
/**
* Clears the list of child nodes.
*/
public void clearChildNodes() {
this.firstChild = null;
}
-
+
/** @return the "id" property. */
public String getId() {
return id;
}
-
+
/** @return whether this object has an id set */
public boolean hasId() {
return id != null && id.length() > 0;
@@ -543,9 +543,9 @@ public abstract class FObj extends FONode implements Constants {
}
/**
- * Add a new extension attachment to this FObj.
+ * Add a new extension attachment to this FObj.
* (see org.apache.fop.fo.FONode for details)
- *
+ *
* @param attachment the attachment to add.
*/
void addExtensionAttachment(ExtensionAttachment attachment) {
@@ -557,13 +557,13 @@ public abstract class FObj extends FONode implements Constants {
extensionAttachments = new java.util.ArrayList();
}
if (log.isDebugEnabled()) {
- log.debug("ExtensionAttachment of category "
- + attachment.getCategory() + " added to "
+ log.debug("ExtensionAttachment of category "
+ + attachment.getCategory() + " added to "
+ getName() + ": " + attachment);
}
extensionAttachments.add(attachment);
}
-
+
/** @return the extension attachments of this FObj. */
public List getExtensionAttachments() {
if (extensionAttachments == null) {
@@ -579,7 +579,7 @@ public abstract class FObj extends FONode implements Constants {
* @param value the attribute value
*/
public void addForeignAttribute(QName attributeName, String value) {
- /* TODO: Handle this over FOP's property mechanism so we can use
+ /* TODO: Handle this over FOP's property mechanism so we can use
* inheritance.
*/
if (attributeName == null) {
@@ -590,7 +590,7 @@ public abstract class FObj extends FONode implements Constants {
}
foreignAttributes.put(attributeName, value);
}
-
+
/** @return the map of foreign attributes */
public Map getForeignAttributes() {
if (foreignAttributes == null) {
@@ -599,7 +599,7 @@ public abstract class FObj extends FONode implements Constants {
return foreignAttributes;
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return (super.toString() + "[@id=" + this.id + "]");
@@ -607,28 +607,28 @@ public abstract class FObj extends FONode implements Constants {
/** Basic {@link FONodeIterator} implementation */
public class FObjIterator implements FONodeIterator {
-
+
private static final int F_NONE_ALLOWED = 0;
private static final int F_SET_ALLOWED = 1;
private static final int F_REMOVE_ALLOWED = 2;
-
+
private FONode currentNode;
private final FObj parentNode;
private int currentIndex;
private int flags = F_NONE_ALLOWED;
-
+
FObjIterator(FObj parent) {
this.parentNode = parent;
this.currentNode = parent.firstChild;
this.currentIndex = 0;
this.flags = F_NONE_ALLOWED;
}
-
+
/** {@inheritDoc} */
public FObj parentNode() {
return parentNode;
}
-
+
/** {@inheritDoc} */
public Object next() {
if (currentNode != null) {
@@ -660,7 +660,7 @@ public abstract class FObj extends FONode implements Constants {
throw new NoSuchElementException();
}
}
-
+
/** {@inheritDoc} */
public void set(Object o) {
if ((flags & F_SET_ALLOWED) == F_SET_ALLOWED) {
@@ -678,7 +678,7 @@ public abstract class FObj extends FONode implements Constants {
throw new IllegalStateException();
}
}
-
+
/** {@inheritDoc} */
public void add(Object o) {
FONode newNode = (FONode) o;
@@ -713,7 +713,7 @@ public abstract class FObj extends FONode implements Constants {
|| (currentNode.siblings != null
&& currentNode.siblings[0] != null);
}
-
+
/** {@inheritDoc} */
public int nextIndex() {
return currentIndex + 1;
@@ -754,19 +754,19 @@ public abstract class FObj extends FONode implements Constants {
}
return currentNode;
}
-
+
/** {@inheritDoc} */
public FONode firstNode() {
currentNode = parentNode.firstChild;
currentIndex = 0;
return currentNode;
}
-
+
/** {@inheritDoc} */
public FONode nextNode() {
return (FONode) next();
}
-
+
/** {@inheritDoc} */
public FONode previousNode() {
return (FONode) previous();
diff --git a/src/java/org/apache/fop/fo/FObjMixed.java b/src/java/org/apache/fop/fo/FObjMixed.java
index 068c2d635..64faa3253 100644
--- a/src/java/org/apache/fop/fo/FObjMixed.java
+++ b/src/java/org/apache/fop/fo/FObjMixed.java
@@ -5,9 +5,9 @@
* 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.
@@ -71,7 +71,7 @@ public abstract class FObjMixed extends FObj {
// send character[s]() events to the FOEventHandler
sendCharacters();
}
-
+
}
/**
@@ -180,10 +180,10 @@ public abstract class FObjMixed extends FObj {
/**
* Returns a {@link CharIterator} over this FO's character content
- *
+ *
* @return iterator for this object
*/
public CharIterator charIterator() {
return new RecursiveCharIterator(this);
- }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/fo/GraphicsProperties.java b/src/java/org/apache/fop/fo/GraphicsProperties.java
index 5cee68679..a22d59c24 100644
--- a/src/java/org/apache/fop/fo/GraphicsProperties.java
+++ b/src/java/org/apache/fop/fo/GraphicsProperties.java
@@ -5,9 +5,9 @@
* 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.
@@ -47,7 +47,7 @@ public interface GraphicsProperties {
* @return the "width" property.
*/
Length getWidth();
-
+
/**
* @return the "content-height" property.
*/
diff --git a/src/java/org/apache/fop/fo/InlineCharIterator.java b/src/java/org/apache/fop/fo/InlineCharIterator.java
index 8a375097e..f71753dde 100644
--- a/src/java/org/apache/fop/fo/InlineCharIterator.java
+++ b/src/java/org/apache/fop/fo/InlineCharIterator.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/NullCharIterator.java b/src/java/org/apache/fop/fo/NullCharIterator.java
index bb98b4a52..2b2a2a9a0 100644
--- a/src/java/org/apache/fop/fo/NullCharIterator.java
+++ b/src/java/org/apache/fop/fo/NullCharIterator.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import java.util.NoSuchElementException;
public class NullCharIterator extends CharIterator {
private static CharIterator instance;
-
+
public static CharIterator getInstance() {
if (instance == null) {
instance = new NullCharIterator();
diff --git a/src/java/org/apache/fop/fo/OneCharIterator.java b/src/java/org/apache/fop/fo/OneCharIterator.java
index 1d96320c1..e2c7275e8 100644
--- a/src/java/org/apache/fop/fo/OneCharIterator.java
+++ b/src/java/org/apache/fop/fo/OneCharIterator.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java
index e3e9f9f83..13f983841 100644
--- a/src/java/org/apache/fop/fo/PropertyList.java
+++ b/src/java/org/apache/fop/fo/PropertyList.java
@@ -5,9 +5,9 @@
* 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.
@@ -149,7 +149,7 @@ public abstract class PropertyList {
* the default value.
* @param propId The Constants ID of the property whose value is desired.
* @return the Property corresponding to that name
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId) throws PropertyException {
return get(propId, true, true);
@@ -161,11 +161,11 @@ public abstract class PropertyList {
* inheritable, to return the inherited value. If all else fails, it returns
* the default value.
* @param propId the property's id
- * @param bTryInherit true for inherited properties, or when the inherited
+ * @param bTryInherit true for inherited properties, or when the inherited
* value is needed
* @param bTryDefault true when the default value may be used as a last resort
* @return the property
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int propId, boolean bTryInherit,
boolean bTryDefault) throws PropertyException {
@@ -189,7 +189,7 @@ public abstract class PropertyList {
public Property getNearestSpecified(int propId) throws PropertyException {
Property p = null;
PropertyList pList = parentPropertyList;
-
+
while (pList != null) {
p = pList.getExplicit(propId);
if (p != null) {
@@ -198,8 +198,8 @@ public abstract class PropertyList {
pList = pList.parentPropertyList;
}
}
-
- // If no explicit value found on any of the ancestor-nodes,
+
+ // If no explicit value found on any of the ancestor-nodes,
// return initial (default) value.
return makeProperty(propId);
}
@@ -238,7 +238,7 @@ public abstract class PropertyList {
}
/**
- * Return the "writing-mode" property value.
+ * Return the "writing-mode" property value.
* @return the "writing-mode" property value.
*/
public int getWritingMode() {
@@ -266,34 +266,34 @@ public abstract class PropertyList {
/**
* Adds the attributes, passed in by the parser to the PropertyList
- *
+ *
* @param attributes Collection of attributes passed to us from the parser.
* @throws ValidationException if there is an attribute that does not
* map to a property id (strict validation only)
*/
- public void addAttributesToList(Attributes attributes)
+ public void addAttributesToList(Attributes attributes)
throws ValidationException {
/*
- * If column-number/number-columns-spanned are specified, then we
- * need them before all others (possible from-table-column() on any
+ * If column-number/number-columns-spanned are specified, then we
+ * need them before all others (possible from-table-column() on any
* other property further in the list...
*/
String attributeName = "column-number";
String attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
attributeName = "number-columns-spanned";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
-
+
/*
* If font-size is set on this FO, must set it first, since
* other attributes specified in terms of "ems" depend on it.
*/
attributeName = "font";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
if (attributeValue == null) {
/*
@@ -302,19 +302,19 @@ public abstract class PropertyList {
*/
attributeName = "font-size";
attributeValue = attributes.getValue(attributeName);
- convertAttributeToProperty(attributes, attributeName,
+ convertAttributeToProperty(attributes, attributeName,
attributeValue);
}
-
+
String attributeNS;
- FopFactory factory = getFObj().getUserAgent().getFactory();
+ FopFactory factory = getFObj().getUserAgent().getFactory();
for (int i = 0; i < attributes.getLength(); i++) {
/* convert all attributes with the same namespace as the fo element
* the "xml:lang" property is a special case */
attributeNS = attributes.getURI(i);
attributeName = attributes.getQName(i);
attributeValue = attributes.getValue(i);
- if (attributeNS == null || attributeNS.length() == 0
+ if (attributeNS == null || attributeNS.length() == 0
|| "xml:lang".equals(attributeName)) {
convertAttributeToProperty(attributes, attributeName, attributeValue);
} else if (!factory.isNamespaceIgnored(attributeNS)) {
@@ -322,10 +322,10 @@ public abstract class PropertyList {
attributeNS);
QName attr = new QName(attributeNS, attributeName);
if (mapping != null) {
- if (mapping.isAttributeProperty(attr)
+ if (mapping.isAttributeProperty(attr)
&& mapping.getStandardPrefix() != null) {
- convertAttributeToProperty(attributes,
- mapping.getStandardPrefix() + ":" + attr.getLocalName(),
+ convertAttributeToProperty(attributes,
+ mapping.getStandardPrefix() + ":" + attr.getLocalName(),
attributeValue);
} else {
getFObj().addForeignAttribute(attr, attributeValue);
@@ -336,7 +336,7 @@ public abstract class PropertyList {
}
}
}
-
+
/**
* Validates a property name.
* @param propertyName the property name to check
@@ -360,34 +360,34 @@ public abstract class PropertyList {
* @param attributes Collection of attributes
* @param attributeName Attribute name to convert
* @param attributeValue Attribute value to assign to property
- * @throws ValidationException in case the property name is invalid
+ * @throws ValidationException in case the property name is invalid
* for the FO namespace
*/
private void convertAttributeToProperty(Attributes attributes,
String attributeName,
- String attributeValue)
+ String attributeValue)
throws ValidationException {
-
+
if (attributeValue != null) {
if (attributeName.startsWith("xmlns:")) {
//Ignore namespace declarations
return;
}
-
+
/* Handle "compound" properties, ex. space-before.minimum */
String basePropertyName = findBasePropertyName(attributeName);
String subPropertyName = findSubPropertyName(attributeName);
int propId = FOPropertyMapping.getPropertyId(basePropertyName);
int subpropId = FOPropertyMapping.getSubPropertyId(subPropertyName);
-
- if (propId == -1
+
+ if (propId == -1
|| (subpropId == -1 && subPropertyName != null)) {
handleInvalidProperty(new QName(null, attributeName));
}
FObj parentFO = fobj.findNearestAncestorFObj();
-
+
PropertyMaker propertyMaker = findMaker(propId);
if (propertyMaker == null) {
log.warn("No PropertyMaker registered for " + attributeName
@@ -401,7 +401,7 @@ public abstract class PropertyList {
/* Do nothing if the base property has already been created.
* This is e.g. the case when a compound attribute was
* specified before the base attribute; in these cases
- * the base attribute was already created in
+ * the base attribute was already created in
* findBaseProperty()
*/
if (getExplicit(propId) != null) {
@@ -410,7 +410,7 @@ public abstract class PropertyList {
prop = propertyMaker.make(this, attributeValue, parentFO);
} else { // e.g. "leader-length.maximum"
Property baseProperty
- = findBaseProperty(attributes, parentFO, propId,
+ = findBaseProperty(attributes, parentFO, propId,
basePropertyName, propertyMaker);
prop = propertyMaker.make(baseProperty, subpropId,
this, attributeValue, parentFO);
@@ -446,13 +446,13 @@ public abstract class PropertyList {
* e.g.
Here, blocks XSL-FO's from having non-FO parents.
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -74,7 +74,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList) throws FOPException {
setLocator(locator);
name = elementName;
@@ -90,17 +90,17 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Returns the dimensions of the generated area in pts.
- *
+ *
* @param view Point2D instance to receive the dimensions
* @return the requested dimensions in pts.
*/
public Point2D getDimension(Point2D view) {
return null;
}
-
+
/**
* Retrieve the intrinsic alignment-adjust of the child element.
- *
+ *
* @return the intrinsic alignment-adjust.
*/
public Length getIntrinsicAlignmentAdjust() {
@@ -149,10 +149,10 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
}
}
}
-
+
/**
* Add the top-level element to the DOM document
- *
+ *
* @param doc DOM document
* @param svgRoot non-XSL-FO element to be added as the root of this document
*/
@@ -163,7 +163,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Create an empty DOM document
- *
+ *
* @return DOM document
*/
public Document createBasicDocument() {
@@ -183,7 +183,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
element.setAttributeNS(XMLNS_NAMESPACE_URI, "xmlns",
getNamespaceURI());
}
-
+
} catch (Exception e) {
//TODO this is ugly because there may be subsequent failures like NPEs
log.error("Error while trying to instantiate a DOM Document", e);
@@ -205,7 +205,7 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
/**
* Add parsed characters to this object
- *
+ *
* @param data array of characters contaning the text to add
* @param start starting array element to add
* @param length number of characters from the array to add
@@ -223,6 +223,6 @@ public abstract class XMLObj extends FONode implements ObjectBuiltListener {
public void notifyObjectBuilt(Object obj) {
this.doc = (Document)obj;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
index d8915b124..759cdaed9 100644
--- a/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
+++ b/src/java/org/apache/fop/fo/XMLWhiteSpaceHandler.java
@@ -27,7 +27,7 @@ import org.apache.fop.util.CharUtilities;
/**
* Class encapsulating the functionality for white-space-handling
* during refinement stage.
- * The handleWhiteSpace()
methods are called during
+ * The handleWhiteSpace()
methods are called during
* FOTree-building and marker-cloning:
*
*
@@ -47,8 +47,8 @@ import org.apache.fop.util.CharUtilities;
* after the previous non-text child
*
*
- * The iteration always starts at firstTextNode
,
- * goes on until the last text-node is reached, and deals only
+ * The iteration always starts at firstTextNode
,
+ * goes on until the last text-node is reached, and deals only
* with FOText
or Character
nodes.
*
* Note: if the method is called from an inline's endOfNode(),
@@ -60,25 +60,25 @@ import org.apache.fop.util.CharUtilities;
* of the ancestor block.
*/
public class XMLWhiteSpaceHandler {
-
+
/** True if we are in a run of white space */
private boolean inWhiteSpace = false;
/** True if the last char was a linefeed */
private boolean afterLinefeed = true;
/** Counter, increased every time a non-white-space is encountered */
private int nonWhiteSpaceCount;
-
+
private int linefeedTreatment;
private int whiteSpaceTreatment;
private int whiteSpaceCollapse;
private boolean endOfBlock;
private boolean nextChildIsBlockLevel;
private RecursiveCharIterator charIter;
-
+
private List pendingInlines;
private Stack nestedBlockStack = new java.util.Stack();
private CharIterator firstWhiteSpaceInSeq;
-
+
/**
* Handle white-space for the fo that is passed in, starting at
* firstTextNode
@@ -93,14 +93,14 @@ public class XMLWhiteSpaceHandler {
Block currentBlock = null;
int foId = fo.getNameId();
-
+
/* set the current block */
switch (foId) {
case Constants.FO_BLOCK:
currentBlock = (Block) fo;
if (nestedBlockStack.empty() || fo != nestedBlockStack.peek()) {
if (nextChild != null) {
- /* if already in a block, push the current block
+ /* if already in a block, push the current block
* onto the stack of nested blocks
*/
nestedBlockStack.push(currentBlock);
@@ -111,7 +111,7 @@ public class XMLWhiteSpaceHandler {
}
}
break;
-
+
case Constants.FO_RETRIEVE_MARKER:
/* look for the nearest block ancestor, if any */
FONode ancestor = fo;
@@ -119,19 +119,19 @@ public class XMLWhiteSpaceHandler {
ancestor = ancestor.getParent();
} while (ancestor.getNameId() != Constants.FO_BLOCK
&& ancestor.getNameId() != Constants.FO_STATIC_CONTENT);
-
+
if (ancestor.getNameId() == Constants.FO_BLOCK) {
currentBlock = (Block) ancestor;
nestedBlockStack.push(currentBlock);
}
break;
-
+
default:
if (!nestedBlockStack.empty()) {
currentBlock = (Block) nestedBlockStack.peek();
}
}
-
+
if (currentBlock != null) {
linefeedTreatment = currentBlock.getLinefeedTreatment();
whiteSpaceCollapse = currentBlock.getWhitespaceCollapse();
@@ -141,9 +141,9 @@ public class XMLWhiteSpaceHandler {
whiteSpaceCollapse = Constants.EN_TRUE;
whiteSpaceTreatment = Constants.EN_IGNORE_IF_SURROUNDING_LINEFEED;
}
-
+
endOfBlock = (nextChild == null && fo == currentBlock);
-
+
if (firstTextNode == null) {
//no text means no white-space to handle; return early
afterLinefeed = (fo == currentBlock && fo.firstChild == null);
@@ -153,10 +153,10 @@ public class XMLWhiteSpaceHandler {
}
return;
}
-
+
charIter = new RecursiveCharIterator(fo, firstTextNode);
inWhiteSpace = false;
-
+
if (fo == currentBlock
|| currentBlock == null
|| (foId == Constants.FO_RETRIEVE_MARKER
@@ -172,7 +172,7 @@ public class XMLWhiteSpaceHandler {
|| previousChildId == Constants.FO_BLOCK_CONTAINER);
}
}
-
+
if (foId == Constants.FO_WRAPPER) {
FONode parent = fo.parent;
int parentId = parent.getNameId();
@@ -187,7 +187,7 @@ public class XMLWhiteSpaceHandler {
endOfBlock = (nextChild == null);
}
}
-
+
if (nextChild != null) {
int nextChildId = nextChild.getNameId();
nextChildIsBlockLevel = (
@@ -199,20 +199,20 @@ public class XMLWhiteSpaceHandler {
} else {
nextChildIsBlockLevel = false;
}
-
+
handleWhiteSpace();
-
- if (fo == currentBlock
+
+ if (fo == currentBlock
&& (endOfBlock || nextChildIsBlockLevel)) {
handlePendingInlines();
}
-
+
if (nextChild == null) {
if (fo != currentBlock) {
/* current FO is not a block, and is about to end */
if (nonWhiteSpaceCount > 0 && pendingInlines != null) {
- /* there is non-white-space text between the pending
- * inline(s) and the end of the non-block node;
+ /* there is non-white-space text between the pending
+ * inline(s) and the end of the non-block node;
* clear list of pending inlines */
pendingInlines.clear();
}
@@ -222,7 +222,7 @@ public class XMLWhiteSpaceHandler {
addPendingInline(fo);
}
} else {
- /* end of block: clear the references and pop the
+ /* end of block: clear the references and pop the
* nested block stack */
if (!nestedBlockStack.empty()) {
nestedBlockStack.pop();
@@ -231,7 +231,7 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
/**
* Handle white-space for the fo that is passed in, starting at
* firstTextNode (when a nested FO is encountered)
@@ -241,13 +241,13 @@ public class XMLWhiteSpaceHandler {
public void handleWhiteSpace(FObjMixed fo, FONode firstTextNode) {
handleWhiteSpace(fo, firstTextNode, null);
}
-
+
private void handleWhiteSpace() {
-
+
EOLchecker lfCheck = new EOLchecker(charIter);
-
+
nonWhiteSpaceCount = 0;
-
+
while (charIter.hasNext()) {
if (!inWhiteSpace) {
firstWhiteSpaceInSeq = charIter.mark();
@@ -265,7 +265,7 @@ public class XMLWhiteSpaceHandler {
switch (CharUtilities.classOf(currentChar)) {
case CharUtilities.XMLWHITESPACE:
// Some kind of whitespace character, except linefeed.
- if (inWhiteSpace
+ if (inWhiteSpace
&& whiteSpaceCollapse == Constants.EN_TRUE) {
// We are in a run of whitespace and should collapse
// Just delete the char
@@ -343,14 +343,14 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
private void addPendingInline(FObjMixed fo) {
if (pendingInlines == null) {
pendingInlines = new java.util.ArrayList(5);
}
pendingInlines.add(new PendingInline(fo, firstWhiteSpaceInSeq));
}
-
+
private void handlePendingInlines() {
if (!(pendingInlines == null || pendingInlines.isEmpty())) {
if (nonWhiteSpaceCount == 0) {
@@ -370,7 +370,7 @@ public class XMLWhiteSpaceHandler {
}
}
}
-
+
/**
* Helper class, used during white-space handling to look ahead, and
* see if the next character is a linefeed (or if there will be
@@ -401,7 +401,7 @@ public class XMLWhiteSpaceHandler {
}
// No more characters == end of text run
// means EOL if there either is a nested block to be added,
- // or if this is the last text node in the current block
+ // or if this is the last text node in the current block
nextIsEOL = nextChildIsBlockLevel || endOfBlock;
}
return nextIsEOL;
@@ -411,16 +411,16 @@ public class XMLWhiteSpaceHandler {
nextIsEOL = false;
}
}
-
+
/**
- * Helper class to store unfinished inline nodes together
+ * Helper class to store unfinished inline nodes together
* with an iterator that starts at the first white-space
* character in the sequence of trailing white-space
*/
private class PendingInline {
protected FObjMixed fo;
protected CharIterator firstTrailingWhiteSpace;
-
+
PendingInline(FObjMixed fo, CharIterator firstTrailingWhiteSpace) {
this.fo = fo;
this.firstTrailingWhiteSpace = firstTrailingWhiteSpace;
diff --git a/src/java/org/apache/fop/fo/expr/AbsFunction.java b/src/java/org/apache/fop/fo/expr/AbsFunction.java
index 64936459f..0e8355faa 100644
--- a/src/java/org/apache/fop/fo/expr/AbsFunction.java
+++ b/src/java/org/apache/fop/fo/expr/AbsFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
index a1c0259fa..eb68b2a23 100644
--- a/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
+++ b/src/java/org/apache/fop/fo/expr/BodyStartFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
index 3aab1325d..fe86860f4 100644
--- a/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/CMYKcolorFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.apps.FOUserAgent;
import org.apache.fop.fo.properties.ColorProperty;
@@ -26,22 +26,22 @@ import org.apache.fop.fo.properties.Property;
* Implements the cmyk() function.
*/
class CMYKcolorFunction extends FunctionBase {
-
+
/**
- * cmyk takes four arguments.
- * {@inheritDoc}
+ * cmyk takes four arguments.
+ * {@inheritDoc}
*/
public int nbArgs() {
return 4;
}
-
+
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
StringBuffer sb = new StringBuffer();
sb.append("cmyk(" + args[0] + "," + args[1] + "," + args[2] + "," + args[3] + ")");
- FOUserAgent ua = (pInfo == null)
- ? null
+ FOUserAgent ua = (pInfo == null)
+ ? null
: (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent());
return ColorProperty.getInstance(ua, sb.toString());
}
diff --git a/src/java/org/apache/fop/fo/expr/CeilingFunction.java b/src/java/org/apache/fop/fo/expr/CeilingFunction.java
index 29ac1940a..875c88751 100644
--- a/src/java/org/apache/fop/fo/expr/CeilingFunction.java
+++ b/src/java/org/apache/fop/fo/expr/CeilingFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.fo.properties.NumberProperty;
diff --git a/src/java/org/apache/fop/fo/expr/FloorFunction.java b/src/java/org/apache/fop/fo/expr/FloorFunction.java
index 9cdbf1a28..043473140 100644
--- a/src/java/org/apache/fop/fo/expr/FloorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FloorFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.fo.properties.NumberProperty;
diff --git a/src/java/org/apache/fop/fo/expr/FromParentFunction.java b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
index b09d3c95f..b1e9d689d 100644
--- a/src/java/org/apache/fop/fo/expr/FromParentFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromParentFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
index 66cafc2ac..df84939f1 100644
--- a/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
+++ b/src/java/org/apache/fop/fo/expr/FromTableColumnFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/Function.java b/src/java/org/apache/fop/fo/expr/Function.java
index a06627f6c..78e40fad2 100644
--- a/src/java/org/apache/fop/fo/expr/Function.java
+++ b/src/java/org/apache/fop/fo/expr/Function.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/FunctionBase.java b/src/java/org/apache/fop/fo/expr/FunctionBase.java
index 24d2fef49..b5040c635 100644
--- a/src/java/org/apache/fop/fo/expr/FunctionBase.java
+++ b/src/java/org/apache/fop/fo/expr/FunctionBase.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
index 9444639a5..2069945f1 100644
--- a/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/ICCColorFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.PercentBase;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -29,16 +29,16 @@ import org.apache.fop.fo.properties.Property;
* Implements the rgb-icc() function.
*/
class ICCColorFunction extends FunctionBase {
-
+
/**
- * rgb-icc takes a variable number of arguments.
- * At least 4 should be passed - returns -4
- * {@inheritDoc}
+ * rgb-icc takes a variable number of arguments.
+ * At least 4 should be passed - returns -4
+ * {@inheritDoc}
*/
public int nbArgs() {
return -4;
}
-
+
/** {@inheritDoc} */
public PercentBase getPercentBase() {
return new ICCPercentBase();
@@ -52,7 +52,7 @@ class ICCColorFunction extends FunctionBase {
Declarations decls = pInfo.getFO().getRoot().getDeclarations();
ColorProfile cp = null;
if (decls == null) {
- //function used in a color-specification
+ //function used in a color-specification
//on a FO occurring:
//a) before the fo:declarations,
//b) or in a document without fo:declarations?
@@ -63,27 +63,27 @@ class ICCColorFunction extends FunctionBase {
} else {
cp = decls.getColorProfile(colorProfileName);
if (cp == null) {
- PropertyException pe = new PropertyException("The " + colorProfileName
+ PropertyException pe = new PropertyException("The " + colorProfileName
+ " color profile was not declared");
pe.setPropertyInfo(pInfo);
throw pe;
}
}
String src = cp.getSrc();
-
+
float red = 0, green = 0, blue = 0;
red = args[0].getNumber().floatValue();
green = args[1].getNumber().floatValue();
blue = args[2].getNumber().floatValue();
/* Verify rgb replacement arguments */
- if ((red < 0 || red > 255)
- || (green < 0 || green > 255)
+ if ((red < 0 || red > 255)
+ || (green < 0 || green > 255)
|| (blue < 0 || blue > 255)) {
throw new PropertyException("Color values out of range. "
+ "Arguments to rgb-icc() must be [0..255] or [0%..100%]");
}
-
- // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
+
+ // rgb-icc is replaced with fop-rgb-icc which has an extra fifth argument containing the
// color profile src attribute as it is defined in the color-profile declarations element.
StringBuffer sb = new StringBuffer();
sb.append("fop-rgb-icc(");
@@ -92,19 +92,19 @@ class ICCColorFunction extends FunctionBase {
sb.append(',').append(blue / 255f);
for (int ix = 3; ix < args.length; ix++) {
if (ix == 3) {
- sb.append(',').append(colorProfileName);
- sb.append(',').append(src);
+ sb.append(',').append(colorProfileName);
+ sb.append(',').append(src);
} else {
sb.append(',').append(args[ix]);
}
}
sb.append(")");
-
+
return ColorProperty.getInstance(pInfo.getUserAgent(), sb.toString());
}
private static final class ICCPercentBase implements PercentBase {
-
+
/** {@inheritDoc} */
public int getBaseLength(PercentBaseContext context) throws PropertyException {
return 0;
diff --git a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
index e24c78caa..94c4fdf22 100644
--- a/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/InheritedPropFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
index 8a02d21d6..65be6cf9f 100644
--- a/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
+++ b/src/java/org/apache/fop/fo/expr/LabelEndFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -70,13 +70,13 @@ public class LabelEndFunction extends FunctionBase {
LengthBase.CONTAINING_REFAREA_WIDTH);
PercentLength refWidth = new PercentLength(1.0, base);
- Numeric labelEnd = distance;
+ Numeric labelEnd = distance;
labelEnd = NumericOp.addition(labelEnd, startIndent);
//TODO add start-intrusion-adjustment
labelEnd = NumericOp.subtraction(labelEnd, separation);
-
+
labelEnd = NumericOp.subtraction(refWidth, labelEnd);
-
+
return (Property) labelEnd;
}
diff --git a/src/java/org/apache/fop/fo/expr/MaxFunction.java b/src/java/org/apache/fop/fo/expr/MaxFunction.java
index 26e1a8f4c..fd2fee0b1 100644
--- a/src/java/org/apache/fop/fo/expr/MaxFunction.java
+++ b/src/java/org/apache/fop/fo/expr/MaxFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/MinFunction.java b/src/java/org/apache/fop/fo/expr/MinFunction.java
index 5e5fc7bee..979d16b27 100644
--- a/src/java/org/apache/fop/fo/expr/MinFunction.java
+++ b/src/java/org/apache/fop/fo/expr/MinFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/NCnameProperty.java b/src/java/org/apache/fop/fo/expr/NCnameProperty.java
index 8e2f8e27f..6bc16f2a9 100644
--- a/src/java/org/apache/fop/fo/expr/NCnameProperty.java
+++ b/src/java/org/apache/fop/fo/expr/NCnameProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,13 +42,13 @@ public class NCnameProperty extends Property {
/**
* If a system color, return the corresponding value.
- *
- * @param foUserAgent
+ *
+ * @param foUserAgent
* Reference to FOP user agent - keeps track of cached ColorMaps for ICC colors
* @return Color object corresponding to the NCName
*/
public Color getColor(FOUserAgent foUserAgent) {
- try {
+ try {
return ColorUtil.parseColorString(foUserAgent, ncName);
} catch (PropertyException e) {
//Not logging this error since for properties like "border" you would get an awful
@@ -71,7 +71,7 @@ public class NCnameProperty extends Property {
public Object getObject() {
return this.ncName;
}
-
+
/**
* @return ncName for this
*/
diff --git a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
index cdde96092..3e0dda565 100644
--- a/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
+++ b/src/java/org/apache/fop/fo/expr/NearestSpecPropFunction.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/NumericOp.java b/src/java/org/apache/fop/fo/expr/NumericOp.java
index af77bb44c..9fe35d96d 100755
--- a/src/java/org/apache/fop/fo/expr/NumericOp.java
+++ b/src/java/org/apache/fop/fo/expr/NumericOp.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,12 +23,12 @@ import org.apache.fop.datatypes.PercentBaseContext;
import org.apache.fop.datatypes.Numeric;
/**
- * This class contains static methods to evaluate operations on Numeric
+ * This class contains static methods to evaluate operations on Numeric
* operands. If the operands are absolute numerics the result is computed
* rigth away and a new absolute numeric is return. If one of the operands are
* relative a n operation node is created with the operation and the operands.
* The evaluation of the operation can then occur when getNumericValue() is
- * called.
+ * called.
*/
public class NumericOp {
/**
@@ -46,16 +46,16 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.ADDITION, op1, op2);
}
}
-
+
public static Numeric addition2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
if (op1.getDimension() != op2.getDimension()) {
throw new PropertyException("Can't subtract Numerics of different dimensions");
}
return numeric(op1.getNumericValue(context) + op2.getNumericValue(context), op1.getDimension());
}
-
+
/**
- * Add the second operand from the first and return a new Numeric
+ * Add the second operand from the first and return a new Numeric
* representing the result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -77,9 +77,9 @@ public class NumericOp {
}
return numeric(op1.getNumericValue(context) - op2.getNumericValue(context), op1.getDimension());
}
-
+
/**
- * Multiply the two operands and return a new Numeric representing the
+ * Multiply the two operands and return a new Numeric representing the
* result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -93,16 +93,16 @@ public class NumericOp {
} else {
return new RelativeNumericProperty(RelativeNumericProperty.MULTIPLY, op1, op2);
}
- }
+ }
public static Numeric multiply2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
- return numeric(op1.getNumericValue(context) * op2.getNumericValue(context),
+ return numeric(op1.getNumericValue(context) * op2.getNumericValue(context),
op1.getDimension() + op2.getDimension());
}
-
+
/**
- * Divide the second operand into the first and return a new
- * Numeric representing the
+ * Divide the second operand into the first and return a new
+ * Numeric representing the
* result.
* @param op1 The first operand.
* @param op2 The second operand.
@@ -117,12 +117,12 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.DIVIDE, op1, op2);
}
}
-
+
public static Numeric divide2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
- return numeric(op1.getNumericValue(context) / op2.getNumericValue(context),
+ return numeric(op1.getNumericValue(context) / op2.getNumericValue(context),
op1.getDimension() - op2.getDimension());
}
-
+
/**
* Return the remainder of a division of the two operand Numeric.
* @param op1 The first operand.
@@ -136,7 +136,7 @@ public class NumericOp {
return new RelativeNumericProperty(RelativeNumericProperty.MODULO, op1, op2);
}
}
-
+
public static Numeric modulo2(Numeric op1, Numeric op2, PercentBaseContext context) throws PropertyException {
return numeric(op1.getNumericValue(context) % op2.getNumericValue(context), op1.getDimension());
}
@@ -157,7 +157,7 @@ public class NumericOp {
public static Numeric abs2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(Math.abs(op.getNumericValue(context)), op.getDimension());
}
-
+
/**
* Return the negation of a Numeric.
* @param op the operand.
@@ -174,7 +174,7 @@ public class NumericOp {
public static Numeric negate2(Numeric op, PercentBaseContext context) throws PropertyException {
return numeric(- op.getNumericValue(context), op.getDimension());
}
-
+
/**
* Return the larger of the two Numerics.
* @param op1 The first operand.
@@ -196,7 +196,7 @@ public class NumericOp {
}
return op1.getNumericValue(context) > op2.getNumericValue(context) ? op1 : op2;
}
-
+
/**
* Return the smaller of two Numerics.
* @param op1 The first operand.
@@ -218,9 +218,9 @@ public class NumericOp {
}
return op1.getNumericValue(context) <= op2.getNumericValue(context) ? op1 : op2;
}
-
+
/**
- * Create a new absolute numeric with the specified value and dimension.
+ * Create a new absolute numeric with the specified value and dimension.
* @param value
* @param dimension
* @return a new absolute numeric.
diff --git a/src/java/org/apache/fop/fo/expr/NumericProperty.java b/src/java/org/apache/fop/fo/expr/NumericProperty.java
index 54fe1f2f7..f80e1f5a5 100644
--- a/src/java/org/apache/fop/fo/expr/NumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/NumericProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import java.awt.Color;
@@ -30,7 +30,7 @@ import org.apache.fop.fo.properties.Property;
/**
* A numeric property which hold the final absolute result of an expression
- * calculations.
+ * calculations.
*/
public class NumericProperty extends Property implements Numeric, Length {
private double value;
diff --git a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
index 394035b49..5defda0fe 100644
--- a/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
+++ b/src/java/org/apache/fop/fo/expr/PPColWidthFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -40,8 +40,8 @@ public class PPColWidthFunction extends FunctionBase {
return 1;
}
- /**
- * @return the {@link PercentBase} for the proportional-column-width()
+ /**
+ * @return the {@link PercentBase} for the proportional-column-width()
* function
*/
public PercentBase getPercentBase() {
@@ -68,7 +68,7 @@ public class PPColWidthFunction extends FunctionBase {
throw new PropertyException("proportional-column-width() function "
+ "may only be used on fo:table-column.");
}
-
+
Table t = (Table) pList.getParentFObj();
if (t.isAutoLayout()) {
throw new PropertyException("proportional-column-width() function "
@@ -96,6 +96,6 @@ public class PPColWidthFunction extends FunctionBase {
public int getDimension() {
return 0;
}
-
+
}
}
diff --git a/src/java/org/apache/fop/fo/expr/PropertyException.java b/src/java/org/apache/fop/fo/expr/PropertyException.java
index d16d1c8ff..2d1d04913 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyException.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyException.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public class PropertyException extends FOPException {
this.propertyName = ((PropertyException)cause).propertyName;
}
}
-
+
/**
* Sets the property context information.
* @param propInfo the property info instance
diff --git a/src/java/org/apache/fop/fo/expr/PropertyInfo.java b/src/java/org/apache/fop/fo/expr/PropertyInfo.java
index 039e8783e..2bce0793f 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyInfo.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyInfo.java
@@ -5,9 +5,9 @@
* 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.
@@ -94,7 +94,7 @@ public class PropertyInfo {
public PropertyMaker getPropertyMaker() {
return maker;
}
-
+
/**
* push a function onto the function stack
* @param func function to push onto stack
@@ -117,15 +117,15 @@ public class PropertyInfo {
/**
* Convenience shortcut to get a reference to the FOUserAgent
- *
+ *
* @return the FOUserAgent
*/
protected FOUserAgent getUserAgent() {
- return (plist.getFObj() != null)
- ? plist.getFObj().getUserAgent()
+ return (plist.getFObj() != null)
+ ? plist.getFObj().getUserAgent()
: null;
}
-
+
private PercentBase getFunctionPercentBase() {
if (stkFunction != null) {
Function f = (Function)stkFunction.peek();
diff --git a/src/java/org/apache/fop/fo/expr/PropertyParser.java b/src/java/org/apache/fop/fo/expr/PropertyParser.java
index c63142773..7ae1db7f3 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyParser.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public final class PropertyParser extends PropertyTokenizer {
private static final String RELUNIT = "em";
private static final HashMap FUNCTION_TABLE = new HashMap();
-
+
static {
// Initialize the HashMap of XSL-defined functions
FUNCTION_TABLE.put("ceiling", new CeilingFunction());
@@ -310,10 +310,10 @@ public final class PropertyParser extends PropertyTokenizer {
propInfo.currentFontSize());
} else {
if ("px".equals(unitPart)) {
- //pass the ratio between source-resolution and
+ //pass the ratio between source-resolution and
//the default resolution of 72dpi
prop = FixedLength.getInstance(
- numPart, unitPart,
+ numPart, unitPart,
propInfo.getPropertyList().getFObj()
.getUserAgent().getSourceResolution() / 72.0f);
} else {
@@ -344,7 +344,7 @@ public final class PropertyParser extends PropertyTokenizer {
}
propInfo.popFunction();
return prop;
-
+
default:
// TODO: add the token or the expr to the error message.
throw new PropertyException("syntax error");
@@ -357,7 +357,7 @@ public final class PropertyParser extends PropertyTokenizer {
* Parse a comma separated list of function arguments. Each argument
* may itself be an expression. This method consumes the closing right
* parenthesis of the argument list.
- * @param function The function object for which the arguments are
+ * @param function The function object for which the arguments are
* collected.
* @return An array of Property objects representing the arguments
* found.
@@ -397,27 +397,27 @@ public final class PropertyParser extends PropertyTokenizer {
}
return args;
}
-
+
/**
- *
+ *
* Parse a comma separated list of function arguments. Each argument
* may itself be an expression. This method consumes the closing right
* parenthesis of the argument list.
- *
- * The method differs from parseArgs in that it accepts a variable
+ *
+ * The method differs from parseArgs in that it accepts a variable
* number of arguments.
- *
- * @param function The function object for which the arguments are
+ *
+ * @param function The function object for which the arguments are
* collected.
* @return An array of Property objects representing the arguments
* found.
* @throws PropertyException If the number of arguments found isn't equal
* to the number expected.
- *
- * TODO Merge this with parseArgs?
+ *
+ * TODO Merge this with parseArgs?
*/
Property[] parseVarArgs(Function function) throws PropertyException {
- // For variable argument functions the minimum number of arguments is returned as a
+ // For variable argument functions the minimum number of arguments is returned as a
// negative integer from the nbArgs method
int nbArgs = -function.nbArgs();
List args = new LinkedList();
diff --git a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
index 5fe5f4445..2ddcd0922 100644
--- a/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
+++ b/src/java/org/apache/fop/fo/expr/PropertyTokenizer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
index ba39662eb..1c7a91503 100644
--- a/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/RGBColorFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -28,7 +28,7 @@ import org.apache.fop.fo.properties.Property;
* Implements the rgb() function.
*/
class RGBColorFunction extends FunctionBase {
-
+
/** {@inheritDoc} */
public int nbArgs() {
return 3;
@@ -46,8 +46,8 @@ class RGBColorFunction extends FunctionBase {
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
- return ColorProperty.getInstance(pInfo.getUserAgent(),
- "rgb(" + args[0] + ","
+ return ColorProperty.getInstance(pInfo.getUserAgent(),
+ "rgb(" + args[0] + ","
+ args[1] + "," + args[2] + ")");
}
diff --git a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
index 647528692..a4e257546 100755
--- a/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
+++ b/src/java/org/apache/fop/fo/expr/RelativeNumericProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,10 +27,10 @@ import org.apache.fop.fo.properties.TableColLength;
/**
- * This class represent a node in a property expression tree.
+ * This class represent a node in a property expression tree.
* It is created when an operation involve relative expression and is used
* to delay evaluation of the operation until the time where getNumericValue()
- * or getValue() is called.
+ * or getValue() is called.
*/
public class RelativeNumericProperty extends Property implements Length {
public static final int ADDITION = 1;
@@ -42,10 +42,10 @@ public class RelativeNumericProperty extends Property implements Length {
public static final int ABS = 7;
public static final int MAX = 8;
public static final int MIN = 9;
-
+
// Used in the toString() method, indexed by operation id.
private static String operations = " +-*/%";
-
+
/**
* The operation identifier.
*/
@@ -62,7 +62,7 @@ public class RelativeNumericProperty extends Property implements Length {
* The dimension of the result.
*/
private int dimension;
-
+
/**
* Constructor for a two argument operation.
* @param operation the operation opcode: ADDITION, SUBTRACTION, ...
@@ -124,12 +124,12 @@ public class RelativeNumericProperty extends Property implements Length {
case MIN:
return NumericOp.min2(op1, op2, context);
default:
- throw new PropertyException("Unknown expr operation " + operation);
+ throw new PropertyException("Unknown expr operation " + operation);
}
}
/**
- * Return the resolved (calculated) value of the expression.
+ * Return the resolved (calculated) value of the expression.
* {@inheritDoc}
*/
public double getNumericValue() throws PropertyException {
@@ -152,14 +152,14 @@ public class RelativeNumericProperty extends Property implements Length {
/**
* Return false since an expression is only created when there is relative
- * numerics involved.
+ * numerics involved.
*/
public boolean isAbsolute() {
return false;
}
/**
- * Cast this numeric as a Length.
+ * Cast this numeric as a Length.
*/
public Length getLength() {
if (dimension == 1) {
@@ -205,7 +205,7 @@ public class RelativeNumericProperty extends Property implements Length {
* If this value is not 0, the actual value of the Length cannot be known
* without looking at all of the columns in the table to determine the value
* of a "table-unit".
- *
+ *
* @return The number of table units which are included in this length
* specification.
*/
@@ -261,7 +261,7 @@ public class RelativeNumericProperty extends Property implements Length {
*/
public String toString() {
switch (operation) {
- case ADDITION: case SUBTRACTION:
+ case ADDITION: case SUBTRACTION:
case DIVIDE: case MULTIPLY: case MODULO:
return "(" + op1 + " " + operations.charAt(operation) + op2 + ")";
case NEGATE:
diff --git a/src/java/org/apache/fop/fo/expr/RoundFunction.java b/src/java/org/apache/fop/fo/expr/RoundFunction.java
index a28a46e28..a29c33e5b 100644
--- a/src/java/org/apache/fop/fo/expr/RoundFunction.java
+++ b/src/java/org/apache/fop/fo/expr/RoundFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
diff --git a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
index b32c38e54..eeb1870f7 100644
--- a/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
+++ b/src/java/org/apache/fop/fo/expr/SystemColorFunction.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.expr;
import org.apache.fop.apps.FOUserAgent;
@@ -27,7 +27,7 @@ import org.apache.fop.fo.properties.Property;
* Implements the system-color() function.
*/
class SystemColorFunction extends FunctionBase {
-
+
/** {@inheritDoc} */
public int nbArgs() {
return 1;
@@ -36,8 +36,8 @@ class SystemColorFunction extends FunctionBase {
/** {@inheritDoc} */
public Property eval(Property[] args,
PropertyInfo pInfo) throws PropertyException {
- FOUserAgent ua = (pInfo == null)
- ? null
+ FOUserAgent ua = (pInfo == null)
+ ? null
: (pInfo.getFO() == null ? null : pInfo.getFO().getUserAgent());
return ColorProperty.getInstance(ua, "system-color(" + args[0] + ")");
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java b/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
index ed4f69041..993768c81 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionAttachment.java
@@ -35,5 +35,5 @@ public interface ExtensionAttachment {
* @return the category URI
*/
String getCategory();
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
index fc61167b2..56521b7e8 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -33,12 +33,12 @@ import org.apache.fop.fo.extensions.destination.Destination;
* Element mapping for FOP's proprietary extension to XSL-FO.
*/
public class ExtensionElementMapping extends ElementMapping {
-
+
/** The FOP extension namespace URI */
public static final String URI = "http://xmlgraphics.apache.org/fop/extensions";
private static final Set propertyAttributes = new java.util.HashSet();
-
+
static {
//These are FOP's standard extension properties (fox:*)
propertyAttributes.add("block-progression-unit");
@@ -46,7 +46,7 @@ public class ExtensionElementMapping extends ElementMapping {
propertyAttributes.add("orphan-content-limit");
propertyAttributes.add("internal-destination");
}
-
+
/**
* Constructor.
*/
@@ -66,7 +66,7 @@ public class ExtensionElementMapping extends ElementMapping {
foObjs.put("external-document", new ExternalDocumentMaker());
}
}
-
+
static class DestinationMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new Destination(parent);
@@ -83,7 +83,7 @@ public class ExtensionElementMapping extends ElementMapping {
public String getStandardPrefix() {
return "fox";
}
-
+
/** {@inheritDoc} */
public boolean isAttributeProperty(QName attributeName) {
if (!URI.equals(attributeName.getNamespaceURI())) {
@@ -91,5 +91,5 @@ public class ExtensionElementMapping extends ElementMapping {
}
return propertyAttributes.contains(attributeName.getLocalName());
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
index f22c6fbbc..da732f421 100644
--- a/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
+++ b/src/java/org/apache/fop/fo/extensions/ExtensionObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public abstract class ExtensionObj extends FObj {
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList)
throws FOPException
{
@@ -53,9 +53,9 @@ public abstract class ExtensionObj extends FObj {
}
/**
- * Create a default property list for this element.
+ * Create a default property list for this element.
*/
- protected PropertyList createPropertyList(PropertyList parent,
+ protected PropertyList createPropertyList(PropertyList parent,
FOEventHandler foEventHandler) throws FOPException {
return null;
}
diff --git a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
index b8707726f..bea6f6f61 100644
--- a/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
+++ b/src/java/org/apache/fop/fo/extensions/ExternalDocument.java
@@ -5,9 +5,9 @@
* 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.
@@ -76,7 +76,7 @@ public class ExternalDocument extends AbstractPageSequence implements GraphicsPr
textAlign = pList.get(PR_TEXT_ALIGN).getEnum();
width = pList.get(PR_WIDTH).getLength();
src = pList.get(PR_SRC).getString();
-
+
if (this.src == null || this.src.length() == 0) {
missingPropertyError("src");
}
diff --git a/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
index fb1810db1..e5ab93c35 100644
--- a/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/OldExtensionElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.fop.fo.UnknownXMLObj;
* Element mapping for the old FOP extension namespace.
*/
public class OldExtensionElementMapping extends ElementMapping {
-
+
/** The old FOP extension namespace URI (FOP 0.20.5 and earlier) */
public static final String URI = "http://xml.apache.org/fop/extensions";
diff --git a/src/java/org/apache/fop/fo/extensions/destination/Destination.java b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
index e3a2bbac4..98114bb23 100644
--- a/src/java/org/apache/fop/fo/extensions/destination/Destination.java
+++ b/src/java/org/apache/fop/fo/extensions/destination/Destination.java
@@ -5,9 +5,9 @@
* 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.
@@ -50,14 +50,14 @@ public class Destination extends FONode {
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList) throws FOPException {
internalDestination = attlist.getValue("internal-destination");
if (internalDestination == null || internalDestination.length() == 0) {
missingPropertyError("internal-destination");
}
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
index a39562877..2cc451b64 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/BatikExtensionElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,10 +32,10 @@ import org.w3c.dom.DOMImplementation;
* of the http://xml.apache.org/batik/ext namespace.
*/
public class BatikExtensionElementMapping extends ElementMapping {
-
+
/** Namespace URI for Batik extension elements */
public static final String URI = "http://xml.apache.org/batik/ext";
-
+
private boolean batikAvail = true;
/** Main constructor. */
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
index 7711130b1..a40b80190 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -65,14 +65,14 @@ public class SVGElement extends SVGObj {
* {@inheritDoc}
*/
public ContentHandlerFactory getContentHandlerFactory() {
- return new DOMBuilderContentHandlerFactory(getNamespaceURI(),
+ return new DOMBuilderContentHandlerFactory(getNamespaceURI(),
SVGDOMImplementation.getDOMImplementation());
}
-
+
/**
* {@inheritDoc}
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList) throws FOPException {
super.processNode(elementName, locator, attlist, propertyList);
init();
@@ -91,11 +91,11 @@ public class SVGElement extends SVGObj {
/* if width and height are zero, get the bounds of the content. */
try {
- URL baseURL = new URL(getUserAgent().getBaseURL() == null
- ? new java.io.File("").toURI().toURL().toExternalForm()
+ URL baseURL = new URL(getUserAgent().getBaseURL() == null
+ ? new java.io.File("").toURI().toURL().toExternalForm()
: getUserAgent().getBaseURL());
if (baseURL != null) {
- SVGOMDocument svgdoc = (SVGOMDocument)doc;
+ SVGOMDocument svgdoc = (SVGOMDocument)doc;
svgdoc.setURLObject(baseURL);
//The following line should not be called to leave FOP compatible to Batik 1.6.
//svgdoc.setDocumentURI(baseURL.toString());
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
index 586fd2d92..167baf723 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -37,13 +37,13 @@ import org.w3c.dom.DOMImplementation;
* that create the SVG Document.
*/
public class SVGElementMapping extends ElementMapping {
-
+
/** the SVG namespace */
public static final String URI = SVGDOMImplementation.SVG_NAMESPACE_URI;
-
+
/** logging instance */
protected Log log = LogFactory.getLog(SVGElementMapping.class);
-
+
private boolean batikAvailable = true;
/** Main constructor. */
diff --git a/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java b/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
index 93193aac4..b23e0f6c6 100644
--- a/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
+++ b/src/java/org/apache/fop/fo/extensions/svg/SVGObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.XMLObj;
* This aids in the construction of the SVG Document.
*/
public class SVGObj extends XMLObj {
-
+
/**
* Constructs an SVG object (called by Maker).
*
@@ -46,6 +46,6 @@ public class SVGObj extends XMLObj {
public String getNormalNamespacePrefix() {
return "svg";
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java b/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
index 0fff78623..f4b770bbe 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/AbstractMetadataElement.java
@@ -32,7 +32,7 @@ import org.apache.xmlgraphics.xmp.Metadata;
public abstract class AbstractMetadataElement extends FONode implements ObjectBuiltListener {
private XMPMetadata attachment;
-
+
/**
* Main constructor.
* @param parent the parent formatting object
@@ -40,14 +40,14 @@ public abstract class AbstractMetadataElement extends FONode implements ObjectBu
public AbstractMetadataElement(FONode parent) {
super(parent);
}
-
+
/**
* {@inheritDoc}
*/
public ContentHandlerFactory getContentHandlerFactory() {
return new XMPContentHandlerFactory();
}
-
+
/** {@inheritDoc} */
public ExtensionAttachment getExtensionAttachment() {
if (parent instanceof FObj) {
@@ -65,5 +65,5 @@ public abstract class AbstractMetadataElement extends FONode implements ObjectBu
attachment.setMetadata((Metadata)obj);
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java b/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
index 6a67575c5..cf1c40c4a 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/RDFElement.java
@@ -34,7 +34,7 @@ public class RDFElement extends AbstractMetadataElement {
public RDFElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "RDF";
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java b/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
index e2aa1ba95..ff84ee11f 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/RDFElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.w3c.dom.DOMImplementation;
* Setup the element mapping for XMP metadata.
*/
public class RDFElementMapping extends ElementMapping {
-
+
/** Main constructor. */
public RDFElementMapping() {
namespaceURI = XMPConstants.RDF_NAMESPACE;
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
index 5c30801f2..02a74b86d 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPContentHandlerFactory.java
@@ -30,7 +30,7 @@ import org.xml.sax.SAXException;
*/
public class XMPContentHandlerFactory implements ContentHandlerFactory {
- private static final String[] NAMESPACES = new String[]
+ private static final String[] NAMESPACES = new String[]
{XMPConstants.XMP_NAMESPACE, XMPConstants.RDF_NAMESPACE};
/** {@inheritDoc} */
@@ -49,7 +49,7 @@ public class XMPContentHandlerFactory implements ContentHandlerFactory {
private class FOPXMPHandler extends XMPHandler implements ObjectSource {
private ObjectBuiltListener obListener;
-
+
public Object getObject() {
return getMetadata();
}
@@ -58,14 +58,14 @@ public class XMPContentHandlerFactory implements ContentHandlerFactory {
public void setObjectBuiltListener(ObjectBuiltListener listener) {
this.obListener = listener;
}
-
+
/** {@inheritDoc} */
public void endDocument() throws SAXException {
if (obListener != null) {
obListener.notifyObjectBuilt(getObject());
}
}
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
index dd250f8b4..b2b3570f2 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.w3c.dom.DOMImplementation;
* Setup the element mapping for XMP metadata.
*/
public class XMPElementMapping extends ElementMapping {
-
+
/** Main constructor. */
public XMPElementMapping() {
namespaceURI = XMPConstants.XMP_NAMESPACE;
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
index 2d3058d3f..f99ccd2aa 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetaElement.java
@@ -34,7 +34,7 @@ public class XMPMetaElement extends AbstractMetadataElement {
public XMPMetaElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "xmpmeta";
diff --git a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
index bdfd1fc29..224741294 100644
--- a/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
+++ b/src/java/org/apache/fop/fo/extensions/xmp/XMPMetadata.java
@@ -35,7 +35,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
/** The category URI for this extension attachment. */
public static final String CATEGORY = XMPConstants.XMP_NAMESPACE;
-
+
private Metadata meta;
private boolean readOnly = true;
@@ -45,7 +45,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public XMPMetadata() {
//nop
}
-
+
/**
* Default constructor.
* @param metadata the XMP metadata
@@ -53,12 +53,12 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public XMPMetadata(Metadata metadata) {
this.meta = metadata;
}
-
+
/** @return the XMP metadata */
public Metadata getMetadata() {
return this.meta;
}
-
+
/**
* Sets the XMP metadata.
* @param metadata the XMP metadata
@@ -66,7 +66,7 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public void setMetadata(Metadata metadata) {
this.meta = metadata;
}
-
+
/** @return true if the XMP metadata is marked read-only. */
public boolean isReadOnly() {
return readOnly;
@@ -84,10 +84,10 @@ public class XMPMetadata implements ExtensionAttachment, Serializable, XMLizable
public String getCategory() {
return CATEGORY;
}
-
+
/** {@inheritDoc} */
public void toSAX(ContentHandler handler) throws SAXException {
getMetadata().toSAX(handler);
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
index 19cea1510..d72682282 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractGraphics.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
index 092358891..b0e93e9c6 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractListItemPart.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public abstract class AbstractListItemPart extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public AbstractListItemPart(FONode parent) {
@@ -62,7 +62,7 @@ public abstract class AbstractListItemPart extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
diff --git a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
index 8849d4d1c..5f420efb8 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractPageNumberCitation.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,12 +38,12 @@ import org.apache.fop.fo.properties.SpaceProperty;
/**
* Common base class for the
- * fo:page-number-citation
and
+ * fo:page-number-citation
and
*
* fo:page-number-citation-last
objects.
*/
public abstract class AbstractPageNumberCitation extends FObj {
-
+
// The value of properties relevant for fo:page-number-citation(-last).
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonFont commonFont;
@@ -73,12 +73,12 @@ public abstract class AbstractPageNumberCitation extends FObj {
// private int wrapOption;
// End of property values
- // Properties which are not explicitely listed but are still applicable
+ // Properties which are not explicitely listed but are still applicable
private Color color;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public AbstractPageNumberCitation(FONode parent) {
@@ -99,7 +99,7 @@ public abstract class AbstractPageNumberCitation extends FObj {
refId = pList.get(PR_REF_ID).getString();
textDecoration = pList.getTextDecorationProps();
// textShadow = pList.get(PR_TEXT_SHADOW);
-
+
// implicit properties
color = pList.get(Constants.PR_COLOR).getColor(getUserAgent());
}
@@ -116,7 +116,7 @@ public abstract class AbstractPageNumberCitation extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -135,29 +135,29 @@ public abstract class AbstractPageNumberCitation extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
-
+
/** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
@@ -167,10 +167,10 @@ public abstract class AbstractPageNumberCitation extends FObj {
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** @return the "ref-id" property. */
public String getRefId() {
return refId;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
index c88147350..ebba1fda5 100644
--- a/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
+++ b/src/java/org/apache/fop/fo/flow/AbstractRetrieveMarker.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java
index 82d0134bd..ee3171188 100644
--- a/src/java/org/apache/fop/fo/flow/BasicLink.java
+++ b/src/java/org/apache/fop/fo/flow/BasicLink.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
* fo:basic-link
object.
*
* This class contains the logic to determine the link represented by this FO,
- * and whether that link is external (uses a URI) or internal (an id
+ * and whether that link is external (uses a URI) or internal (an id
* reference).
*/
public class BasicLink extends Inline {
@@ -55,7 +55,7 @@ public class BasicLink extends Inline {
/**
* Construct a BasicLink instance with the given {@link FONode}
* as its parent.
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public BasicLink(FONode parent) {
@@ -74,8 +74,8 @@ public class BasicLink extends Inline {
// targetPresentationContext = pList.get(PR_TARGET_PRESENTATION_CONTEXT);
// targetStylesheet = pList.get(PR_TARGET_STYLESHEET);
- // per spec, internal takes precedence if both specified
- if (internalDestination.length() > 0) {
+ // per spec, internal takes precedence if both specified
+ if (internalDestination.length() > 0) {
externalDestination = null;
} else if (externalDestination.length() == 0) {
// slightly stronger than spec "should be specified"
@@ -96,7 +96,7 @@ public class BasicLink extends Inline {
}
/** {@inheritDoc} */
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -162,7 +162,7 @@ public class BasicLink extends Inline {
public String getLocalName() {
return "basic-link";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_BASIC_LINK}
diff --git a/src/java/org/apache/fop/fo/flow/BidiOverride.java b/src/java/org/apache/fop/fo/flow/BidiOverride.java
index 492e6c4ba..6e4a74379 100644
--- a/src/java/org/apache/fop/fo/flow/BidiOverride.java
+++ b/src/java/org/apache/fop/fo/flow/BidiOverride.java
@@ -5,9 +5,9 @@
* 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.
@@ -54,12 +54,12 @@ public class BidiOverride extends FObjMixed {
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*/
public BidiOverride(FONode parent) {
super(parent);
-
+
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
@@ -94,15 +94,15 @@ public class BidiOverride extends FObjMixed {
*
XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
*
Additionally: "An fo:bidi-override that is a descendant of an fo:leader
* or of the fo:inline child of an fo:footnote may not have block-level
- * children, unless it has a nearer ancestor that is an
+ * children, unless it has a nearer ancestor that is an
* fo:inline-container."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (!isBlockOrInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java
index 40175ce49..d1df9c21d 100644
--- a/src/java/org/apache/fop/fo/flow/Block.java
+++ b/src/java/org/apache/fop/fo/flow/Block.java
@@ -5,9 +5,9 @@
* 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.
@@ -86,10 +86,10 @@ public class Block extends FObjMixed {
// private Length textAltitude;
// private int visibility;
// End of property values
-
+
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*
*/
@@ -254,22 +254,22 @@ public class Block extends FObjMixed {
*
XSL Content Model: marker* initial-property-set? (#PCDATA|%inline;|%block;)*
*
Additionally: "An fo:bidi-override that is a descendant of an fo:leader
* or of the fo:inline child of an fo:footnote may not have block-level
- * children, unless it has a nearer ancestor that is an
+ * children, unless it has a nearer ancestor that is an
* fo:inline-container."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
if (blockOrInlineItemFound || initialPropertySetFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"initial-property-set? (#PCDATA|%inline;|%block;)");
}
} else if ("initial-property-set".equals(localName)) {
if (initialPropertySetFound) {
tooManyNodesError(loc, "fo:initial-property-set");
} else if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:initial-property-set",
+ nodesOutOfOrderError(loc, "fo:initial-property-set",
"(#PCDATA|%inline;|%block;)");
} else {
initialPropertySetFound = true;
@@ -286,17 +286,17 @@ public class Block extends FObjMixed {
public int getLinefeedTreatment() {
return linefeedTreatment;
}
-
+
/** @return the "white-space-treatment" property */
public int getWhitespaceTreatment() {
return whiteSpaceTreatment;
}
-
+
/** @return the "white-space-collapse" property */
public int getWhitespaceCollapse() {
return whiteSpaceCollapse;
}
-
+
/** @return the {@link CommonRelativePosition} */
public CommonRelativePosition getCommonRelativePosition() {
return this.commonRelativePosition;
@@ -334,5 +334,5 @@ public class Block extends FObjMixed {
public int getNameId() {
return FO_BLOCK;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java
index 431dae954..25b3f2a2a 100644
--- a/src/java/org/apache/fop/fo/flow/BlockContainer.java
+++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java
@@ -5,9 +5,9 @@
* 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.
@@ -67,7 +67,7 @@ public class BlockContainer extends FObj {
/**
* Creates a new BlockContainer instance as a child of
* the given {@link FONode}.
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public BlockContainer(FONode parent) {
@@ -104,13 +104,13 @@ public class BlockContainer extends FObj {
/**
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
- *
BUT: "In addition an fo:block-container that does not generate an
- * absolutely positioned area may have a sequence of zero or more
+ *
BUT: "In addition an fo:block-container that does not generate an
+ * absolutely positioned area may have a sequence of zero or more
* fo:markers as its initial children."
* The latter refers to block-containers with absolute-position="absolute"
* or absolute-position="fixed".
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
@@ -148,7 +148,7 @@ public class BlockContainer extends FObj {
public CommonAbsolutePosition getCommonAbsolutePosition() {
return commonAbsolutePosition;
}
-
+
/** @return the {@link CommonMarginBlock} */
public CommonMarginBlock getCommonMarginBlock() {
return commonMarginBlock;
@@ -170,7 +170,7 @@ public class BlockContainer extends FObj {
public int getDisplayAlign() {
return displayAlign;
}
-
+
/** @return the "break-after" property. */
public int getBreakAfter() {
return breakAfter;
@@ -220,12 +220,12 @@ public class BlockContainer extends FObj {
public int getWritingMode() {
return writingMode;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "block-container";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_BLOCK_CONTAINER}
diff --git a/src/java/org/apache/fop/fo/flow/Character.java b/src/java/org/apache/fop/fo/flow/Character.java
index 7fd98b0ef..f76b3225d 100644
--- a/src/java/org/apache/fop/fo/flow/Character.java
+++ b/src/java/org/apache/fop/fo/flow/Character.java
@@ -5,9 +5,9 @@
* 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.
@@ -120,7 +120,7 @@ public class Character extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -161,25 +161,25 @@ public class Character extends FObj {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "letter-spacing" property */
public Property getLetterSpacing() {
- return letterSpacing;
+ return letterSpacing;
}
/** @return the "line-height" property */
@@ -189,29 +189,29 @@ public class Character extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
-
+
/** @return the "word-spacing" property */
public Property getWordSpacing() {
- return wordSpacing;
+ return wordSpacing;
}
/** @return the "keep-with-next" property */
public KeepProperty getKeepWithNext() {
return keepWithNext;
}
-
+
/** @return the "keep-with-previous" property */
public KeepProperty getKeepWithPrevious() {
return keepWithPrevious;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "character";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_CHARACTER}
@@ -219,16 +219,16 @@ public class Character extends FObj {
public int getNameId() {
return FO_CHARACTER;
}
-
+
private class FOCharIterator extends CharIterator {
private boolean bFirst = true;
private Character foChar;
-
+
FOCharIterator(Character foChar) {
this.foChar = foChar;
}
-
+
public boolean hasNext() {
return bFirst;
}
diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
index bfe54cbd9..fa952000d 100644
--- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
+++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ import org.apache.fop.fo.properties.FixedLength;
* inline area that can be added to the area tree.
*/
public class ExternalGraphic extends AbstractGraphics {
-
+
// The value of properties relevant for fo:external-graphic.
// All but one of the e-g properties are kept in AbstractGraphics
private String src;
@@ -56,7 +56,7 @@ public class ExternalGraphic extends AbstractGraphics {
private int intrinsicWidth;
private int intrinsicHeight;
private Length intrinsicAlignmentAdjust;
-
+
/**
* Create a new ExternalGraphic node that is a child
* of the given {@link FONode}.
@@ -71,7 +71,7 @@ public class ExternalGraphic extends AbstractGraphics {
public void bind(PropertyList pList) throws FOPException {
super.bind(pList);
src = pList.get(PR_SRC).getString();
-
+
//Additional processing: obtain the image's intrinsic size and baseline information
url = URISpecification.getURL(src);
FOUserAgent userAgent = getUserAgent();
@@ -113,7 +113,7 @@ public class ExternalGraphic extends AbstractGraphics {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java
index 90bc423fd..815b30393 100644
--- a/src/java/org/apache/fop/fo/flow/Float.java
+++ b/src/java/org/apache/fop/fo/flow/Float.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,15 +39,15 @@ public class Float extends FObj {
// End of property values
static boolean notImplementedWarningGiven = false;
-
+
/**
* Base constructor
- *
+ *
* @param parent the parent {@link FONode}
*/
public Float(FONode parent) {
super(parent);
-
+
if (!notImplementedWarningGiven) {
getFOValidationEventProducer().unimplementedFeature(this, getName(),
getName(), getLocator());
@@ -64,7 +64,7 @@ public class Float extends FObj {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
@@ -84,7 +84,7 @@ public class Float extends FObj {
public String getLocalName() {
return "float";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FLOAT}
diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java
index 5b13b502c..e73701c3b 100644
--- a/src/java/org/apache/fop/fo/flow/Footnote.java
+++ b/src/java/org/apache/fop/fo/flow/Footnote.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,7 +42,7 @@ public class Footnote extends FObj {
/**
* Create a Footnote instance that is a child of the
* given {@link FONode}
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Footnote(FONode parent) {
@@ -53,7 +53,7 @@ public class Footnote extends FObj {
public void bind(PropertyList pList) throws FOPException {
// No active properties -> do nothing.
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
getFOEventHandler().startFootnote(this);
@@ -62,7 +62,7 @@ public class Footnote extends FObj {
/**
* Make sure content model satisfied, if so then tell the
* {@link org.apache.fop.fo.FOEventHandler} that we are at the end of the footnote.
- *
+ *
* {@inheritDoc}
*/
protected void endOfNode() throws FOPException {
@@ -78,11 +78,11 @@ public class Footnote extends FObj {
*
XSL Content Model: (inline,footnote-body)
* @todo implement additional constraint: A fo:footnote is not permitted
* to have a fo:float, fo:footnote, or fo:marker as a descendant.
- * @todo implement additional constraint: A fo:footnote is not
- * permitted to have as a descendant a fo:block-container that
+ * @todo implement additional constraint: A fo:footnote is not
+ * permitted to have as a descendant a fo:block-container that
* generates an absolutely positioned area.
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("inline")) {
@@ -94,7 +94,7 @@ public class Footnote extends FObj {
nodesOutOfOrderError(loc, "fo:inline", "fo:footnote-body");
} else if (footnoteBody != null) {
tooManyNodesError(loc, "fo:footnote-body");
- }
+ }
} else {
invalidChildError(loc, nsURI, localName);
}
@@ -112,7 +112,7 @@ public class Footnote extends FObj {
/**
* Public accessor for inline FO
- *
+ *
* @return the {@link Inline} child
*/
public Inline getFootnoteCitation() {
@@ -121,7 +121,7 @@ public class Footnote extends FObj {
/**
* Public accessor for footnote-body FO
- *
+ *
* @return the {@link FootnoteBody} child
*/
public FootnoteBody getFootnoteBody() {
@@ -132,7 +132,7 @@ public class Footnote extends FObj {
public String getLocalName() {
return "footnote";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FOOTNOTE}
diff --git a/src/java/org/apache/fop/fo/flow/FootnoteBody.java b/src/java/org/apache/fop/fo/flow/FootnoteBody.java
index 711d56c60..eb26a2009 100644
--- a/src/java/org/apache/fop/fo/flow/FootnoteBody.java
+++ b/src/java/org/apache/fop/fo/flow/FootnoteBody.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,7 +39,7 @@ public class FootnoteBody extends FObj {
/**
* Base constructor
- *
+ *
* @param parent FONode that is the parent of this object
*/
public FootnoteBody(FONode parent) {
@@ -57,7 +57,7 @@ public class FootnoteBody extends FObj {
/**
* Make sure the content model is satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at the
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at the
* end of the footnote-body.
* {@inheritDoc}
*/
@@ -72,7 +72,7 @@ public class FootnoteBody extends FObj {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
@@ -85,7 +85,7 @@ public class FootnoteBody extends FObj {
public String getLocalName() {
return "footnote-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FOOTNOTE_BODY}
diff --git a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
index a7f62535f..0df7379f2 100644
--- a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
+++ b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java
@@ -5,9 +5,9 @@
* 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.
@@ -53,7 +53,7 @@ public class InitialPropertySet extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public InitialPropertySet(FONode parent) {
@@ -72,7 +72,7 @@ public class InitialPropertySet extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -88,7 +88,7 @@ public class InitialPropertySet extends FObj {
public String getLocalName() {
return "initial-property-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INITIAL_PROPERTY_SET}
diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java
index a770b0f06..dae7d306b 100644
--- a/src/java/org/apache/fop/fo/flow/Inline.java
+++ b/src/java/org/apache/fop/fo/flow/Inline.java
@@ -5,9 +5,9 @@
* 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.
@@ -52,7 +52,7 @@ public class Inline extends InlineLevel {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Inline(FONode parent) {
@@ -71,7 +71,7 @@ public class Inline extends InlineLevel {
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
-
+
/* Check to see if this node can have block-level children.
* See validateChildNode() below.
*/
@@ -106,12 +106,12 @@ public class Inline extends InlineLevel {
* or fo:footnote may not have block-level children, unless it has a
* nearer ancestor that is an fo:inline-container." (paraphrased)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -128,27 +128,27 @@ public class Inline extends InlineLevel {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "inline";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INLINE}
diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java
index c26730b3a..d2422a24b 100644
--- a/src/java/org/apache/fop/fo/flow/InlineContainer.java
+++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,7 +39,7 @@ import org.apache.fop.fo.properties.SpaceProperty;
* fo:inline-container
object.
*/
public class InlineContainer extends FObj {
-
+
// The value of properties relevant for fo:inline-container.
private Length alignmentAdjust;
private int alignmentBaseline;
@@ -69,7 +69,7 @@ public class InlineContainer extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public InlineContainer(FONode parent) {
@@ -99,7 +99,7 @@ public class InlineContainer extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -125,27 +125,27 @@ public class InlineContainer extends FObj {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "block-progression-dimension" property */
public LengthRangeProperty getBlockProgressionDimension() {
return blockProgressionDimension;
}
-
+
/** @return the "clip" property */
public int getClip() {
return clip;
}
-
+
/**@return Returns the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return this.commonBorderPaddingBackground;
@@ -160,17 +160,17 @@ public class InlineContainer extends FObj {
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "keep-together" property */
public KeepProperty getKeepTogether() {
return keepTogether;
}
-
+
/** @return the "inline-progression-dimension" property */
public LengthRangeProperty getInlineProgressionDimension() {
return inlineProgressionDimension;
}
-
+
/** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
@@ -180,22 +180,22 @@ public class InlineContainer extends FObj {
public int getOverflow() {
return overflow;
}
-
+
/** @return the "reference-orientation" property */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
}
-
+
/** @return the "writing-mode" property */
public int getWritingMode() {
return writingMode;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "inline-container";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INLINE_CONTAINER}
@@ -203,5 +203,5 @@ public class InlineContainer extends FObj {
public int getNameId() {
return FO_INLINE_CONTAINER;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/InlineLevel.java b/src/java/org/apache/fop/fo/flow/InlineLevel.java
index 92af98d3c..5410e1ca7 100644
--- a/src/java/org/apache/fop/fo/flow/InlineLevel.java
+++ b/src/java/org/apache/fop/fo/flow/InlineLevel.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ import org.apache.fop.fo.properties.SpaceProperty;
* formatting objects.
*/
public abstract class InlineLevel extends FObjMixed {
-
+
// The value of properties relevant for inline-level FOs.
private CommonBorderPaddingBackground commonBorderPaddingBackground;
private CommonMarginInline commonMarginInline;
@@ -49,7 +49,7 @@ public abstract class InlineLevel extends FObjMixed {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
protected InlineLevel(FONode parent) {
@@ -76,7 +76,7 @@ public abstract class InlineLevel extends FObjMixed {
/** @return the {@link CommonBorderPaddingBackground} */
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
return commonBorderPaddingBackground;
- }
+ }
/** @return the {@link CommonFont} */
public CommonFont getCommonFont() {
@@ -92,15 +92,15 @@ public abstract class InlineLevel extends FObjMixed {
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** @return the "keep-with-next" property */
public KeepProperty getKeepWithNext() {
return keepWithNext;
}
-
+
/** @return the "keep-with-previous" property */
public KeepProperty getKeepWithPrevious() {
return keepWithPrevious;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
index 3583087d4..fe478770e 100644
--- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
+++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,7 +38,7 @@ import org.apache.fop.fo.XMLObj;
* This is an atomic inline object that contains XML data.
*/
public class InstreamForeignObject extends AbstractGraphics {
-
+
// The value of properties relevant for fo:instream-foreign-object.
// All property values contained in AbstractGraphics
// End of property values
@@ -48,9 +48,9 @@ public class InstreamForeignObject extends AbstractGraphics {
private boolean instrisicSizeDetermined;
private Length intrinsicAlignmentAdjust;
-
+
/**
- * Constructs an instream-foreign-object object
+ * Constructs an instream-foreign-object object
* (called by {@link org.apache.fop.fo.ElementMapping.Maker}).
*
* @param parent the parent {@link FONode}
@@ -61,7 +61,7 @@ public class InstreamForeignObject extends AbstractGraphics {
/**
* Make sure content model satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at
* the end of the instream-foreign-object.
* {@inheritDoc}
*/
@@ -76,7 +76,7 @@ public class InstreamForeignObject extends AbstractGraphics {
* {@inheritDoc}
*
XSL Content Model: one (1) non-XSL namespace child
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -89,7 +89,7 @@ public class InstreamForeignObject extends AbstractGraphics {
public String getLocalName() {
return "instream-foreign-object";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_INSTREAM_FOREIGN_OBJECT}
@@ -139,7 +139,7 @@ public class InstreamForeignObject extends AbstractGraphics {
prepareIntrinsicSize();
return intrinsicAlignmentAdjust;
}
-
+
/** {@inheritDoc} */
protected void addChildNode(FONode child) throws FOPException {
super.addChildNode(child);
@@ -149,5 +149,5 @@ public class InstreamForeignObject extends AbstractGraphics {
public XMLObj getChildXMLObj() {
return (XMLObj) firstChild;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java
index b73534d87..d72ed1e63 100644
--- a/src/java/org/apache/fop/fo/flow/Leader.java
+++ b/src/java/org/apache/fop/fo/flow/Leader.java
@@ -5,9 +5,9 @@
* 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.
@@ -55,7 +55,7 @@ public class Leader extends InlineLevel {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Leader(FONode parent) {
@@ -130,22 +130,22 @@ public class Leader extends InlineLevel {
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "leader";
diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java
index 8c7777e6a..dfadc9c02 100644
--- a/src/java/org/apache/fop/fo/flow/ListBlock.java
+++ b/src/java/org/apache/fop/fo/flow/ListBlock.java
@@ -5,9 +5,9 @@
* 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.
@@ -56,13 +56,13 @@ public class ListBlock extends FObj {
/** extension properties */
private Length widowContentLimit;
private Length orphanContentLimit;
-
+
// used for child node validation
private boolean hasListItem = false;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListBlock(FONode parent) {
@@ -89,10 +89,10 @@ public class ListBlock extends FObj {
super.startOfNode();
getFOEventHandler().startList(this);
}
-
+
/**
* Make sure the content model is satisfied, if so then tell the
- * {@link org.apache.fop.fo.FOEventHandler} that we are at the end
+ * {@link org.apache.fop.fo.FOEventHandler} that we are at the end
* of the list-block.
* {@inheritDoc}
*/
@@ -107,7 +107,7 @@ public class ListBlock extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (list-item)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -171,7 +171,7 @@ public class ListBlock extends FObj {
public String getLocalName() {
return "list-block";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_BLOCK}
diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java
index 398d91558..95760c00b 100644
--- a/src/java/org/apache/fop/fo/flow/ListItem.java
+++ b/src/java/org/apache/fop/fo/flow/ListItem.java
@@ -5,9 +5,9 @@
* 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.
@@ -56,7 +56,7 @@ public class ListItem extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListItem(FONode parent) {
@@ -93,7 +93,7 @@ public class ListItem extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (list-item-label,list-item-body)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -118,12 +118,12 @@ public class ListItem extends FObj {
/**
* {@inheritDoc}
- * @todo see if can/should rely on base class for this
+ * @todo see if can/should rely on base class for this
* (i.e., add to childNodes instead)
*/
public void addChildNode(FONode child) {
int nameId = child.getNameId();
-
+
if (nameId == FO_LIST_ITEM_LABEL) {
label = (ListItemLabel) child;
} else if (nameId == FO_LIST_ITEM_BODY) {
@@ -184,7 +184,7 @@ public class ListItem extends FObj {
public String getLocalName() {
return "list-item";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM}
diff --git a/src/java/org/apache/fop/fo/flow/ListItemBody.java b/src/java/org/apache/fop/fo/flow/ListItemBody.java
index 226cacd12..853beb20b 100644
--- a/src/java/org/apache/fop/fo/flow/ListItemBody.java
+++ b/src/java/org/apache/fop/fo/flow/ListItemBody.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,12 +46,12 @@ public class ListItemBody extends AbstractListItemPart {
super.endOfNode();
getFOEventHandler().endListBody();
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "list-item-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM_BODY}
diff --git a/src/java/org/apache/fop/fo/flow/ListItemLabel.java b/src/java/org/apache/fop/fo/flow/ListItemLabel.java
index 7fbbe77d3..1c757686c 100644
--- a/src/java/org/apache/fop/fo/flow/ListItemLabel.java
+++ b/src/java/org/apache/fop/fo/flow/ListItemLabel.java
@@ -5,9 +5,9 @@
* 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.
@@ -30,7 +30,7 @@ public class ListItemLabel extends AbstractListItemPart {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public ListItemLabel(FONode parent) {
@@ -53,7 +53,7 @@ public class ListItemLabel extends AbstractListItemPart {
public String getLocalName() {
return "list-item-label";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LIST_ITEM_LABEL}
diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java
index ea6721686..1e8b352bb 100644
--- a/src/java/org/apache/fop/fo/flow/Marker.java
+++ b/src/java/org/apache/fop/fo/flow/Marker.java
@@ -5,9 +5,9 @@
* 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.
@@ -49,7 +49,7 @@ public class Marker extends FObjMixed {
/**
* Create a marker fo.
- *
+ *
* @param parent the parent {@link FONode}
*/
public Marker(FONode parent) {
@@ -59,32 +59,32 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
if (findAncestor(FO_FLOW) < 0) {
- invalidChildError(locator, getParent().getName(), FO_URI, getName(),
+ invalidChildError(locator, getParent().getName(), FO_URI, getName(),
"rule.markerDescendantOfFlow");
}
-
+
markerClassName = pList.get(PR_MARKER_CLASS_NAME).getString();
-
+
if (markerClassName == null || markerClassName.equals("")) {
missingPropertyError("marker-class-name");
- }
+ }
}
-
+
/**
- * Retrieve the property list of the given {@link FONode}
+ * Retrieve the property list of the given {@link FONode}
* descendant
- *
+ *
* @param foNode the {@link FONode} whose property list is requested
* @return the {@link MarkerPropertyList} for the given node
*/
protected MarkerPropertyList getPropertyListFor(FONode foNode) {
- return (MarkerPropertyList)
+ return (MarkerPropertyList)
descendantPropertyLists.get(foNode);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() {
- FOTreeBuilderContext builderContext = getBuilderContext();
+ FOTreeBuilderContext builderContext = getBuilderContext();
// Push a new property list maker which will make MarkerPropertyLists.
savePropertyListMaker = builderContext.getPropertyListMaker();
builderContext.setPropertyListMaker(new PropertyListMaker() {
@@ -95,7 +95,7 @@ public class Marker extends FObjMixed {
}
});
}
-
+
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
super.endOfNode();
@@ -112,7 +112,7 @@ public class Marker extends FObjMixed {
* the fo:marker's children."
* @todo implement "additional" constraint, possibly within fo:retrieve-marker
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -120,12 +120,12 @@ public class Marker extends FObjMixed {
}
}
}
-
+
/** {@inheritDoc} */
protected boolean inMarker() {
return true;
}
-
+
/** @return the "marker-class-name" property */
public String getMarkerClassName() {
return markerClassName;
@@ -135,7 +135,7 @@ public class Marker extends FObjMixed {
public String getLocalName() {
return "marker";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MARKER}
@@ -156,15 +156,15 @@ public class Marker extends FObjMixed {
* specified properties/attributes as bundles of name-value-namespace
* strings
*/
- protected class MarkerPropertyList extends PropertyList
+ protected class MarkerPropertyList extends PropertyList
implements Attributes {
-
+
/** the array of attributes **/
private MarkerAttribute[] attribs;
-
+
/**
* Overriding default constructor
- *
+ *
* @param fobj the {@link FObj} to attach
* @param parentPropertyList ignored
*/
@@ -175,34 +175,34 @@ public class Marker extends FObjMixed {
*/
super(fobj, null);
}
-
+
/**
* Override that doesn't convert the attributes to {@link Property}
* instances, but simply stores the attributes for later processing.
- *
+ *
* {@inheritDoc}
*/
- public void addAttributesToList(Attributes attributes)
+ public void addAttributesToList(Attributes attributes)
throws ValidationException {
-
+
this.attribs = new MarkerAttribute[attributes.getLength()];
String name;
String value;
String namespace;
String qname;
-
+
for (int i = attributes.getLength(); --i >= 0;) {
namespace = attributes.getURI(i);
qname = attributes.getQName(i);
name = attributes.getLocalName(i);
value = attributes.getValue(i);
-
- this.attribs[i] =
+
+ this.attribs[i] =
MarkerAttribute.getInstance(namespace, qname, name, value);
}
}
-
+
/** Null implementation; not used by this type of {@link PropertyList} */
public void putExplicit(int propId, Property value) {
//nop
@@ -224,7 +224,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getURI(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -236,7 +236,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getLocalName(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -248,7 +248,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getQName(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -265,7 +265,7 @@ public class Marker extends FObjMixed {
/** {@inheritDoc} */
public String getValue(int index) {
- if (attribs != null
+ if (attribs != null
&& index < attribs.length
&& index >= 0
&& attribs[index] != null) {
@@ -295,7 +295,7 @@ public class Marker extends FObjMixed {
int index = -1;
if (attribs != null && qname != null) {
for (int i = attribs.length; --i >= 0;) {
- if (attribs[i] != null
+ if (attribs[i] != null
&& qname.equals(attribs[i].qname)) {
break;
}
@@ -332,18 +332,18 @@ public class Marker extends FObjMixed {
return null;
}
}
-
+
/** Convenience inner class */
private static final class MarkerAttribute {
-
- private static Map attributeCache =
+
+ private static Map attributeCache =
Collections.synchronizedMap(new java.util.WeakHashMap());
protected String namespace;
protected String qname;
protected String name;
protected String value;
-
+
/**
* Main constructor
* @param namespace the namespace URI
@@ -351,14 +351,14 @@ public class Marker extends FObjMixed {
* @param name the name
* @param value the value
*/
- private MarkerAttribute(String namespace, String qname,
+ private MarkerAttribute(String namespace, String qname,
String name, String value) {
this.namespace = namespace;
this.qname = qname;
this.name = (name == null ? qname : name);
this.value = value;
}
-
+
/**
* Convenience method, reduces the number
* of distinct MarkerAttribute instances
@@ -367,13 +367,13 @@ public class Marker extends FObjMixed {
* @param qname the fully qualified name of the attribute
* @param name the attribute name
* @param value the attribute value
- * @return the single MarkerAttribute instance corresponding to
+ * @return the single MarkerAttribute instance corresponding to
* the name/value-pair
*/
private static MarkerAttribute getInstance(
String namespace, String qname,
String name, String value) {
- MarkerAttribute newInstance =
+ MarkerAttribute newInstance =
new MarkerAttribute(namespace, qname, name, value);
if (attributeCache.containsKey(newInstance)) {
return (MarkerAttribute) attributeCache.get(newInstance);
@@ -382,7 +382,7 @@ public class Marker extends FObjMixed {
return newInstance;
}
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (o instanceof MarkerAttribute) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java
index 284d82d63..b2d630ba7 100644
--- a/src/java/org/apache/fop/fo/flow/MultiCase.java
+++ b/src/java/org/apache/fop/fo/flow/MultiCase.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,7 +42,7 @@ public class MultiCase extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiCase(FONode parent) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java
index ef015a9c1..091934203 100644
--- a/src/java/org/apache/fop/fo/flow/MultiProperties.java
+++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public class MultiProperties extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiProperties(FONode parent) {
@@ -69,7 +69,7 @@ public class MultiProperties extends FObj {
* {@inheritDoc}
*
XSL Content Model: (multi-property-set+, wrapper)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("multi-property-set")) {
@@ -89,7 +89,7 @@ public class MultiProperties extends FObj {
}
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "multi-properties";
diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
index 0736976b4..96e73ec97 100644
--- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
+++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java
@@ -5,9 +5,9 @@
* 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.
@@ -41,7 +41,7 @@ public class MultiPropertySet extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiPropertySet(FONode parent) {
@@ -64,7 +64,7 @@ public class MultiPropertySet extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -75,7 +75,7 @@ public class MultiPropertySet extends FObj {
public String getLocalName() {
return "multi-property-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MULTI_PROPERTY_SET}
diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
index 81cb2aff9..1db72159e 100644
--- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java
+++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,7 +43,7 @@ public class MultiSwitch extends FObj {
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiSwitch(FONode parent) {
@@ -74,7 +74,7 @@ public class MultiSwitch extends FObj {
* {@inheritDoc}
*
XSL Content Model: (multi-case+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("multi-case")) {
diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java
index bcb1f806a..aacfda8eb 100644
--- a/src/java/org/apache/fop/fo/flow/MultiToggle.java
+++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,12 +38,12 @@ public class MultiToggle extends FObj {
// private CommonAccessibility commonAccessibility;
// public ToBeImplementedProperty prSwitchTo;
// End of property values
-
+
static boolean notImplementedWarningGiven = false;
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public MultiToggle(FONode parent) {
@@ -66,7 +66,7 @@ public class MultiToggle extends FObj {
* {@inheritDoc}
*
XSL Content Model: (#PCDATA|%inline;|%block;)*
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockOrInlineItem(nsURI, localName)) {
@@ -79,7 +79,7 @@ public class MultiToggle extends FObj {
public String getLocalName() {
return "multi-toggle";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_MULTI_TOGGLE}
diff --git a/src/java/org/apache/fop/fo/flow/PageNumber.java b/src/java/org/apache/fop/fo/flow/PageNumber.java
index 3b91c6b44..dc834d708 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumber.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumber.java
@@ -5,9 +5,9 @@
* 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.
@@ -68,12 +68,12 @@ public class PageNumber extends FObj {
// private int wrapOption;
// End of property values
- // Properties which are not explicitely listed but are still applicable
+ // Properties which are not explicitely listed but are still applicable
private Color color;
-
+
/**
* Base constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public PageNumber(FONode parent) {
@@ -113,7 +113,7 @@ public class PageNumber extends FObj {
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -137,34 +137,34 @@ public class PageNumber extends FObj {
/** @return the "text-decoration" property. */
public CommonTextDecoration getTextDecoration() {
- return textDecoration;
+ return textDecoration;
}
/** @return the "alignment-adjust" property */
public Length getAlignmentAdjust() {
return alignmentAdjust;
}
-
+
/** @return the "alignment-baseline" property */
public int getAlignmentBaseline() {
return alignmentBaseline;
}
-
+
/** @return the "baseline-shift" property */
public Length getBaselineShift() {
return baselineShift;
}
-
+
/** @return the "dominant-baseline" property */
public int getDominantBaseline() {
return dominantBaseline;
}
-
+
/** @return the "line-height" property */
public SpaceProperty getLineHeight() {
return lineHeight;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "page-number";
diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
index b31bc9a11..0ebb6eb3d 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java
@@ -5,9 +5,9 @@
* 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.
@@ -33,7 +33,7 @@ public class PageNumberCitation extends AbstractPageNumberCitation {
/**
* Main constructor
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public PageNumberCitation(FONode parent) {
diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java b/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
index 9e98c06be..6a08568b1 100644
--- a/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
+++ b/src/java/org/apache/fop/fo/flow/PageNumberCitationLast.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,13 +34,13 @@ public class PageNumberCitationLast extends AbstractPageNumberCitation {
/**
* Main constructor
- *
+ *
* @param parent the parent {@link FONode}
*/
public PageNumberCitationLast(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
@@ -57,7 +57,7 @@ public class PageNumberCitationLast extends AbstractPageNumberCitation {
public String getLocalName() {
return "page-number-citation-last";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_PAGE_NUMBER_CITATION_LAST}
diff --git a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
index c696d3d14..0d0331359 100644
--- a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
+++ b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java
@@ -5,9 +5,9 @@
* 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.
@@ -109,5 +109,5 @@ public class RetrieveMarker extends AbstractRetrieveMarker {
*/
public int getNameId() {
return FO_RETRIEVE_MARKER;
- }
+ }
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
index 9d04e308d..c58ecc628 100644
--- a/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
+++ b/src/java/org/apache/fop/fo/flow/RetrieveTableMarker.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java
index 5ed594ecc..74072da87 100644
--- a/src/java/org/apache/fop/fo/flow/Wrapper.java
+++ b/src/java/org/apache/fop/fo/flow/Wrapper.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,20 +31,20 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
* fo:wrapper
object.
- * The fo:wrapper
object serves as a property holder for
+ * The fo:wrapper
object serves as a property holder for
* its child node objects.
*/
public class Wrapper extends FObjMixed {
// The value of properties relevant for fo:wrapper.
// End of property values
-
+
// used for FO validation
private boolean blockOrInlineItemFound = false;
/**
* Create a Wrapper instance that is a child of the
* given {@link FONode}
- *
+ *
* @param parent {@link FONode} that is the parent of this object
*/
public Wrapper(FONode parent) {
@@ -54,16 +54,16 @@ public class Wrapper extends FObjMixed {
/**
* {@inheritDoc}
*
XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
- *
Additionally (unimplemented): "An fo:wrapper that is a child of an
- * fo:multi-properties is only permitted to have children that would
+ *
Additionally (unimplemented): "An fo:wrapper that is a child of an
+ * fo:multi-properties is only permitted to have children that would
* be permitted in place of the fo:multi-properties."
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if ("marker".equals(localName)) {
if (blockOrInlineItemFound) {
- nodesOutOfOrderError(loc, "fo:marker",
+ nodesOutOfOrderError(loc, "fo:marker",
"(#PCDATA|%inline;|%block;)");
}
} else if (isBlockOrInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/flow/table/BorderResolver.java b/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
index 82bdac845..1b856abff 100644
--- a/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
+++ b/src/java/org/apache/fop/fo/flow/table/BorderResolver.java
@@ -5,9 +5,9 @@
* 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.
@@ -29,7 +29,7 @@ interface BorderResolver {
/**
* Receives notification of the end of a row.
- *
+ *
* @param row the row that has just been finished
* @param container the FO element holding the given row
*/
@@ -37,7 +37,7 @@ interface BorderResolver {
/**
* Receives notification of the start of a table-header/footer/body.
- *
+ *
* @param part the part that has started
*/
void startPart(TablePart part);
diff --git a/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java b/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
index ce6e1b802..3fa3eb15b 100644
--- a/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
+++ b/src/java/org/apache/fop/fo/flow/table/BorderSpecification.java
@@ -5,9 +5,9 @@
* 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.
@@ -37,7 +37,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Creates a new border specification.
- *
+ *
* @param borderInfo the border's informations
* @param holder the FO element declaring this border
*/
@@ -56,7 +56,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Returns this border's informations.
- *
+ *
* @return this border's informations
*/
public/*TODO*/ BorderInfo getBorderInfo() {
@@ -65,7 +65,7 @@ public/*TODO*/ class BorderSpecification {
/**
* Returns the FO element declaring this border.
- *
+ *
* @return one of {@link Constants#FO_TABLE}, {@link Constants#FO_TABLE_COLUMN},
* {@link Constants#FO_TABLE_HEADER}, {@link Constants#FO_TABLE_FOOTER},
* {@link Constants#FO_TABLE_BODY}, {@link Constants#FO_TABLE_ROW},
diff --git a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
index 3a887166a..783c2ff8f 100644
--- a/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
+++ b/src/java/org/apache/fop/fo/flow/table/CollapsingBorderResolver.java
@@ -5,9 +5,9 @@
* 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.
@@ -82,7 +82,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Integrates border-before specified on the table and its column.
- *
+ *
* @param row the first row of the table (in the header, or in the body if the
* table has no header)
* @param withNormal
@@ -103,7 +103,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Resolves border-after for the first row, border-before for the second one.
- *
+ *
* @param rowBefore
* @param rowAfter
*/
@@ -129,7 +129,7 @@ class CollapsingBorderResolver implements BorderResolver {
/**
* Integrates border-after specified on the table and its columns.
- *
+ *
* @param row the last row of the footer, or of the last body if the table has no
* footer
* @param withNormal
@@ -149,7 +149,7 @@ class CollapsingBorderResolver implements BorderResolver {
* Integrates either border-before specified on the table and its columns if the
* table has no header, or border-after specified on the cells of the header's
* last row. For the case the grid unit are at the top of a page.
- *
+ *
* @param row
*/
void integrateLeadingBorders(List/*start
to end
as occupied,
* and updates the number of the next available column.
- *
+ *
* @param start start number, inclusive, 1-based
* @param end end number, inclusive
*/
@@ -68,7 +68,7 @@ public class ColumnNumberManager {
/**
* Resets the record of occupied columns, taking into account columns already occupied
* by previous spanning cells, and computes the number of the first free column.
- *
+ *
* @param pendingSpans List<PendingSpan> of possible spans over the next row
*/
void prepareForNextRow(List pendingSpans) {
@@ -95,7 +95,7 @@ public class ColumnNumberManager {
/**
* Checks whether a given column-number is already in use
* for the current row.
- *
+ *
* @param colNr the column-number to check
* @return true if column-number is already occupied
*/
diff --git a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
index 5b253709b..6eb6bab53 100644
--- a/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
+++ b/src/java/org/apache/fop/fo/flow/table/ColumnNumberManagerHolder.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ public interface ColumnNumberManagerHolder {
/**
* Returns the encapsulated ColumnNumberManage instance.
- *
+ *
* @return a {@link ColumnNumberManager} instance
*/
ColumnNumberManager getColumnNumberManager();
diff --git a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
index 389681f1d..5ff01b7fa 100644
--- a/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
+++ b/src/java/org/apache/fop/fo/flow/table/ConditionalBorder.java
@@ -5,9 +5,9 @@
* 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.
@@ -65,7 +65,7 @@ public class ConditionalBorder {
/**
* Creates a new conditional border.
- *
+ *
* @param borderSpecification the border specification to take as a basis
* @param collapsingBorderModel the model that will be used to resolved borders
*/
@@ -83,7 +83,7 @@ public class ConditionalBorder {
/**
* Resolves and updates the relevant parts of this border as well as the given one.
- *
+ *
* @param competitor
* @param withNormal
* @param withLeadingTrailing
@@ -122,7 +122,7 @@ public class ConditionalBorder {
* {@link #integrateSegment(ConditionalBorder, boolean, boolean, boolean)}, this
* method nicely handles the case where the CollapsingBorderModel returns null, by
* keeping the components to their old values.
- *
+ *
* @param competitor
* @param withNormal
* @param withLeadingTrailing
@@ -156,7 +156,7 @@ public class ConditionalBorder {
/**
* Updates this border after taking into account the given segment. The
* CollapsingBorderModel is not expected to return null.
- *
+ *
* @param segment
* @param withNormal
* @param withLeadingTrailing
@@ -181,7 +181,7 @@ public class ConditionalBorder {
/**
* Returns a shallow copy of this border.
- *
+ *
* @return a copy of this border
*/
ConditionalBorder copy() {
@@ -195,7 +195,7 @@ public class ConditionalBorder {
/**
* Returns a default border specification.
- *
+ *
* @param collapsingBorderModel the model that will be used to resolve borders
* @return a border with style 'none' for all of the three components
*/
diff --git a/src/java/org/apache/fop/fo/flow/table/EffRow.java b/src/java/org/apache/fop/fo/flow/table/EffRow.java
index fc8209b01..16d507303 100644
--- a/src/java/org/apache/fop/fo/flow/table/EffRow.java
+++ b/src/java/org/apache/fop/fo/flow/table/EffRow.java
@@ -34,19 +34,19 @@ import org.apache.fop.util.BreakUtil;
* the row as well as some additional values.
*/
public class EffRow {
-
+
/** Indicates that the row is the first in a table-body */
public static final int FIRST_IN_PART = GridUnit.FIRST_IN_PART;
/** Indicates that the row is the last in a table-body */
public static final int LAST_IN_PART = GridUnit.LAST_IN_PART;
-
+
private List gridUnits = new java.util.ArrayList();
private int index;
/** One of HEADER, FOOTER, BODY */
private int bodyType;
private MinOptMax height;
private MinOptMax explicitHeight;
-
+
/**
* Creates a new effective row instance.
* @param index index of the row
@@ -70,45 +70,45 @@ public class EffRow {
public int getIndex() {
return this.index;
}
-
+
/**
- * @return an indicator what type of body this EffRow is in (one of HEADER, FOOTER, BODY
+ * @return an indicator what type of body this EffRow is in (one of HEADER, FOOTER, BODY
* as found on TableRowIterator)
*/
public int getBodyType() {
return this.bodyType;
}
-
+
/** @return the table-row FO for this EffRow, or null if there is no table-row. */
public TableRow getTableRow() {
return getGridUnit(0).getRow();
}
-
+
/**
* Returns the calculated height for this EffRow, including the cells'
* bpds/paddings/borders, and the table's border-separation.
- *
+ *
* @return the row's height
*/
public MinOptMax getHeight() {
return this.height;
}
-
+
/**
* Sets the calculated height for this EffRow, including everything (cells' bpds,
* paddings, borders, and border-separation).
- *
+ *
* @param mom the calculated height
*/
public void setHeight(MinOptMax mom) {
this.height = mom;
}
-
+
/** @return the explicit height of the EffRow (as specified through properties) */
public MinOptMax getExplicitHeight() {
return this.explicitHeight;
}
-
+
/**
* Sets the height for this row that resulted from the explicit height properties specified
* by the user.
@@ -117,12 +117,12 @@ public class EffRow {
public void setExplicitHeight(MinOptMax mom) {
this.explicitHeight = mom;
}
-
+
/** @return the list of GridUnits for this EffRow */
public List getGridUnits() {
return gridUnits;
}
-
+
/**
* Returns the grid unit at a given position.
* @param column index of the grid unit in the row (zero based)
@@ -131,9 +131,9 @@ public class EffRow {
public GridUnit getGridUnit(int column) {
return (GridUnit)gridUnits.get(column);
}
-
+
/**
- * Returns the grid unit at a given position. In contrast to getGridUnit() this
+ * Returns the grid unit at a given position. In contrast to getGridUnit() this
* method returns null if there's no grid unit at the given position. The number of
* grid units for row x can be smaller than the number of grid units for row x-1.
* @param column index of the grid unit in the row (zero based)
@@ -167,7 +167,7 @@ public class EffRow {
/**
* Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element
* of this row, or if any of the cells starting on this row, have keep-with-previous set.
- *
+ *
* @return the strength of the keep-with-previous constraint
*/
public int getKeepWithPreviousStrength() {
@@ -189,7 +189,7 @@ public class EffRow {
/**
* Returns the strength of the keep constraint if the enclosing (if any) fo:table-row element
* of this row, or if any of the cells ending on this row, have keep-with-next set.
- *
+ *
* @return the strength of the keep-with-next constraint
*/
public int getKeepWithNextStrength() {
@@ -224,7 +224,7 @@ public class EffRow {
}
return strength;
}
-
+
/**
* Returns the break class for this row. This is a combination of break-before set on
* the first children of any cells starting on this row.
@@ -233,7 +233,7 @@ public class EffRow {
* belongs to a group of spanned rows (see XSL-FO 1.1, 7.20.2).
*
XSL Content Model: marker* table-caption? table
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
diff --git a/src/java/org/apache/fop/fo/flow/table/TableBody.java b/src/java/org/apache/fop/fo/flow/table/TableBody.java
index b4071e255..0ddfa97e3 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableBody.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableBody.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCaption.java b/src/java/org/apache/fop/fo/flow/table/TableCaption.java
index 80fccb236..bbc9b52bc 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCaption.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCaption.java
@@ -5,9 +5,9 @@
* 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.
@@ -82,7 +82,7 @@ public class TableCaption extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCell.java b/src/java/org/apache/fop/fo/flow/table/TableCell.java
index 21da54128..637ee2a9a 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCell.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCell.java
@@ -5,9 +5,9 @@
* 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.
@@ -108,7 +108,7 @@ public class TableCell extends TableFObj {
/** {@inheritDoc} */
public void finalizeNode() throws FOPException {
-
+
if (!blockItemFound) {
missingChildElementError("marker* (%block;)+", true);
}
@@ -118,9 +118,9 @@ public class TableCell extends TableFObj {
getUserAgent().getEventBroadcaster());
eventProducer.startEndRowUnderTableRowWarning(this, getLocator());
}
-
+
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
diff --git a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
index 1d1a29b35..9b4fe755f 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableCellContainer.java
@@ -5,9 +5,9 @@
* 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.
@@ -94,7 +94,7 @@ public abstract class TableCellContainer extends TableFObj implements ColumnNumb
/**
* Returns the enclosing table-header/footer/body of this container.
- *
+ *
* @return this
for TablePart, or the parent element for TableRow
*/
abstract TablePart getTablePart();
diff --git a/src/java/org/apache/fop/fo/flow/table/TableColumn.java b/src/java/org/apache/fop/fo/flow/table/TableColumn.java
index 025f5a74f..5047822da 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableColumn.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableColumn.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
index 9c4a82dd6..d6abf609e 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableEventProducer.java
@@ -33,7 +33,7 @@ public interface TableEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -83,7 +83,7 @@ public interface TableEventProducer extends EventProducer {
*/
void footerOrderCannotRecover(Object source, String elementName, Locator loc)
throws ValidationException;
-
+
/**
* starts-row/ends-row for fo:table-cells non-applicable for children of an fo:table-row
* @param source the event source
@@ -93,7 +93,7 @@ public interface TableEventProducer extends EventProducer {
void startEndRowUnderTableRowWarning(Object source, Locator loc);
/**
- * Column-number or number of cells in the row overflows the number of fo:table-column
+ * Column-number or number of cells in the row overflows the number of fo:table-column
* specified for the table.
* @param source the event source
* @param loc the location of the error or null
@@ -166,5 +166,5 @@ public interface TableEventProducer extends EventProducer {
void breakIgnoredDueToRowSpanning(Object source, String elementName, boolean breakBefore,
Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFObj.java b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
index f459ecd65..ec508580c 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFObj.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFObj.java
@@ -5,9 +5,9 @@
* 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.
@@ -234,7 +234,7 @@ public abstract class TableFObj extends FObj {
setCollapsedBorders();
}
}
-
+
/**
* Prepares the borders of this element if the collapsing-border model is in use.
* Conflict resolution with parent elements is done where applicable.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableFooter.java b/src/java/org/apache/fop/fo/flow/table/TableFooter.java
index a89a2e431..cfd0136dc 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableFooter.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableFooter.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/table/TableHeader.java b/src/java/org/apache/fop/fo/flow/table/TableHeader.java
index 7f4173754..a0ad40798 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableHeader.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableHeader.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/flow/table/TablePart.java b/src/java/org/apache/fop/fo/flow/table/TablePart.java
index 4d20db8c4..b1db59d91 100644
--- a/src/java/org/apache/fop/fo/flow/table/TablePart.java
+++ b/src/java/org/apache/fop/fo/flow/table/TablePart.java
@@ -5,9 +5,9 @@
* 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.
@@ -79,7 +79,7 @@ public abstract class TablePart extends TableCellContainer {
public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList pList)
throws FOPException {
-
+
super.processNode(elementName, locator, attlist, pList);
if (!inMarker()) {
Table t = getTable();
@@ -94,7 +94,7 @@ public abstract class TablePart extends TableCellContainer {
}
columnNumberManager = new ColumnNumberManager();
}
-
+
}
/** {@inheritDoc} */
diff --git a/src/java/org/apache/fop/fo/flow/table/TableRow.java b/src/java/org/apache/fop/fo/flow/table/TableRow.java
index ac6eafc2f..4d11f8780 100644
--- a/src/java/org/apache/fop/fo/flow/table/TableRow.java
+++ b/src/java/org/apache/fop/fo/flow/table/TableRow.java
@@ -5,9 +5,9 @@
* 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.
@@ -118,7 +118,7 @@ public class TableRow extends TableCellContainer {
columnNumberManager = null;
}
}
-
+
/**
* {@inheritDoc} String, String)
*
XSL Content Model: (table-cell+)
diff --git a/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java b/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
index 23c16d1f2..f005c8fbe 100644
--- a/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
+++ b/src/java/org/apache/fop/fo/flow/table/VariableColRowGroupBuilder.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,7 +43,7 @@ class VariableColRowGroupBuilder extends RowGroupBuilder {
private static interface Event {
/**
* Plays this event
- *
+ *
* @param rowGroupBuilder the delegate builder which will actually create the row
* groups
* @throws ValidationException if a row-spanning cell overflows its parent body
diff --git a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
index f0928a8ca..dce36f95c 100644
--- a/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/AbstractPageSequence.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.fo.PropertyList;
* fox:external-document
extension object.
*/
public abstract class AbstractPageSequence extends FObj {
-
+
// The value of properties relevant for fo:page-sequence.
protected Numeric initialPageNumber;
protected int forcePageCount;
@@ -81,7 +81,7 @@ public abstract class AbstractPageSequence extends FObj {
*/
public void initPageNumber() {
int pageNumberType = 0;
-
+
if (initialPageNumber.getEnum() != 0) {
// auto | auto-odd | auto-even.
startingPageNumber = getRoot().getEndingPageNumberOfPreviousSequence() + 1;
@@ -143,7 +143,7 @@ public abstract class AbstractPageSequence extends FObj {
public Numeric getInitialPageNumber() {
return initialPageNumber;
}
-
+
/**
* Get the value of the reference-orientation
property.
* @return the "reference-orientation" property
diff --git a/src/java/org/apache/fop/fo/pagination/ColorProfile.java b/src/java/org/apache/fop/fo/pagination/ColorProfile.java
index 0af1aa42d..7fac8655e 100644
--- a/src/java/org/apache/fop/fo/pagination/ColorProfile.java
+++ b/src/java/org/apache/fop/fo/pagination/ColorProfile.java
@@ -5,9 +5,9 @@
* 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.
@@ -60,7 +60,7 @@ public class ColorProfile extends FObj {
* {@inheritDoc}
*
XSL 1.0/FOP: EMPTY (no child nodes permitted)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -78,7 +78,7 @@ public class ColorProfile extends FObj {
public String getLocalName() {
return "color-profile";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_COLOR_PROFILE}
@@ -86,26 +86,26 @@ public class ColorProfile extends FObj {
public int getNameId() {
return FO_COLOR_PROFILE;
}
-
- /**
+
+ /**
* Get src attribute
- *
+ *
* @return value of color-profile src attribute
*/
public String getSrc() {
return this.src;
}
-
+
/**
* Get rendering-intent attribute
- *
+ *
* Returned value is one of
* Constants.EN_AUTO
* Constants.EN_PERCEPTUAL
* Constants.EN_RELATIVE_COLOMETRIC
* Constants.EN_SATURATION
* Constants.EN_ABSOLUTE_COLORMETRIC
- *
+ *
* @return Rendering intent attribute
*/
public int getRenderingIntent() {
diff --git a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
index 7c76109f4..eaa8c2491 100644
--- a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
* fo:conditional-page-master-reference
object.
- *
+ *
* This is a reference to a page master with a set of conditions.
* The conditions must be satisfied for the referenced master to
* be used.
@@ -45,7 +45,7 @@ public class ConditionalPageMasterReference extends FObj {
private int oddOrEven;
private int blankOrNotBlank;
// End of property values
-
+
/**
* Create a ConditionalPageMasterReference instance that is a
* child of the given {@link FONode}.
@@ -65,7 +65,7 @@ public class ConditionalPageMasterReference extends FObj {
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -76,12 +76,12 @@ public class ConditionalPageMasterReference extends FObj {
private RepeatablePageMasterAlternatives getConcreteParent() {
return (RepeatablePageMasterAlternatives) parent;
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
invalidChildError(loc, nsURI, localName);
}
@@ -158,7 +158,7 @@ public class ConditionalPageMasterReference extends FObj {
public String getMasterReference() {
return masterReference;
}
-
+
/**
* Get the value for the page-position
property.
* @return the page-position property value
@@ -166,12 +166,12 @@ public class ConditionalPageMasterReference extends FObj {
public int getPagePosition() {
return this.pagePosition;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "conditional-page-master-reference";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_CONDITIONAL_PAGE_MASTER_REFERENCE}
diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java
index eb24cffe0..1385bccc9 100644
--- a/src/java/org/apache/fop/fo/pagination/Declarations.java
+++ b/src/java/org/apache/fop/fo/pagination/Declarations.java
@@ -5,9 +5,9 @@
* 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.
@@ -61,7 +61,7 @@ public class Declarations extends FObj {
*
XSL 1.0: (color-profile)+ (and non-XSL NS nodes)
*
FOP/XSL 1.1: (color-profile)* (and non-XSL NS nodes)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("color-profile")) {
@@ -88,7 +88,7 @@ public class Declarations extends FObj {
cp.getName(), "color-profile-name", locator);
}
} else {
- log.debug("Ignoring element " + node.getName()
+ log.debug("Ignoring element " + node.getName()
+ " inside fo:declarations.");
}
}
@@ -112,7 +112,7 @@ public class Declarations extends FObj {
public String getLocalName() {
return "declarations";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_DECLARATIONS}
@@ -120,13 +120,13 @@ public class Declarations extends FObj {
public int getNameId() {
return FO_DECLARATIONS;
}
-
+
/**
* Return ColorProfile with given name.
- *
- * @param cpName Name of ColorProfile, i.e. the value of the color-profile-name attribute of
+ *
+ * @param cpName Name of ColorProfile, i.e. the value of the color-profile-name attribute of
* the fo:color-profile element
- * @return The org.apache.fop.fo.pagination.ColorProfile object associated with this
+ * @return The org.apache.fop.fo.pagination.ColorProfile object associated with this
* color-profile-name or null
*/
public ColorProfile getColorProfile(String cpName) {
@@ -136,6 +136,6 @@ public class Declarations extends FObj {
}
return profile;
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/Flow.java b/src/java/org/apache/fop/fo/pagination/Flow.java
index d3682fa81..153f06fc1 100644
--- a/src/java/org/apache/fop/fo/pagination/Flow.java
+++ b/src/java/org/apache/fop/fo/pagination/Flow.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ public class Flow extends FObj {
// The value of properties relevant for fo:flow.
private String flowName;
// End of property values
-
+
/** used for FO validation */
private boolean blockItemFound = false;
@@ -53,7 +53,7 @@ public class Flow extends FObj {
super.bind(pList);
flowName = pList.get(PR_FLOW_NAME).getString();
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
if (flowName == null || flowName.equals("")) {
@@ -92,7 +92,7 @@ public class Flow extends FObj {
* {@inheritDoc}
*
XSL Content Model: marker* (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("marker")) {
@@ -124,7 +124,7 @@ public class Flow extends FObj {
public String getLocalName() {
return "flow";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_FLOW}
diff --git a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
index 7f081579d..482ec83c4 100644
--- a/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
+++ b/src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
@@ -5,9 +5,9 @@
* 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.
@@ -81,11 +81,11 @@ public class LayoutMasterSet extends FObj {
* {@inheritDoc}
*
XSL/FOP: (simple-page-master|page-sequence-master)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (!localName.equals("simple-page-master")
- && !localName.equals("page-sequence-master")) {
+ if (!localName.equals("simple-page-master")
+ && !localName.equals("page-sequence-master")) {
invalidChildError(loc, nsURI, localName);
}
}
@@ -207,7 +207,7 @@ public class LayoutMasterSet extends FObj {
public String getLocalName() {
return "layout-master-set";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_LAYOUT_MASTER_SET}
diff --git a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
index 50620f678..485fb67cc 100644
--- a/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
+++ b/src/java/org/apache/fop/fo/pagination/PageNumberGenerator.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.pagination;
/**
diff --git a/src/java/org/apache/fop/fo/pagination/PageProductionException.java b/src/java/org/apache/fop/fo/pagination/PageProductionException.java
index 068e38ff8..bb09db6f4 100644
--- a/src/java/org/apache/fop/fo/pagination/PageProductionException.java
+++ b/src/java/org/apache/fop/fo/pagination/PageProductionException.java
@@ -5,9 +5,9 @@
* 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.
@@ -37,7 +37,7 @@ public class PageProductionException extends RuntimeException {
private String localizedMessage;
private Locator locator;
-
+
/**
* Creates a new PageProductionException.
* @param message the message
@@ -47,7 +47,7 @@ public class PageProductionException extends RuntimeException {
super(message);
setLocator(locator);
}
-
+
/**
* Set a location associated with the exception.
* @param locator the locator holding the location.
@@ -64,7 +64,7 @@ public class PageProductionException extends RuntimeException {
public Locator getLocator() {
return this.locator;
}
-
+
/**
* Sets the localized message for this exception.
* @param msg the localized message
@@ -81,7 +81,7 @@ public class PageProductionException extends RuntimeException {
return super.getLocalizedMessage();
}
}
-
+
/** Exception factory for {@link PageProductionException}. */
public static class PageProductionExceptionFactory implements ExceptionFactory {
@@ -96,11 +96,11 @@ public class PageProductionException extends RuntimeException {
}
return ex;
}
-
+
/** {@inheritDoc} */
public Class getExceptionClass() {
return PageProductionException.class;
}
-
- }
+
+ }
}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequence.java b/src/java/org/apache/fop/fo/pagination/PageSequence.java
index c8f7c66d7..bdcb27198 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequence.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequence.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ import org.apache.fop.fo.ValidationException;
* fo:page-sequence
object.
*/
public class PageSequence extends AbstractPageSequence {
-
+
// The value of properties relevant for fo:page-sequence.
private String country;
private String language;
@@ -87,10 +87,10 @@ public class PageSequence extends AbstractPageSequence {
language = pList.get(PR_LANGUAGE).getString();
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
//writingMode = pList.getWritingMode();
-
+
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -124,7 +124,7 @@ public class PageSequence extends AbstractPageSequence {
* {@inheritDoc}
XSL Content Model: (title?,static-content*,flow)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("title")) {
@@ -138,7 +138,7 @@ public class PageSequence extends AbstractPageSequence {
} else if (localName.equals("static-content")) {
if (mainFlow != null) {
nodesOutOfOrderError(loc, "fo:static-content", "fo:flow");
- }
+ }
} else if (localName.equals("flow")) {
if (mainFlow != null) {
tooManyNodesError(loc, "fo:flow");
@@ -186,8 +186,8 @@ public class PageSequence extends AbstractPageSequence {
flowName, flow.getLocator());
}
- if (!getRoot().getLayoutMasterSet().regionNameExists(flowName)
- && !flowName.equals("xsl-before-float-separator")
+ if (!getRoot().getLayoutMasterSet().regionNameExists(flowName)
+ && !flowName.equals("xsl-before-float-separator")
&& !flowName.equals("xsl-footnote-separator")) {
getFOValidationEventProducer().flowNameNotMapped(this, flow.getName(),
flowName, flow.getLocator());
@@ -226,7 +226,7 @@ public class PageSequence extends AbstractPageSequence {
* Determine if this PageSequence already has a flow with the given flow-name
* Used for validation of incoming fo:flow or fo:static-content objects
* @param flowName The flow-name to search for
- * @return true if flow-name already defined within this page sequence,
+ * @return true if flow-name already defined within this page sequence,
* false otherwise
*/
public boolean hasFlowName(String flowName) {
@@ -237,7 +237,7 @@ public class PageSequence extends AbstractPageSequence {
public Map getFlowMap() {
return this.flowMap;
}
-
+
/**
* Public accessor for determining the next page master to use within this page sequence.
* @param page the page number of the page to be created
@@ -251,9 +251,9 @@ public class PageSequence extends AbstractPageSequence {
* @return the SimplePageMaster to use for this page
* @throws PageProductionException if there's a problem determining the page master
*/
- public SimplePageMaster getNextSimplePageMaster(int page,
- boolean isFirstPage,
- boolean isLastPage,
+ public SimplePageMaster getNextSimplePageMaster(int page,
+ boolean isFirstPage,
+ boolean isLastPage,
boolean isOnlyPage,
boolean isBlank) throws PageProductionException {
@@ -263,13 +263,13 @@ public class PageSequence extends AbstractPageSequence {
boolean isOddPage = ((page % 2) == 1);
if (log.isDebugEnabled()) {
log.debug("getNextSimplePageMaster(page=" + page
- + " isOdd=" + isOddPage
- + " isFirst=" + isFirstPage
+ + " isOdd=" + isOddPage
+ + " isFirst=" + isFirstPage
+ " isLast=" + isLastPage
+ " isOnly=" + isOnlyPage
+ " isBlank=" + isBlank + ")");
}
- return pageSequenceMaster.getNextSimplePageMaster(isOddPage,
+ return pageSequenceMaster.getNextSimplePageMaster(isOddPage,
isFirstPage, isLastPage, isOnlyPage, isBlank);
}
@@ -293,7 +293,7 @@ public class PageSequence extends AbstractPageSequence {
return pageSequenceMaster.hasPagePositionLast();
}
}
-
+
/** @return true if the page-sequence has a page-master with page-position="only" */
public boolean hasPagePositionOnly() {
if (pageSequenceMaster == null) {
@@ -302,7 +302,7 @@ public class PageSequence extends AbstractPageSequence {
return pageSequenceMaster.hasPagePositionOnly();
}
}
-
+
/**
* Get the value of the master-reference
property.
* @return the "master-reference" property
@@ -323,7 +323,7 @@ public class PageSequence extends AbstractPageSequence {
public int getNameId() {
return FO_PAGE_SEQUENCE;
}
-
+
/**
* Get the value of the country
property.
* @return the country property value
@@ -331,7 +331,7 @@ public class PageSequence extends AbstractPageSequence {
public String getCountry() {
return this.country;
}
-
+
/**
* Get the value of the language
property.
* @return the language property value
@@ -347,5 +347,5 @@ public class PageSequence extends AbstractPageSequence {
this.mainFlow = null;
this.flowMap.clear();
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
index a16514705..b1d8d4055 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequenceMaster.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,7 +42,7 @@ public class PageSequenceMaster extends FObj {
// The value of properties relevant for fo:page-sequence-master.
private String masterName;
// End of property values
-
+
private LayoutMasterSet layoutMasterSet;
private List subSequenceSpecifiers;
private SubSequenceSpecifier currentSubSequence;
@@ -68,7 +68,7 @@ public class PageSequenceMaster extends FObj {
/** {@inheritDoc} */
public void bind(PropertyList pList) throws FOPException {
masterName = pList.get(PR_MASTER_NAME).getString();
-
+
if (masterName == null || masterName.equals("")) {
missingPropertyError("master-name");
}
@@ -80,7 +80,7 @@ public class PageSequenceMaster extends FObj {
layoutMasterSet = parent.getRoot().getLayoutMasterSet();
layoutMasterSet.addPageSequenceMaster(masterName, this);
}
-
+
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (firstChild == null) {
@@ -94,12 +94,12 @@ public class PageSequenceMaster extends FObj {
*
XSL/FOP: (single-page-master-reference|repeatable-page-master-reference|
* repeatable-page-master-alternatives)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (!"single-page-master-reference".equals(localName)
+ if (!"single-page-master-reference".equals(localName)
&& !"repeatable-page-master-reference".equals(localName)
- && !"repeatable-page-master-alternatives".equals(localName)) {
+ && !"repeatable-page-master-alternatives".equals(localName)) {
invalidChildError(loc, nsURI, localName);
}
}
@@ -159,19 +159,19 @@ public class PageSequenceMaster extends FObj {
}
return (currentSubSequence != null);
}
-
+
/** @return true if the page-sequence-master has a page-master with page-position="last" */
public boolean hasPagePositionLast() {
return (currentSubSequence != null
&& currentSubSequence.hasPagePositionLast());
}
-
+
/** @return true if the page-sequence-master has a page-master with page-position="only" */
public boolean hasPagePositionOnly() {
return (currentSubSequence != null
&& currentSubSequence.hasPagePositionOnly());
}
-
+
/**
* Returns the next simple-page-master.
* @param isOddPage True if the next page number is odd
@@ -230,7 +230,7 @@ public class PageSequenceMaster extends FObj {
public String getLocalName() {
return "page-sequence-master";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_PAGE_SEQUENCE_MASTER}
diff --git a/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java b/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
index f8a37d8c0..247384770 100644
--- a/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
+++ b/src/java/org/apache/fop/fo/pagination/PageSequenceWrapper.java
@@ -5,9 +5,9 @@
* 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.
@@ -37,7 +37,7 @@ public class PageSequenceWrapper extends FObj {
private String indexClass;
private String indexKey;
// End of property values
-
+
/**
* Create a PageSequenceWrapper instance that is a child of
* the given parent {@link FONode}.
@@ -59,7 +59,7 @@ public class PageSequenceWrapper extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!(localName.equals("page-sequence")
diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java
index 753e8f735..87e9c4590 100644
--- a/src/java/org/apache/fop/fo/pagination/Region.java
+++ b/src/java/org/apache/fop/fo/pagination/Region.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@ public abstract class Region extends FObj {
private Numeric referenceOrientation;
private int writingMode;
// End of property values
-
+
private SimplePageMaster layoutMaster;
/**
@@ -68,7 +68,7 @@ public abstract class Region extends FObj {
regionName = pList.get(PR_REGION_NAME).getString();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingMode = pList.getWritingMode();
-
+
// regions may have name, or default
if (regionName.equals("")) {
regionName = getDefaultRegionName();
@@ -80,7 +80,7 @@ public abstract class Region extends FObj {
regionName, getLocator());
}
}
-
+
//TODO do we need context for getBPPaddingAndBorder() and getIPPaddingAndBorder()?
if ((getCommonBorderPaddingBackground().getBPPaddingAndBorder(false, null) != 0
|| getCommonBorderPaddingBackground().getIPPaddingAndBorder(false, null) != 0)) {
@@ -93,7 +93,7 @@ public abstract class Region extends FObj {
* {@inheritDoc} String, String)
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -149,7 +149,7 @@ public abstract class Region extends FObj {
* @return the Background Properties (border and padding are not used here).
*/
public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
- return commonBorderPaddingBackground;
+ return commonBorderPaddingBackground;
}
/** @return the "region-name" property. */
@@ -166,12 +166,12 @@ public abstract class Region extends FObj {
public int getOverflow() {
return overflow;
}
-
+
/** @return the display-align property. */
public int getDisplayAlign() {
return displayAlign;
}
-
+
/** @return the "reference-orientation" property. */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java
index 91aadce76..2189fa67b 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,13 +45,13 @@ public class RegionAfter extends RegionBA {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionAfter extends RegionBA {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBA.java b/src/java/org/apache/fop/fo/pagination/RegionBA.java
index 4cedee6d1..149e470cf 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBA.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBA.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ public abstract class RegionBA extends SideRegion {
// The value of properties relevant for fo:region-[before|after].
private int precedence;
// End of property values
-
+
/**
* Create a RegionBA instance that is a child of the
* given parent {@link FONode}.
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java
index fbcf7e8e7..71ea26818 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java
@@ -5,9 +5,9 @@
* 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.
@@ -50,13 +50,13 @@ public class RegionBefore extends RegionBA {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -64,7 +64,7 @@ public class RegionBefore extends RegionBA {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java
index c9dd792db..43499678a 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionBody.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java
@@ -5,9 +5,9 @@
* 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.
@@ -58,7 +58,7 @@ public class RegionBody extends Region {
commonMarginBlock = pList.getMarginBlockProps();
columnCount = pList.get(PR_COLUMN_COUNT).getNumeric();
columnGap = pList.get(PR_COLUMN_GAP).getLength();
-
+
if ((getColumnCount() > 1) && (getOverflow() == EN_SCROLL)) {
/* This is an error (See XSL Rec, fo:region-body description).
* The Rec allows for acting as if "1" is chosen in
@@ -103,13 +103,13 @@ public class RegionBody extends Region {
* all margin properties are configured to using BLOCK_WIDTH.
* That's why we 'cheat' here and setup a context for the height but
* use the LengthBase.BLOCK_WIDTH.
- * Also the values are resolved relative to the page size
+ * Also the values are resolved relative to the page size
* and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CONTAINING_BLOCK_WIDTH,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -117,7 +117,7 @@ public class RegionBody extends Region {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CONTAINING_BLOCK_WIDTH,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -152,7 +152,7 @@ public class RegionBody extends Region {
public String getLocalName() {
return "region-body";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_REGION_BODY}
diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java
index 1b1abd53c..611b1edf6 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,13 +45,13 @@ public class RegionEnd extends RegionSE {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionEnd extends RegionSE {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -91,7 +91,7 @@ public class RegionEnd extends RegionSE {
public String getLocalName() {
return "region-end";
}
-
+
/**
* {@inheritDoc}
* @return {@link org.apache.fop.fo.Constants#FO_REGION_END}
diff --git a/src/java/org/apache/fop/fo/pagination/RegionSE.java b/src/java/org/apache/fop/fo/pagination/RegionSE.java
index 15f61096b..f106e8a36 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionSE.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionSE.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java
index e11a8f201..12b578634 100644
--- a/src/java/org/apache/fop/fo/pagination/RegionStart.java
+++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,13 +45,13 @@ public class RegionStart extends RegionSE {
/** {@inheritDoc} */
public Rectangle getViewportRectangle (FODimension reldims, SimplePageMaster spm) {
- /* Special rules apply to resolving extent as values are resolved relative
+ /* Special rules apply to resolving extent as values are resolved relative
* to the page size and reference orientation.
*/
SimplePercentBaseContext pageWidthContext;
SimplePercentBaseContext pageHeightContext;
if (spm.getReferenceOrientation() % 180 == 0) {
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageWidth().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
@@ -59,7 +59,7 @@ public class RegionStart extends RegionSE {
spm.getPageHeight().getValue());
} else {
// invert width and height since top left are rotated by 90 (cl or ccl)
- pageWidthContext = new SimplePercentBaseContext(null,
+ pageWidthContext = new SimplePercentBaseContext(null,
LengthBase.CUSTOM_BASE,
spm.getPageHeight().getValue());
pageHeightContext = new SimplePercentBaseContext(null,
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
index 5c06dd40d..d1e710c89 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,7 +43,7 @@ public class RepeatablePageMasterAlternatives extends FObj
// The value of properties relevant for fo:repeatable-page-master-alternatives.
private Property maximumRepeats;
// End of property values
-
+
private static final int INFINITE = -1;
private int numberConsumed = 0;
@@ -86,7 +86,7 @@ public class RepeatablePageMasterAlternatives extends FObj
* {@inheritDoc}
*
XSL/FOP: (conditional-page-master-reference+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("conditional-page-master-reference")) {
@@ -168,17 +168,17 @@ public class RepeatablePageMasterAlternatives extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return this.hasPagePositionLast;
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionOnly() {
return this.hasPagePositionOnly;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "repeatable-page-master-alternatives";
diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
index 1cf77675d..60f8e0d6a 100644
--- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterReference.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,7 +42,7 @@ public class RepeatablePageMasterReference extends FObj
private String masterReference;
private Property maximumRepeats;
// End of property values
-
+
private static final int INFINITE = -1;
private int numberConsumed = 0;
@@ -60,10 +60,10 @@ public class RepeatablePageMasterReference extends FObj
public void bind(PropertyList pList) throws FOPException {
masterReference = pList.get(PR_MASTER_REFERENCE).getString();
maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
-
+
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -76,12 +76,12 @@ public class RepeatablePageMasterReference extends FObj
pageSequenceMaster.addSubsequenceSpecifier(this);
}
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
invalidChildError(loc, nsURI, localName);
}
@@ -125,7 +125,7 @@ public class RepeatablePageMasterReference extends FObj
this.numberConsumed = 0;
}
-
+
/** {@inheritDoc} */
public boolean goToPrevious() {
if (numberConsumed == 0) {
@@ -135,7 +135,7 @@ public class RepeatablePageMasterReference extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return false;
diff --git a/src/java/org/apache/fop/fo/pagination/Root.java b/src/java/org/apache/fop/fo/pagination/Root.java
index c6346e9fb..fcbb54abd 100644
--- a/src/java/org/apache/fop/fo/pagination/Root.java
+++ b/src/java/org/apache/fop/fo/pagination/Root.java
@@ -5,9 +5,9 @@
* 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.
@@ -63,12 +63,12 @@ public class Root extends FObj {
* Context class used while building the FO tree.
*/
private FOTreeBuilderContext builderContext;
-
+
/**
* FOEventHandler object for this FO Tree
*/
private FOEventHandler foEventHandler = null;
-
+
/**
* Base constructor
*
@@ -88,7 +88,7 @@ public class Root extends FObj {
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
if (!pageSequenceFound || layoutMasterSet == null) {
- missingChildElementError("(layout-master-set, declarations?, "
+ missingChildElementError("(layout-master-set, declarations?, "
+ "bookmark-tree?, (page-sequence|fox:external-document)+)");
}
}
@@ -98,14 +98,14 @@ public class Root extends FObj {
*
XSL 1.0 Spec: (layout-master-set,declarations?,page-sequence+)
*
FOP: (layout-master-set, declarations?, fox:bookmarks?, page-sequence+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
- if (localName.equals("layout-master-set")) {
+ if (localName.equals("layout-master-set")) {
if (layoutMasterSet != null) {
tooManyNodesError(loc, "fo:layout-master-set");
}
- } else if (localName.equals("declarations")) {
+ } else if (localName.equals("declarations")) {
if (layoutMasterSet == null) {
nodesOutOfOrderError(loc, "fo:layout-master-set", "fo:declarations");
} else if (declarations != null) {
@@ -123,7 +123,7 @@ public class Root extends FObj {
} else if (pageSequenceFound) {
nodesOutOfOrderError(loc, "fo:bookmark-tree", "fo:page-sequence");
}
- } else if (localName.equals("page-sequence")) {
+ } else if (localName.equals("page-sequence")) {
if (layoutMasterSet == null) {
nodesOutOfOrderError(loc, "fo:layout-master-set", "fo:page-sequence");
} else {
@@ -142,7 +142,7 @@ public class Root extends FObj {
//Ignore non-FO elements under root
}
}
-
+
/** @inheritDoc */
protected void validateChildNode(Locator loc, FONode child) throws ValidationException {
@@ -159,15 +159,15 @@ public class Root extends FObj {
this.foEventHandler = foEventHandler;
}
- /**
- * This method overrides the FONode version. The FONode version calls the
- * method by the same name for the parent object. Since Root is at the top
- * of the tree, it returns the actual FOEventHandler object. Thus, any FONode
- * can use this chain to find which FOEventHandler it is being built for.
- * @return the FOEventHandler implementation that this Root is attached to
- */
- public FOEventHandler getFOEventHandler() {
- return foEventHandler;
+ /**
+ * This method overrides the FONode version. The FONode version calls the
+ * method by the same name for the parent object. Since Root is at the top
+ * of the tree, it returns the actual FOEventHandler object. Thus, any FONode
+ * can use this chain to find which FOEventHandler it is being built for.
+ * @return the FOEventHandler implementation that this Root is attached to
+ */
+ public FOEventHandler getFOEventHandler() {
+ return foEventHandler;
}
/**
@@ -182,7 +182,7 @@ public class Root extends FObj {
public FOTreeBuilderContext getBuilderContext() {
return this.builderContext;
}
-
+
/**
* Gets the last page number generated by the previous page-sequence
* @return the last page number, 0 if no page sequences yet generated
@@ -207,15 +207,15 @@ public class Root extends FObj {
* @param additionalPages the total pages generated by the sequence (for statistics)
* @throws IllegalArgumentException for negative additional page counts
*/
- public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) {
-
+ public void notifyPageSequenceFinished(int lastPageNumber, int additionalPages) {
+
if (additionalPages >= 0) {
totalPagesGenerated += additionalPages;
- endingPageNumberOfPreviousSequence = lastPageNumber;
+ endingPageNumberOfPreviousSequence = lastPageNumber;
} else {
throw new IllegalArgumentException(
"Number of additional pages must be zero or greater.");
- }
+ }
}
/**
diff --git a/src/java/org/apache/fop/fo/pagination/SideRegion.java b/src/java/org/apache/fop/fo/pagination/SideRegion.java
index 552ca871b..1b78de73f 100644
--- a/src/java/org/apache/fop/fo/pagination/SideRegion.java
+++ b/src/java/org/apache/fop/fo/pagination/SideRegion.java
@@ -30,7 +30,7 @@ import org.apache.fop.fo.PropertyList;
public abstract class SideRegion extends Region {
private Length extent;
-
+
/**
* Creates a new side region.
* @param parent the parent node
@@ -45,10 +45,10 @@ public abstract class SideRegion extends Region {
super.bind(pList);
extent = pList.get(PR_EXTENT).getLength();
}
-
+
/** @return the "extent" property. */
public Length getExtent() {
return extent;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
index b296b8579..b0ec96406 100644
--- a/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
+++ b/src/java/org/apache/fop/fo/pagination/SimplePageMaster.java
@@ -5,9 +5,9 @@
* 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.
@@ -80,7 +80,7 @@ public class SimplePageMaster extends FObj {
pageWidth = pList.get(PR_PAGE_WIDTH).getLength();
referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
writingMode = pList.getWritingMode();
-
+
if (masterName == null || masterName.equals("")) {
missingPropertyError("master-name");
}
@@ -112,7 +112,7 @@ public class SimplePageMaster extends FObj {
* {@inheritDoc}
*
XSL Content Model: (region-body,region-before?,region-after?,region-start?,region-end?)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("region-body")) {
@@ -247,12 +247,12 @@ public class SimplePageMaster extends FObj {
public Length getPageHeight() {
return pageHeight;
}
-
+
/** @return the "writing-mode" property. */
public int getWritingMode() {
return writingMode;
}
-
+
/** @return the "reference-orientation" property. */
public int getReferenceOrientation() {
return referenceOrientation.getValue();
diff --git a/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java b/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
index f58f32d1f..89416a534 100644
--- a/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
+++ b/src/java/org/apache/fop/fo/pagination/SinglePageMasterReference.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,13 +34,13 @@ import org.apache.fop.fo.ValidationException;
* This is a reference for a single page. It returns the
* master name only once until reset.
*/
-public class SinglePageMasterReference extends FObj
+public class SinglePageMasterReference extends FObj
implements SubSequenceSpecifier {
// The value of properties relevant for fo:single-page-master-reference.
private String masterReference;
// End of property values
-
+
private static final int FIRST = 0;
private static final int DONE = 1;
@@ -62,7 +62,7 @@ public class SinglePageMasterReference extends FObj
if (masterReference == null || masterReference.equals("")) {
missingPropertyError("master-reference");
- }
+ }
}
/** {@inheritDoc} */
@@ -70,12 +70,12 @@ public class SinglePageMasterReference extends FObj
PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
pageSequenceMaster.addSubsequenceSpecifier(this);
}
-
+
/**
* {@inheritDoc}
*
XSL Content Model: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -100,8 +100,8 @@ public class SinglePageMasterReference extends FObj
public void reset() {
this.state = FIRST;
}
-
-
+
+
/** {@inheritDoc} */
public boolean goToPrevious() {
@@ -112,7 +112,7 @@ public class SinglePageMasterReference extends FObj
return true;
}
}
-
+
/** {@inheritDoc} */
public boolean hasPagePositionLast() {
return false;
@@ -122,7 +122,7 @@ public class SinglePageMasterReference extends FObj
public boolean hasPagePositionOnly() {
return false;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "single-page-master-reference";
diff --git a/src/java/org/apache/fop/fo/pagination/StaticContent.java b/src/java/org/apache/fop/fo/pagination/StaticContent.java
index 9a5e47d8a..4084a250a 100644
--- a/src/java/org/apache/fop/fo/pagination/StaticContent.java
+++ b/src/java/org/apache/fop/fo/pagination/StaticContent.java
@@ -5,9 +5,9 @@
* 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.
@@ -63,7 +63,7 @@ public class StaticContent extends Flow {
* {@inheritDoc}
*
XSL Content Model: (%block;)+
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isBlockItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
index 68c8ed9b9..a8eddf5d3 100644
--- a/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
+++ b/src/java/org/apache/fop/fo/pagination/SubSequenceSpecifier.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.pagination;
@@ -25,7 +25,7 @@ package org.apache.fop.fo.pagination;
* and are capable of looking up an appropriate {@link SimplePageMaster}.
*/
public interface SubSequenceSpecifier {
-
+
/**
* Returns the name of the next page master.
* @param isOddPage True if the next page number is odd
@@ -57,9 +57,9 @@ public interface SubSequenceSpecifier {
/** @return true if the subsequence has a page master for page-position "last" */
boolean hasPagePositionLast();
-
+
/** @return true if the subsequence has a page master for page-position "only" */
boolean hasPagePositionOnly();
-
+
}
diff --git a/src/java/org/apache/fop/fo/pagination/Title.java b/src/java/org/apache/fop/fo/pagination/Title.java
index 03afcf5f6..5838e6ae1 100644
--- a/src/java/org/apache/fop/fo/pagination/Title.java
+++ b/src/java/org/apache/fop/fo/pagination/Title.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@ public class Title extends InlineLevel {
* {@inheritDoc} String, String)
*
XSL/FOP: (#PCDATA|%inline;)*
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!isInlineItem(nsURI, localName)) {
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
index ac1ef66de..5969729d4 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/Bookmark.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.fo.ValidationException;
/**
* Class modelling the
- * fo:bookmark
object, first introduced in the
+ * fo:bookmark
object, first introduced in the
* XSL 1.1 WD.
*/
public class Bookmark extends FObj {
@@ -42,7 +42,7 @@ public class Bookmark extends FObj {
private String internalDestination;
private String externalDestination;
private boolean bShow = true; // from starting-state property
-
+
// Valid, but unused properties. Commented out for performance
// private CommonAccessibility commonAccessibility;
@@ -63,8 +63,8 @@ public class Bookmark extends FObj {
internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString();
bShow = (pList.get(PR_STARTING_STATE).getEnum() == EN_SHOW);
- // per spec, internal takes precedence if both specified
- if (internalDestination.length() > 0) {
+ // per spec, internal takes precedence if both specified
+ if (internalDestination.length() > 0) {
externalDestination = null;
} else if (externalDestination.length() == 0) {
// slightly stronger than spec "should be specified"
@@ -79,7 +79,7 @@ public class Bookmark extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark-title, bookmark*)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (localName.equals("bookmark-title")) {
@@ -89,7 +89,7 @@ public class Bookmark extends FObj {
} else if (localName.equals("bookmark")) {
if (bookmarkTitle == null) {
nodesOutOfOrderError(loc, "fo:bookmark-title", "fo:bookmark");
- }
+ }
} else {
invalidChildError(loc, nsURI, localName);
}
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
index 6cee46752..fc508dc96 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTitle.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@ public class BookmarkTitle extends FObj {
/**
* Add the characters to this BookmarkTitle.
- * The text data inside the BookmarkTitle xml element
+ * The text data inside the BookmarkTitle xml element
* is used for the BookmarkTitle string.
*
* @param data the character data
@@ -64,7 +64,7 @@ public class BookmarkTitle extends FObj {
* {@inheritDoc}
*
XSL/FOP: empty
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -79,7 +79,7 @@ public class BookmarkTitle extends FObj {
public String getTitle() {
return title;
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return "bookmark-title";
diff --git a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
index 9df049251..22bf0769b 100644
--- a/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
+++ b/src/java/org/apache/fop/fo/pagination/bookmarks/BookmarkTree.java
@@ -5,9 +5,9 @@
* 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.
@@ -67,7 +67,7 @@ public class BookmarkTree extends FObj {
* {@inheritDoc}
*
XSL/FOP: (bookmark+)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
if (!localName.equals("bookmark")) {
diff --git a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
index 6307ad1c5..709fdf7f2 100644
--- a/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
+++ b/src/java/org/apache/fop/fo/properties/BackgroundPositionShorthand.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,16 +43,16 @@ public class BackgroundPositionShorthand extends ListProperty {
/**
* Construct an instance of a Maker for the given property.
- *
+ *
* @param propId The Constant ID of the property to be made.
*/
public Maker(int propId) {
super(propId);
}
-
-
- /**
- * {@inheritDoc}
+
+
+ /**
+ * {@inheritDoc}
* If only background-position-horizontal
is
* specified, background-position-vertical
is set
* to "50%".
@@ -60,7 +60,7 @@ public class BackgroundPositionShorthand extends ListProperty {
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
Property p = super.make(propertyList, value, fo);
if (p.getList().size() == 1) {
- /* only background-position-horizontal specified
+ /* only background-position-horizontal specified
* through the shorthand, as a length or percentage:
* background-position-vertical=50% (see: XSL-FO 1.1 -- 7.31.2)
*/
@@ -71,8 +71,8 @@ public class BackgroundPositionShorthand extends ListProperty {
return p;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* Returns a {@link org.apache.fop.datatypes.PercentBase} whose
* getDimension()
returns 1.
*/
@@ -92,11 +92,11 @@ public class BackgroundPositionShorthand extends ListProperty {
public int getDimension() {
return 1;
}
-
+
};
}
}
-
+
/**
* Inner class to provide shorthand parsing capabilities
*
@@ -109,7 +109,7 @@ public class BackgroundPositionShorthand extends ListProperty {
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
int index = -1;
List propList = property.getList();
if (propId == Constants.PR_BACKGROUND_POSITION_HORIZONTAL) {
@@ -119,8 +119,8 @@ public class BackgroundPositionShorthand extends ListProperty {
}
if (index >= 0) {
return maker.convertProperty(
- (Property) propList.get(index),
- propertyList,
+ (Property) propList.get(index),
+ propertyList,
propertyList.getFObj());
} // else: invalid index? shouldn't happen...
return null;
diff --git a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
index 341baca1a..7c2854759 100644
--- a/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/BorderWidthPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -24,21 +24,21 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of LengthProperty.Maker handles the special treatment of
+ * This subclass of LengthProperty.Maker handles the special treatment of
* border width described in 7.7.20.
*/
public class BorderWidthPropertyMaker extends LengthProperty.Maker {
- int borderStyleId = 0;
-
+ int borderStyleId = 0;
+
/**
* Create a length property which check the value of the border-*-style
- * property and return a length of 0 when the style is "none".
+ * property and return a length of 0 when the style is "none".
* @param propId the border-*-width of the property.
*/
public BorderWidthPropertyMaker(int propId) {
super(propId);
}
-
+
/**
* Set the propId of the style property for the same side.
* @param borderStyleId
@@ -50,9 +50,9 @@ public class BorderWidthPropertyMaker extends LengthProperty.Maker {
/**
* Check the value of the style property and return a length of 0 when
* the style is NONE.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
-
+
public Property get(int subpropId, PropertyList propertyList,
boolean bTryInherit, boolean bTryDefault)
throws PropertyException
diff --git a/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java b/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
index c71bc830f..feee406ab 100644
--- a/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/BoxPropShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/properties/CharacterProperty.java b/src/java/org/apache/fop/fo/properties/CharacterProperty.java
index f42591fe8..c078da0c7 100644
--- a/src/java/org/apache/fop/fo/properties/CharacterProperty.java
+++ b/src/java/org/apache/fop/fo/properties/CharacterProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,7 +26,7 @@ import org.apache.fop.fo.PropertyList;
* Superclass for properties that wrap a character value
*/
public final class CharacterProperty extends Property {
-
+
/**
* Inner class for creating instances of CharacterProperty
*/
@@ -58,7 +58,7 @@ public final class CharacterProperty extends Property {
private CharacterProperty(char character) {
this.character = character;
}
-
+
public static CharacterProperty getInstance(char character) {
return (CharacterProperty) cache.fetch(
new CharacterProperty(character));
@@ -85,7 +85,7 @@ public final class CharacterProperty extends Property {
return new Character(character).toString();
}
- /**
+ /**
* {@inheritDoc}
*/
public boolean equals(Object obj) {
@@ -96,7 +96,7 @@ public final class CharacterProperty extends Property {
}
}
- /**
+ /**
* {@inheritDoc}
*/
public int hashCode() {
diff --git a/src/java/org/apache/fop/fo/properties/ColorProperty.java b/src/java/org/apache/fop/fo/properties/ColorProperty.java
index a2a3d2150..925d275af 100644
--- a/src/java/org/apache/fop/fo/properties/ColorProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ColorProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,16 +31,16 @@ import org.apache.fop.util.ColorUtil;
* Class for properties that wrap Color values
*/
public final class ColorProperty extends Property {
-
+
/** cache holding canonical ColorProperty instances */
private static final PropertyCache cache = new PropertyCache(ColorProperty.class);
-
+
/**
* The color represented by this property.
*/
protected final Color color;
-
+
/**
* Inner class for creating instances of ColorTypeProperty
*/
@@ -57,7 +57,7 @@ public final class ColorProperty extends Property {
* Return a ColorProperty object based on the passed Property object.
* This method is called if the Property object built by the parser
* isn't the right type for this property.
- *
+ *
* @param p
* The Property object return by the expression parser
* @param propertyList
@@ -70,7 +70,7 @@ public final class ColorProperty extends Property {
* for invalid or inconsistent FO input
*/
public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof ColorProperty) {
return p;
@@ -89,10 +89,10 @@ public final class ColorProperty extends Property {
/**
* Set the color given a particular String. For a full List of supported
* values please see ColorUtil.
- *
+ *
* @param foUserAgent FOP user agent
* @param value RGB value as String to be parsed
- * @return the canonical ColorProperty instance corresponding
+ * @return the canonical ColorProperty instance corresponding
* to the given value
* @throws PropertyException if the value can't be parsed
* @see ColorUtil#parseColorString(FOUserAgent, String)
@@ -106,13 +106,13 @@ public final class ColorProperty extends Property {
/**
* Create a new ColorProperty with a given color.
- *
+ *
* @param value the color to use.
*/
private ColorProperty(Color value) {
this.color = value;
}
-
+
/**
* Returns an AWT instance of this color
* @param foUserAgent FOP user agent
@@ -141,19 +141,19 @@ public final class ColorProperty extends Property {
public Object getObject() {
return this;
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (this == o) {
return true;
}
-
+
if (o instanceof ColorProperty) {
return ((ColorProperty) o).color.equals(this.color);
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return this.color.hashCode();
diff --git a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
index 36e7377f4..e32e9dbd9 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAbsolutePosition.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,12 +44,12 @@ public class CommonAbsolutePosition {
* The "right" property.
*/
public Length right;
-
+
/**
* The "bottom" property.
*/
public Length bottom;
-
+
/**
* The "left" property.
*/
@@ -64,9 +64,9 @@ public class CommonAbsolutePosition {
top = pList.get(Constants.PR_TOP).getLength();
bottom = pList.get(Constants.PR_BOTTOM).getLength();
left = pList.get(Constants.PR_LEFT).getLength();
- right = pList.get(Constants.PR_RIGHT).getLength();
+ right = pList.get(Constants.PR_RIGHT).getLength();
}
-
+
public String toString() {
StringBuffer sb = new StringBuffer("CommonAbsolutePosition{");
sb.append(" absPos=");
diff --git a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
index e97ba5a0a..74edf046b 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAccessibility.java
@@ -5,9 +5,9 @@
* 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.
@@ -52,7 +52,7 @@ public class CommonAccessibility {
if ("none".equals(role)) {
role = null;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonAural.java b/src/java/org/apache/fop/fo/properties/CommonAural.java
index f5e20584a..a47f183f1 100644
--- a/src/java/org/apache/fop/fo/properties/CommonAural.java
+++ b/src/java/org/apache/fop/fo/properties/CommonAural.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
index 35913ce3a..94639a5a6 100755
--- a/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
+++ b/src/java/org/apache/fop/fo/properties/CommonBorderPaddingBackground.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,14 +39,14 @@ import org.apache.fop.fo.expr.PropertyException;
*/
public class CommonBorderPaddingBackground {
- /**
- * cache holding all canonical instances
+ /**
+ * cache holding all canonical instances
* (w/ absolute background-position-* and padding-*)
*/
private static final PropertyCache cache = new PropertyCache(CommonBorderPaddingBackground.class);
-
+
private int hash = -1;
-
+
/**
* The "background-attachment" property.
*/
@@ -91,17 +91,17 @@ public class CommonBorderPaddingBackground {
public static final int END = 3;
/**
- *
+ *
*/
public static class BorderInfo {
-
+
/** cache holding all canonical instances */
private static final PropertyCache cache = new PropertyCache(BorderInfo.class);
-
+
private int mStyle; // Enum for border style
private Color mColor; // Border color
private CondLengthProperty mWidth;
-
+
private int hash = -1;
/**
@@ -115,7 +115,7 @@ public class CommonBorderPaddingBackground {
/**
* Returns a BorderInfo instance corresponding to the given values
- *
+ *
* @param style the border-style
* @param width the border-width
* @param color the border-color
@@ -149,7 +149,7 @@ public class CommonBorderPaddingBackground {
/**
* Convenience method returning the border-width,
* taking into account values of "none" and "hidden"
- *
+ *
* @return the retained border-width
*/
public int getRetainedWidth() {
@@ -173,23 +173,23 @@ public class CommonBorderPaddingBackground {
sb.append("}");
return sb.toString();
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
return true;
}
-
+
if (obj instanceof BorderInfo) {
BorderInfo bi = (BorderInfo)obj;
return (this.mColor == bi.mColor
&& this.mStyle == bi.mStyle
&& this.mWidth == bi.mWidth);
}
-
+
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
@@ -207,9 +207,9 @@ public class CommonBorderPaddingBackground {
* A border info with style "none". Used as a singleton, in the collapsing-border model,
* for elements which don't specify any border on some of their sides.
*/
- private static final BorderInfo defaultBorderInfo
+ private static final BorderInfo defaultBorderInfo
= BorderInfo.getInstance(Constants.EN_NONE, new ConditionalNullLength(), null);
-
+
/**
* A conditional length of value 0. Returned by the
* {@link CommonBorderPaddingBackground#getBorderInfo(int)} method when the
@@ -265,7 +265,7 @@ public class CommonBorderPaddingBackground {
/**
* Returns a default BorderInfo of style none.
- *
+ *
* @return a BorderInfo instance with style set to {@link Constants#EN_NONE}
*/
public static BorderInfo getDefaultBorderInfo() {
@@ -277,14 +277,14 @@ public class CommonBorderPaddingBackground {
/**
* Construct a CommonBorderPaddingBackground object.
- *
+ *
* @param pList The PropertyList to get properties from.
* @throws PropertyException if there's an error while binding the properties
*/
private CommonBorderPaddingBackground(PropertyList pList) throws PropertyException {
backgroundAttachment = pList.get(Constants.PR_BACKGROUND_ATTACHMENT).getEnum();
-
+
Color bc = pList.get(Constants.PR_BACKGROUND_COLOR).getColor(
pList.getFObj().getUserAgent());
if (bc.getAlpha() == 0) {
@@ -332,16 +332,16 @@ public class CommonBorderPaddingBackground {
}
/**
- * Obtain a CommonBorderPaddingBackground instance based on the
+ * Obtain a CommonBorderPaddingBackground instance based on the
* related property valus in the given {@link PropertyList}
- *
+ *
* @param pList the {@link PropertyList} to use
* @return a CommonBorderPaddingBackground instance (cached if possible)
* @throws PropertyException in case of an error
*/
- public static CommonBorderPaddingBackground getInstance(PropertyList pList)
+ public static CommonBorderPaddingBackground getInstance(PropertyList pList)
throws PropertyException {
-
+
CommonBorderPaddingBackground newInstance
= new CommonBorderPaddingBackground(pList);
CommonBorderPaddingBackground cachedInstance = null;
@@ -355,9 +355,9 @@ public class CommonBorderPaddingBackground {
&& (newInstance.backgroundPositionVertical == null || newInstance.backgroundPositionVertical.isAbsolute())) {
cachedInstance = cache.fetch(newInstance);
}
-
+
/* for non-cached, or not-yet-cached instances, preload the image */
- if ((cachedInstance == null
+ if ((cachedInstance == null
|| cachedInstance == newInstance)
&& !("".equals(newInstance.backgroundImage))) {
//Additional processing: preload image
@@ -374,14 +374,14 @@ public class CommonBorderPaddingBackground {
}
//TODO Report to caller so he can decide to throw an exception
}
-
+
return (cachedInstance != null ? cachedInstance : newInstance);
}
private void initBorderInfo(PropertyList pList, int side,
int colorProp, int styleProp, int widthProp, int paddingProp)
throws PropertyException {
-
+
padding[side] = pList.get(paddingProp).getCondLength();
// If style = none, force width to 0, don't get Color (spec 7.7.20)
int style = pList.get(styleProp).getEnum();
@@ -391,7 +391,7 @@ public class CommonBorderPaddingBackground {
pList.get(widthProp).getCondLength(),
pList.get(colorProp).getColor(ua)), side);
}
-
+
}
/**
@@ -517,7 +517,7 @@ public class CommonBorderPaddingBackground {
/**
* The border-color for the given side
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @return the border-color for the given side
*/
@@ -531,7 +531,7 @@ public class CommonBorderPaddingBackground {
/**
* The border-style for the given side
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @return the border-style for the given side
*/
@@ -547,7 +547,7 @@ public class CommonBorderPaddingBackground {
* Return the padding for the given side, taking into account
* the conditionality and evaluating any percentages in the given
* context.
- *
+ *
* @param side one of {@link #BEFORE}, {@link #AFTER}, {@link #START}, {@link #END}
* @param discard true if the conditionality component should be considered
* @param context the context for percentage-resolution
@@ -620,7 +620,7 @@ public class CommonBorderPaddingBackground {
+ getBorderStartWidth(false) + getBorderEndWidth(false)) > 0);
}
- /**
+ /**
* @param context for percentage based evaluation.
* @return true if padding is non-zero.
*/
@@ -634,7 +634,7 @@ public class CommonBorderPaddingBackground {
return (borderInfo[BEFORE] != null || borderInfo[AFTER] != null
|| borderInfo[START] != null || borderInfo[END] != null);
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (this == obj) {
@@ -657,10 +657,10 @@ public class CommonBorderPaddingBackground {
&& this.padding[START] == cbpb.padding[START]
&& this.padding[END] == cbpb.padding[END]);
}
-
+
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
@@ -681,7 +681,7 @@ public class CommonBorderPaddingBackground {
hash = 37 * hash + (padding[END] == null ? 0 : padding[END].hashCode());
this.hash = hash;
}
-
+
return this.hash;
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonFont.java b/src/java/org/apache/fop/fo/properties/CommonFont.java
index ca543a050..11275fdd3 100755
--- a/src/java/org/apache/fop/fo/properties/CommonFont.java
+++ b/src/java/org/apache/fop/fo/properties/CommonFont.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,10 +38,10 @@ public final class CommonFont {
/** cache holding canonical CommonFont instances (only those with
* absolute font-size and font-size-adjust) */
private static final PropertyCache cache = new PropertyCache(CommonFont.class);
-
+
/** hashcode of this instance */
private int hash = 0;
-
+
/** The "font-family" property. */
private final FontFamilyProperty fontFamily;
@@ -59,17 +59,17 @@ public final class CommonFont {
/** The "font-weight" property. */
private final EnumProperty fontWeight;
-
+
/** The "font-size" property. */
public final Length fontSize;
/** The "font-size-adjust" property. */
public final Numeric fontSizeAdjust;
-
+
/**
* Construct a CommonFont instance
- *
+ *
* @param fontFamily the font-family property
* @param fontSelectionStrategy the font-selection-strategy property
* @param fontStretch the font-stretch property
@@ -84,8 +84,8 @@ public final class CommonFont {
EnumProperty fontStretch,
EnumProperty fontStyle,
EnumProperty fontVariant,
- EnumProperty fontWeight,
- Length fontSize,
+ EnumProperty fontWeight,
+ Length fontSize,
Numeric fontSizeAdjust) {
this.fontFamily = fontFamily;
this.fontSelectionStrategy = fontSelectionStrategy;
@@ -103,7 +103,7 @@ public final class CommonFont {
* the entire instance will be cached.
* If not, then a distinct instance will be returned, with
* as much cached information as possible.
- *
+ *
* @param pList the PropertyList to get the properties from
* @return a CommonFont instance corresponding to the properties
* @throws PropertyException if there was a problem getting the properties
@@ -117,19 +117,19 @@ public final class CommonFont {
EnumProperty fontWeight = (EnumProperty) pList.get(Constants.PR_FONT_WEIGHT);
Numeric fontSizeAdjust = pList.get(Constants.PR_FONT_SIZE_ADJUST).getNumeric();
Length fontSize = pList.get(Constants.PR_FONT_SIZE).getLength();
-
- CommonFont commonFont = new CommonFont(fontFamily,
- fontSelectionStrategy,
- fontStretch,
- fontStyle,
- fontVariant,
+
+ CommonFont commonFont = new CommonFont(fontFamily,
+ fontSelectionStrategy,
+ fontStretch,
+ fontStyle,
+ fontVariant,
fontWeight,
fontSize,
fontSizeAdjust);
-
+
return cache.fetch(commonFont);
}
-
+
/** @return an array with the font-family names */
private String[] getFontFamily() {
List lst = fontFamily.getList();
@@ -139,12 +139,12 @@ public final class CommonFont {
}
return fontFamily;
}
-
+
/** @return the first font-family name in the list */
public String getFirstFontFamily() {
return ((Property) fontFamily.list.get(0)).getString();
}
-
+
/** @return the "font-selection-strategy" property */
public int getFontSelectionStrategy() {
return fontSelectionStrategy.getEnum();
@@ -154,12 +154,12 @@ public final class CommonFont {
public int getFontStretch() {
return fontStretch.getEnum();
}
-
+
/** @return the "font-style" property */
public int getFontStyle() {
return fontStyle.getEnum();
}
-
+
/** @return the "font-variant" property */
public int getFontVariant() {
return fontVariant.getEnum();
@@ -169,11 +169,11 @@ public final class CommonFont {
public int getFontWeight() {
return fontWeight.getEnum();
}
-
+
/**
- * Create and return an array of FontTriplets
based on
+ * Create and return an array of FontTriplets
based on
* the properties stored in the instance variables.
- *
+ *
* @param fontInfo
* @return a Font object.
*/
@@ -194,13 +194,13 @@ public final class CommonFont {
String style;
switch (fontStyle.getEnum()) {
- case Constants.EN_ITALIC:
+ case Constants.EN_ITALIC:
style = "italic";
break;
- case Constants.EN_OBLIQUE:
+ case Constants.EN_OBLIQUE:
style = "oblique";
break;
- case Constants.EN_BACKSLANT:
+ case Constants.EN_BACKSLANT:
style = "backslant";
break;
default:
@@ -210,22 +210,22 @@ public final class CommonFont {
// various kinds of keywords too
//int fontVariant = propertyList.get("font-variant").getEnum();
FontTriplet[] triplets = fontInfo.fontLookup(
- getFontFamily(),
+ getFontFamily(),
style, font_weight);
return triplets;
}
/** {@inheritDoc} */
public boolean equals(Object o) {
-
+
if (o == null) {
return false;
}
-
+
if (this == o) {
return true;
}
-
+
if (o instanceof CommonFont) {
CommonFont cf = (CommonFont) o;
return (cf.fontFamily == this.fontFamily)
@@ -238,12 +238,12 @@ public final class CommonFont {
&& (cf.fontSizeAdjust == this.fontSizeAdjust);
}
return false;
-
+
}
-
+
/** {@inheritDoc} */
public int hashCode() {
-
+
if (this.hash == -1) {
int hash = 17;
hash = 37 * hash + (fontSize == null ? 0 : fontSize.hashCode());
@@ -257,6 +257,6 @@ public final class CommonFont {
this.hash = hash;
}
return hash;
-
+
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
index a294b2bbd..0e32f250a 100644
--- a/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
+++ b/src/java/org/apache/fop/fo/properties/CommonHyphenation.java
@@ -5,9 +5,9 @@
* 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.
@@ -37,11 +37,11 @@ public final class CommonHyphenation {
/** Logger */
protected static Log log = LogFactory.getLog(CommonHyphenation.class);
-
+
private static final PropertyCache cache = new PropertyCache(CommonHyphenation.class);
-
+
private int hash = 0;
-
+
/** The "language" property */
public final StringProperty language;
@@ -65,7 +65,7 @@ public final class CommonHyphenation {
/**
* Construct a CommonHyphenation object holding the given properties
- *
+ *
*/
private CommonHyphenation(StringProperty language,
StringProperty country,
@@ -82,46 +82,46 @@ public final class CommonHyphenation {
this.hyphenationPushCharacterCount = hyphenationPushCharacterCount;
this.hyphenationRemainCharacterCount = hyphenationRemainCharacterCount;
}
-
+
/**
* Gets the canonical CommonHyphenation
instance corresponding
- * to the values of the related properties present on the given
+ * to the values of the related properties present on the given
* PropertyList
- *
+ *
* @param propertyList the PropertyList
*/
public static CommonHyphenation getInstance(PropertyList propertyList) throws PropertyException {
- StringProperty language =
+ StringProperty language =
(StringProperty) propertyList.get(Constants.PR_LANGUAGE);
- StringProperty country =
+ StringProperty country =
(StringProperty) propertyList.get(Constants.PR_COUNTRY);
- StringProperty script =
+ StringProperty script =
(StringProperty) propertyList.get(Constants.PR_SCRIPT);
- EnumProperty hyphenate =
+ EnumProperty hyphenate =
(EnumProperty) propertyList.get(Constants.PR_HYPHENATE);
- CharacterProperty hyphenationCharacter =
+ CharacterProperty hyphenationCharacter =
(CharacterProperty) propertyList.get(Constants.PR_HYPHENATION_CHARACTER);
- NumberProperty hyphenationPushCharacterCount =
+ NumberProperty hyphenationPushCharacterCount =
(NumberProperty) propertyList.get(Constants.PR_HYPHENATION_PUSH_CHARACTER_COUNT);
- NumberProperty hyphenationRemainCharacterCount =
+ NumberProperty hyphenationRemainCharacterCount =
(NumberProperty) propertyList.get(Constants.PR_HYPHENATION_REMAIN_CHARACTER_COUNT);
-
+
CommonHyphenation instance = new CommonHyphenation(
- language,
- country,
- script,
- hyphenate,
- hyphenationCharacter,
- hyphenationPushCharacterCount,
+ language,
+ country,
+ script,
+ hyphenate,
+ hyphenationCharacter,
+ hyphenationPushCharacterCount,
hyphenationRemainCharacterCount);
-
+
return cache.fetch(instance);
-
+
}
-
+
private static final char HYPHEN_MINUS = '-';
private static final char MINUS_SIGN = '\u2212';
-
+
/**
* Returns the effective hyphenation character for a font. The hyphenation character specified
* in XSL-FO may be substituted if it's not available in the font.
@@ -166,13 +166,13 @@ public final class CommonHyphenation {
if (warn) {
log.warn("Substituted specified hyphenation character (0x"
+ Integer.toHexString(hyphChar)
- + ") with 0x" + Integer.toHexString(effHyphChar)
- + " because the font doesn't have the specified hyphenation character: "
+ + ") with 0x" + Integer.toHexString(effHyphChar)
+ + " because the font doesn't have the specified hyphenation character: "
+ font.getFontTriplet());
}
return effHyphChar;
}
-
+
/**
* Returns the IPD for the hyphenation character for a font.
* @param font the font
@@ -182,7 +182,7 @@ public final class CommonHyphenation {
char hyphChar = getHyphChar(font);
return font.getCharWidth(hyphChar);
}
-
+
/** {@inheritDoc} */
public boolean equals(Object obj) {
if (obj == this) {
@@ -200,7 +200,7 @@ public final class CommonHyphenation {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == 0) {
@@ -209,15 +209,15 @@ public final class CommonHyphenation {
hash = 37 * hash + (script == null ? 0 : script.hashCode());
hash = 37 * hash + (country == null ? 0 : country.hashCode());
hash = 37 * hash + (hyphenate == null ? 0 : hyphenate.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationCharacter == null ? 0 : hyphenationCharacter.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationPushCharacterCount == null ? 0 : hyphenationPushCharacterCount.hashCode());
- hash = 37 * hash +
+ hash = 37 * hash +
(hyphenationRemainCharacterCount == null ? 0 : hyphenationRemainCharacterCount.hashCode());
this.hash = hash;
}
return this.hash;
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
index 6ca9e5817..8d63b3d22 100644
--- a/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
+++ b/src/java/org/apache/fop/fo/properties/CommonMarginBlock.java
@@ -5,9 +5,9 @@
* 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.
@@ -86,17 +86,17 @@ public class CommonMarginBlock {
startIndent = pList.get(Constants.PR_START_INDENT).getLength();
endIndent = pList.get(Constants.PR_END_INDENT).getLength();
}
-
+
/** {@inheritDoc} */
public String toString() {
- return "CommonMarginBlock:\n"
- + "Margins (top, bottom, left, right): ("
- + marginTop + ", " + marginBottom + ", "
+ return "CommonMarginBlock:\n"
+ + "Margins (top, bottom, left, right): ("
+ + marginTop + ", " + marginBottom + ", "
+ marginLeft + ", " + marginRight + ")\n"
- + "Space (before, after): ("
- + spaceBefore + ", " + spaceAfter + ")\n"
+ + "Space (before, after): ("
+ + spaceBefore + ", " + spaceAfter + ")\n"
+ "Indents (start, end): ("
+ startIndent + ", " + endIndent + ")\n";
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
index eb892d0a4..c578e58b8 100644
--- a/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
+++ b/src/java/org/apache/fop/fo/properties/CommonMarginInline.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
index 504fb6362..f28a3edb3 100644
--- a/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
+++ b/src/java/org/apache/fop/fo/properties/CommonRelativePosition.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ public class CommonRelativePosition {
* The "relative-position" property.
*/
public int relativePosition;
-
+
/**
* The "top" property.
*/
@@ -44,12 +44,12 @@ public class CommonRelativePosition {
* The "right" property.
*/
public Length right;
-
+
/**
* The "bottom" property.
*/
public Length bottom;
-
+
/**
* The "left" property.
*/
@@ -64,7 +64,7 @@ public class CommonRelativePosition {
top = pList.get(Constants.PR_TOP).getLength();
bottom = pList.get(Constants.PR_BOTTOM).getLength();
left = pList.get(Constants.PR_LEFT).getLength();
- right = pList.get(Constants.PR_RIGHT).getLength();
+ right = pList.get(Constants.PR_RIGHT).getLength();
}
}
diff --git a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
index d56d9a101..f7c11578d 100644
--- a/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
+++ b/src/java/org/apache/fop/fo/properties/CommonTextDecoration.java
@@ -39,30 +39,30 @@ public class CommonTextDecoration {
private static final int OVERLINE = 2;
private static final int LINE_THROUGH = 4;
private static final int BLINK = 8;
-
+
private int decoration;
private Color underColor;
private Color overColor;
private Color throughColor;
-
+
/**
* Creates a new CommonTextDecoration object with default values.
*/
public CommonTextDecoration() {
}
-
+
/**
* Creates a CommonTextDecoration object from a property list.
* @param pList the property list to build the object for
* @return a CommonTextDecoration object or null if the obj would only have default values
* @throws PropertyException if there's a problem while processing the property
*/
- public static CommonTextDecoration createFromPropertyList(PropertyList pList)
+ public static CommonTextDecoration createFromPropertyList(PropertyList pList)
throws PropertyException {
return calcTextDecoration(pList);
}
-
- private static CommonTextDecoration calcTextDecoration(PropertyList pList)
+
+ private static CommonTextDecoration calcTextDecoration(PropertyList pList)
throws PropertyException {
CommonTextDecoration deco = null;
PropertyList parentList = pList.getParentPropertyList();
@@ -76,7 +76,7 @@ public class CommonTextDecoration {
List list = textDecoProp.getList();
Iterator i = list.iterator();
while (i.hasNext()) {
- Property prop = (Property)i.next();
+ Property prop = (Property)i.next();
int propEnum = prop.getEnum();
FOUserAgent ua = (pList == null)
? null
@@ -135,7 +135,7 @@ public class CommonTextDecoration {
}
return deco;
}
-
+
/** @return true if underline is active */
public boolean hasUnderline() {
return (this.decoration & UNDERLINE) != 0;
@@ -155,12 +155,12 @@ public class CommonTextDecoration {
public boolean isBlinking() {
return (this.decoration & BLINK) != 0;
}
-
+
/** @return the color of the underline mark */
public Color getUnderlineColor() {
return this.underColor;
}
-
+
/** @return the color of the overline mark */
public Color getOverlineColor() {
return this.overColor;
diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
index f15050fbe..45f6b2e9f 100644
--- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,13 +26,13 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This class extends Property.Maker with support for sub-properties.
+ * This class extends Property.Maker with support for sub-properties.
*/
public class CompoundPropertyMaker extends PropertyMaker {
/**
* The list of subproperty makers supported by this compound maker.
- */
- private PropertyMaker[] subproperties =
+ */
+ private PropertyMaker[] subproperties =
new PropertyMaker[Constants.COMPOUND_COUNT];
/**
@@ -63,7 +63,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
}
}
-
+
/**
* Add a subproperty to this maker.
* @param subproperty
@@ -72,7 +72,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
// Place the base propId in the propId of the subproperty.
subproperty.propId &= Constants.COMPOUND_MASK;
subproperty.propId |= propId;
-
+
subproperties[getSubpropIndex(subproperty.getPropId())] = subproperty;
// Store the first subproperty with a setByShorthand. That subproperty
@@ -81,8 +81,8 @@ public class CompoundPropertyMaker extends PropertyMaker {
shorthandMaker = subproperty;
}
}
-
-
+
+
/**
* Return a Maker object which is used to set the values on components
* of compound property types, such as "space".
@@ -96,11 +96,11 @@ public class CompoundPropertyMaker extends PropertyMaker {
public PropertyMaker getSubpropMaker(int subpropertyId) {
return subproperties[getSubpropIndex(subpropertyId)];
}
-
+
/**
* Calculate the real value of a subproperty by unmasking and shifting
* the value into the range [0 - (COMPOUND_COUNT-1)].
- * The value is used as index into the subproperties array.
+ * The value is used as index into the subproperties array.
* @param propId the property id of the sub property.
* @return the array index.
*/
@@ -111,7 +111,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
/**
* For compound properties which can take enumerate values.
- * Delegate the enumeration check to one of the subpropeties.
+ * Delegate the enumeration check to one of the subpropeties.
* @param value the string containing the property value
* @return the Property encapsulating the enumerated equivalent of the
* input value
@@ -136,7 +136,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
* Is 0 when retriving a base property.
* @param propertyList The PropertyList object being built for this FO.
* @param tryInherit true if inherited properties should be examined.
- * @param tryDefault true if the default value should be returned.
+ * @param tryDefault true if the default value should be returned.
*/
public Property get(int subpropertyId, PropertyList propertyList,
boolean tryInherit, boolean tryDefault)
@@ -148,7 +148,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
return p;
}
-
+
/**
* Return a Property object based on the passed Property object.
* This method is called if the Property object built by the parser
@@ -165,7 +165,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
FObj fo) throws PropertyException {
// Delegate to the subproperty maker to do conversions.
p = shorthandMaker.convertProperty(p, propertyList, fo);
-
+
if (p != null) {
Property prop = makeCompound(propertyList, fo);
CompoundDatatype pval = (CompoundDatatype) prop.getObject();
@@ -181,7 +181,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
/**
- * Make a compound property with default values.
+ * Make a compound property with default values.
* @param propertyList The PropertyList object being built for this FO.
* @return the Property object corresponding to the parameters
* @throws PropertyException for invalid or inconsisten FO input
@@ -193,7 +193,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
return makeCompound(propertyList, propertyList.getParentFObj());
}
}
-
+
/**
* Create a Property object from an attribute specification.
* @param propertyList The PropertyList object being built for this FO.
@@ -201,14 +201,14 @@ public class CompoundPropertyMaker extends PropertyMaker {
* @param fo The parent FO for the FO whose property is being made.
* @return The initialized Property object.
* @throws PropertyException for invalid or inconsistent FO input
- */
+ */
public Property make(PropertyList propertyList, String value,
FObj fo) throws PropertyException {
Property p = super.make(propertyList, value, fo);
p = convertProperty(p, propertyList, fo);
- return p;
+ return p;
}
-
+
/**
* Return a property value for a compound property. If the property
* value is already partially initialized, this method will modify it.
@@ -243,7 +243,7 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
return baseProperty;
}
-
+
/**
* Create a empty compound property and fill it with default values for
* the subproperties.
@@ -265,5 +265,5 @@ public class CompoundPropertyMaker extends PropertyMaker {
}
}
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
index 15d430051..aa913d969 100644
--- a/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/CondLengthProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,14 +31,14 @@ import org.apache.fop.fo.expr.PropertyException;
* Superclass for properties that have conditional lengths
*/
public class CondLengthProperty extends Property implements CompoundDatatype {
-
+
/** cache holding canonical instances (for absolute conditional lengths) */
private static final PropertyCache cache = new PropertyCache(CondLengthProperty.class);
-
+
/** components */
private Property length;
private EnumProperty conditionality;
-
+
private boolean isCached = false;
private int hash = -1;
@@ -56,7 +56,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of CondLengthProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new CondLengthProperty();
@@ -64,7 +64,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof KeepProperty) {
@@ -75,7 +75,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -83,7 +83,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
throw new IllegalStateException(
"CondLengthProperty.setComponent() called on a cached value!");
}
-
+
if (cmpId == CP_LENGTH) {
length = cmpnValue;
} else if (cmpId == CP_CONDITIONALITY) {
@@ -147,11 +147,11 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
- return "CondLength[" + length.getObject().toString()
- + ", " + (isDiscard()
- ? conditionality.toString().toLowerCase()
+ return "CondLength[" + length.getObject().toString()
+ + ", " + (isDiscard()
+ ? conditionality.toString().toLowerCase()
: conditionality.toString()) + "]";
- }
+ }
/**
* @return this.condLength
@@ -188,7 +188,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
if (this == obj) {
return true;
}
-
+
if (obj instanceof CondLengthProperty) {
CondLengthProperty clp = (CondLengthProperty)obj;
return (this.length == clp.length
@@ -196,7 +196,7 @@ public class CondLengthProperty extends Property implements CompoundDatatype {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == -1) {
diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
index add38161e..60237c53a 100644
--- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -33,19 +33,19 @@ public class CorrespondingPropertyMaker {
protected int tb_rl;
protected boolean useParent;
private boolean relative;
-
+
public CorrespondingPropertyMaker(PropertyMaker baseMaker) {
this.baseMaker = baseMaker;
baseMaker.setCorresponding(this);
}
-
-
+
+
public void setCorresponding(int lr_tb, int rl_tb, int tb_rl) {
this.lr_tb = lr_tb;
this.rl_tb = rl_tb;
this.tb_rl = tb_rl;
}
-
+
/**
* Controls whether the PropertyMaker accesses the parent property list or the current
* property list for determining the writing mode.
@@ -58,7 +58,7 @@ public class CorrespondingPropertyMaker {
public void setRelative(boolean relative) {
this.relative = relative;
}
-
+
/**
* For properties that operate on a relative direction (before, after,
* start, end) instead of an absolute direction (top, bottom, left,
@@ -80,18 +80,18 @@ public class CorrespondingPropertyMaker {
if (!relative) {
return false;
}
-
+
PropertyList pList = getWMPropertyList(propertyList);
if (pList != null) {
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
if (pList.getExplicit(correspondingId) != null) {
return true;
}
- }
+ }
return false;
}
-
+
/**
* Return a Property object representing the value of this property,
* based on other property values for this FO.
@@ -108,7 +108,7 @@ public class CorrespondingPropertyMaker {
return null;
}
int correspondingId = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
-
+
Property p = propertyList.getExplicitOrShorthand(correspondingId);
if (p != null) {
FObj parentFO = propertyList.getParentFObj();
@@ -116,7 +116,7 @@ public class CorrespondingPropertyMaker {
}
return p;
}
-
+
/**
* Return the property list to use for fetching writing mode depending property
* ids.
diff --git a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
index 6bd30929a..29715fe66 100644
--- a/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/DimensionPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
public DimensionPropertyMaker(PropertyMaker baseMaker) {
super(baseMaker);
}
-
+
public void setExtraCorresponding(int[][] extraCorresponding) {
this.extraCorresponding = extraCorresponding;
}
@@ -47,7 +47,7 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
int wmcorr = extraCorresponding[i][0]; //propertyList.getWritingMode()];
if (propertyList.getExplicit(wmcorr) != null)
return true;
- }
+ }
return false;
}
@@ -59,8 +59,8 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
// Based on min-[width|height]
- int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
- extraCorresponding[0][1],
+ int wmcorr = propertyList.getWritingMode(extraCorresponding[0][0],
+ extraCorresponding[0][1],
extraCorresponding[0][2]);
Property subprop = propertyList.getExplicitOrShorthand(wmcorr);
if (subprop != null) {
@@ -68,8 +68,8 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
// Based on max-[width|height]
- wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
- extraCorresponding[1][1],
+ wmcorr = propertyList.getWritingMode(extraCorresponding[1][0],
+ extraCorresponding[1][1],
extraCorresponding[1][2]);
subprop = propertyList.getExplicitOrShorthand(wmcorr);
// TODO: Don't set when NONE.
@@ -78,5 +78,5 @@ public class DimensionPropertyMaker extends CorrespondingPropertyMaker {
}
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/EnumLength.java b/src/java/org/apache/fop/fo/properties/EnumLength.java
index 95b759356..76fd0e5b7 100755
--- a/src/java/org/apache/fop/fo/properties/EnumLength.java
+++ b/src/java/org/apache/fop/fo/properties/EnumLength.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -26,7 +26,7 @@ import org.apache.fop.datatypes.PercentBaseContext;
*/
public class EnumLength extends LengthProperty {
private Property enumProperty;
-
+
public EnumLength(Property enumProperty) {
this.enumProperty = enumProperty;
}
diff --git a/src/java/org/apache/fop/fo/properties/EnumNumber.java b/src/java/org/apache/fop/fo/properties/EnumNumber.java
index 5e60b4e35..fdc359a06 100755
--- a/src/java/org/apache/fop/fo/properties/EnumNumber.java
+++ b/src/java/org/apache/fop/fo/properties/EnumNumber.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fo.properties;
import org.apache.fop.datatypes.Numeric;
@@ -32,7 +32,7 @@ public final class EnumNumber extends Property implements Numeric {
private static final PropertyCache cache = new PropertyCache(EnumNumber.class);
private final EnumProperty enumProperty;
-
+
/**
* Constructor
* @param enumProperty the base EnumProperty
@@ -44,7 +44,7 @@ public final class EnumNumber extends Property implements Numeric {
/**
* Returns the canonical EnumNumber instance corresponding
* to the given Property
- *
+ *
* @param enumProperty the base EnumProperty
* @return the canonical instance
*/
@@ -87,16 +87,16 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
+ /**
* {@inheritDoc}
* Always true
for instances of this type
*/
public boolean isAbsolute() {
return true;
}
-
- /**
- * {@inheritDoc}
+
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue(PercentBaseContext context) throws PropertyException {
@@ -104,8 +104,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue(PercentBaseContext context) {
@@ -113,8 +113,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public int getValue() {
@@ -122,8 +122,8 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
* logs an error, because it's not supposed to be called
*/
public double getNumericValue() {
@@ -131,7 +131,7 @@ public final class EnumNumber extends Property implements Numeric {
return 0;
}
- /**
+ /**
* {@inheritDoc}
*/
public Numeric getNumeric() {
diff --git a/src/java/org/apache/fop/fo/properties/EnumProperty.java b/src/java/org/apache/fop/fo/properties/EnumProperty.java
index d3043c5c3..07cfaadcc 100644
--- a/src/java/org/apache/fop/fo/properties/EnumProperty.java
+++ b/src/java/org/apache/fop/fo/properties/EnumProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.expr.PropertyException;
* Superclass for properties that wrap an enumeration value
*/
public final class EnumProperty extends Property {
-
+
/** cache holding all canonical EnumProperty instances */
private static final PropertyCache cache = new PropertyCache(EnumProperty.class);
@@ -102,7 +102,7 @@ public final class EnumProperty extends Property {
public boolean equals(Object obj) {
if (obj instanceof EnumProperty) {
EnumProperty ep = (EnumProperty)obj;
- return (ep.value == this.value)
+ return (ep.value == this.value)
&& ((ep.text == this.text)
|| (ep.text != null
&& ep.text.equals(this.text)));
diff --git a/src/java/org/apache/fop/fo/properties/FixedLength.java b/src/java/org/apache/fop/fo/properties/FixedLength.java
index 5636a4225..84d159edf 100644
--- a/src/java/org/apache/fop/fo/properties/FixedLength.java
+++ b/src/java/org/apache/fop/fo/properties/FixedLength.java
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@ import org.apache.fop.datatypes.PercentBaseContext;
* An absolute length quantity in XSL
*/
public final class FixedLength extends LengthProperty {
-
+
/** Describes the unit pica. */
public static final String PICA = "pc";
@@ -46,16 +46,16 @@ public final class FixedLength extends LengthProperty {
/** cache holding all canonical FixedLength instances */
private static final PropertyCache cache = new PropertyCache(FixedLength.class);
-
+
/** canonical zero-length instance */
public static final FixedLength ZERO_FIXED_LENGTH = new FixedLength(0, FixedLength.MPT, 1.0f);
-
+
private int millipoints;
/**
* Set the length given a number of units, a unit name and
* an assumed resolution (used in case the units are pixels)
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param res input/source resolution
@@ -63,11 +63,11 @@ public final class FixedLength extends LengthProperty {
private FixedLength(double numUnits, String units, float res) {
this.millipoints = convert(numUnits, units, res);
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value in base-units (millipoints).
- *
+ *
* @param numUnits quantity of input units
* @param units input unit specifier
* @param sourceResolution input/source resolution (= ratio of pixels per pt)
@@ -75,7 +75,7 @@ public final class FixedLength extends LengthProperty {
* to the given number of units and unit specifier
* in the given resolution
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units,
float sourceResolution) {
if (numUnits == 0.0) {
@@ -84,44 +84,44 @@ public final class FixedLength extends LengthProperty {
return (FixedLength)cache.fetch(
new FixedLength(numUnits, units, sourceResolution));
}
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value
* This method assumes a source-resolution of 1 (1px = 1pt)
- *
+ *
* @param numUnits input units
* @param units unit specifier
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
- public static FixedLength getInstance(double numUnits,
+ public static FixedLength getInstance(double numUnits,
String units) {
return getInstance(numUnits, units, 1.0f);
-
+
}
-
+
/**
* Return the cached {@link FixedLength} instance corresponding
* to the computed value.
- * This method assumes 'millipoints' (non-standard) as units,
+ * This method assumes 'millipoints' (non-standard) as units,
* and an implied source-resolution of 1 (1px = 1pt).
- *
+ *
* @param numUnits input units
* @return the canonical FixedLength instance corresponding
* to the given number of units and unit specifier
*/
public static FixedLength getInstance(double numUnits) {
return getInstance(numUnits, FixedLength.MPT, 1.0f);
-
+
}
-
+
/**
* Convert the given length to a dimensionless integer representing
* a whole number of base units (milli-points).
- *
+ *
* @param dvalue quantity of input units
* @param unit input unit specifier (in, cm, etc.)
* @param res the input/source resolution (in case the unit spec is "px")
diff --git a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
index 7404dbe9b..34a6b58d8 100644
--- a/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
+++ b/src/java/org/apache/fop/fo/properties/FontFamilyProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,9 +32,9 @@ public final class FontFamilyProperty extends ListProperty {
/** cache holding all canonical FontFamilyProperty instances */
private static final PropertyCache cache = new PropertyCache(FontFamilyProperty.class);
-
+
private int hash = 0;
-
+
/**
* Inner class for creating instances of ListProperty
*/
@@ -126,7 +126,7 @@ public final class FontFamilyProperty extends ListProperty {
private FontFamilyProperty() {
super();
}
-
+
/**
* Add a new property to the list
* @param prop Property to be added to the list
@@ -154,7 +154,7 @@ public final class FontFamilyProperty extends ListProperty {
if (this == o) {
return true;
}
-
+
if (o instanceof FontFamilyProperty) {
FontFamilyProperty ffp = (FontFamilyProperty) o;
return (this.list != null
@@ -162,7 +162,7 @@ public final class FontFamilyProperty extends ListProperty {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
if (this.hash == 0) {
diff --git a/src/java/org/apache/fop/fo/properties/FontShorthandParser.java b/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
index 89e029c5e..c22ba4745 100644
--- a/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/FontShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -29,14 +29,14 @@ import org.apache.fop.fo.expr.PropertyException;
public class FontShorthandParser extends GenericShorthandParser {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
int index = -1;
Property newProp;
switch (propId) {
diff --git a/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java b/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
index 638f77338..0cb44d7f8 100644
--- a/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
+++ b/src/java/org/apache/fop/fo/properties/FontShorthandProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,24 +39,24 @@ public class FontShorthandProperty extends ListProperty {
Constants.PR_LINE_HEIGHT, Constants.PR_FONT_STYLE,
Constants.PR_FONT_VARIANT, Constants.PR_FONT_WEIGHT
};
-
+
/**
* @param propId ID of the property for which Maker should be created
*/
public Maker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList propertyList,
+ public Property make(PropertyList propertyList,
String value, FObj fo) throws PropertyException {
-
+
try {
FontShorthandProperty newProp = new FontShorthandProperty();
newProp.setSpecifiedValue(value);
-
+
String specVal = value;
Property prop = null;
if ("inherit".equals(specVal)) {
@@ -80,14 +80,14 @@ public class FontShorthandProperty extends ListProperty {
int spaceIndex = value.indexOf(' ');
int quoteIndex = (value.indexOf('\'') == -1)
? value.indexOf('\"') : value.indexOf('\'');
- if (spaceIndex == -1
+ if (spaceIndex == -1
|| (quoteIndex != -1 && spaceIndex > quoteIndex)) {
/* no spaces or first space appears after the first
* single/double quote, so malformed value string
*/
throw new PropertyException("Invalid property value: "
- + "font=\"" + value + "\"");
- }
+ + "font=\"" + value + "\"");
+ }
PropertyMaker m = null;
int fromIndex = spaceIndex + 1;
int toIndex = specVal.length();
@@ -97,11 +97,11 @@ public class FontShorthandProperty extends ListProperty {
boolean fontFamilyParsed = false;
int commaIndex = value.indexOf(',');
while (!fontFamilyParsed) {
- /* value contains a (list of) possibly quoted
- * font-family name(s)
+ /* value contains a (list of) possibly quoted
+ * font-family name(s)
*/
if (commaIndex == -1) {
- /* no list, just a single name
+ /* no list, just a single name
* (or first name in the list)
*/
if (quoteIndex != -1) {
@@ -112,7 +112,7 @@ public class FontShorthandProperty extends ListProperty {
m = FObj.getPropertyMakerFor(PROP_IDS[1]);
prop = m.make(propertyList, specVal.substring(fromIndex), fo);
newProp.addProperty(prop, 1);
- fontFamilyParsed = true;
+ fontFamilyParsed = true;
} else {
if (quoteIndex != -1 && quoteIndex < commaIndex) {
/* a quoted font-family name as first name
@@ -131,7 +131,7 @@ public class FontShorthandProperty extends ListProperty {
fromIndex = value.lastIndexOf(' ', toIndex - 1) + 1;
value = specVal.substring(fromIndex, toIndex);
int slashIndex = value.indexOf('/');
- String fontSize = value.substring(0,
+ String fontSize = value.substring(0,
(slashIndex == -1) ? value.length() : slashIndex);
m = FObj.getPropertyMakerFor(PROP_IDS[0]);
prop = m.make(propertyList, fontSize, fo);
@@ -190,7 +190,7 @@ public class FontShorthandProperty extends ListProperty {
}
}
}
-
+
private void addProperty(Property prop, int pos) {
while (list.size() < (pos + 1)) {
list.add(null);
diff --git a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
index b641b2abf..5096d6160 100644
--- a/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontSizePropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -24,30 +24,30 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of LengthProperty.Maker handles the special treatment of
+ * This subclass of LengthProperty.Maker handles the special treatment of
* relative font sizes described in 7.8.4.
*/
-public class FontSizePropertyMaker
+public class FontSizePropertyMaker
extends LengthProperty.Maker implements Constants {
/** The default normal font size in mpt */
private static final int FONT_SIZE_NORMAL = 12000;
/** The factor to be applied when stepping font sizes upwards */
private static final double FONT_SIZE_GROWTH_FACTOR = 1.2;
-
+
/**
- * Create a length property which can handle relative font sizes
+ * Create a length property which can handle relative font sizes
* @param propId the font size property id.
*/
public FontSizePropertyMaker(int propId) {
super(propId);
}
-
-
+
+
/**
* {@inheritDoc}
* Contrary to basic lengths, percentages for font-size can be resolved
- * here already: if the property evaluates to a {@link PercentLength},
+ * here already: if the property evaluates to a {@link PercentLength},
* it is immediately replaced by the resolved {@link FixedLength}.
*/
public Property make(PropertyList propertyList, String value, FObj fo) throws PropertyException {
@@ -82,7 +82,7 @@ public class FontSizePropertyMaker
}
return super.convertProperty(p, propertyList, fo);
}
-
+
/**
* Calculates the nearest absolute font size to the given
* font size.
@@ -107,7 +107,7 @@ public class FontSizePropertyMaker
}
// baseFontSize is between last and next step font size
// Return the step value closer to the baseFontSize
- if (Math.abs(lastStepFontSize - baseFontSize)
+ if (Math.abs(lastStepFontSize - baseFontSize)
<= Math.abs(baseFontSize - nextStepFontSize)) {
return lastStepFontSize;
}
diff --git a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
index 82f152ff5..eba62946d 100644
--- a/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontStretchPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -24,24 +24,24 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.expr.PropertyException;
/**
- * This subclass of EnumProperty.Maker handles the special treatment of
+ * This subclass of EnumProperty.Maker handles the special treatment of
* relative font stretch values described in 7.8.5.
*/
-public class FontStretchPropertyMaker
+public class FontStretchPropertyMaker
extends EnumProperty.Maker implements Constants {
-
+
/* Ordered list of absolute font stretch properties so we can easily find the next /
* previous one */
private Property[] orderedFontStretchValues = null;
-
+
/**
- * Create an enum property which can handle relative font stretches
+ * Create an enum property which can handle relative font stretches
* @param propId the font size property id.
*/
public FontStretchPropertyMaker(int propId) {
super(propId);
}
-
+
/**
* {@inheritDoc}
* Implements the parts of 7.8.5 relevant to relative font stretches
diff --git a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
index 173b28f7c..278fec862 100644
--- a/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/FontWeightPropertyMaker.java
@@ -26,7 +26,7 @@ import org.apache.fop.fo.expr.PropertyInfo;
import org.apache.fop.fo.expr.PropertyParser;
public class FontWeightPropertyMaker extends EnumProperty.Maker {
-
+
/**
* Main constructor
* @param propId the property id
@@ -34,11 +34,11 @@ public class FontWeightPropertyMaker extends EnumProperty.Maker {
public FontWeightPropertyMaker(int propId) {
super(propId);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
- public Property make(PropertyList pList, String value, FObj fo)
+ public Property make(PropertyList pList, String value, FObj fo)
throws PropertyException {
if ("inherit".equals(value)) {
return super.make(pList, value, fo);
diff --git a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
index 5802112bc..b008c714d 100644
--- a/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/GenericShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -30,7 +30,7 @@ import org.apache.fop.fo.expr.PropertyException;
public class GenericShorthandParser implements ShorthandParser {
/**
- * Constructor.
+ * Constructor.
*/
public GenericShorthandParser() {
}
@@ -47,9 +47,9 @@ public class GenericShorthandParser implements ShorthandParser {
return null;
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
diff --git a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
index 75ecb9d24..d976fc6ea 100644
--- a/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/IndentPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -33,15 +33,15 @@ import org.apache.fop.fo.expr.PropertyException;
*/
public class IndentPropertyMaker extends CorrespondingPropertyMaker {
/**
- * The corresponding padding-* propIds
+ * The corresponding padding-* propIds
*/
- private int[] paddingCorresponding = null;
+ private int[] paddingCorresponding = null;
/**
- * The corresponding border-*-width propIds
+ * The corresponding border-*-width propIds
*/
private int[] borderWidthCorresponding = null;
-
+
/**
* Create a start-indent or end-indent property maker.
* @param baseMaker the property maker to use
@@ -57,7 +57,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
public void setPaddingCorresponding(int[] paddingCorresponding) {
this.paddingCorresponding = paddingCorresponding;
}
-
+
/**
* Set the corresponding values for the border-*-width properties.
* @param borderWidthCorresponding the corresping propids.
@@ -65,9 +65,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
public void setBorderWidthCorresponding(int[] borderWidthCorresponding) {
this.borderWidthCorresponding = borderWidthCorresponding;
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property compute(PropertyList propertyList) throws PropertyException {
@@ -78,9 +78,9 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
return computeConforming(propertyList);
}
}
-
+
/**
- * Calculate the corresponding value for start-indent and end-indent.
+ * Calculate the corresponding value for start-indent and end-indent.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeConforming(PropertyList propertyList) throws PropertyException {
@@ -92,7 +92,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
@@ -107,7 +107,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (!propertyList.getFObj().generatesReferenceAreas()) {
// The inherited_value_of([start|end]-indent)
@@ -119,23 +119,23 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
v = NumericOp.addition(v, border);
return (Property) v;
}
-
+
}
-
+
private boolean isInherited(PropertyList pList) {
if (pList.getFObj().getUserAgent().isBreakIndentInheritanceOnReferenceAreaBoundary()) {
- FONode nd = pList.getFObj().getParent();
+ FONode nd = pList.getFObj().getParent();
return !((nd instanceof FObj) && ((FObj)nd).generatesReferenceAreas());
} else {
return true;
}
}
-
+
/**
* Calculate the corresponding value for start-indent and end-indent.
* This method calculates indent following an alternative rule set that
* tries to mimic many commercial solutions that chose to violate the
- * XSL specification.
+ * XSL specification.
* @see CorrespondingPropertyMaker#compute(PropertyList)
*/
public Property computeAlternativeRuleset(PropertyList propertyList) throws PropertyException {
@@ -148,10 +148,10 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
Numeric padding = getCorresponding(paddingCorresponding, propertyList).getNumeric();
Numeric border = getCorresponding(borderWidthCorresponding, propertyList).getNumeric();
-
+
int marginProp = pList.getWritingMode(lr_tb, rl_tb, tb_rl);
- //Determine whether the nearest anscestor indent was specified through
+ //Determine whether the nearest anscestor indent was specified through
//start-indent|end-indent or through a margin property.
boolean marginNearest = false;
PropertyList pl = propertyList.getParentPropertyList();
@@ -164,7 +164,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
}
pl = pl.getParentPropertyList();
}
-
+
// Calculate the absolute margin.
if (propertyList.getExplicitOrShorthand(marginProp) == null) {
Property indent = propertyList.getExplicit(baseMaker.propId);
@@ -181,7 +181,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
} else {
//Margin is used
Numeric margin = propertyList.get(marginProp).getNumeric();
-
+
Numeric v = FixedLength.ZERO_FIXED_LENGTH;
if (isInherited(propertyList)) {
// The inherited_value_of([start|end]-indent)
@@ -194,7 +194,7 @@ public class IndentPropertyMaker extends CorrespondingPropertyMaker {
return (Property) v;
}
}
-
+
private Property getCorresponding(int[] corresponding, PropertyList propertyList)
throws PropertyException {
PropertyList pList = getWMPropertyList(propertyList);
diff --git a/src/java/org/apache/fop/fo/properties/KeepProperty.java b/src/java/org/apache/fop/fo/properties/KeepProperty.java
index 67961b6e5..d2e2c70a7 100644
--- a/src/java/org/apache/fop/fo/properties/KeepProperty.java
+++ b/src/java/org/apache/fop/fo/properties/KeepProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,10 +28,10 @@ import org.apache.fop.fo.expr.PropertyException;
* Class for properties that wrap Keep values
*/
public final class KeepProperty extends Property implements CompoundDatatype {
-
+
/** class holding all canonical KeepProperty instances*/
private static final PropertyCache cache = new PropertyCache(KeepProperty.class);
-
+
private boolean isCachedValue = false;
private Property withinLine;
private Property withinColumn;
@@ -51,7 +51,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of KeepProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new KeepProperty();
@@ -59,7 +59,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException
{
@@ -71,7 +71,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -154,9 +154,9 @@ public final class KeepProperty extends Property implements CompoundDatatype {
* @return String representation
*/
public String toString() {
- return "Keep[" +
- "withinLine:" + getWithinLine().getObject() +
- ", withinColumn:" + getWithinColumn().getObject() +
+ return "Keep[" +
+ "withinLine:" + getWithinLine().getObject() +
+ ", withinColumn:" + getWithinColumn().getObject() +
", withinPage:" + getWithinPage().getObject() + "]";
}
@@ -183,7 +183,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
if (this == o) {
return true;
}
-
+
if (o instanceof KeepProperty) {
KeepProperty keep = (KeepProperty) o;
return (keep.withinColumn == this.withinColumn)
@@ -192,7 +192,7 @@ public final class KeepProperty extends Property implements CompoundDatatype {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
int hash = 17;
diff --git a/src/java/org/apache/fop/fo/properties/LengthPairProperty.java b/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
index f89b7d8b7..9840c4683 100644
--- a/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthPairProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,7 +45,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of LengthPairProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthPairProperty();
@@ -53,7 +53,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/**
* {@inheritDoc}
- */
+ */
public Property convertProperty(Property p, PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof LengthPairProperty) {
@@ -69,7 +69,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
public LengthPairProperty() {
super();
}
-
+
/**
* Creates a new LengthPairProperty.
* @param ipd inline-progression-dimension
@@ -80,7 +80,7 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
this.ipd = ipd;
this.bpd = bpd;
}
-
+
/**
* Creates a new LengthPairProperty which sets both bpd and ipd to the
* same value.
@@ -89,9 +89,9 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
public LengthPairProperty(Property len) {
this(len, len);
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -131,8 +131,8 @@ public class LengthPairProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
- return "LengthPair["
- + "ipd:" + getIPD().getObject()
+ return "LengthPair["
+ + "ipd:" + getIPD().getObject()
+ ", bpd:" + getBPD().getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/LengthProperty.java b/src/java/org/apache/fop/fo/properties/LengthProperty.java
index 697aa75a7..4ffe38074 100644
--- a/src/java/org/apache/fop/fo/properties/LengthProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,9 +28,9 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* Superclass for properties wrapping a Length value.
*/
-public abstract class LengthProperty extends Property
+public abstract class LengthProperty extends Property
implements Length, Numeric {
-
+
/**
* Inner class for making instances of LengthProperty
*/
@@ -38,7 +38,7 @@ public abstract class LengthProperty extends Property
/**
* Constructor
- *
+ *
* @param propId the id of the property for which a Maker should be created
*/
public Maker(int propId) {
diff --git a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
index aeab37972..3161fc517 100644
--- a/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
+++ b/src/java/org/apache/fop/fo/properties/LengthRangeProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -53,7 +53,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/**
* Create a new empty instance of LengthRangeProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new LengthRangeProperty();
@@ -64,16 +64,16 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
&& ((PercentLength) len).getPercentage() < 0)
|| (len.isAbsolute() && len.getValue() < 0));
}
-
- /** {@inheritDoc} */
- public Property convertProperty(Property p,
+
+ /** {@inheritDoc} */
+ public Property convertProperty(Property p,
PropertyList propertyList, FObj fo)
throws PropertyException {
-
+
if (p instanceof LengthRangeProperty) {
return p;
}
-
+
if (this.propId == PR_BLOCK_PROGRESSION_DIMENSION
|| this.propId == PR_INLINE_PROGRESSION_DIMENSION) {
Length len = p.getLength();
@@ -86,13 +86,13 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
}
}
-
+
return super.convertProperty(p, propertyList, fo);
}
-
-
+
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected Property setSubprop(Property baseProperty, int subpropertyId,
Property subproperty) {
@@ -119,7 +119,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -191,7 +191,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
consistent = false;
}
-
+
// Minimum is prioritaire, if explicit
private void checkConsistency(PercentBaseContext context) {
if (consistent) {
@@ -203,7 +203,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
// Make sure max >= min
// Must also control if have any allowed enum values!
- if (!minimum.isAuto() && !maximum.isAuto()
+ if (!minimum.isAuto() && !maximum.isAuto()
&& minimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force max to min
@@ -217,7 +217,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
}
}
// Now make sure opt <= max and opt >= min
- if (!optimum.isAuto() && !maximum.isAuto()
+ if (!optimum.isAuto() && !maximum.isAuto()
&& optimum.getLength().getValue(context) > maximum.getLength().getValue(context)) {
if ((bfSet & OPTSET) != 0) {
if ((bfSet & MAXSET) != 0) {
@@ -231,8 +231,8 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
// opt is default and max is explicit or default
optimum = maximum;
}
- } else if (!optimum.isAuto() && !minimum.isAuto()
- && optimum.getLength().getValue(context)
+ } else if (!optimum.isAuto() && !minimum.isAuto()
+ && optimum.getLength().getValue(context)
< minimum.getLength().getValue(context)) {
if ((bfSet & MINSET) != 0) {
// if minimum is explicit, force opt to min
@@ -244,7 +244,7 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
minimum = optimum; // minimum was default value
}
}
-
+
consistent = true;
}
@@ -278,8 +278,8 @@ public class LengthRangeProperty extends Property implements CompoundDatatype {
/** {@inheritDoc} */
public String toString() {
return "LengthRange["
- + "min:" + getMinimum(null).getObject()
- + ", max:" + getMaximum(null).getObject()
+ + "min:" + getMinimum(null).getObject()
+ + ", max:" + getMaximum(null).getObject()
+ ", opt:" + getOptimum(null).getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
index dd57502d8..4b408e83b 100644
--- a/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/LineHeightPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -33,7 +33,7 @@ import org.apache.fop.fo.expr.PropertyException;
* value, instead of the computed value.
* So when a line-height is create based on an attribute, the specified value
* is stored in the property and in compute() the stored specified value of
- * the nearest specified is used to recalculate the line-height.
+ * the nearest specified is used to recalculate the line-height.
*/
public class LineHeightPropertyMaker extends SpaceProperty.Maker {
@@ -48,9 +48,9 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
/**
* {@inheritDoc}
*/
- public Property make(PropertyList propertyList, String value, FObj fo)
+ public Property make(PropertyList propertyList, String value, FObj fo)
throws PropertyException {
- /* if value was specified as a number/length/percentage then
+ /* if value was specified as a number/length/percentage then
* conditionality and precedence components are overridden
*/
Property p = super.make(propertyList, value, fo);
@@ -60,7 +60,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
EnumProperty.getInstance(Constants.EN_FORCE, "FORCE"), true);
return p;
}
-
+
/**
* Recalculate the line-height value based on the nearest specified
* value.
@@ -80,7 +80,7 @@ public class LineHeightPropertyMaker extends SpaceProperty.Maker {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property convertProperty(Property p,
PropertyList propertyList,
diff --git a/src/java/org/apache/fop/fo/properties/ListProperty.java b/src/java/org/apache/fop/fo/properties/ListProperty.java
index 46d8c9496..4c5208505 100644
--- a/src/java/org/apache/fop/fo/properties/ListProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ListProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -64,7 +64,7 @@ public class ListProperty extends Property {
protected ListProperty() {
//nop
}
-
+
/**
* @param prop the first Property to be added to the list
*/
diff --git a/src/java/org/apache/fop/fo/properties/NumberProperty.java b/src/java/org/apache/fop/fo/properties/NumberProperty.java
index aa4791889..4d7c3b97b 100644
--- a/src/java/org/apache/fop/fo/properties/NumberProperty.java
+++ b/src/java/org/apache/fop/fo/properties/NumberProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -51,7 +51,7 @@ public final class NumberProperty extends Property implements Numeric {
* {@inheritDoc}
*/
public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof NumberProperty) {
return p;
@@ -79,12 +79,12 @@ public final class NumberProperty extends Property implements Numeric {
}
/**
- * If the value is not positive, return a property with value 1
- *
+ * If the value is not positive, return a property with value 1
+ *
* {@inheritDoc}
*/
- public Property convertProperty(Property p,
- PropertyList propertyList, FObj fo)
+ public Property convertProperty(Property p,
+ PropertyList propertyList, FObj fo)
throws PropertyException {
if (p instanceof EnumProperty) {
return EnumNumber.getInstance(p);
@@ -101,10 +101,10 @@ public final class NumberProperty extends Property implements Numeric {
}
}
-
+
/** cache holding all canonical NumberProperty instances */
private static final PropertyCache cache = new PropertyCache(NumberProperty.class);
-
+
private final Number number;
/**
@@ -132,7 +132,7 @@ public final class NumberProperty extends Property implements Numeric {
private NumberProperty(int num) {
this.number = new Integer(num);
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Number
@@ -143,7 +143,7 @@ public final class NumberProperty extends Property implements Numeric {
return (NumberProperty)cache.fetch(
new NumberProperty(num.doubleValue()));
}
-
+
/**
* Returns the canonical NumberProperty instance
* corresponding to the given Integer
@@ -176,7 +176,7 @@ public final class NumberProperty extends Property implements Numeric {
return (NumberProperty)cache.fetch(
new NumberProperty(num));
}
-
+
/**
* Plain number always has a dimension of 0.
* @return a dimension of 0.
@@ -254,7 +254,7 @@ public final class NumberProperty extends Property implements Numeric {
/**
* Convert NumberProperty to a Color. Not sure why this is needed.
- * @param foUserAgent FOUserAgent
+ * @param foUserAgent FOUserAgent
* @return Color that corresponds to black
*/
public Color getColor(FOUserAgent foUserAgent) {
@@ -268,7 +268,7 @@ public final class NumberProperty extends Property implements Numeric {
public int hashCode() {
return number.hashCode();
}
-
+
/** {@inheritDoc} */
public boolean equals(Object o) {
if (o == this) {
diff --git a/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java b/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
index f04cdd3cc..066c00336 100644
--- a/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/PageBreakShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,9 +28,9 @@ import org.apache.fop.fo.expr.PropertyException;
* Used to set the corresponding keep-* and break-* properties.
*/
public class PageBreakShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
@@ -38,11 +38,11 @@ public class PageBreakShorthandParser implements ShorthandParser {
PropertyList propertyList)
throws PropertyException {
- if (propId == Constants.PR_KEEP_WITH_PREVIOUS
+ if (propId == Constants.PR_KEEP_WITH_PREVIOUS
|| propId == Constants.PR_KEEP_WITH_NEXT
|| propId == Constants.PR_KEEP_TOGETHER) {
if (property.getEnum() == Constants.EN_AVOID) {
- return maker.make(null, Constants.CP_WITHIN_PAGE,
+ return maker.make(null, Constants.CP_WITHIN_PAGE,
propertyList, "always", propertyList.getFObj());
}
} else if (propId == Constants.PR_BREAK_BEFORE
diff --git a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
index 542dcac32..53a9c1286 100644
--- a/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PageDimensionMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,38 +26,38 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* Custom Maker for page-height / page-width
- *
+ *
*/
public class PageDimensionMaker extends LengthProperty.Maker {
-
+
/**
* Constructor
- *
+ *
* @param propId the property Id
*/
public PageDimensionMaker(int propId) {
super(propId);
}
-
+
/**
- * Check the value of the page-width / page-height property.
+ * Check the value of the page-width / page-height property.
* Return the default or user-defined fallback in case the value
* was specified as "auto"
- *
+ *
* @see PropertyMaker#get(int, PropertyList, boolean, boolean)
*/
public Property get(int subpropId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
+ boolean tryInherit, boolean tryDefault)
throws PropertyException {
-
- Property p = super.get(0, propertyList, tryInherit, tryDefault);
+
+ Property p = super.get(0, propertyList, tryInherit, tryDefault);
FObj fo = propertyList.getFObj();
String fallbackValue = (propId == Constants.PR_PAGE_HEIGHT)
? fo.getUserAgent().getPageHeight()
: fo.getUserAgent().getPageWidth();
-
+
if (p.getEnum() == Constants.EN_INDEFINITE) {
- int otherId = (propId == Constants.PR_PAGE_HEIGHT)
+ int otherId = (propId == Constants.PR_PAGE_HEIGHT)
? Constants.PR_PAGE_WIDTH : Constants.PR_PAGE_HEIGHT;
int writingMode = propertyList.get(Constants.PR_WRITING_MODE).getEnum();
int refOrientation = propertyList.get(Constants.PR_REFERENCE_ORIENTATION)
@@ -66,10 +66,10 @@ public class PageDimensionMaker extends LengthProperty.Maker {
&& propertyList.getExplicit(otherId).getEnum() == Constants.EN_INDEFINITE) {
//both set to "indefinite":
//determine which one of the two defines the dimension
- //in block-progression-direction, and set the other to
+ //in block-progression-direction, and set the other to
//"auto"
if ((writingMode != Constants.EN_TB_RL
- && (refOrientation == 0
+ && (refOrientation == 0
|| refOrientation == 180
|| refOrientation == -180))
|| (writingMode == Constants.EN_TB_RL
@@ -94,7 +94,7 @@ public class PageDimensionMaker extends LengthProperty.Maker {
} else if (p.isAuto()) {
return make(propertyList, fallbackValue, fo);
}
-
+
return p;
- }
+ }
}
diff --git a/src/java/org/apache/fop/fo/properties/PercentLength.java b/src/java/org/apache/fop/fo/properties/PercentLength.java
index 82f5e60f9..f89007f34 100644
--- a/src/java/org/apache/fop/fo/properties/PercentLength.java
+++ b/src/java/org/apache/fop/fo/properties/PercentLength.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import org.apache.fop.fo.expr.PropertyException;
* a percent specified length quantity in XSL
*/
public class PercentLength extends LengthProperty {
-
+
/**
* The percentage itself, expressed as a decimal value, e.g. for 95%, set
* the value to .95
@@ -39,7 +39,7 @@ public class PercentLength extends LengthProperty {
* {@link #factor} should be applied to compute the actual length
*/
private PercentBase lbase = null;
-
+
private double resolvedValue;
/**
@@ -63,9 +63,9 @@ public class PercentLength extends LengthProperty {
}
/**
- * Used during property resolution to check for
+ * Used during property resolution to check for
* negative percentages
- *
+ *
* @return the percentage value
*/
protected double getPercentage() {
@@ -95,7 +95,7 @@ public class PercentLength extends LengthProperty {
return 0;
}
}
-
+
/** {@inheritDoc} */
public String getString() {
return (factor * 100.0) + "%";
@@ -103,7 +103,7 @@ public class PercentLength extends LengthProperty {
/**
* Return the length of this PercentLength.
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int getValue() {
return (int) getNumericValue();
@@ -113,12 +113,12 @@ public class PercentLength extends LengthProperty {
public int getValue(PercentBaseContext context) {
return (int) getNumericValue(context);
}
-
+
/**
* @return the String equivalent of this
*/
public String toString() {
- StringBuffer sb =
+ StringBuffer sb =
new StringBuffer(PercentLength.class.getName())
.append("[factor=").append(factor)
.append(",lbase=").append(lbase).append("]");
diff --git a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
index 5f2468ed6..5040afeaf 100755
--- a/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/PositionShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,15 +27,15 @@ import org.apache.fop.fo.PropertyList;
* values for absolute-position and relative-position.
*/
public class PositionShorthandParser implements ShorthandParser {
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList) {
-
+
int propVal = property.getEnum();
if (propId == Constants.PR_ABSOLUTE_POSITION) {
switch (propVal) {
diff --git a/src/java/org/apache/fop/fo/properties/Property.java b/src/java/org/apache/fop/fo/properties/Property.java
index 5aef1b881..29e8faac5 100644
--- a/src/java/org/apache/fop/fo/properties/Property.java
+++ b/src/java/org/apache/fop/fo/properties/Property.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ import org.apache.fop.fo.Constants;
* Base class for all property objects
*/
public class Property {
-
+
/** Logger for all property classes */
protected static Log log = LogFactory.getLog(PropertyMaker.class);
@@ -134,7 +134,7 @@ public class Property {
public boolean isAuto() {
return (getEnum() == Constants.EN_AUTO);
}
-
+
/**
* This method expects to be overridden by subclasses
* @return char property value
diff --git a/src/java/org/apache/fop/fo/properties/PropertyCache.java b/src/java/org/apache/fop/fo/properties/PropertyCache.java
index 6f87c0c45..f834a78ae 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyCache.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyCache.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,35 +28,35 @@ import java.lang.ref.WeakReference;
* The public access points are overloaded fetch()
methods
* that each correspond to a cached type.
* It is designed especially to be used concurrently by multiple threads,
- * drawing heavily upon the principles behind Java 1.5's
- * ConcurrentHashMap
.
+ * drawing heavily upon the principles behind Java 1.5's
+ * ConcurrentHashMap
.
*/
public final class PropertyCache {
- /** bitmask to apply to the hash to get to the
+ /** bitmask to apply to the hash to get to the
* corresponding cache segment */
private static final int SEGMENT_MASK = 0x1F;
- /**
+ /**
* Indicates whether the cache should be used at all
* Can be controlled by the system property:
* org.apache.fop.fo.properties.use-cache
*/
private final boolean useCache;
-
+
/** the segments array (length = 32) */
private CacheSegment[] segments = new CacheSegment[SEGMENT_MASK + 1];
/** the table of hash-buckets */
private CacheEntry[] table = new CacheEntry[8];
-
+
private Class runtimeType;
-
+
final boolean[] votesForRehash = new boolean[SEGMENT_MASK + 1];
-
+
/* same hash function as used by java.util.HashMap */
private static int hash(Object x) {
return hash(x.hashCode());
}
-
+
private static int hash(int hashCode) {
int h = hashCode;
h += ~(h << 9);
@@ -65,32 +65,32 @@ public final class PropertyCache {
h ^= (h >>> 10);
return h;
}
-
+
/* shortcut function */
private static boolean eq(Object p, Object q) {
return (p == q || (p != null && p.equals(q)));
}
-
+
/* Class modeling a cached entry */
private final class CacheEntry extends WeakReference {
volatile CacheEntry nextEntry;
final int hash;
-
+
/* main constructor */
public CacheEntry(Object p, CacheEntry nextEntry, ReferenceQueue refQueue) {
super(p, refQueue);
this.nextEntry = nextEntry;
this.hash = p.hashCode();
}
-
+
}
-
+
/* Wrapper objects to synchronize on */
private final class CacheSegment {
private int count = 0;
private volatile ReferenceQueue staleEntries = new ReferenceQueue();
- }
-
+ }
+
private void cleanSegment(int segmentIndex) {
CacheEntry entry;
CacheSegment segment = segments[segmentIndex];
@@ -145,7 +145,7 @@ public final class PropertyCache {
}
}
}
-
+
/*
* Puts a new instance in the cache.
* If the total number of entries for the corresponding
@@ -154,14 +154,14 @@ public final class PropertyCache {
* entries.
*/
private void put(Object o) {
-
+
int hash = hash(o);
CacheSegment segment = segments[hash & SEGMENT_MASK];
-
+
synchronized (segment) {
int index = hash & (table.length - 1);
CacheEntry entry = table[index];
-
+
if (entry == null) {
entry = new CacheEntry(o, null, segment.staleEntries);
table[index] = entry;
@@ -176,23 +176,23 @@ public final class PropertyCache {
segment.count++;
}
}
-
+
if (segment.count > (2 * table.length)) {
cleanSegment(hash & SEGMENT_MASK);
}
}
}
-
+
/* Gets a cached instance. Returns null if not found */
private Object get(Object o) {
-
+
int hash = hash(o);
int index = hash & (table.length - 1);
-
+
CacheEntry entry = table[index];
Object q;
-
+
/* try non-synched first */
for (CacheEntry e = entry; e != null; e = e.nextEntry) {
if (e.hash == o.hashCode()
@@ -201,7 +201,7 @@ public final class PropertyCache {
return q;
}
}
-
+
/* retry synched, only if the above attempt did not succeed,
* as another thread may, in the meantime, have added a
* corresponding entry */
@@ -218,14 +218,14 @@ public final class PropertyCache {
}
return null;
}
-
+
/*
* Recursively acquires locks on all 32 segments,
* extends the cache and redistributes the entries.
- *
+ *
*/
private void rehash(int index) {
-
+
CacheSegment seg = segments[index];
synchronized (seg) {
if (index > 0) {
@@ -239,9 +239,9 @@ public final class PropertyCache {
for (int i = segments.length; --i >= 0;) {
segments[i].count = 0;
}
-
+
CacheEntry[] newTable = new CacheEntry[newLength];
-
+
int hash, idx;
Object o;
newLength--;
@@ -250,7 +250,7 @@ public final class PropertyCache {
if ((o = c.get()) != null) {
hash = c.hash;
idx = hash & newLength;
- newTable[idx] = new CacheEntry(o, newTable[idx],
+ newTable[idx] = new CacheEntry(o, newTable[idx],
segments[hash & SEGMENT_MASK].staleEntries);
segments[hash & SEGMENT_MASK].count++;
}
@@ -261,10 +261,10 @@ public final class PropertyCache {
}
}
}
-
+
/**
* Default constructor.
- *
+ *
* @param c Runtime type of the objects that will be stored in the cache
*/
public PropertyCache(Class c) {
@@ -278,13 +278,13 @@ public final class PropertyCache {
}
this.runtimeType = c;
}
-
+
/**
* Generic fetch() method.
- * Checks if the given Object
is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given Object
is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param obj the Object to check for
* @return the cached instance
*/
@@ -292,81 +292,81 @@ public final class PropertyCache {
if (!this.useCache) {
return obj;
}
-
+
if (obj == null) {
return null;
}
Object cacheEntry = get(obj);
if (cacheEntry != null) {
- return cacheEntry;
+ return cacheEntry;
}
put(obj);
return obj;
}
-
+
/**
- * Checks if the given {@link Property} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link Property} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param prop the Property instance to check for
* @return the cached instance
*/
public final Property fetch(Property prop) {
-
+
return (Property) fetch((Object) prop);
}
-
+
/**
- * Checks if the given {@link CommonHyphenation} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonHyphenation} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param chy the CommonHyphenation instance to check for
* @return the cached instance
*/
public final CommonHyphenation fetch(CommonHyphenation chy) {
-
+
return (CommonHyphenation) fetch((Object) chy);
}
-
+
/**
- * Checks if the given {@link CommonFont} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonFont} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cf the CommonFont instance to check for
* @return the cached instance
*/
public final CommonFont fetch(CommonFont cf) {
-
+
return (CommonFont) fetch((Object) cf);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param cbpb the CommonBorderPaddingBackground instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground fetch(CommonBorderPaddingBackground cbpb) {
-
+
return (CommonBorderPaddingBackground) fetch((Object) cbpb);
}
/**
- * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
- * if so, returns a reference to the cached instance.
+ * Checks if the given {@link CommonBorderPaddingBackground.BorderInfo} is present in the cache -
+ * if so, returns a reference to the cached instance.
* Otherwise the given object is added to the cache and returned.
- *
+ *
* @param bi the BorderInfo instance to check for
* @return the cached instance
*/
public final CommonBorderPaddingBackground.BorderInfo fetch(CommonBorderPaddingBackground.BorderInfo bi) {
-
+
return (CommonBorderPaddingBackground.BorderInfo) fetch((Object) bi);
}
@@ -374,6 +374,6 @@ public final class PropertyCache {
public String toString() {
return super.toString() + "[runtimeType=" + this.runtimeType + "]";
}
-
-
+
+
}
diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
index b1162563d..0f4632110 100644
--- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -123,8 +123,8 @@ public class PropertyMaker implements Cloneable {
/**
* Add a enum constant.
- * @param constant the enum constant
- * @param value the Property value to use when the constant is specified
+ * @param constant the enum constant
+ * @param value the Property value to use when the constant is specified
*/
public void addEnum(String constant, Property value) {
if (enums == null) {
@@ -138,16 +138,16 @@ public class PropertyMaker implements Cloneable {
* @param subproperty the PropertyMaker for the subproperty
*/
public void addSubpropMaker(PropertyMaker subproperty) {
- throw new RuntimeException("Unable to add subproperties " + getClass());
+ throw new RuntimeException("Unable to add subproperties " + getClass());
}
/**
- * Return a subproperty maker for the subpropertyId.
- * @param subpropertyId The subpropertyId of the maker.
+ * Return a subproperty maker for the subpropertyId.
+ * @param subpropertyId The subpropertyId of the maker.
* @return The subproperty maker.
*/
public PropertyMaker getSubpropMaker(int subpropertyId) {
- throw new RuntimeException("Unable to add subproperties");
+ throw new RuntimeException("Unable to add subproperties");
}
/**
@@ -155,7 +155,7 @@ public class PropertyMaker implements Cloneable {
* shorthands list. Later the Integers are replaced with references
* to the actual shorthand property makers.
* @param shorthand a property maker thar is that is checked for
- * shorthand values.
+ * shorthand values.
*/
public void addShorthand(PropertyMaker shorthand) {
if (shorthands == null) {
@@ -197,7 +197,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Set the percent base identifier for this maker.
+ * Set the percent base identifier for this maker.
* @param percentBase the percent base (ex. LengthBase.FONTSIZE)
*/
public void setPercentBase(int percentBase) {
@@ -205,9 +205,9 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Set the setByShorthand flag which only is applicable for subproperty
- * makers. It should be true for the subproperties which must be
- * assigned a value when the base property is assigned a attribute
+ * Set the setByShorthand flag which only is applicable for subproperty
+ * makers. It should be true for the subproperties which must be
+ * assigned a value when the base property is assigned a attribute
* value directly.
* @param setByShorthand true if this subproperty must be set when the base property is set
*/
@@ -217,7 +217,7 @@ public class PropertyMaker implements Cloneable {
/**
* Set the correspoding property information.
- * @param corresponding a corresponding maker where the
+ * @param corresponding a corresponding maker where the
* isForcedCorresponding and compute methods are delegated to.
*/
public void setCorresponding(CorrespondingPropertyMaker corresponding) {
@@ -225,7 +225,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Create a new empty property. Must be overriden in compound
+ * Create a new empty property. Must be overriden in compound
* subclasses.
* @return a new instance of the Property for which this is a maker.
*/
@@ -243,13 +243,13 @@ public class PropertyMaker implements Cloneable {
* @param propertyList the applicable property list
* @param tryInherit true if inherited properties should be examined.
* @return the property value
- * @throws PropertyException if there is a problem evaluating the property
+ * @throws PropertyException if there is a problem evaluating the property
*/
- public Property findProperty(PropertyList propertyList,
+ public Property findProperty(PropertyList propertyList,
boolean tryInherit)
throws PropertyException {
Property p = null;
-
+
if (log.isTraceEnabled()) {
log.trace("PropertyMaker.findProperty: "
+ FOPropertyMapping.getPropertyName(propId)
@@ -267,9 +267,9 @@ public class PropertyMaker implements Cloneable {
p = this.compute(propertyList);
}
}
- if (p == null && tryInherit) {
+ if (p == null && tryInherit) {
// else inherit (if has parent and is inheritable)
- PropertyList parentPropertyList = propertyList.getParentPropertyList();
+ PropertyList parentPropertyList = propertyList.getParentPropertyList();
if (parentPropertyList != null && isInherited()) {
p = parentPropertyList.get(propId, true, false);
}
@@ -287,8 +287,8 @@ public class PropertyMaker implements Cloneable {
* @param propertyList The PropertyList object being built for this FO.
* @param tryInherit true if inherited properties should be examined.
* @param tryDefault true if the default value should be returned.
- * @return the property value
- * @throws PropertyException if there is a problem evaluating the property
+ * @return the property value
+ * @throws PropertyException if there is a problem evaluating the property
*/
public Property get(int subpropertyId, PropertyList propertyList,
boolean tryInherit, boolean tryDefault)
@@ -370,7 +370,7 @@ public class PropertyMaker implements Cloneable {
}
/**
- * Return the default value.
+ * Return the default value.
* @param propertyList The PropertyList object being built for this FO.
* @return the Property object corresponding to the parameters
* @throws PropertyException for invalid or inconsisten FO input
@@ -422,7 +422,7 @@ public class PropertyMaker implements Cloneable {
.getExplicit(getPropId());
if (parentExplicit == null) {
log.warn(FOPropertyMapping.getPropertyName(getPropId())
- + "=\"inherit\" on " + propertyList.getFObj().getName()
+ + "=\"inherit\" on " + propertyList.getFObj().getName()
+ ", but no explicit value found on the parent FO.");
}
}
@@ -436,7 +436,7 @@ public class PropertyMaker implements Cloneable {
newProp = PropertyParser.parse(pvalue,
new PropertyInfo(this,
propertyList));
- }
+ }
if (newProp != null) {
newProp = convertProperty(newProp, propertyList, fo);
}
@@ -475,7 +475,7 @@ public class PropertyMaker implements Cloneable {
/**
* Converts a shorthand property
- *
+ *
* @param propertyList the propertyList for which to convert
* @param prop the shorthand property
* @param fo ...
@@ -538,7 +538,7 @@ public class PropertyMaker implements Cloneable {
* file specifies a length value equivalent for these keywords,
* such as "0.5pt" for "thin".
* @param keyword the string value of property attribute.
- * @return a String containing a parseable equivalent or null if
+ * @return a String containing a parseable equivalent or null if
* the passed value isn't a keyword initializer for this Property
*/
protected String checkValueKeywords(String keyword) {
@@ -549,7 +549,7 @@ public class PropertyMaker implements Cloneable {
}
}
// TODO: should return null here?
- return keyword;
+ return keyword;
}
/**
@@ -642,7 +642,7 @@ public class PropertyMaker implements Cloneable {
}
return null;
}
-
+
/** @return the name of the property this maker is used for. */
public String getName() {
return FOPropertyMapping.getPropertyName(propId);
@@ -650,7 +650,7 @@ public class PropertyMaker implements Cloneable {
/**
* Return a clone of the makers. Used by useGeneric() to clone the
- * subproperty makers of the generic compound makers.
+ * subproperty makers of the generic compound makers.
* {@inheritDoc}
*/
public Object clone() {
diff --git a/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java b/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
index 505afccd5..009b85b35 100644
--- a/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
+++ b/src/java/org/apache/fop/fo/properties/ReferenceOrientationMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,16 +35,16 @@ public class ReferenceOrientationMaker extends Maker {
public ReferenceOrientationMaker(int propId) {
super(propId);
}
-
+
/**
* Check the value of the reference-orientation property.
- *
- * {@inheritDoc}
+ *
+ * {@inheritDoc}
*/
public Property get(int subpropId, PropertyList propertyList,
- boolean tryInherit, boolean tryDefault)
+ boolean tryInherit, boolean tryDefault)
throws PropertyException {
-
+
Property p = super.get(0, propertyList, tryInherit, tryDefault);
int ro = 0;
if (p != null) {
diff --git a/src/java/org/apache/fop/fo/properties/ShorthandParser.java b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
index bf51c3f66..f0ec0e6e9 100644
--- a/src/java/org/apache/fop/fo/properties/ShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/ShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/properties/SpaceProperty.java b/src/java/org/apache/fop/fo/properties/SpaceProperty.java
index 98caa04ff..49f76f874 100644
--- a/src/java/org/apache/fop/fo/properties/SpaceProperty.java
+++ b/src/java/org/apache/fop/fo/properties/SpaceProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -47,7 +47,7 @@ public class SpaceProperty extends LengthRangeProperty {
/**
* Create a new empty instance of SpaceProperty.
- * @return the new instance.
+ * @return the new instance.
*/
public Property makeNewProperty() {
return new SpaceProperty();
@@ -69,7 +69,7 @@ public class SpaceProperty extends LengthRangeProperty {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void setComponent(int cmpId, Property cmpnValue,
boolean bIsDefault) {
@@ -138,10 +138,10 @@ public class SpaceProperty extends LengthRangeProperty {
public String toString() {
return "Space[" +
- "min:" + getMinimum(null).getObject() +
- ", max:" + getMaximum(null).getObject() +
- ", opt:" + getOptimum(null).getObject() +
- ", precedence:" + precedence.getObject() +
+ "min:" + getMinimum(null).getObject() +
+ ", max:" + getMaximum(null).getObject() +
+ ", opt:" + getOptimum(null).getObject() +
+ ", precedence:" + precedence.getObject() +
", conditionality:" + conditionality.getObject() + "]";
}
diff --git a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
index ba547b37a..19fa7baa7 100755
--- a/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
+++ b/src/java/org/apache/fop/fo/properties/SpacingPropertyMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,7 +26,7 @@ import org.apache.fop.fo.expr.PropertyException;
/**
* A maker which creates 'letter-spacing' and 'word-spacing' properties.
- * These two properties properties are standard space properties with
+ * These two properties properties are standard space properties with
* additinal support for the 'normal' enum value.
*/
@@ -42,7 +42,7 @@ public class SpacingPropertyMaker extends SpaceProperty.Maker {
/**
* Support for the 'normal' value.
*/
- public Property convertProperty(Property p,
+ public Property convertProperty(Property p,
PropertyList propertyList,
FObj fo) throws PropertyException {
if (p.getEnum() == Constants.EN_NORMAL) {
diff --git a/src/java/org/apache/fop/fo/properties/StringProperty.java b/src/java/org/apache/fop/fo/properties/StringProperty.java
index 087feb350..ec7e1f841 100644
--- a/src/java/org/apache/fop/fo/properties/StringProperty.java
+++ b/src/java/org/apache/fop/fo/properties/StringProperty.java
@@ -5,9 +5,9 @@
* 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.
@@ -81,13 +81,13 @@ public final class StringProperty extends Property {
}
}
-
+
/** cache containing all canonical StringProperty instances */
private static final PropertyCache cache = new PropertyCache(StringProperty.class);
-
+
/** canonical instance for empty strings */
public static final StringProperty EMPTY_STRING_PROPERTY = new StringProperty("");
-
+
private final String str;
/**
@@ -99,7 +99,7 @@ public final class StringProperty extends Property {
}
/**
- * Return the canonical StringProperty instance
+ * Return the canonical StringProperty instance
* corresponding to the given string value
* @param str the base String
* @return the canonical instance
@@ -112,7 +112,7 @@ public final class StringProperty extends Property {
new StringProperty(str));
}
}
-
+
/** @return the Object equivalent of this property */
public Object getObject() {
return this.str;
@@ -135,7 +135,7 @@ public final class StringProperty extends Property {
}
return false;
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return str.hashCode();
diff --git a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
index 181dd00d5..4a2fc92f4 100644
--- a/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
+++ b/src/java/org/apache/fop/fo/properties/TableBorderPrecedence.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,10 +36,10 @@ public class TableBorderPrecedence extends NumberProperty.Maker{
public TableBorderPrecedence(int propId) {
super(propId);
}
-
+
/**
* Set default precedence according to the parent FObj
- *
+ *
* {@inheritDoc}
*/
public Property make(PropertyList propertyList) throws PropertyException {
diff --git a/src/java/org/apache/fop/fo/properties/TableColLength.java b/src/java/org/apache/fop/fo/properties/TableColLength.java
index 251007093..ccb85bcfb 100644
--- a/src/java/org/apache/fop/fo/properties/TableColLength.java
+++ b/src/java/org/apache/fop/fo/properties/TableColLength.java
@@ -5,9 +5,9 @@
* 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.
@@ -41,7 +41,7 @@ public class TableColLength extends LengthProperty {
private double tcolUnits;
/**
- * The column the column-units are defined on.
+ * The column the column-units are defined on.
*/
private FObj column;
diff --git a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
index 4cb1b2f4a..3cbe56f00 100644
--- a/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
+++ b/src/java/org/apache/fop/fo/properties/TextDecorationProperty.java
@@ -84,7 +84,7 @@ public class TextDecorationProperty extends ListProperty {
}
return lst;
}
-
+
}
/**
@@ -156,5 +156,5 @@ public class TextDecorationProperty extends ListProperty {
addProperty(prop);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
index 20d3d7303..c04b1a892 100644
--- a/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
+++ b/src/java/org/apache/fop/fo/properties/ToBeImplementedProperty.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
index d71dc4db1..c0950a794 100644
--- a/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/VerticalAlignShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,13 +23,13 @@ import org.apache.fop.fo.PropertyList;
/**
* A shorthand parser for the vertical-align shorthand. It is used to set
- * values for alignment-baseline, alignment-adjust, baseline-shift
+ * values for alignment-baseline, alignment-adjust, baseline-shift
* and dominant-baseline.
*/
public class VerticalAlignShorthandParser implements ShorthandParser, Constants {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId,
Property property,
diff --git a/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java b/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
index 2feb5e9c8..26df69c91 100644
--- a/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/WhiteSpaceShorthandParser.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.fo.expr.PropertyException;
public class WhiteSpaceShorthandParser implements ShorthandParser {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public Property getValueForProperty(int propId, Property property,
PropertyMaker maker, PropertyList propertyList)
diff --git a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
index 5a5cf95c5..efadd8957 100644
--- a/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
+++ b/src/java/org/apache/fop/fo/properties/XMLLangShorthandParser.java
@@ -25,14 +25,14 @@ import org.apache.fop.fo.expr.PropertyException;
public class XMLLangShorthandParser extends GenericShorthandParser {
private static final char HYPHEN_MINUS = '-';
-
+
/** {@inheritDoc} */
public Property getValueForProperty(int propId,
Property property,
PropertyMaker maker,
PropertyList propertyList)
throws PropertyException {
-
+
String shorthandValue = property.getString();
int hyphenIndex = shorthandValue.indexOf(HYPHEN_MINUS);
if (propId == Constants.PR_LANGUAGE) {
diff --git a/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java b/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
index 3a2ac5022..56558b02e 100644
--- a/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
+++ b/src/java/org/apache/fop/fonts/AbstractCodePointMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,7 +38,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
private char[] unicodeMap; //code point to Unicode char
private String[] charNameMap; //all character names in the encoding
private Map fallbackMap; //Here we accumulate all mappings we have found through substitution
-
+
/**
* Main constructor.
* @param name the name of the encoding
@@ -140,7 +140,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
bot = mid + 1;
}
}
-
+
//Fallback: using cache
synchronized (this) {
if (fallbackMap != null) {
@@ -164,7 +164,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
}
}
}
-
+
putFallbackCharacter(c, NOT_FOUND_CODE_POINT);
return NOT_FOUND_CODE_POINT;
}
@@ -177,7 +177,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
this.fallbackMap.put(new Character(c), new Character(mapTo));
}
}
-
+
/**
* Returns the main Unicode value that is associated with the given code point in the encoding.
* Note that multiple Unicode values can theoretically be mapped to one code point in the
@@ -200,10 +200,10 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
System.arraycopy(this.unicodeMap, 0, copy, 0, this.unicodeMap.length);
return copy;
}
-
+
/**
* Returns the index of a character/glyph with the given name. Note that this
- * method is relatively slow and should only be used for fallback operations.
+ * method is relatively slow and should only be used for fallback operations.
* @param charName the character name
* @return the index of the character in the encoding or -1 if it doesn't exist
*/
@@ -219,7 +219,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
}
return -1;
}
-
+
/** {@inheritDoc} */
public String[] getCharNameMap() {
if (this.charNameMap != null) {
@@ -235,7 +235,7 @@ public class AbstractCodePointMapping implements SingleByteEncoding {
if (c != CharUtilities.NOT_A_CHARACTER) {
String charName = Glyphs.charToGlyphName(c);
if (charName.length() > 0) {
- derived[i] = charName;
+ derived[i] = charName;
}
}
}
diff --git a/src/java/org/apache/fop/fonts/BFEntry.java b/src/java/org/apache/fop/fonts/BFEntry.java
index 2cc527b61..4e0b169fd 100644
--- a/src/java/org/apache/fop/fonts/BFEntry.java
+++ b/src/java/org/apache/fop/fonts/BFEntry.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
/**
* This is just a holder class for bfentries, groups of characters of a base font (bf).
*/
public class BFEntry {
-
+
private int unicodeStart;
private int unicodeEnd;
private int glyphStartIndex;
diff --git a/src/java/org/apache/fop/fonts/Base14Font.java b/src/java/org/apache/fop/fonts/Base14Font.java
index 26c11e72b..04349a148 100644
--- a/src/java/org/apache/fop/fonts/Base14Font.java
+++ b/src/java/org/apache/fop/fonts/Base14Font.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
/**
diff --git a/src/java/org/apache/fop/fonts/CIDFont.java b/src/java/org/apache/fop/fonts/CIDFont.java
index 1a7e1b0e3..eac794514 100644
--- a/src/java/org/apache/fop/fonts/CIDFont.java
+++ b/src/java/org/apache/fop/fonts/CIDFont.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fonts/CIDFontType.java b/src/java/org/apache/fop/fonts/CIDFontType.java
index 51b4a73d1..24132ffc2 100644
--- a/src/java/org/apache/fop/fonts/CIDFontType.java
+++ b/src/java/org/apache/fop/fonts/CIDFontType.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts;
import org.apache.avalon.framework.ValuedEnum;
@@ -59,8 +59,8 @@ public class CIDFontType extends ValuedEnum {
throw new IllegalArgumentException("Invalid CID font type: " + name);
}
}
-
-
+
+
/**
* Returns the CID FontType by value.
* @param value Value of the CID font type to look up
@@ -75,5 +75,5 @@ public class CIDFontType extends ValuedEnum {
throw new IllegalArgumentException("Invalid CID font type: " + value);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/fonts/CIDSubset.java b/src/java/org/apache/fop/fonts/CIDSubset.java
index 6bcfc0b71..c2505488b 100644
--- a/src/java/org/apache/fop/fonts/CIDSubset.java
+++ b/src/java/org/apache/fop/fonts/CIDSubset.java
@@ -5,9 +5,9 @@
* 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.
@@ -54,10 +54,10 @@ public class CIDSubset {
* usedCharsIndex contains new glyph, original char (char selector -> Unicode)
*/
private Map/*AttributeValue
object holding the
* value of the specified String
.
- *
+ *
* @param valuesString the value to be parsed
* @return an AttributeValue
object holding the value
* represented by the string argument.
diff --git a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
index 63ec13db1..3419ab2c7 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontQualifier.java
@@ -5,9 +5,9 @@
* 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.
@@ -144,7 +144,7 @@ public class FontQualifier {
/**
* Returns a list of matching font triplet found in a given font info
- *
+ *
* @param fontInfo the font info
* @return a list of matching font triplets
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
index 7e9709a51..7725fc147 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitution.java
@@ -5,9 +5,9 @@
* 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.
@@ -29,7 +29,7 @@ public class FontSubstitution {
/**
* Main constructor
- *
+ *
* @param fromQualifier the substitution from qualifier
* @param toQualifier the substitution to qualifier
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
index cc4e74143..313ad04a8 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutions.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
index 44950221d..0c6c0db0e 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontSubstitutionsConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ public class FontSubstitutionsConfigurator {
/**
* Main constructor
- *
+ *
* @param cfg a configuration
*/
public FontSubstitutionsConfigurator(Configuration cfg) {
@@ -59,7 +59,7 @@ public class FontSubstitutionsConfigurator {
/**
* Configures a font substitution catalog
- *
+ *
* @param substitutions font substitutions
* @throws FOPException if something's wrong with the config data
*/
diff --git a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
index 890d6cf7b..29ae0556d 100644
--- a/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
+++ b/src/java/org/apache/fop/fonts/substitute/FontWeightRange.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@ public class FontWeightRange {
/**
* Returns an FontWeightRange
object holding the
* range values of the specified String
.
- *
+ *
* @param weightRangeString the value range string
* @return an FontWeightRange
object holding the value ranges
*/
diff --git a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
index 0d1af4785..d12b19654 100644
--- a/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
+++ b/src/java/org/apache/fop/fonts/truetype/FontFileReader.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.File;
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
index ce3f3efe9..171f71a76 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFCmapEntry.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
/**
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
index c1dfc5ea0..405a71395 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFDirTabEntry.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.IOException;
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFile.java b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
index 8c5211e67..f6b9ac020 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFile.java
@@ -5,9 +5,9 @@
* 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.
@@ -111,7 +111,7 @@ public class TTFFile {
private int[] ansiWidth;
private Map ansiIndex;
-
+
// internal mapping of glyph indexes to unicode indexes
// used for quick mappings in this class
private Map glyphToUnicodeMap = new java.util.HashMap();
@@ -120,12 +120,12 @@ public class TTFFile {
private TTFDirTabEntry currentDirTab;
private boolean isCFF;
-
+
/**
* logging instance
*/
protected Log log = LogFactory.getLog(TTFFile.class);
-
+
/**
* Key-value helper class
*/
@@ -186,7 +186,7 @@ public class TTFFile {
if (n < 0) {
long rest1 = n % upem;
long storrest = 1000 * rest1;
- long ledd2 = (storrest != 0 ? rest1 / storrest : 0);
+ long ledd2 = (storrest != 0 ? rest1 / storrest : 0);
ret = -((-1000 * n) / upem - (int)ledd2);
} else {
ret = (n / upem) * 1000 + ((n % upem) * 1000) / upem;
@@ -329,7 +329,7 @@ public class TTFFile {
Iterator e = v.listIterator();
while (e.hasNext()) {
Integer aIdx = (Integer)e.next();
- ansiWidth[aIdx.intValue()]
+ ansiWidth[aIdx.intValue()]
= mtxTab[glyphIdx].getWx();
if (log.isTraceEnabled()) {
@@ -754,7 +754,7 @@ public class TTFFile {
public boolean isCFF() {
return this.isCFF;
}
-
+
/**
* Read Table Directory from the current position in the
* FontFileReader and fill the global HashMap dirTabs
@@ -840,11 +840,11 @@ public class TTFFile {
protected void readHorizontalHeader(FontFileReader in)
throws IOException {
seekTab(in, "hhea", 4);
- hheaAscender = in.readTTFShort();
+ hheaAscender = in.readTTFShort();
log.debug("hhea.Ascender: " + hheaAscender + " " + convertTTFUnit2PDFUnit(hheaAscender));
hheaDescender = in.readTTFShort();
log.debug("hhea.Descender: " + hheaDescender + " " + convertTTFUnit2PDFUnit(hheaDescender));
-
+
in.skip(2 + 2 + 3 * 2 + 8 * 2);
nhmtx = in.readTTFUShort();
log.debug("Number of horizontal metrics: " + nhmtx);
@@ -988,10 +988,10 @@ public class TTFFile {
if (dirTabs.get("OS/2") != null) {
seekTab(in, "OS/2", 2 * 2);
this.usWeightClass = in.readTTFUShort();
-
+
// usWidthClass
in.skip(2);
-
+
int fsType = in.readTTFUShort();
if (fsType == 2) {
isEmbeddable = false;
@@ -1005,10 +1005,10 @@ public class TTFFile {
in.skip(3 * 2);
int v;
os2Ascender = in.readTTFShort(); //sTypoAscender
- log.debug("sTypoAscender: " + os2Ascender
+ log.debug("sTypoAscender: " + os2Ascender
+ " " + convertTTFUnit2PDFUnit(os2Ascender));
os2Descender = in.readTTFShort(); //sTypoDescender
- log.debug("sTypoDescender: " + os2Descender
+ log.debug("sTypoDescender: " + os2Descender
+ " " + convertTTFUnit2PDFUnit(os2Descender));
v = in.readTTFShort(); //sTypoLineGap
log.debug("sTypoLineGap: " + v);
@@ -1021,7 +1021,7 @@ public class TTFFile {
log.debug("sxHeight: " + this.os2xHeight);
this.os2CapHeight = in.readTTFShort(); //sCapHeight
log.debug("sCapHeight: " + this.os2CapHeight);
-
+
} else {
isEmbeddable = true;
}
@@ -1123,7 +1123,7 @@ public class TTFFile {
int k = in.readTTFUShort();
int l = in.readTTFUShort();
- if (((platformID == 1 || platformID == 3)
+ if (((platformID == 1 || platformID == 3)
&& (encodingID == 0 || encodingID == 1))) {
in.seekSet(j + in.readTTFUShort());
String txt;
@@ -1132,9 +1132,9 @@ public class TTFFile {
} else {
txt = in.readTTFString(l);
}
-
+
if (log.isDebugEnabled()) {
- log.debug(platformID + " "
+ log.debug(platformID + " "
+ encodingID + " "
+ languageID + " "
+ k + " " + txt);
@@ -1182,11 +1182,11 @@ public class TTFFile {
if (dirTab != null) {
in.seekSet(dirTab.getOffset() + 4 + 4 + 2);
xHeight = in.readTTFUShort();
- log.debug("xHeight from PCLT: " + xHeight
+ log.debug("xHeight from PCLT: " + xHeight
+ " " + convertTTFUnit2PDFUnit(xHeight));
in.skip(2 * 2);
capHeight = in.readTTFUShort();
- log.debug("capHeight from PCLT: " + capHeight
+ log.debug("capHeight from PCLT: " + capHeight
+ " " + convertTTFUnit2PDFUnit(capHeight));
in.skip(2 + 16 + 8 + 6 + 1 + 1);
@@ -1211,7 +1211,7 @@ public class TTFFile {
* the hhea values are defined after the Apple interpretation, but not in every font. The
* same problem is in the OS/2 table. FOP needs the ascender and descender to determine the
* baseline so we need values which add up more or less to the "em box". However, due to
- * accent modifiers a character can grow beyond the em box.
+ * accent modifiers a character can grow beyond the em box.
*/
private void determineAscDesc() {
int hheaBoxHeight = hheaAscender - hheaDescender;
@@ -1279,7 +1279,7 @@ public class TTFFile {
}
}
}
- log.debug("Ascender from glyph 'd': " + localAscender
+ log.debug("Ascender from glyph 'd': " + localAscender
+ " " + convertTTFUnit2PDFUnit(localAscender));
log.debug("Descender from glyph 'p': " + localDescender
+ " " + convertTTFUnit2PDFUnit(localDescender));
@@ -1351,7 +1351,7 @@ public class TTFFile {
final Integer u2 = glyphToUnicode(j);
if (iObj == null) {
// happens for many fonts (Ubuntu font set),
- // stray entries in the kerning table??
+ // stray entries in the kerning table??
log.debug("Ignoring kerning pair because no Unicode index was"
+ " found for the first glyph " + i);
} else if (u2 == null) {
@@ -1370,7 +1370,7 @@ public class TTFFile {
}
// Create winAnsiEncoded kerning table from kerningTab
- // (could probably be simplified, for now we remap back to CID indexes and
+ // (could probably be simplified, for now we remap back to CID indexes and
// then to winAnsi)
Iterator ae = kerningTab.keySet().iterator();
while (ae.hasNext()) {
@@ -1534,7 +1534,7 @@ public class TTFFile {
return null;
}
}
-
+
/*
* Helper classes, they are not very efficient, but that really
* doesn't matter...
@@ -1580,7 +1580,7 @@ public class TTFFile {
/**
* Map a glyph index to the corresponding unicode code point
- *
+ *
* @param glyphIndex
* @return unicode code point
* @throws IOException if glyphIndex not found
@@ -1588,10 +1588,10 @@ public class TTFFile {
private Integer glyphToUnicode(int glyphIndex) throws IOException {
return (Integer) glyphToUnicodeMap.get(new Integer(glyphIndex));
}
-
+
/**
- * Map a unicode code point to the corresponding glyph index
- *
+ * Map a unicode code point to the corresponding glyph index
+ *
* @param unicodeIndex unicode code point
* @return glyph index
* @throws IOException if unicodeIndex not found
@@ -1605,7 +1605,7 @@ public class TTFFile {
}
return result;
}
-
+
/**
* Static main method to get info about a TrueType font.
* @param args The command line arguments
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
index 325c46971..e14514b51 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFFontLoader.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@ public class TTFFontLoader extends FontLoader {
private MultiByteFont multiFont;
private SingleByteFont singleFont;
private String subFontName;
-
+
/**
* Default constructor
* @param fontFileURI the URI representing the font file
@@ -55,7 +55,7 @@ public class TTFFontLoader extends FontLoader {
public TTFFontLoader(String fontFileURI, FontResolver resolver) {
this(fontFileURI, null, true, resolver);
}
-
+
/**
* Additional constructor for TrueType Collections.
* @param fontFileURI the URI representing the font file
@@ -69,14 +69,14 @@ public class TTFFontLoader extends FontLoader {
super(fontFileURI, embedded, resolver);
this.subFontName = subFontName;
}
-
+
/** {@inheritDoc} */
protected void read() throws IOException {
read(this.subFontName);
}
/**
- * Reads a TrueType font.
+ * Reads a TrueType font.
* @param ttcFontName the TrueType sub-font name of TrueType Collection (may be null for
* normal TrueType fonts)
* @throws IOException if an I/O error occurs
@@ -96,16 +96,16 @@ public class TTFFontLoader extends FontLoader {
IOUtils.closeQuietly(in);
}
}
-
-
+
+
private void buildFont(TTFFile ttf, String ttcFontName) {
if (ttf.isCFF()) {
throw new UnsupportedOperationException(
"OpenType fonts with CFF data are not supported, yet");
}
-
+
boolean isCid = this.embedded;
-
+
if (isCid) {
multiFont = new MultiByteFont();
returnFont = multiFont;
@@ -153,7 +153,7 @@ public class TTFFontLoader extends FontLoader {
returnFont.setLastChar(ttf.getLastChar());
copyWidthsSingleByte(ttf);
}
-
+
copyKerning(ttf, isCid);
if (this.embedded && ttf.isEmbeddable()) {
multiFont.setEmbedFileName(this.fontFileURI);
@@ -184,12 +184,12 @@ public class TTFFontLoader extends FontLoader {
}
}
}
-
+
/**
* Copy kerning information.
*/
private void copyKerning(TTFFile ttf, boolean isCid) {
-
+
// Get kerning
Iterator iter;
if (isCid) {
@@ -209,5 +209,5 @@ public class TTFFontLoader extends FontLoader {
}
returnFont.putKerningEntry(kpx1, h2);
}
- }
+ }
}
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java b/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
index dae192404..6884a633d 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFMtxEntry.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.util.List;
@@ -37,7 +37,7 @@ class TTFMtxEntry {
/**
* Returns a String representation of this object.
- *
+ *
* @param t TTFFile to use for unit conversion
* @return String String representation
*/
@@ -81,7 +81,7 @@ class TTFMtxEntry {
public int getIndex() {
return index;
}
-
+
/**
* Determines whether this index represents a reserved character.
* @return True if it is reserved
@@ -89,7 +89,7 @@ class TTFMtxEntry {
public boolean isIndexReserved() {
return (getIndex() >= 32768) && (getIndex() <= 65535);
}
-
+
/**
* Returns a String representation of the index taking into account if
* the index is in the reserved range.
diff --git a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
index d593c4544..37e24836e 100644
--- a/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
+++ b/src/java/org/apache/fop/fonts/truetype/TTFSubSetFile.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.fonts.truetype;
import java.io.IOException;
@@ -86,7 +86,7 @@ public class TTFSubSetFile extends TTFFile {
}
return numTables;
}
-
+
/**
* Create the directory table
*/
@@ -651,7 +651,7 @@ public class TTFSubSetFile extends TTFFile {
if (!checkTTC(in, name)) {
throw new IOException("Failed to read font");
}
-
+
//Copy the Map as we're going to modify it
Map subsetGlyphs = new java.util.HashMap(glyphs);
diff --git a/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java b/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
index 758078af4..4906f2c31 100644
--- a/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
+++ b/src/java/org/apache/fop/fonts/type1/AFMCharMetrics.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ public class AFMCharMetrics {
private double widthX;
private double widthY;
private RectangularShape bBox;
-
+
/**
* Returns the character code.
* @return the charCode (-1 if not part of the encoding)
@@ -42,7 +42,7 @@ public class AFMCharMetrics {
public int getCharCode() {
return charCode;
}
-
+
/**
* Indicates whether the character has a character code, i.e. is part of the default encoding.
* @return true if there is a character code.
@@ -50,7 +50,7 @@ public class AFMCharMetrics {
public boolean hasCharCode() {
return charCode >= 0;
}
-
+
/**
* Sets the character code.
* @param charCode the charCode to set
@@ -58,7 +58,7 @@ public class AFMCharMetrics {
public void setCharCode(int charCode) {
this.charCode = charCode;
}
-
+
/**
* Returns the named character represented by this instance.
* @return the named character (or null if no named character is associated)
@@ -66,7 +66,7 @@ public class AFMCharMetrics {
public NamedCharacter getCharacter() {
return this.character;
}
-
+
/**
* Sets the named character represented by this instance.
* @param ch the named character
@@ -74,7 +74,7 @@ public class AFMCharMetrics {
public void setCharacter(NamedCharacter ch) {
this.character = ch;
}
-
+
/**
* Sets the named character represented by this instance.
* @param charName the character name (as defined in the Adobe glyph list)
@@ -83,7 +83,7 @@ public class AFMCharMetrics {
public void setCharacter(String charName, String unicodeSequence) {
setCharacter(new NamedCharacter(charName, unicodeSequence));
}
-
+
/**
* Returns the Unicode sequence for this character.
* @return the Unicode characters
@@ -92,7 +92,7 @@ public class AFMCharMetrics {
public String getUnicodeSequence() {
return (getCharacter() != null ? getCharacter().getUnicodeSequence() : null);
}
-
+
/**
* Returns the PostScript character name.
* @return the charName (or null if no character name is associated)
@@ -100,7 +100,7 @@ public class AFMCharMetrics {
public String getCharName() {
return (getCharacter() != null ? getCharacter().getName() : null);
}
-
+
/**
* Returns the progression dimension in x-direction.
* @return the widthX
@@ -108,7 +108,7 @@ public class AFMCharMetrics {
public double getWidthX() {
return widthX;
}
-
+
/**
* Sets the progression dimension in x-direction
* @param widthX the widthX to set
@@ -116,7 +116,7 @@ public class AFMCharMetrics {
public void setWidthX(double widthX) {
this.widthX = widthX;
}
-
+
/**
* Returns the progression dimension in y-direction.
* @return the widthY
@@ -124,7 +124,7 @@ public class AFMCharMetrics {
public double getWidthY() {
return widthY;
}
-
+
/**
* Sets the progression dimension in y-direction
* @param widthY the widthY to set
@@ -132,7 +132,7 @@ public class AFMCharMetrics {
public void setWidthY(double widthY) {
this.widthY = widthY;
}
-
+
/**
* Returns the character's bounding box.
* @return the bounding box (or null if it isn't available)
@@ -163,5 +163,5 @@ public class AFMCharMetrics {
sb.append(getCharName()).append(')');
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/fonts/type1/AFMFile.java b/src/java/org/apache/fop/fonts/type1/AFMFile.java
index 3cb4b3343..c427ff22f 100644
--- a/src/java/org/apache/fop/fonts/type1/AFMFile.java
+++ b/src/java/org/apache/fop/fonts/type1/AFMFile.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,13 +36,13 @@ public class AFMFile {
private String fontName;
private String fullName;
private String familyName;
-
+
private String weight;
private RectangularShape fontBBox;
-
+
private String encodingScheme;
private String characterSet;
-
+
private Number capHeight;
private Number xHeight;
private Number ascender;
@@ -52,17 +52,17 @@ public class AFMFile {
private AFMWritingDirectionMetrics[] writingDirectionMetrics
= new AFMWritingDirectionMetrics[3];
-
+
private List charMetrics = new java.util.ArrayList();
//ListLayoutContext
.
+ * Handles span changes reported through the LayoutContext
.
* Only used by the PSLM and called by getNextBlockList()
.
* @param childLC the LayoutContext
* @param nextSequenceStartsOn previous value for break handling
@@ -543,12 +543,12 @@ public abstract class AbstractBreaker {
* @param nextSequenceStartsOn indicates on what page the next sequence should start
* @return the page on which the next content should appear after a hard break
*/
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
updateLayoutContext(childLC);
//Make sure the span change signal is reset
childLC.signalSpanChange(Constants.NOT_SET);
-
+
BlockSequence blockList;
List returnedList = getNextKnuthElements(childLC, alignment);
if (returnedList != null) {
@@ -557,10 +557,10 @@ public abstract class AbstractBreaker {
return nextSequenceStartsOn;
}
blockList = new BlockSequence(nextSequenceStartsOn, getCurrentDisplayAlign());
-
+
//Only implemented by the PSLM
nextSequenceStartsOn = handleSpanChange(childLC, nextSequenceStartsOn);
-
+
Position breakPosition = null;
if (((KnuthElement) ListUtil.getLast(returnedList)).isForcedBreak()) {
KnuthPenalty breakPenalty = (KnuthPenalty) ListUtil
@@ -585,7 +585,7 @@ public abstract class AbstractBreaker {
nextSequenceStartsOn = Constants.EN_EVEN_PAGE;
break;
default:
- throw new IllegalStateException("Invalid break class: "
+ throw new IllegalStateException("Invalid break class: "
+ breakPenalty.getBreakClass());
}
}
@@ -649,7 +649,7 @@ public abstract class AbstractBreaker {
* Justifies the boxes and returns them as a new KnuthSequence.
* @param blockList block list to justify
* @param alg reference to the algorithm instance
- * @param availableBPD the available BPD
+ * @param availableBPD the available BPD
* @return the effective list
*/
private BlockSequence justifyBoxes(BlockSequence blockList, PageBreakingAlgorithm alg, int availableBPD) {
@@ -659,7 +659,7 @@ public abstract class AbstractBreaker {
1, true, BreakingAlgorithm.ALL_BREAKS);
log.debug("PLM> iOptPageNumber= " + iOptPageNumber);
- //
+ //
ListIterator sequenceIterator = blockList.listIterator();
ListIterator breakIterator = alg.getPageBreaks().listIterator();
KnuthElement thisElement = null;
@@ -687,7 +687,7 @@ public abstract class AbstractBreaker {
KnuthElement firstElement;
while (!(firstElement = (KnuthElement) sequenceIterator
.next()).isBox()) {
- //
+ //
log.debug("PLM> ignoring glue or penalty element "
+ "at the beginning of the sequence");
if (firstElement.isGlue()) {
@@ -811,7 +811,7 @@ public abstract class AbstractBreaker {
// create a new sequence: the new elements will contain the
// Positions
// which will be used in the addAreas() phase
- BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
+ BlockSequence effectiveList = new BlockSequence(blockList.getStartOn(),
blockList.getDisplayAlign());
effectiveList.addAll(getCurrentChildLM().getChangedKnuthElements(
blockList.subList(0, blockList.size() - blockList.ignoreAtEnd),
@@ -828,7 +828,7 @@ public abstract class AbstractBreaker {
private int adjustBlockSpaces(LinkedList spaceList, int difference, int total) {
if (log.isDebugEnabled()) {
- log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ log.debug("AdjustBlockSpaces: difference " + difference + " / " + total
+ " on " + spaceList.size() + " spaces in block");
}
ListIterator spaceListIterator = spaceList.listIterator();
@@ -839,8 +839,8 @@ public abstract class AbstractBreaker {
partial += (difference > 0 ? blockSpace.getY() : blockSpace.getZ());
if (log.isDebugEnabled()) {
log.debug("available = " + partial + " / " + total);
- log.debug("competenza = "
- + (((int)((float) partial * difference / total)) - adjustedDiff)
+ log.debug("competenza = "
+ + (((int)((float) partial * difference / total)) - adjustedDiff)
+ " / " + difference);
}
int newAdjust = ((BlockLevelLayoutManager) blockSpace.getLayoutManager()).negotiateBPDAdjustment(((int) ((float) partial * difference / total)) - adjustedDiff, blockSpace);
@@ -888,5 +888,5 @@ public abstract class AbstractBreaker {
}
return adjustedDiff;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
index 13ea66d1f..a5393ced2 100644
--- a/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -294,7 +294,7 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
if (pos.getIndex() >= 0) {
throw new IllegalStateException("Position already got its index");
}
-
+
lastGeneratedPosition++;
pos.setIndex(lastGeneratedPosition);
return pos;
@@ -383,27 +383,27 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
* Checks to see if the incoming {@link Position}
* is the last one for this LM, and if so, calls
* {@link #notifyEndOfLayout()} and cleans up.
- *
+ *
* @param pos the {@link Position} to check
*/
protected void checkEndOfLayout(Position pos) {
if (pos != null
&& pos.getLM() == this
&& this.isLast(pos)) {
-
+
notifyEndOfLayout();
-
+
/* References to the child LMs are no longer needed
*/
childLMs = null;
curChildLM = null;
childLMiter = null;
-
+
/* markers that qualify have been transferred to the page
*/
markers = null;
-
- /* References to the FO's children can be released if the
+
+ /* References to the FO's children can be released if the
* LM is a descendant of the FlowLM. For static-content
* the FO may still be needed on following pages.
*/
@@ -418,7 +418,7 @@ public abstract class AbstractLayoutManager extends AbstractBaseLayoutManager
}
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return (super.toString() + (fobj != null ? "[fobj=" + fobj.toString() + "]" : ""));
diff --git a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
index 2b61fb6c6..758761303 100644
--- a/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/AbstractPageSequenceLayoutManager.java
@@ -43,15 +43,15 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
private static Log log = LogFactory.getLog(AbstractPageSequenceLayoutManager.class);
- /**
+ /**
* AreaTreeHandler which activates the PSLM and controls
* the rendering of its pages.
*/
protected AreaTreeHandler areaTreeHandler;
-
+
/** ID tracker supplied by the AreaTreeHandler */
protected IDTracker idTracker;
-
+
/** page sequence formatting object being processed by this class */
protected AbstractPageSequence pageSeq;
@@ -62,7 +62,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
protected int currentPageNum = 0;
/** The stating page number */
protected int startPageNum = 0;
-
+
/**
* Constructor
*
@@ -112,12 +112,12 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
startPageNum = pageSeq.getStartingPageNumber();
currentPageNum = startPageNum - 1;
}
-
+
/**
* This returns the first PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the first PageViewport that contains the ID trait
*/
public PageViewport getFirstPVWithID(String idref) {
@@ -132,7 +132,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* This returns the last PageViewport that contains an id trait
* matching the idref argument, or null if no such PV exists.
*
- * @param idref the idref trait needing to be resolved
+ * @param idref the idref trait needing to be resolved
* @return the last PageViewport that contains the ID trait
*/
public PageViewport getLastPVWithID(String idref) {
@@ -142,7 +142,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
}
return null;
}
-
+
/**
* Add an ID reference to the current page.
* When adding areas the area adds its ID reference.
@@ -156,7 +156,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
idTracker.associateIDWithPageViewport(id, curPage.getPageViewport());
}
}
-
+
/**
* Add an id reference of the layout manager in the AreaTreeHandler,
* if the id hasn't been resolved yet
@@ -175,7 +175,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
return true;
}
}
-
+
/**
* Notify the areaTreeHandler that the LayoutManagers containing
* idrefs have finished creating areas
@@ -184,16 +184,16 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
public void notifyEndOfLayout(String id) {
idTracker.signalIDProcessed(id);
}
-
+
/**
- * Identify an unresolved area (one needing an idref to be
+ * Identify an unresolved area (one needing an idref to be
* resolved, e.g. the internal-destination of an fo:basic-link)
* for both the AreaTreeHandler and PageViewport object.
- *
+ *
* The IDTracker keeps a document-wide list of idref's
- * and the PV's needing them to be resolved. It uses this to
+ * and the PV's needing them to be resolved. It uses this to
* send notifications to the PV's when an id has been resolved.
- *
+ *
* The PageViewport keeps lists of id's needing resolving, along
* with the child areas (page-number-citation, basic-link, etc.)
* of the PV needing their resolution.
@@ -216,7 +216,7 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* then the containing page does not have a qualifying area,
* and all qualifying areas have ended.
* Therefore we use last-ending-within-page (Constants.EN_LEWP)
- * as the position.
+ * as the position.
*
* @param rm the RetrieveMarker instance whose properties are to
* used to find the matching Marker.
@@ -227,8 +227,8 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
AreaTreeModel areaTreeModel = areaTreeHandler.getAreaTreeModel();
String name = rm.getRetrieveClassName();
int pos = rm.getRetrievePosition();
- int boundary = rm.getRetrieveBoundary();
-
+ int boundary = rm.getRetrieveBoundary();
+
// get marker from the current markers on area tree
Marker mark = (Marker)getCurrentPV().getMarker(name, pos);
if (mark == null && boundary != EN_PAGE) {
@@ -271,10 +271,10 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
* @return the newly created page
*/
protected abstract Page createPage(int pageNumber, boolean isBlank);
-
+
/**
* Makes a new page
- *
+ *
* @param bIsBlank whether this page is blank or not
* @param bIsLast whether this page is the last page or not
* @return a new page
@@ -289,14 +289,14 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
curPage = createPage(currentPageNum, isBlank);
if (log.isDebugEnabled()) {
- log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ log.debug("[" + curPage.getPageViewport().getPageNumberString()
+ (isBlank ? "*" : "") + "]");
}
-
+
addIDToPage(pageSeq.getId());
return curPage;
}
-
+
/**
* Finishes a page in preparation for a new page.
*/
@@ -304,19 +304,19 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
if (log.isTraceEnabled()) {
curPage.getPageViewport().dumpMarkers();
}
-
+
// Try to resolve any unresolved IDs for the current page.
- //
+ //
idTracker.tryIDResolution(curPage.getPageViewport());
// Queue for ID resolution and rendering
areaTreeHandler.getAreaTreeModel().addPage(curPage.getPageViewport());
if (log.isDebugEnabled()) {
- log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ log.debug("page finished: " + curPage.getPageViewport().getPageNumberString()
+ ", current num: " + currentPageNum);
}
curPage = null;
}
-
+
/** {@inheritDoc} */
public void doForcePageCount(Numeric nextPageSeqInitialPageNumber) {
@@ -325,14 +325,14 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
// xsl-spec version 1.0 (15.oct 2001)
// auto | even | odd | end-on-even | end-on-odd | no-force | inherit
// auto:
- // Force the last page in this page-sequence to be an odd-page
- // if the initial-page-number of the next page-sequence is even.
- // Force it to be an even-page
- // if the initial-page-number of the next page-sequence is odd.
- // If there is no next page-sequence
+ // Force the last page in this page-sequence to be an odd-page
+ // if the initial-page-number of the next page-sequence is even.
+ // Force it to be an even-page
+ // if the initial-page-number of the next page-sequence is odd.
+ // If there is no next page-sequence
// or if the value of its initial-page-number is "auto" do not force any page.
-
- // if force-page-count is auto then set the value of forcePageCount
+
+ // if force-page-count is auto then set the value of forcePageCount
// depending on the initial-page-number of the next page-sequence
if (nextPageSeqInitialPageNumber != null && forcePageCount == Constants.EN_AUTO) {
if (nextPageSeqInitialPageNumber.getEnum() != 0) {
@@ -381,5 +381,5 @@ public abstract class AbstractPageSequenceLayoutManager extends AbstractLayoutMa
finishPage();
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
index 1b0d02639..a429359ad 100644
--- a/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/AreaAdditionUtil.java
@@ -49,7 +49,7 @@ public class AreaAdditionUtil {
* @param parentIter the position iterator
* @param layoutContext the layout context
*/
- public static void addAreas(BlockStackingLayoutManager bslm,
+ public static void addAreas(BlockStackingLayoutManager bslm,
PositionIterator parentIter, LayoutContext layoutContext) {
LayoutManager childLM = null;
LayoutContext lc = new LayoutContext(0);
@@ -57,9 +57,9 @@ public class AreaAdditionUtil {
LayoutManager lastLM = null;
Position firstPos = null;
Position lastPos = null;
-
+
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -93,11 +93,11 @@ public class AreaAdditionUtil {
//correctly determine first and last conditions. The Iterator
//doesn't give us that info.
}
-
+
if (bslm != null) {
bslm.addMarkersToPage(
- true,
- bslm.isFirst(firstPos),
+ true,
+ bslm.isFirst(firstPos),
bslm.isLast(lastPos));
}
@@ -120,15 +120,15 @@ public class AreaAdditionUtil {
lc.setStackLimitsFrom(layoutContext);
childLM.addAreas(childPosIter, lc);
}
-
+
if (bslm != null) {
bslm.addMarkersToPage(
- false,
- bslm.isFirst(firstPos),
+ false,
+ bslm.isFirst(firstPos),
bslm.isLast(lastPos));
}
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
index a28fdbfbc..2bb499a36 100644
--- a/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/BalancingColumnBreakingAlgorithm.java
@@ -30,11 +30,11 @@ import org.apache.fop.traits.MinOptMax;
public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
private Log log = LogFactory.getLog(BalancingColumnBreakingAlgorithm.class);
-
+
private int columnCount;
private int fullLen;
private int idealPartLen;
-
+
public BalancingColumnBreakingAlgorithm(LayoutManager topLevelLM,
PageProvider pageProvider,
PageBreakingLayoutListener layoutListener,
@@ -43,18 +43,18 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
boolean partOverflowRecovery,
int columnCount) {
super(topLevelLM, pageProvider, layoutListener,
- alignment, alignmentLast,
+ alignment, alignmentLast,
footnoteSeparatorLength, partOverflowRecovery, false, false);
this.columnCount = columnCount;
this.considerTooShort = true; //This is important!
}
-
+
/** {@inheritDoc} */
protected double computeDemerits(KnuthNode activeNode,
KnuthElement element, int fitnessClass, double r) {
double dem = super.computeDemerits(activeNode, element, fitnessClass, r);
if (log.isTraceEnabled()) {
- log.trace("original demerit=" + dem + " " + totalWidth
+ log.trace("original demerit=" + dem + " " + totalWidth
+ " line=" + activeNode.line + "/" + columnCount
+ " pos=" + activeNode.position + "/" + (par.size() - 1));
}
@@ -71,7 +71,7 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
avgRestLen = restLen / remParts;
}
if (log.isTraceEnabled()) {
- log.trace("remaining parts: " + remParts + " rest len: " + restLen
+ log.trace("remaining parts: " + remParts + " rest len: " + restLen
+ " avg=" + avgRestLen);
}
double balance = (idealPartLen - partLen) / 1000f;
@@ -92,9 +92,9 @@ public class BalancingColumnBreakingAlgorithm extends PageBreakingAlgorithm {
dem = dem * 1.2f;
}
}
- //Step 2: This helps keep the trailing parts shorter than the previous ones
+ //Step 2: This helps keep the trailing parts shorter than the previous ones
dem += (avgRestLen) / 1000f;
-
+
if (activeNode.line >= columnCount) {
//We don't want more columns than available
dem = Double.MAX_VALUE;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
index 4aa73cc37..17eb44049 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,14 +44,14 @@ import org.apache.fop.util.ListUtil;
/**
* LayoutManager for a block-container FO.
*/
-public class BlockContainerLayoutManager extends BlockStackingLayoutManager
+public class BlockContainerLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
* logging instance
*/
private static Log log = LogFactory.getLog(BlockContainerLayoutManager.class);
-
+
private BlockViewport viewportBlockArea;
private Block referenceArea;
@@ -62,11 +62,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private Length height;
//private int vpContentIPD;
private int vpContentBPD;
-
+
// When viewport should grow with the content.
private boolean autoHeight = true;
private boolean inlineElementList = false;
-
+
/* holds the (one-time use) fo:block space-before
and -after properties. Large fo:blocks are split
into multiple Area.Blocks to accomodate the subsequent
@@ -78,7 +78,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
//TODO space-before|after: handle space-resolution rules
private MinOptMax foBlockSpaceBefore;
private MinOptMax foBlockSpaceAfter;
-
+
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
@@ -86,7 +86,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private MinOptMax effSpaceBefore;
private MinOptMax effSpaceAfter;
-
+
/**
* Create a new block container layout manager.
* @param node block-container node to create the layout manager for.
@@ -94,7 +94,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
public BlockContainerLayoutManager(BlockContainer node) {
super(node);
}
-
+
/** {@inheritDoc} */
public void initialize() {
abProps = getBlockContainerFO().getCommonAbsolutePosition();
@@ -103,7 +103,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
foBlockSpaceAfter = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
.spaceAfter, this).getSpace();
startIndent = getBlockContainerFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getBlockContainerFO().getCommonMarginBlock().endIndent.getValue(this);
boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
if (rotated) {
@@ -117,7 +117,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
width = getBlockContainerFO().getInlineProgressionDimension()
.getOptimum(this).getLength();
}
-
+
bpUnit = 0; //layoutProps.blockProgressionUnit;
if (bpUnit == 0) {
// use optimum space values
@@ -133,11 +133,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.spaceAfter.getSpace().getMinimum(this).getLength().getValue(this);
}
}
-
+
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
@@ -153,11 +153,11 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int overflow = getBlockContainerFO().getOverflow();
return (overflow == EN_HIDDEN || overflow == EN_ERROR_IF_OVERFLOW);
}
-
+
private int getSpaceBefore() {
return foBlockSpaceBefore.opt;
}
-
+
private int getBPIndents() {
int indents = 0;
/* TODO This is wrong isn't it?
@@ -170,16 +170,16 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.getBPPaddingAndBorder(false, this);
return indents;
}
-
+
private boolean isAbsoluteOrFixed() {
- return (abProps.absolutePosition == EN_ABSOLUTE)
+ return (abProps.absolutePosition == EN_ABSOLUTE)
|| (abProps.absolutePosition == EN_FIXED);
}
private boolean isFixed() {
return (abProps.absolutePosition == EN_FIXED);
}
-
+
/** {@inheritDoc} */
public int getContentAreaBPD() {
if (autoHeight) {
@@ -188,26 +188,26 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
return this.vpContentBPD;
}
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
resetSpaces();
if (isAbsoluteOrFixed()) {
return getNextKnuthElementsAbsolute(context, alignment);
}
-
+
autoHeight = false;
//boolean rotated = (getBlockContainerFO().getReferenceOrientation() % 180 != 0);
int maxbpd = context.getStackLimitBP().opt;
int allocBPD;
- if (height.getEnum() == EN_AUTO
+ if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
- //auto height when height="auto" or "if that dimension is not specified explicitly
+ //auto height when height="auto" or "if that dimension is not specified explicitly
//(i.e., it depends on content's block-progression-dimension)" (XSL 1.0, 7.14.1)
allocBPD = maxbpd;
autoHeight = true;
if (getBlockContainerFO().getReferenceOrientation() == 0) {
- //Cannot easily inline element list when ref-or="180"
+ //Cannot easily inline element list when ref-or="180"
inlineElementList = true;
}
} else {
@@ -223,7 +223,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int contentWidth = width.getValue(this);
updateContentAreaIPDwithOverconstrainedAdjust(contentWidth);
}
-
+
double contentRectOffsetX = 0;
contentRectOffsetX += getBlockContainerFO()
.getCommonMarginBlock().startIndent.getValue(this);
@@ -232,7 +232,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.getCommonBorderPaddingBackground().getBorderBeforeWidth(false);
contentRectOffsetY += getBlockContainerFO()
.getCommonBorderPaddingBackground().getPaddingBefore(false, this);
-
+
updateRelDims(contentRectOffsetX, contentRectOffsetY, autoHeight);
int availableIPD = referenceIPD - getIPIndents();
@@ -243,13 +243,13 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
getContentAreaIPD(), context.getRefIPD(),
getBlockContainerFO().getLocator());
}
-
+
MinOptMax stackLimit = new MinOptMax(relDims.bpd);
List returnedList;
List contentList = new LinkedList();
List returnList = new LinkedList();
-
+
if (!breakBeforeServed) {
try {
if (addKnuthElementsForBreakBefore(returnList, context)) {
@@ -264,7 +264,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addKnuthElementsForSpaceBefore(returnList, alignment);
context.updateKeepWithPreviousPending(getKeepWithPreviousStrength());
}
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
@@ -366,7 +366,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
returnList.add(new KnuthBox(vpContentBPD, notifyPos(bcPosition), false));
//TODO Handle min/opt/max for block-progression-dimension
/* These two elements will be used to add stretchability to the above box
- returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+ returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, returnPosition, false));
returnList.add(new KnuthGlue(0, 1 * constantLineHeight, 0,
LINE_NUMBER_ADJUSTMENT, returnPosition, false));
@@ -375,7 +375,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (contentOverflows) {
BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
getBlockContainerFO().getUserAgent().getEventBroadcaster());
- boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
+ boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
eventProducer.viewportOverflow(this, getBlockContainerFO().getName(),
breaker.getOverflowAmount(), needClip(), canRecover,
getBlockContainerFO().getLocator());
@@ -384,7 +384,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
- //All child content is processed. Only break-after can occur now, so...
+ //All child content is processed. Only break-after can occur now, so...
context.clearPendingMarks();
addKnuthElementsForBreakAfter(returnList, context);
@@ -393,7 +393,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
setFinished(true);
return returnList;
}
-
+
private List getNextKnuthElementsAbsolute(LayoutContext context, int alignment) {
autoHeight = false;
@@ -403,7 +403,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
int allocBPD, allocIPD;
if (height.getEnum() == EN_AUTO
|| (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) {
- //auto height when height="auto" or "if that dimension is not specified explicitly
+ //auto height when height="auto" or "if that dimension is not specified explicitly
//(i.e., it depends on content's blockprogression-dimension)" (XSL 1.0, 7.14.1)
allocBPD = 0;
if (abProps.bottom.getEnum() != EN_AUTO) {
@@ -411,7 +411,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (isFixed()) {
availHeight = (int)getCurrentPV().getViewArea().getHeight();
} else {
- availHeight = context.getStackLimitBP().opt;
+ availHeight = context.getStackLimitBP().opt;
}
allocBPD = availHeight;
allocBPD -= offset.y;
@@ -456,7 +456,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (width.getEnum() == EN_AUTO) {
int availWidth;
if (isFixed()) {
- availWidth = (int)getCurrentPV().getViewArea().getWidth();
+ availWidth = (int)getCurrentPV().getViewArea().getWidth();
} else {
availWidth = context.getRefIPD();
}
@@ -500,7 +500,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
vpContentBPD = allocBPD - getBPIndents();
setContentAreaIPD(allocIPD - getIPIndents());
-
+
updateRelDims(0, 0, autoHeight);
MinOptMax range = new MinOptMax(relDims.ipd);
@@ -521,12 +521,12 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (!breaker.isEmpty()) {
Position bcPosition = new BlockContainerPosition(this, breaker);
returnList.add(new KnuthBox(0, notifyPos(bcPosition), false));
-
+
//TODO Maybe check for page overflow when autoHeight=true
if (!autoHeight & (contentOverflows)) {
BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
getBlockContainerFO().getUserAgent().getEventBroadcaster());
- boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
+ boolean canRecover = (getBlockContainerFO().getOverflow() != EN_ERROR_IF_OVERFLOW);
eventProducer.viewportOverflow(this, getBlockContainerFO().getName(),
breaker.getOverflowAmount(), needClip(), canRecover,
getBlockContainerFO().getLocator());
@@ -539,16 +539,16 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
private void updateRelDims(double xOffset, double yOffset, boolean skipAutoHeight) {
Rectangle2D rect = new Rectangle2D.Double(
- xOffset, yOffset,
+ xOffset, yOffset,
getContentAreaIPD(),
this.vpContentBPD);
relDims = new FODimension(0, 0);
absoluteCTM = CTM.getCTMandRelDims(
getBlockContainerFO().getReferenceOrientation(),
- getBlockContainerFO().getWritingMode(),
+ getBlockContainerFO().getWritingMode(),
rect, relDims);
}
-
+
private class BlockContainerPosition extends NonLeafPosition {
private BlockContainerBreaker breaker;
@@ -557,23 +557,23 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
super(lm, null);
this.breaker = breaker;
}
-
+
public BlockContainerBreaker getBreaker() {
return this.breaker;
}
-
+
}
-
+
private class BlockContainerBreaker extends AbstractBreaker {
-
+
private BlockContainerLayoutManager bclm;
private MinOptMax ipd;
-
+
//Info for deferred adding of areas
private PageBreakingAlgorithm deferredAlg;
private BlockSequence deferredOriginalList;
private BlockSequence deferredEffectiveList;
-
+
public BlockContainerBreaker(BlockContainerLayoutManager bclm, MinOptMax ipd) {
this.bclm = bclm;
this.ipd = ipd;
@@ -581,10 +581,10 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
protected void observeElementList(List elementList) {
- ElementListObserver.observe(elementList, "block-container",
+ ElementListObserver.observe(elementList, "block-container",
bclm.getBlockContainerFO().getId());
}
-
+
/** {@inheritDoc} */
protected boolean isPartOverflowRecoveryActivated() {
//For block-containers, this must be disabled because of wanted overflow.
@@ -600,19 +600,19 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
PageBreakPosition pbp = (PageBreakPosition)this.deferredAlg.getPageBreaks().getFirst();
return pbp.difference;
}
-
+
public boolean isOverflow() {
return !isEmpty()
&& ((deferredAlg.getPageBreaks().size() > 1)
|| (deferredAlg.totalWidth - deferredAlg.totalShrink)
> deferredAlg.getLineWidth());
}
-
+
public int getOverflowAmount() {
- return (deferredAlg.totalWidth - deferredAlg.totalShrink)
+ return (deferredAlg.totalWidth - deferredAlg.totalShrink)
- deferredAlg.getLineWidth();
}
-
+
protected LayoutManager getTopLevelLM() {
return bclm;
}
@@ -623,7 +623,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
lc.setWritingMode(getBlockContainerFO().getWritingMode());
return lc;
}
-
+
protected List getNextKnuthElements(LayoutContext context, int alignment) {
LayoutManager curLM; // currently active LM
List returnList = new LinkedList();
@@ -633,7 +633,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getBlockContainerFO().getWritingMode());
-
+
List returnedList = null;
if (!curLM.isFinished()) {
returnedList = curLM.getNextKnuthElements(childLC, alignment);
@@ -650,45 +650,45 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
protected int getCurrentDisplayAlign() {
return getBlockContainerFO().getDisplayAlign();
}
-
+
protected boolean hasMoreContent() {
return !isFinished();
}
-
+
protected void addAreas(PositionIterator posIter, LayoutContext context) {
- AreaAdditionUtil.addAreas(bclm, posIter, context);
+ AreaAdditionUtil.addAreas(bclm, posIter, context);
}
-
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
//Defer adding of areas until addAreas is called by the parent LM
this.deferredAlg = alg;
this.deferredOriginalList = originalList;
this.deferredEffectiveList = effectiveList;
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
//nop for bclm
}
-
+
protected LayoutManager getCurrentChildLM() {
return curChildLM;
}
-
+
public void addContainedAreas() {
if (isEmpty()) {
return;
}
- //Rendering all parts (not just the first) at once for the case where the parts that
+ //Rendering all parts (not just the first) at once for the case where the parts that
//overflow should be visible.
this.deferredAlg.removeAllPageBreaks();
- this.addAreas(this.deferredAlg,
- this.deferredAlg.getPageBreaks().size(),
+ this.addAreas(this.deferredAlg,
+ this.deferredAlg.getPageBreaks().size(),
this.deferredOriginalList, this.deferredEffectiveList);
}
-
+
}
-
+
private Point getAbsOffset() {
int x = 0;
int y = 0;
@@ -696,7 +696,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
x = abProps.left.getValue(this);
} else if (abProps.right.getEnum() != EN_AUTO
&& width.getEnum() != EN_AUTO) {
- x = getReferenceAreaIPD()
+ x = getReferenceAreaIPD()
- abProps.right.getValue(this) - width.getValue(this);
}
if (abProps.top.getEnum() != EN_AUTO) {
@@ -708,7 +708,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
return new Point(x, y);
}
-
+
/** {@inheritDoc} */
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
@@ -755,7 +755,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
if (bcpos != null) {
throw new IllegalStateException("Only one BlockContainerPosition allowed");
}
- bcpos = (BlockContainerPosition)pos;
+ bcpos = (BlockContainerPosition)pos;
//Add child areas inside the reference area
//bcpos.getBreaker().addContainedAreas();
} else if (innerPosition == null) {
@@ -786,9 +786,9 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
addId();
-
+
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
-
+
if (bcpos == null) {
if (bpUnit == 0) {
// the Positions in positionList were inside the elements
@@ -831,7 +831,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
//log.debug("Adding areas from " + iFirst + " to " + iLast);
//log.debug("splitLength= " + splitLength
// + " (" + neededUnits(splitLength) + " units') "
- // + (neededUnits(splitLength) * bpUnit - splitLength)
+ // + (neededUnits(splitLength) * bpUnit - splitLength)
// + " spacing");
// add space before and / or after the paragraph
// to reach a multiple of bpUnit
@@ -864,7 +864,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
.size());
//}
}
-
+
while ((childLM = childPosIter.getNextChildLM()) != null) {
// set last area flag
lc.setFlags(LayoutContext.LAST_AREA,
@@ -880,7 +880,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
- TraitSetter.addSpaceBeforeAfter(viewportBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(viewportBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
@@ -890,7 +890,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
notifyEndOfLayout();
}
-
+
/**
* Get the parent area for children of this block container.
* This returns the current block container area
@@ -906,7 +906,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea = new BlockViewport(allowBPDUpdate);
viewportBlockArea.addTrait(Trait.IS_VIEWPORT_AREA, Boolean.TRUE);
-
+
viewportBlockArea.setIPD(getContentAreaIPD());
if (allowBPDUpdate) {
viewportBlockArea.setBPD(0);
@@ -914,22 +914,22 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea.setBPD(this.vpContentBPD);
}
transferForeignAttributes(viewportBlockArea);
-
+
TraitSetter.setProducerID(viewportBlockArea, getBlockContainerFO().getId());
- TraitSetter.addBorders(viewportBlockArea,
- getBlockContainerFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(viewportBlockArea,
+ getBlockContainerFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(viewportBlockArea,
- getBlockContainerFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(viewportBlockArea,
+ getBlockContainerFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
- // TraitSetter.addBackground(viewportBlockArea,
+ // TraitSetter.addBackground(viewportBlockArea,
// getBlockContainerFO().getCommonBorderPaddingBackground(),
// this);
- TraitSetter.addMargins(viewportBlockArea,
+ TraitSetter.addMargins(viewportBlockArea,
getBlockContainerFO().getCommonBorderPaddingBackground(),
startIndent, endIndent,
this);
-
+
viewportBlockArea.setCTM(absoluteCTM);
viewportBlockArea.setClip(needClip());
/*
@@ -940,7 +940,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
viewportBlockArea.addTrait(Trait.SPACE_AFTER, new Integer(foBlockSpaceAfter.opt));
}*/
- if (abProps.absolutePosition == EN_ABSOLUTE
+ if (abProps.absolutePosition == EN_ABSOLUTE
|| abProps.absolutePosition == EN_FIXED) {
Point offset = getAbsOffset();
viewportBlockArea.setXOffset(offset.x);
@@ -981,17 +981,17 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
}
}
- /**
+ /**
* Force current area to be added to parent area.
* {@inheritDoc}
*/
protected void flush() {
viewportBlockArea.addBlock(referenceArea, autoHeight);
- TraitSetter.addBackground(viewportBlockArea,
+ TraitSetter.addBackground(viewportBlockArea,
getBlockContainerFO().getCommonBorderPaddingBackground(),
this);
-
+
super.flush();
}
@@ -1004,7 +1004,7 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
public void discardSpace(KnuthGlue spaceGlue) {
// TODO Auto-generated method stub
-
+
}
/** {@inheritDoc} */
@@ -1032,15 +1032,15 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
*/
protected BlockContainer getBlockContainerFO() {
return (BlockContainer) fobj;
- }
+ }
// --------- Property Resolution related functions --------- //
-
+
/** {@inheritDoc} */
public boolean getGeneratesReferenceArea() {
return true;
}
-
+
/** {@inheritDoc} */
public boolean getGeneratesBlockArea() {
return true;
@@ -1050,13 +1050,13 @@ public class BlockContainerLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
index d3365b10f..fac5bf075 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockKnuthSequence.java
@@ -26,16 +26,16 @@ import java.util.List;
* Represents a list of block level Knuth elements.
*/
public class BlockKnuthSequence extends KnuthSequence {
-
+
private boolean isClosed = false;
-
+
/**
* Creates a new and empty list.
*/
public BlockKnuthSequence() {
super();
}
-
+
/**
* Creates a new list from an existing list.
* @param list The list from which to create the new list.
@@ -59,7 +59,7 @@ public class BlockKnuthSequence extends KnuthSequence {
// log.debug("Cannot append a sequence without a BreakElement");
return false;
}
-
+
/** {@inheritDoc} */
public boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement) {
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
index b6b6f921f..c641c3e69 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
@@ -42,14 +42,14 @@ import org.apache.fop.traits.SpaceVal;
/**
* LayoutManager for a block FO.
*/
-public class BlockLayoutManager extends BlockStackingLayoutManager
+public class BlockLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
* logging instance
*/
private static Log log = LogFactory.getLog(BlockLayoutManager.class);
-
+
private Block curBlockArea;
/** Iterator over the child layout managers. */
@@ -59,7 +59,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
private Length lineHeight;
private int follow = 2000;
//private int middleShift = 0;
-
+
private boolean discardBorderBefore;
private boolean discardBorderAfter;
private boolean discardPaddingBefore;
@@ -91,7 +91,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
//middleShift = -fs.getXHeight() / 2;
lineHeight = getBlockFO().getLineHeight().getOptimum(this).getLength();
startIndent = getBlockFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getBlockFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getBlockFO().getCommonMarginBlock().endIndent.getValue(this);
foSpaceBefore = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceBefore, this)
.getSpace();
foSpaceAfter = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceAfter, this)
@@ -114,19 +114,19 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
- resetSpaces();
+ resetSpaces();
return super.getNextKnuthElements(context, alignment);
}
-
+
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/**
* Proxy iterator for Block LM.
* This iterator creates and holds the complete list
@@ -216,7 +216,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KeepUtil.getCombinedBlockLevelKeepStrength(getBlockFO().getKeepWithNext());
@@ -298,7 +298,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
addId();
-
+
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
if (bpUnit == 0) {
@@ -340,7 +340,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
//log.debug("Adding areas from " + iFirst + " to " + iLast);
//log.debug("splitLength= " + splitLength
// + " (" + neededUnits(splitLength) + " units') "
- // + (neededUnits(splitLength) * bpUnit - splitLength)
+ // + (neededUnits(splitLength) * bpUnit - splitLength)
// + " spacing");
// add space before and / or after the paragraph
// to reach a multiple of bpUnit
@@ -385,13 +385,13 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
//Notify end of block layout manager to the PSLM
checkEndOfLayout(lastPos);
}
@@ -414,7 +414,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
curBlockArea.setIPD(super.getContentAreaIPD());
- TraitSetter.addBreaks(curBlockArea,
+ TraitSetter.addBreaks(curBlockArea,
getBlockFO().getBreakBefore(), getBlockFO().getBreakAfter());
// Must get dimensions from parent area
@@ -423,14 +423,14 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
// set traits
TraitSetter.setProducerID(curBlockArea, getBlockFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getBlockFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getBlockFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getBlockFO().getCommonBorderPaddingBackground(),
+ getBlockFO().getCommonBorderPaddingBackground(),
startIndent, endIndent,
this);
@@ -458,7 +458,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
*/
protected void flush() {
if (curBlockArea != null) {
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getBlockFO().getCommonBorderPaddingBackground(),
this);
super.flush();
@@ -472,9 +472,9 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
protected org.apache.fop.fo.flow.Block getBlockFO() {
return (org.apache.fop.fo.flow.Block) fobj;
}
-
+
// --------- Property Resolution related functions --------- //
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -485,7 +485,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
return super.getContentAreaIPD();
}
-
+
/**
* Returns the BPD of the content area
@@ -497,7 +497,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
}
return -1;
}
-
+
/**
* {@inheritDoc}
*/
@@ -509,13 +509,13 @@ public class BlockLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
index b1dd7ef5d..222ce277e 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLevelEventProducer.java
@@ -34,7 +34,7 @@ public interface BlockLevelEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -56,7 +56,7 @@ public interface BlockLevelEventProducer extends EventProducer {
* @event.severity WARN
*/
void rowTooTall(Object source, int row, int effCellBPD, int maxCellBPD, Locator loc);
-
+
/**
* Auto-table layout is not supported, yet.
* @param source the event source
@@ -64,28 +64,28 @@ public interface BlockLevelEventProducer extends EventProducer {
* @event.severity INFO
*/
void tableFixedAutoWidthNotSupported(Object source, Locator loc);
-
+
/**
* An formatting object is too wide.
* @param source the event source
- * @param elementName the formatting object
+ * @param elementName the formatting object
* @param effIPD the effective extent in inline-progression direction of the table contents
* @param maxIPD the maximum extent in inline-progression direction available
* @param loc the location of the error or null
* @event.severity WARN
*/
void objectTooWide(Object source, String elementName, int effIPD, int maxIPD, Locator loc);
-
+
/**
* An overconstrained geometry adjustment rule was triggered (5.3.4, XSL 1.0).
* @param source the event source
- * @param elementName the formatting object
+ * @param elementName the formatting object
* @param amount the amount of the adjustment (in mpt)
* @param loc the location of the error or null
* @event.severity INFO
*/
void overconstrainedAdjustEndIndent(Object source, String elementName, int amount, Locator loc);
-
+
/**
* Contents overflow a viewport.
* @param source the event source
@@ -97,10 +97,10 @@ public interface BlockLevelEventProducer extends EventProducer {
* @throws LayoutException the layout error provoked by the method call
* @event.severity FATAL
*/
- void viewportOverflow(Object source, String elementName,
+ void viewportOverflow(Object source, String elementName,
int amount, boolean clip, boolean canRecover,
Locator loc) throws LayoutException;
-
+
/**
* Contents overflow a region viewport.
* @param source the event source
@@ -117,7 +117,7 @@ public interface BlockLevelEventProducer extends EventProducer {
String page,
int amount, boolean clip, boolean canRecover,
Locator loc) throws LayoutException;
-
+
/**
* Indicates that FOP doesn't support flows that are not mapped to region-body, yet.
* @param source the event source
@@ -129,7 +129,7 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void flowNotMappingToRegionBody(Object source, String flowName, String masterName,
Locator loc) throws UnsupportedOperationException;
-
+
/**
* A page sequence master is exhausted.
* @param source the event source
@@ -152,7 +152,7 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void missingSubsequencesInPageSequenceMaster(Object source, String pageSequenceMasterName,
Locator loc) throws PageProductionException;
-
+
/**
* No single-page-master matching in page sequence master.
* @param source the event source
@@ -164,5 +164,5 @@ public interface BlockLevelEventProducer extends EventProducer {
*/
void noMatchingPageMaster(Object source, String pageSequenceMasterName,
String pageMasterName, Locator loc) throws PageProductionException;
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
index 765bb1086..9163193a2 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockLevelLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
/**
@@ -39,7 +39,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
int KEEP_AUTO = Integer.MIN_VALUE;
/** The integer value for "always" keep strength */
int KEEP_ALWAYS = Integer.MAX_VALUE;
-
+
int negotiateBPDAdjustment(int adj, KnuthElement lastElement);
void discardSpace(KnuthGlue spaceGlue);
@@ -60,7 +60,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
* @return the keep-with-previous strength
*/
int getKeepWithPreviousStrength();
-
+
/**
* @return true if this element must be kept with the previous element.
*/
@@ -71,7 +71,7 @@ public interface BlockLevelLayoutManager extends LayoutManager {
* @return the keep-with-next strength
*/
int getKeepWithNextStrength();
-
+
/**
* @return true if this element must be kept with the next element.
*/
diff --git a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
index 4360f62e9..1d6662cb2 100644
--- a/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -91,7 +91,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
private Position auxiliaryPosition;
private int contentAreaIPD = 0;
-
+
/**
* @param node the fo this LM deals with
*/
@@ -100,7 +100,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setGeneratesBlockArea(true);
}
- /**
+ /**
* @return current area being filled
*/
protected BlockParent getCurrentArea() {
@@ -181,7 +181,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
return this.auxiliaryPosition;
}
-
+
/**
* @param len length in millipoints to span with bp units
* @return the minimum integer n such that n * bpUnit >= len
@@ -194,7 +194,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* Determines and sets the content area IPD based on available reference area IPD, start- and
* end-indent properties.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
- *
+ *
* @return the resulting content area IPD
*/
protected int updateContentAreaIPDwithOverconstrainedAdjust() {
@@ -213,9 +213,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setContentAreaIPD(ipd);
return ipd;
}
-
+
/**
- * Sets the content area IPD by directly supplying the value.
+ * Sets the content area IPD by directly supplying the value.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
* @param contentIPD the IPD of the content
* @return the resulting content area IPD
@@ -234,7 +234,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
setContentAreaIPD(contentIPD);
return contentIPD;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
//log.debug("BLM.getNextKnuthElements> keep-together = "
@@ -247,7 +247,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
BlockLevelLayoutManager prevLM = null; // previously active LM
referenceIPD = context.getRefIPD();
-
+
updateContentAreaIPDwithOverconstrainedAdjust();
List returnedList = null;
@@ -268,16 +268,16 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
addKnuthElementsForSpaceBefore(returnList, alignment);
context.updateKeepWithPreviousPending(getKeepWithPreviousStrength());
}
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
//Spaces, border and padding to be repeated at each break
addPendingMarks(context);
-
+
//Used to indicate a special break-after case when all content has already been generated.
BreakElement forcedBreakAfterLast = null;
-
+
while ((curLM = (BlockLevelLayoutManager) getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
childLC.copyPendingMarksFrom(context);
@@ -314,13 +314,13 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (contentList.isEmpty()) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered and borders/padding are painted.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), false));
}
// a descendant of this block has break-before
contentList.addAll(returnedList);
-
+
/* extension: conversione di tutta la sequenza fin'ora ottenuta */
if (bpUnit > 0) {
storedList = contentList;
@@ -350,7 +350,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// a descendant of this block has break-after
if (curLM.isFinished() && !hasNextChildLM()) {
forcedBreakAfterLast = (BreakElement) ListUtil
- .removeLast(contentList);
+ .removeLast(contentList);
context.clearPendingMarks();
break;
}
@@ -385,15 +385,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (!contentList.isEmpty()) {
wrapPositionElements(contentList, returnList);
} else if (forcedBreakAfterLast == null) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), true));
}
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
-
- //All child content is processed. Only break-after can occur now, so...
+
+ //All child content is processed. Only break-after can occur now, so...
context.clearPendingMarks();
if (forcedBreakAfterLast == null) {
addKnuthElementsForBreakAfter(returnList, context);
@@ -403,9 +403,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
forcedBreakAfterLast.clearPendingMarks();
wrapPositionElement(forcedBreakAfterLast, returnList, false);
}
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
-
+
setFinished(true);
return returnList;
@@ -419,20 +419,20 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
*/
protected void addInBetweenBreak(List contentList, LayoutContext context,
LayoutContext childLC) {
- if (mustKeepTogether()
+ if (mustKeepTogether()
|| context.isKeepWithNextPending()
|| childLC.isKeepWithPreviousPending()) {
-
+
int strength = getKeepTogetherStrength();
-
+
//Handle pending keep-with-next
strength = Math.max(strength, context.getKeepWithNextPending());
context.clearKeepWithNextPending();
-
+
//Handle pending keep-with-previous from child LM
strength = Math.max(strength, childLC.getKeepWithPreviousPending());
childLC.clearKeepWithPreviousPending();
-
+
int penalty = KeepUtil.getPenaltyForKeep(strength);
// add a penalty to forbid or discourage a break between blocks
@@ -440,7 +440,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
new Position(this), penalty, context));
return;
}
-
+
ListElement last = (ListElement) ListUtil.getLast(contentList);
if (last.isGlue()) {
// the last element in contentList is a glue;
@@ -465,7 +465,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// areas for following Positions. The above test aims at preventing
// such a situation from occurring. add a null penalty to allow a break
// between blocks
-
+
// add a null penalty to allow a break between blocks
contentList.add(new BreakElement(
new Position(this), 0, context));
@@ -473,11 +473,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> " + adj);
-/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
+/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
// ? "penalty" : (lastElement.isGlue() ? "glue" : "box" )));
/*LF*/ //log.debug(" position e' " + lastElement.getPosition().getClass().getName());
/*LF*/ //log.debug(" " + (bpUnit > 0 ? "unit" : ""));
@@ -497,9 +497,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return adj;
} else if (innerPosition instanceof MappingPosition) {
// this block has block-progression-unit > 0: the adjustment can concern
- // - the space-before or space-after of this block,
+ // - the space-before or space-after of this block,
// - the line number of a descendant of this block
- MappingPosition mappingPos = (MappingPosition)innerPosition;
+ MappingPosition mappingPos = (MappingPosition)innerPosition;
if (lastElement.isGlue()) {
// lastElement is a glue
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> bpunit con glue");
@@ -512,7 +512,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
newAdjustment += ((BlockLevelLayoutManager)storedElement
.getLayoutManager()).negotiateBPDAdjustment(
adj - newAdjustment, storedElement);
-/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
+/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
// + newAdjustment);
}
}
@@ -530,7 +530,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// the original penalty has width > 0
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> chiamata passata");
return ((BlockLevelLayoutManager)storedPenalty.getLayoutManager())
- .negotiateBPDAdjustment(storedPenalty.getW(),
+ .negotiateBPDAdjustment(storedPenalty.getW(),
(KnuthElement)storedPenalty);
} else {
// the original penalty has width = 0
@@ -586,11 +586,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
/*LF*/ //log.debug("");
-/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
+/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
// + oldList.size());
ListIterator oldListIterator = oldList.listIterator();
KnuthElement returnedElement;
@@ -605,10 +605,10 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement)oldListIterator.next();
Position innerPosition = ((NonLeafPosition) oldElement.getPosition()).getPosition();
- //log.debug(" BLM> unwrapping: "
- // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
+ //log.debug(" BLM> unwrapping: "
+ // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
// + " creato da " + oldElement.getLayoutManager().getClass().getName());
- //log.debug(" BLM> unwrapping: "
+ //log.debug(" BLM> unwrapping: "
// + oldElement.getPosition().getClass().getName());
if (innerPosition != null) {
// oldElement was created by a descendant of this BlockLM
@@ -645,18 +645,18 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
int iLast = ((MappingPosition) el.getPosition()).getLastIndex();
- //log-debug(" si usa storedList da " + iFirst + " a " + iLast
+ //log-debug(" si usa storedList da " + iFirst + " a " + iLast
// + " compresi su " + storedList.size() + " elementi totali");
workList = storedList.subList(iFirst, iLast + 1);
}
ListIterator workListIterator = workList.listIterator();
- //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
// + workList.size() + " da 0 a " + (workList.size() - 1));
while (workListIterator.hasNext()) {
currElement = (KnuthElement) workListIterator.next();
- //log.debug("elemento n. " + workListIterator.previousIndex()
+ //log.debug("elemento n. " + workListIterator.previousIndex()
// + " nella workList");
if (prevElement != null
&& prevElement.getLayoutManager() != currElement.getLayoutManager()) {
@@ -667,8 +667,8 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
currElement.getLayoutManager();
boolean bSomethingAdded = false;
if (prevLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da "
- // + fromIndex + " a " + workListIterator.previousIndex() + " su "
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da "
+ // + fromIndex + " a " + workListIterator.previousIndex() + " su "
// + prevLM.getClass().getName());
returnedList.addAll(prevLM.getChangedKnuthElements(workList.subList(
fromIndex, workListIterator.previousIndex()), alignment));
@@ -677,7 +677,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// prevLM == this
// do nothing
//log.debug(" BLM.getChangedKnuthElements> elementi propri, "
- // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
+ // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
// + " su " + prevLM.getClass().getName());
}
fromIndex = workListIterator.previousIndex();
@@ -692,7 +692,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
|| prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious())) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (bSomethingAdded
&& !((KnuthElement) ListUtil.getLast(returnedList))
@@ -707,7 +707,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
BlockLevelLayoutManager currLM = (BlockLevelLayoutManager)
currElement.getLayoutManager();
if (currLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
// + " a " + oldList.size() + " su " + currLM.getClass().getName());
returnedList.addAll(currLM.getChangedKnuthElements(
workList.subList(fromIndex, workList.size()), alignment));
@@ -718,7 +718,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (!returnedList.isEmpty()) {
ListUtil.removeLast(returnedList);
}
- //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
+ //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
// + fromIndex + " a " + workList.size());
}
}
@@ -747,7 +747,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
}
- //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
// + returnedList.size());
/* estensione: conversione complessiva */
@@ -774,18 +774,18 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (bpUnit > 0 || adjustedSpaceAfter != 0) {
if (!spaceAfterIsConditional) {
- returnList.add(new KnuthPenalty(0,
+ returnList.add(new KnuthPenalty(0,
KnuthElement.INFINITE, false,
new NonLeafPosition(this, null), false));
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
} else {
returnList.add(new KnuthGlue(adjustedSpaceAfter, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
}
@@ -795,7 +795,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
}
- //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
// + returnList.size());
return returnList;
}
@@ -807,7 +807,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected int getParentKeepTogetherStrength() {
int strength = KEEP_AUTO;
if (getParent() instanceof BlockLevelLayoutManager) {
- strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
+ strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
} else if (getParent() instanceof InlineLayoutManager) {
if (((InlineLayoutManager) getParent()).mustKeepTogether()) {
strength = KEEP_ALWAYS;
@@ -817,7 +817,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
return strength;
}
-
+
/** {@inheritDoc} */
public boolean mustKeepTogether() {
return getKeepTogetherStrength() > KEEP_AUTO;
@@ -843,7 +843,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
context.addPendingBeforeMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.BEFORE).getWidth(),
RelSide.BEFORE,
@@ -854,15 +854,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.BEFORE),
- RelSide.BEFORE,
+ RelSide.BEFORE,
false, false, this));
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
context.addPendingAfterMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.AFTER).getWidth(),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
if (borderAndPadding.getPaddingAfter(false, this) > 0) {
@@ -870,12 +870,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.AFTER),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
}
}
-
+
/** @return the border, padding and background info structure */
private CommonBorderPaddingBackground getBorderPaddingBackground() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -897,7 +897,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/** @return the space-before property */
private SpaceProperty getSpaceBeforeProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -919,7 +919,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/** @return the space-after property */
private SpaceProperty getSpaceAfterProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -941,11 +941,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
return null;
}
}
-
+
/**
* Creates Knuth elements for before border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isFirst true if this is the first time a layout manager instance needs to generate
+ * @param isFirst true if this is the first time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingBefore(List returnList, boolean isFirst) {
@@ -954,7 +954,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.BEFORE)
.getWidth(),
RelSide.BEFORE, isFirst, false, this));
@@ -963,7 +963,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
returnList.add(new PaddingElement(
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
- CommonBorderPaddingBackground.BEFORE),
+ CommonBorderPaddingBackground.BEFORE),
RelSide.BEFORE, isFirst, false, this));
}
}
@@ -972,7 +972,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
/**
* Creates Knuth elements for after border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isLast true if this is the last time a layout manager instance needs to generate
+ * @param isLast true if this is the last time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingAfter(List returnList, boolean isLast) {
@@ -988,7 +988,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.AFTER)
.getWidth(),
RelSide.AFTER, false, isLast, this));
@@ -1002,7 +1002,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param context the layout context
* @return true if an element has been added due to a break-before.
*/
- protected boolean addKnuthElementsForBreakBefore(List returnList,
+ protected boolean addKnuthElementsForBreakBefore(List returnList,
LayoutContext context) {
int breakBefore = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1017,11 +1017,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
breakBefore = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakBefore();
}
if (breakBefore == EN_PAGE
- || breakBefore == EN_COLUMN
- || breakBefore == EN_EVEN_PAGE
+ || breakBefore == EN_COLUMN
+ || breakBefore == EN_EVEN_PAGE
|| breakBefore == EN_ODD_PAGE) {
// return a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakBefore, context));
return true;
} else {
@@ -1035,7 +1035,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param context the layout context
* @return true if an element has been added due to a break-after.
*/
- protected boolean addKnuthElementsForBreakAfter(List returnList,
+ protected boolean addKnuthElementsForBreakAfter(List returnList,
LayoutContext context) {
int breakAfter = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1054,7 +1054,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
|| breakAfter == EN_EVEN_PAGE
|| breakAfter == EN_ODD_PAGE) {
// add a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakAfter, context));
return true;
} else {
@@ -1067,21 +1067,21 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceBefore(List returnList/*,
+ protected void addKnuthElementsForSpaceBefore(List returnList/*,
Position returnPosition*/, int alignment) {
SpaceProperty spaceBefore = getSpaceBeforeProperty();
// append elements representing space-before
if (spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceBefore,
- RelSide.BEFORE,
+ RelSide.BEFORE,
true, false, this));
}
/*
if (bpUnit > 0
|| spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceBefore != null && !spaceBefore.getSpace().isDiscard()) {
// add elements to prevent the glue to be discarded
@@ -1091,7 +1091,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
returnList.add(new KnuthGlue(
@@ -1100,11 +1100,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
- spaceBefore.getOptimum(this).getLength().getValue(this),
spaceBefore.getOptimum(this).getLength().getValue(this)
- spaceBefore.getMinimum(this).getLength().getValue(this),
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
// } else {
// returnList.add(new KnuthGlue(
-// spaceBefore.getOptimum().getLength().getValue(this),
+// spaceBefore.getOptimum().getLength().getValue(this),
// 0, 0, BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
// returnPosition, true));
}
@@ -1116,28 +1116,28 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
+ protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
int alignment) {
SpaceProperty spaceAfter = getSpaceAfterProperty();
// append elements representing space-after
if (spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceAfter,
- RelSide.AFTER,
+ RelSide.AFTER,
false, true, this));
}
/*
if (bpUnit > 0
|| spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceAfter != null && !spaceAfter.getSpace().isDiscard()) {
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, getAuxiliaryPosition(), false));
}
if (bpUnit > 0) {
- returnList.add(new KnuthGlue(0, 0, 0,
+ returnList.add(new KnuthGlue(0, 0, 0,
BlockLevelLayoutManager.SPACE_AFTER_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
@@ -1162,7 +1162,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
}
protected List createUnitElements(List oldList) {
- //log.debug("Start conversion: " + oldList.size()
+ //log.debug("Start conversion: " + oldList.size()
// + " elements, space-before.min=" + layoutProps.spaceBefore.getSpace().min
// + " space-after.min=" + layoutProps.spaceAfter.getSpace().min);
// add elements at the beginning and at the end of oldList
@@ -1192,15 +1192,15 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
KnuthElement element = (KnuthElement) oldListIterator.next();
if (element.isBox()) {
totalLength.add(new MinOptMax(element.getW()));
- //log.debug("box " + element.getW());
+ //log.debug("box " + element.getW());
} else if (element.isGlue()) {
totalLength.min -= ((KnuthGlue) element).getZ();
totalLength.max += ((KnuthGlue) element).getY();
//leafValue = ((LeafPosition) element.getPosition()).getLeafPos();
- //log.debug("glue " + element.getW() + " + "
+ //log.debug("glue " + element.getW() + " + "
// + ((KnuthGlue) element).getY() + " - " + ((KnuthGlue) element).getZ());
} else {
- //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
+ //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
// ? "PENALTY " : "penalty ") + element.getW());
}
}
@@ -1294,12 +1294,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
int uNewShrink = (unitsBeforeBreak.opt - unitsBeforeBreak.min)
- (unsuppressibleUnits.opt - unsuppressibleUnits.min);
- //log.debug("("
- // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
+ //log.debug("("
+ // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
// + unsuppressibleUnits.max + ") "
- // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
+ // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
// + unitsBeforeBreak.max
- // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
+ // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
// + unitsAfterBreak.max
// + (uLengthChange != 0 ? " [length " + uLengthChange + "] " : "")
// + (uStretchChange != 0 ? " [stretch " + uStretchChange + "] " : "")
@@ -1332,9 +1332,9 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
// new infinite penalty, glue and box, if necessary
if (uNewStretch - uStretchChange > 0
|| uNewShrink - uShrinkChange > 0) {
- int iStretchUnits = (uNewStretch - uStretchChange > 0
+ int iStretchUnits = (uNewStretch - uStretchChange > 0
? (uNewStretch - uStretchChange) : 0);
- int iShrinkUnits = (uNewShrink - uShrinkChange > 0
+ int iShrinkUnits = (uNewShrink - uShrinkChange > 0
? (uNewShrink - uShrinkChange) : 0);
newList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
mappingPos,
@@ -1381,7 +1381,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
//log.debug(" PENALTY");
//log.debug(" glue 0 " + uStretchChange + " " + uShrinkChange);
//log.debug(" penalty " + uLengthChange + " * unit");
- //log.debug(" glue 0 " + (- uStretchChange) + " "
+ //log.debug(" glue 0 " + (- uStretchChange) + " "
// + (- uShrinkChange));
} else if (oldListIterator.hasNext()) {
// new penalty
@@ -1483,11 +1483,11 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
StackingIter(Iterator parentIter) {
super(parentIter);
}
-
+
protected LayoutManager getLM(Object nextObj) {
return ((Position) nextObj).getLM();
}
-
+
protected Position getPos(Object nextObj) {
return ((Position) nextObj);
}
@@ -1496,24 +1496,24 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected static class MappingPosition extends Position {
private int iFirstIndex;
private int iLastIndex;
-
+
public MappingPosition(LayoutManager lm, int first, int last) {
super(lm);
iFirstIndex = first;
iLastIndex = last;
}
-
+
public int getFirstIndex() {
return iFirstIndex;
}
-
+
public int getLastIndex() {
return iLastIndex;
}
}
/**
- * "wrap" the Position inside each element moving the elements from
+ * "wrap" the Position inside each element moving the elements from
* SourceList to targetList
* @param sourceList source list
* @param targetList target list receiving the wrapped position elements
@@ -1521,16 +1521,16 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected void wrapPositionElements(List sourceList, List targetList) {
wrapPositionElements(sourceList, targetList, false);
}
-
+
/**
- * "wrap" the Position inside each element moving the elements from
+ * "wrap" the Position inside each element moving the elements from
* SourceList to targetList
* @param sourceList source list
* @param targetList target list receiving the wrapped position elements
* @param force if true, every Position is wrapped regardless of its LM of origin
*/
protected void wrapPositionElements(List sourceList, List targetList, boolean force) {
-
+
ListIterator listIter = sourceList.listIterator();
Object tempElement;
while (listIter.hasNext()) {
@@ -1542,7 +1542,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
force);
} else if (tempElement instanceof List) {
wrapPositionElements(
- (List) tempElement,
+ (List) tempElement,
targetList,
force);
}
@@ -1563,12 +1563,12 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
targetList.add(el);
}
-
+
/** @return the sum of start-indent and end-indent */
protected int getIPIndents() {
return startIndent + endIndent;
}
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -1576,7 +1576,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
/**
* Sets the IPD of the content area
* @param contentAreaIPD the IPD of the content area
@@ -1584,7 +1584,7 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
protected void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
@@ -1592,6 +1592,6 @@ public abstract class BlockStackingLayoutManager extends AbstractLayoutManager
public int getContentAreaBPD() {
return -1;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BorderElement.java b/src/java/org/apache/fop/layoutmgr/BorderElement.java
index 410ba7ebb..67026a4c0 100644
--- a/src/java/org/apache/fop/layoutmgr/BorderElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BorderElement.java
@@ -42,7 +42,7 @@ public class BorderElement extends BorderOrPaddingElement {
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position, condLength, side, isFirst, isLast, context);
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
LayoutManager lm = getOriginatingLayoutManager();
@@ -54,7 +54,7 @@ public class BorderElement extends BorderOrPaddingElement {
+ lm.getClass().getName());
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("Border[");
@@ -62,5 +62,5 @@ public class BorderElement extends BorderOrPaddingElement {
sb.append("]");
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java b/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
index d78a92610..28820224a 100644
--- a/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
@@ -41,11 +41,11 @@ public abstract class BorderOrPaddingElement extends UnresolvedListElementWithLe
RelSide side,
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position,
- new MinOptMax(condLength.getLength().getValue(context)), side,
+ new MinOptMax(condLength.getLength().getValue(context)), side,
condLength.isDiscard(), isFirst, isLast);
}
-
+
/** {@inheritDoc} */
public abstract void notifyLayoutManager(MinOptMax effectiveLength);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/BreakElement.java b/src/java/org/apache/fop/layoutmgr/BreakElement.java
index 3ccfbf616..98e31dbf8 100644
--- a/src/java/org/apache/fop/layoutmgr/BreakElement.java
+++ b/src/java/org/apache/fop/layoutmgr/BreakElement.java
@@ -33,7 +33,7 @@ public class BreakElement extends UnresolvedListElement {
private int breakClass = -1;
private List pendingBeforeMarks;
private List pendingAfterMarks;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -43,10 +43,10 @@ public class BreakElement extends UnresolvedListElement {
public BreakElement(Position position, int penaltyValue, LayoutContext context) {
this(position, 0, penaltyValue, -1, context);
}
-
+
/**
* Constructor for hard breaks.
- *
+ *
* @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
@@ -55,7 +55,7 @@ public class BreakElement extends UnresolvedListElement {
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param context the layout context which contains the pending conditional elements
*/
- public BreakElement(Position position, int penaltyWidth, int penaltyValue,
+ public BreakElement(Position position, int penaltyWidth, int penaltyValue,
int breakClass, LayoutContext context) {
super(position);
this.penaltyWidth = penaltyWidth;
@@ -64,7 +64,7 @@ public class BreakElement extends UnresolvedListElement {
this.pendingBeforeMarks = context.getPendingBeforeMarks();
this.pendingAfterMarks = context.getPendingAfterMarks();
}
-
+
/** {@inheritDoc} */
public boolean isConditional() {
return false; //Does not really apply here
@@ -80,12 +80,12 @@ public class BreakElement extends UnresolvedListElement {
public int getPenaltyWidth() {
return this.penaltyWidth;
}
-
+
/** @return the penalty value */
public int getPenaltyValue() {
return this.penaltyValue;
}
-
+
/**
* Sets the penalty value.
* @param p the new penalty value
@@ -93,15 +93,15 @@ public class BreakElement extends UnresolvedListElement {
public void setPenaltyValue(int p) {
this.penaltyValue = p;
}
-
+
/** {@inheritDoc} */
public boolean isForcedBreak() {
return penaltyValue == -KnuthElement.INFINITE;
}
-
+
/**
* 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}
@@ -109,10 +109,10 @@ public class BreakElement extends UnresolvedListElement {
public int getBreakClass() {
return breakClass;
}
-
+
/**
* 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}
@@ -120,17 +120,17 @@ public class BreakElement extends UnresolvedListElement {
public void setBreakClass(int breakClass) {
this.breakClass = breakClass;
}
-
+
/** @return the pending border and padding elements at the before edge */
public List getPendingBeforeMarks() {
return this.pendingBeforeMarks;
}
-
+
/** @return the pending border and padding elements at the after edge */
public List getPendingAfterMarks() {
return this.pendingAfterMarks;
}
-
+
/**
* Clears all pending marks associated with this break element. This is used in break
* cases where we only know very late if the break is actually after all the content
@@ -140,7 +140,7 @@ public class BreakElement extends UnresolvedListElement {
this.pendingBeforeMarks = null;
this.pendingAfterMarks = null;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
index df4bb1d47..0bf228e7e 100644
--- a/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,24 +26,24 @@ import org.apache.fop.fo.FONode;
/**
* The set of nodes is sorted into lines indexed into activeLines.
- * The nodes in each line are linked together in a single linked list by the
+ * The nodes in each line are linked together in a single linked list by the
* KnuthNode.next field. The activeLines array contains a link to the head of
* the linked list in index 'line*2' and a link to the tail at index 'line*2+1'.
*
* for (int line = startLine; line < endLine; line++) {
* for (KnuthNode node = getNode(line); node != null; node = node.next) {
* // Do something with 'node'
* }
* }
- *
+ *
*/
public abstract class BreakingAlgorithm {
/** the logger for the class */
protected static Log log = LogFactory.getLog(BreakingAlgorithm.class);
-
+
/** Maximum adjustment ration */
protected static final int INFINITE_RATIO = 1000;
@@ -79,7 +79,7 @@ public abstract class BreakingAlgorithm {
* The paragraph of KnuthElements.
*/
protected KnuthSequence par;
-
+
/**
* The width of a line (or height of a column in page-breaking mode).
* -1 indicates that the line widths are different for each line.
@@ -118,12 +118,12 @@ public abstract class BreakingAlgorithm {
* line number l corresponds to the number of the line ending at the node's breakpoint.
*/
protected KnuthNode[] activeLines;
-
+
/**
* The number of active nodes.
*/
protected int activeNodeCount;
-
+
/**
* The lowest available line in the set of active nodes.
*/
@@ -218,7 +218,7 @@ public abstract class BreakingAlgorithm {
/** best node for the preceding breakpoint */
public KnuthNode previous;
- /** next possible node in the same line */
+ /** next possible node in the same line */
public KnuthNode next;
/**
@@ -226,7 +226,7 @@ public abstract class BreakingAlgorithm {
* into a line.
*/
public int fitRecoveryCounter = 0;
-
+
public KnuthNode(int position, int line, int fitness,
int totalWidth, int totalStretch, int totalShrink,
double adjustRatio, int availableShrink, int availableStretch,
@@ -249,7 +249,7 @@ public abstract class BreakingAlgorithm {
return "
*
* @param activeNode
* @param difference
@@ -895,11 +895,11 @@ public abstract class BreakingAlgorithm {
return 0;
}
}
-
+
/**
* Figure out the fitness class of this line (tight, loose,
* very tight or very loose).
- * See the section on "More Bells and Whistles" in Knuth's
+ * See the section on "More Bells and Whistles" in Knuth's
* "Breaking Paragraphs Into Lines".
* @param r
* @return the fitness class
@@ -923,11 +923,11 @@ public abstract class BreakingAlgorithm {
* node and ending at the given element.
* @param activeNode considered preceding line break
* @param element considered current line break
- * @param fitnessClass fitness of the current line
+ * @param fitnessClass fitness of the current line
* @param r adjustment ratio for the current line
* @return the demerit of the current line
*/
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -942,14 +942,14 @@ public abstract class BreakingAlgorithm {
} else {
demerits = f * f;
}
-
+
if (element.isPenalty() && ((KnuthPenalty) element).isFlagged()
&& getElement(activeNode.position).isPenalty()
&& ((KnuthPenalty) getElement(activeNode.position)).isFlagged()) {
// add demerit for consecutive breaks at flagged penalties
demerits += repeatedFlaggedDemerit;
// there are at least two consecutive lines ending with a flagged penalty;
- // check if the previous line end with a flagged penalty too,
+ // check if the previous line end with a flagged penalty too,
// and if this situation is allowed
int flaggedPenaltiesCount = 2;
for (KnuthNode prevNode = activeNode.previous;
@@ -1084,18 +1084,18 @@ public abstract class BreakingAlgorithm {
*/
protected int getLineWidth(int line) {
if (this.lineWidth < 0) {
- throw new IllegalStateException("lineWidth must be set"
+ throw new IllegalStateException("lineWidth must be set"
+ (this.lineWidth != 0 ? " and positive, but it is: " + this.lineWidth : ""));
} else {
return this.lineWidth;
}
}
-
+
/** @return the constant line/part width or -1 if there is no such value */
protected int getLineWidth() {
return this.lineWidth;
}
-
+
/**
* Creates a string representation of the active nodes. Used for debugging.
* @param prepend a string to prepend on each entry
@@ -1130,7 +1130,7 @@ public abstract class BreakingAlgorithm {
bestActiveNode = bestActiveNode.previous;
}
}
-
+
/** @return the alignment for normal lines/parts */
public int getAlignment() {
return this.alignment;
diff --git a/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java b/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
index 50fdc54b0..9124cf997 100644
--- a/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
+++ b/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
@@ -49,5 +49,5 @@ public interface ConditionalElementListener {
* (null means zero length)
*/
void notifyPadding(RelSide side, MinOptMax effectiveLength);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
index d4f23b1ee..73a6d5be4 100644
--- a/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
+++ b/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
@@ -28,9 +28,9 @@ import java.util.List;
* Please see the subclass within the test code.
*/
public class ElementListObserver {
-
+
private static List activeObservers = null;
-
+
/**
* Adds a new Observer to the list.
* @param observer the observer implementation
@@ -41,7 +41,7 @@ public class ElementListObserver {
}
activeObservers.add(observer);
}
-
+
/**
* Removes an Observer from the list. This call simply returns if the observer was not on
* the list and does nothing.
@@ -52,7 +52,7 @@ public class ElementListObserver {
activeObservers.remove(observer);
}
}
-
+
/**
* Notifies all registered observers about the element list.
* @param elementList the Knuth element list
@@ -70,7 +70,7 @@ public class ElementListObserver {
}
}
}
-
+
/** @return true if observation is active, i.e. Observers are registered. */
public static boolean isObservationActive() {
return activeObservers != null;
@@ -80,7 +80,7 @@ public class ElementListObserver {
* Implement this interface to receive notifications on element lists.
*/
public interface Observer {
-
+
/**
* Notifies the observer about the element list.
* @param elementList the Knuth element list
@@ -89,7 +89,7 @@ public class ElementListObserver {
* @param id ID for the element list (may be null)
*/
void observe(List elementList, String category, String id);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
index c04d197e4..d7f854a42 100644
--- a/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
+++ b/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
@@ -29,14 +29,14 @@ import org.apache.fop.util.ListUtil;
* Utilities for Knuth element lists.
*/
public final class ElementListUtils {
-
+
private ElementListUtils() {
// Utility class.
}
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint.opt space is filled will be removed.
* @param elements the element list
* @param constraint min/opt/max value to restrict the range in which the breaks are removed.
@@ -48,7 +48,7 @@ public final class ElementListUtils {
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint space is filled will be removed.
* @param elements the element list
* @param constraint value to restrict the range in which the breaks are removed.
diff --git a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
index 086d91c31..4dcb5e14c 100644
--- a/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
@@ -61,8 +61,8 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
private static Log log = LogFactory.getLog(ExternalDocumentLayoutManager.class);
- private ImageLayout imageLayout;
-
+ private ImageLayout imageLayout;
+
/**
* Constructor
*
@@ -74,7 +74,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
/**
- * @return the ExternalDocument being managed by this layout manager
+ * @return the ExternalDocument being managed by this layout manager
*/
protected ExternalDocument getExternalDocument() {
return (ExternalDocument)pageSeq;
@@ -84,24 +84,24 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
public PageSequenceLayoutManager getPSLM() {
throw new IllegalStateException("getPSLM() is illegal for " + getClass().getName());
}
-
+
/** {@inheritDoc} */
public void activateLayout() {
initialize();
FOUserAgent userAgent = pageSeq.getUserAgent();
ImageManager imageManager = userAgent.getFactory().getImageManager();
-
+
String uri = getExternalDocument().getSrc();
Integer firstPageIndex = ImageUtil.getPageIndexFromURI(uri);
boolean hasPageIndex = (firstPageIndex != null);
-
+
try {
ImageInfo info = imageManager.getImageInfo(uri, userAgent.getImageSessionContext());
-
+
Object moreImages = info.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
boolean hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
Dimension intrinsicSize = info.getSize().getDimensionMpt();
ImageLayout layout = new ImageLayout(getExternalDocument(), this, intrinsicSize);
@@ -111,7 +111,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
makePageForImage(info, layout);
-
+
if (!hasPageIndex && hasMoreImages) {
if (log.isTraceEnabled()) {
log.trace("Starting multi-page processing...");
@@ -129,16 +129,16 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
}
ImageInfo subinfo = imageManager.getImageInfo(
tempURI.toASCIIString(), userAgent.getImageSessionContext());
-
+
moreImages = subinfo.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
intrinsicSize = subinfo.getSize().getDimensionMpt();
layout = new ImageLayout(
getExternalDocument(), this, intrinsicSize);
-
+
makePageForImage(subinfo, layout);
-
+
pageIndex++;
}
} catch (URISyntaxException e) {
@@ -170,15 +170,15 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
fillPage(info.getOriginalURI());
finishPage();
}
-
+
private void fillPage(String uri) {
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
Block blockArea = new Block();
blockArea.setIPD(imageSize.width);
LineArea lineArea = new LineArea();
-
+
Image imageArea = new Image(uri);
TraitSetter.setProducerID(imageArea, fobj.getId());
transferForeignAttributes(imageArea);
@@ -189,7 +189,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
vp.setBPD(imageSize.height);
vp.setContentPosition(imageLayout.getPlacement());
vp.setOffset(0);
-
+
//Link them all together...
lineArea.addInlineArea(vp);
lineArea.updateExtentsFromChildren();
@@ -197,7 +197,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
curPage.getPageViewport().getCurrentFlow().addBlock(blockArea);
curPage.getPageViewport().getCurrentSpan().notifyFlowsFinished();
}
-
+
/** {@inheritDoc} */
public void finishPageSequence() {
if (pageSeq.hasId()) {
@@ -208,7 +208,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
(currentPageNum - startPageNum) + 1);
areaTreeHandler.notifyPageSequenceFinished(pageSeq,
(currentPageNum - startPageNum) + 1);
-
+
if (log.isDebugEnabled()) {
log.debug("Ending layout");
}
@@ -217,9 +217,9 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
/** {@inheritDoc} */
protected Page createPage(int pageNumber, boolean isBlank) {
String pageNumberString = pageSeq.makeFormattedPageNumber(pageNumber);
-
+
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
// Set up the CTM on the page reference area based on writing-mode
// and reference-orientation
Rectangle referenceRect;
@@ -231,10 +231,10 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
FODimension reldims = new FODimension(0, 0);
CTM pageCTM = CTM.getCTMandRelDims(pageSeq.getReferenceOrientation(),
Constants.EN_LR_TB, referenceRect, reldims);
-
+
Page page = new Page(referenceRect, pageNumber, pageNumberString, isBlank);
-
- PageViewport pv = page.getPageViewport();
+
+ PageViewport pv = page.getPageViewport();
org.apache.fop.area.Page pageArea = new org.apache.fop.area.Page();
pv.setPage(pageArea);
@@ -242,8 +242,8 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
rv.setIPD(referenceRect.width);
rv.setBPD(referenceRect.height);
rv.setClip(true);
-
- BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
+
+ BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
"fop-image-region", rv, 1, 0);
body.setIPD(imageSize.width);
body.setBPD(imageSize.height);
@@ -256,7 +256,7 @@ public class ExternalDocumentLayoutManager extends AbstractPageSequenceLayoutMan
//Also creates first normal flow region
pv.createSpan(false);
-
+
return page;
}
diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
index 1c8fb679f..293d6dbe0 100644
--- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,12 +46,12 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
* logging instance
*/
private static Log log = LogFactory.getLog(FlowLayoutManager.class);
-
+
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
private int currentSpan = EN_NONE;
-
+
/**
* This is the top level layout manager.
* It is created by the PageSequence FO.
@@ -96,7 +96,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
SpaceResolver.resolveElementList(returnList);
return returnList;
}
-
+
// Set up a LayoutContext
//MinOptMax bpd = context.getStackLimit();
@@ -104,7 +104,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getCurrentPage().getSimplePageMaster().getWritingMode());
-
+
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
//log.debug("FLM.getNextKnuthElements> returnedList.size() = " + returnedList.size());
@@ -148,7 +148,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
//Propagate and clear
context.updateKeepWithNextPending(childLC.getKeepWithNextPending());
childLC.clearKeepWithNextPending();
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
}
@@ -201,7 +201,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getKeepTogetherStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -211,7 +211,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public List getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) {
ListIterator oldListIterator = oldList.listIterator();
@@ -255,7 +255,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
if (prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious()) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (!((KnuthElement) returnedList.get(returnedList
.size() - 1)).isGlue()) {
@@ -288,7 +288,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
AreaAdditionUtil.addAreas(this, parentIter, layoutContext);
@@ -299,7 +299,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
* Add child area to a the correct container, depending on its
* area class. A Flow can fill at most one area container of any class
* at any one time. The actual work is done by BlockStackingLM.
- *
+ *
* @param childArea the area to add
*/
public void addChildArea(Area childArea) {
@@ -314,7 +314,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public Area getParentArea(Area childArea) {
BlockParent parentArea = null;
int aclass = childArea.getAreaClass();
-
+
if (aclass == Area.CLASS_NORMAL) {
parentArea = getCurrentPV().getCurrentFlow();
} else if (aclass == Area.CLASS_BEFORE_FLOAT) {
@@ -325,7 +325,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
throw new IllegalStateException("(internal error) Invalid "
+ "area class (" + aclass + ") requested.");
}
-
+
this.currentAreas[aclass] = parentArea;
setCurrentArea(parentArea);
return parentArea;
@@ -338,7 +338,7 @@ public class FlowLayoutManager extends BlockStackingLayoutManager
public int getContentAreaIPD() {
return getCurrentPV().getCurrentSpan().getColumnWidth();
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
diff --git a/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
index 34b931c03..791008aec 100644
--- a/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -95,7 +95,7 @@ public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
public int getKeepTogetherStrength() {
return getParentKeepTogetherStrength();
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -105,5 +105,5 @@ public class FootnoteBodyLayoutManager extends BlockStackingLayoutManager {
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
index e9973c14f..6d11a3c24 100644
--- a/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
@@ -35,12 +35,12 @@ public class InlineKnuthSequence extends KnuthSequence {
private boolean isClosed = false;
/**
- * Creates a new and empty list.
+ * Creates a new and empty list.
*/
public InlineKnuthSequence() {
super();
}
-
+
/**
* Creates a new list from an existing list.
* @param list The list from which to create the new list.
@@ -84,14 +84,14 @@ public class InlineKnuthSequence extends KnuthSequence {
}
/* (non-Javadoc)
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement) {
return appendSequence(sequence);
}
-
+
/* (non-Javadoc)
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KeepUtil.java b/src/java/org/apache/fop/layoutmgr/KeepUtil.java
index 8c80a1b10..5cc33533f 100644
--- a/src/java/org/apache/fop/layoutmgr/KeepUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/KeepUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,7 +46,7 @@ public class KeepUtil {
return keep.getNumber().intValue();
}
}
-
+
/**
* Returns the combined block-level keep strength from a keep property.
*
@@ -90,7 +90,7 @@ public class KeepUtil {
}
return penalty;
}
-
+
/**
* Returns a string representation of a keep strength value.
* @param keepStrength the keep strength
@@ -105,5 +105,5 @@ public class KeepUtil {
return Integer.toString(keepStrength);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
index 364c896ad..1aa22ea3e 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.fop.traits.MinOptMax;
* Knuth box used to represent a line in block-progression-dimension (i.e. the width is its height).
*/
public class KnuthBlockBox extends KnuthBox {
-
+
private MinOptMax ipdRange;
/**
* Natural width of the line represented by this box. In addition to ipdRange because
@@ -58,7 +58,7 @@ public class KnuthBlockBox extends KnuthBox {
* Creates a new box.
* @param w block progression dimension of this box
* @param list footnotes cited by elements in this box. The list contains the
- * corresponding FootnoteBodyLayoutManagers
+ * corresponding FootnoteBodyLayoutManagers
* @param pos the Position stored in this box
* @param bAux is this box auxiliary?
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthBox.java b/src/java/org/apache/fop/layoutmgr/KnuthBox.java
index a465ca8da..7c3df61fa 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthBox.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthBox.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,11 +23,11 @@ package org.apache.fop.layoutmgr;
* An instance of this class represents an unbreakable piece of content with
* fixed width: for example an image, a syllable (but only if letter spacing
* is constant), ...
- *
+ *
* A KnuthBox is never a feasible breaking point.
- *
+ *
* The represented piece of content is never suppressed.
- *
+ *
* Besides the inherited methods and attributes, this class has some more
* attributes to store information about the content height and its vertical
* positioning, and the methods used to get them.
@@ -61,5 +61,5 @@ public class KnuthBox extends KnuthElement {
sb.append(getW());
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthElement.java b/src/java/org/apache/fop/layoutmgr/KnuthElement.java
index 71f3b3ce9..41c813010 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthElement.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -21,7 +21,7 @@ package org.apache.fop.layoutmgr;
/**
* This is the super class for KnuthBox, KnuthGlue and KnuthPenalty.
- *
+ *
* It stores information common to all sub classes, and the methods to get it:
* the width, a Position and a boolean marking KnuthElements used for some
* special feature (for example, the additional elements used to represent
@@ -59,21 +59,21 @@ public abstract class KnuthElement extends ListElement {
return width;
}
- /** @return the penalty value of this element, if applicable. */
+ /** @return the penalty value of this element, if applicable. */
public int getP() {
throw new RuntimeException("Element is not a penalty");
}
- /** @return the stretch value of this element, if applicable. */
+ /** @return the stretch value of this element, if applicable. */
public int getY() {
throw new RuntimeException("Element is not a glue");
}
- /** @return the shrink value of this element, if applicable. */
+ /** @return the shrink value of this element, if applicable. */
public int getZ() {
throw new RuntimeException("Element is not a glue");
}
-
+
/** {@inheritDoc} */
public boolean isUnresolvedElement() {
return false;
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
index 0b6706c4b..fbb291f6b 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
@@ -5,9 +5,9 @@
* 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.
@@ -20,16 +20,16 @@
package org.apache.fop.layoutmgr;
/**
- * An instance of this class represents a piece of content with adjustable
+ * An instance of this class represents a piece of content with adjustable
* width: for example a space between words of justified text.
- *
+ *
* A KnuthGlue is a feasible breaking point only if it immediately follows
* a KnuthBox.
- *
+ *
* The represented piece of content is suppressed if either the KnuthGlue
* is a chosen breaking point or there isn't any KnuthBox between the
* previous breaking point and the KnuthGlue itself.
- *
+ *
* So, an unsuppressible piece of content with adjustable width, for example
* a leader or a word with adjustable letter space, cannot be represented
* by a single KnuthGlue; it can be represented using the sequence:
@@ -39,14 +39,14 @@ package org.apache.fop.layoutmgr;
* KnuthBox(width = 0)
* where the infinity penalty avoids choosing the KnuthGlue as a breaking point
* and the 0-width KnuthBoxes prevent suppression.
- *
+ *
* Besides the inherited methods and attributes, this class has two attributes
* used to store the stretchability (difference between max and opt width) and
* the shrinkability (difference between opt and min width), and the methods
* to get these values.
*/
public class KnuthGlue extends KnuthElement {
-
+
private int stretchability;
private int shrinkability;
private int adjustmentClass = -1;
@@ -88,12 +88,12 @@ public class KnuthGlue extends KnuthElement {
public int getZ() {
return shrinkability;
}
-
+
/** @return the adjustment class (or role) of this glue. */
public int getAdjustmentClass() {
return adjustmentClass;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(64);
@@ -109,5 +109,5 @@ public class KnuthGlue extends KnuthElement {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
index ecaeac627..6c13fba8a 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
@@ -5,9 +5,9 @@
* 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.
@@ -24,15 +24,15 @@ 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.
- *
+ *
* A KnuthPenalty is a feasible breaking point unless its value is infinity;
* a KnuthPenalty whose value is -infinity represents a forced break.
- *
+ *
* A KnuthPenalty is suppressed, and its width is ignored, if it is not a
* chosen breaking point; for example, a KnuthPenalty representing a
* hyphenation point has a width (the "-" width), which must be ignored if
* that point is not chosen as a breaking point.
- *
+ *
* Besides the inherited methods and attributes, this class has two more
* attributes and the methods used to get them: the penalty value, which is
* a kind of "aesthetic cost" (the higher the value, the more unsightly the
@@ -45,7 +45,7 @@ public class KnuthPenalty extends KnuthElement {
public static final int FLAGGED_PENALTY = 50;
private int penalty;
- private boolean bFlagged;
+ private boolean bFlagged;
private int breakClass = -1;
/**
@@ -65,7 +65,7 @@ public class KnuthPenalty extends KnuthElement {
/**
* Create a new KnuthPenalty.
- *
+ *
* @param w the width of this penalty
* @param p the penalty value of this penalty
* @param f is this penalty flagged?
@@ -102,7 +102,7 @@ public class KnuthPenalty extends KnuthElement {
public void setP(int p) {
this.penalty = p;
}
-
+
/** @return true is this penalty is a flagged one. */
public boolean isFlagged() {
return bFlagged;
@@ -112,7 +112,7 @@ public class KnuthPenalty extends KnuthElement {
public boolean isForcedBreak() {
return penalty == -KnuthElement.INFINITE;
}
-
+
/**
* @return the break class of this penalty (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE,
* EN_ODD_PAGE)
@@ -120,7 +120,7 @@ public class KnuthPenalty extends KnuthElement {
public int getBreakClass() {
return breakClass;
}
-
+
/**
* Sets the break class for this penalty.
* @param cl the break class (EN_AUTO, EN_COLUMN, EN_PAGE, EN_EVEN_PAGE, EN_ODD_PAGE)
@@ -128,7 +128,7 @@ public class KnuthPenalty extends KnuthElement {
public void setBreakClass(int cl) {
this.breakClass = cl;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(64);
@@ -171,5 +171,5 @@ public class KnuthPenalty extends KnuthElement {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
index 3f334f4be..e7397babb 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthPossPosIter.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@ public class KnuthPossPosIter extends PositionIterator {
super(elementList.listIterator(startPos));
iterCount = endPos - startPos;
}
-
+
/**
* Auxiliary constructor
* @param elementList List of Knuth elements
@@ -45,7 +45,7 @@ public class KnuthPossPosIter extends PositionIterator {
}
// Check position < endPos
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
index 4467a397b..fe9a01498 100644
--- a/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
+++ b/src/java/org/apache/fop/layoutmgr/KnuthSequence.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import java.util.ListIterator;
* Represents a list of Knuth elements.
*/
/**
- *
+ *
*/
public abstract class KnuthSequence extends ArrayList {
/**
@@ -68,19 +68,19 @@ public abstract class KnuthSequence extends ArrayList {
* Append sequence to this sequence if it can be appended.
* @param sequence The sequence that is to be appended.
* @param keepTogether Whether the two sequences must be kept together.
- * @param breakElement The BreakElement that may be inserted between the two sequences.
+ * @param breakElement The BreakElement that may be inserted between the two sequences.
* @return whether the sequence was succesfully appended to this sequence.
*/
public abstract boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement);
-
+
/**
* Append sequence to this sequence if it can be appended.
* @param sequence The sequence that is to be appended.
* @return whether the sequence was succesfully appended to this sequence.
*/
public abstract boolean appendSequence(KnuthSequence sequence);
-
+
/**
* Append sequence to this sequence if it can be appended.
* If that is not possible, close this sequence.
@@ -95,13 +95,13 @@ public abstract class KnuthSequence extends ArrayList {
return true;
}
}
-
+
/**
* Append sequence to this sequence if it can be appended.
* If that is not possible, close this sequence.
* @param sequence The sequence that is to be appended.
* @param keepTogether Whether the two sequences must be kept together.
- * @param breakElement The BreakElement that may be inserted between the two sequences.
+ * @param breakElement The BreakElement that may be inserted between the two sequences.
* @return whether the sequence was succesfully appended to this sequence.
*/
public boolean appendSequenceOrClose(KnuthSequence sequence, boolean keepTogether,
@@ -113,7 +113,7 @@ public abstract class KnuthSequence extends ArrayList {
return true;
}
}
-
+
/**
* Wrap the Positions of the elements of this sequence in a Position for LayoutManager lm.
* @param lm The LayoutManager for the Positions that will be created.
@@ -127,14 +127,14 @@ public abstract class KnuthSequence extends ArrayList {
(lm.notifyPos(new NonLeafPosition(lm, element.getPosition())));
}
}
-
+
/**
* @return the last element of this sequence.
*/
public ListElement getLast() {
int idx = size();
if (idx == 0) {
- return null;
+ return null;
}
return (ListElement) get(idx - 1);
}
@@ -146,7 +146,7 @@ public abstract class KnuthSequence extends ArrayList {
public ListElement removeLast() {
int idx = size();
if (idx == 0) {
- return null;
+ return null;
}
return (ListElement) remove(idx - 1);
}
diff --git a/src/java/org/apache/fop/layoutmgr/LMiter.java b/src/java/org/apache/fop/layoutmgr/LMiter.java
index 9e812a8b7..4fa5590dc 100644
--- a/src/java/org/apache/fop/layoutmgr/LMiter.java
+++ b/src/java/org/apache/fop/layoutmgr/LMiter.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutContext.java b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
index 5ac9808f2..1be89304b 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutContext.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -106,15 +106,15 @@ public class LayoutContext {
/** Current pending space-before or space-start from ancestor areas */
private SpaceSpecifier leadingSpace;
-
+
/**
- * A list of pending marks (border and padding) on the after edge when a page break occurs.
+ * A list of pending marks (border and padding) on the after edge when a page break occurs.
* May be null.
*/
private List pendingAfterMarks;
-
+
/**
- * A list of pending marks (border and padding) on the before edge when a page break occurs.
+ * A list of pending marks (border and padding) on the before edge when a page break occurs.
* May be null.
*/
private List pendingBeforeMarks;
@@ -124,7 +124,7 @@ public class LayoutContext {
/** Alignment in BP direction */
private int bpAlignment = Constants.EN_START;
-
+
/** Stretch or shrink value when making areas. */
private double ipdAdjust = 0.0;
@@ -132,12 +132,12 @@ public class LayoutContext {
private double dSpaceAdjust = 0.0;
private AlignmentContext alignmentContext = null;
-
+
/** Amount of space before / start */
private int spaceBefore = 0;
/** Amount of space after / end */
private int spaceAfter = 0;
-
+
/** Amount of space to reserve at the beginning of each line */
private int lineStartBorderAndPaddingWidth = 0;
/** Amount of space to reserve at the end of each line */
@@ -146,9 +146,9 @@ public class LayoutContext {
private int breakBefore;
private int breakAfter;
- private int pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
- private int pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
-
+ private int pendingKeepWithNext = BlockLevelLayoutManager.KEEP_AUTO;
+ private int pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
+
/**
* Copy constructor for creating child layout contexts.
* @param parentLC the parent layout context to copy from
@@ -188,13 +188,13 @@ public class LayoutContext {
public void copyPendingMarksFrom(LayoutContext source) {
if (source.pendingAfterMarks != null) {
- this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
+ this.pendingAfterMarks = new java.util.ArrayList(source.pendingAfterMarks);
}
if (source.pendingBeforeMarks != null) {
- this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
+ this.pendingBeforeMarks = new java.util.ArrayList(source.pendingBeforeMarks);
}
}
-
+
public void setFlags(int flags) {
setFlags(flags, true);
}
@@ -238,7 +238,7 @@ public class LayoutContext {
public int getKeepWithNextPending() {
return this.pendingKeepWithNext;
}
-
+
/**
* Returns the strength of a keep-with-previous currently pending.
* @return the keep-with-previous strength
@@ -246,7 +246,7 @@ public class LayoutContext {
public int getKeepWithPreviousPending() {
return this.pendingKeepWithPrevious;
}
-
+
/**
* Clears any pending keep-with-next strength.
*/
@@ -260,7 +260,7 @@ public class LayoutContext {
public void clearKeepWithPreviousPending() {
this.pendingKeepWithPrevious = BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Clears both keep-with-previous and keep-with-next strengths.
*/
@@ -292,7 +292,7 @@ public class LayoutContext {
public boolean isKeepWithNextPending() {
return getKeepWithNextPending() != BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Indicates whether a keep-with-previous constraint is pending.
* @return true if a keep-with-previous constraint is pending
@@ -300,7 +300,7 @@ public class LayoutContext {
public boolean isKeepWithPreviousPending() {
return getKeepWithPreviousPending() != BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
public void setLeadingSpace(SpaceSpecifier space) {
leadingSpace = space;
}
@@ -333,7 +333,7 @@ public class LayoutContext {
}
this.pendingAfterMarks.add(element);
}
-
+
/**
* @return the pending border and padding elements at the after edge
* @see #addPendingAfterMark(UnresolvedListElementWithLength)
@@ -345,7 +345,7 @@ public class LayoutContext {
return null;
}
}
-
+
/**
* Clears all pending marks on the LayoutContext.
*/
@@ -353,7 +353,7 @@ public class LayoutContext {
this.pendingBeforeMarks = null;
this.pendingAfterMarks = null;
}
-
+
/**
* Adds a border or padding element to the pending list which will be used to generate
* the right element list for break possibilities. Conditionality resolution will be done
@@ -366,7 +366,7 @@ public class LayoutContext {
}
this.pendingBeforeMarks.add(element);
}
-
+
/**
* @return the pending border and padding elements at the before edge
* @see #addPendingBeforeMark(UnresolvedListElementWithLength)
@@ -378,7 +378,7 @@ public class LayoutContext {
return null;
}
}
-
+
/**
* Sets the stack limit in block-progression-dimension.
* @param limit the stack limit
@@ -419,7 +419,7 @@ public class LayoutContext {
setStackLimitBP(context.getStackLimitBP());
setStackLimitIP(context.getStackLimitIP());
}
-
+
/**
* Sets the inline-progression-dimension of the nearest ancestor reference area.
*/
@@ -429,7 +429,7 @@ public class LayoutContext {
/**
* Returns the inline-progression-dimension of the nearest ancestor reference area.
- *
+ *
* @return the inline-progression-dimension of the nearest ancestor reference area
*/
public int getRefIPD() {
@@ -455,12 +455,12 @@ public class LayoutContext {
public void setBPAlignment(int alignment) {
this.bpAlignment = alignment;
}
-
+
/** @return the currently applicable alignment in BP direction (EN_START, EN_JUSTIFY...) */
public int getBPAlignment() {
return this.bpAlignment;
}
-
+
public void setSpaceAdjust(double adjust) {
dSpaceAdjust = adjust;
}
@@ -480,7 +480,7 @@ public class LayoutContext {
public void setAlignmentContext(AlignmentContext alignmentContext) {
this.alignmentContext = alignmentContext;
}
-
+
public AlignmentContext getAlignmentContext() {
return this.alignmentContext;
}
@@ -490,7 +490,7 @@ public class LayoutContext {
this.alignmentContext = this.alignmentContext.getParentAlignmentContext();
}
}
-
+
/**
* Get the width to be reserved for border and padding at the start of the line.
* @return the width to be reserved
@@ -498,7 +498,7 @@ public class LayoutContext {
public int getLineStartBorderAndPaddingWidth() {
return lineStartBorderAndPaddingWidth;
}
-
+
/**
* Set the width to be reserved for border and padding at the start of the line.
* @param lineStartBorderAndPaddingWidth the width to be reserved
@@ -506,7 +506,7 @@ public class LayoutContext {
public void setLineStartBorderAndPaddingWidth(int lineStartBorderAndPaddingWidth) {
this.lineStartBorderAndPaddingWidth = lineStartBorderAndPaddingWidth;
}
-
+
/**
* Get the width to be reserved for border and padding at the end of the line.
* @return the width to be reserved
@@ -514,7 +514,7 @@ public class LayoutContext {
public int getLineEndBorderAndPaddingWidth() {
return lineEndBorderAndPaddingWidth;
}
-
+
/**
* Set the width to be reserved for border and padding at the end of the line.
* @param lineEndBorderAndPaddingWidth the width to be reserved
@@ -522,7 +522,7 @@ public class LayoutContext {
public void setLineEndBorderAndPaddingWidth(int lineEndBorderAndPaddingWidth) {
this.lineEndBorderAndPaddingWidth = lineEndBorderAndPaddingWidth;
}
-
+
/**
* @return true if the current element list ends early because of a span change
* in multi-column layout.
@@ -530,7 +530,7 @@ public class LayoutContext {
public int getNextSpan() {
return nextSpan;
}
-
+
/**
* Used to signal the PSLM that the element list ends early because of a span change in
* multi-column layout.
@@ -544,8 +544,8 @@ public class LayoutContext {
+ span);
}
}
-
- /**
+
+ /**
* Get the writing mode of the relevant reference area.
* @return the applicable writing mode
*/
@@ -553,7 +553,7 @@ public class LayoutContext {
return writingMode;
}
- /**
+ /**
* Set the writing mode.
* @param writingMode the writing mode
*/
@@ -597,7 +597,7 @@ public class LayoutContext {
* Returns the value of the break before the element whose
* {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
* called.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
* {@link Constants#EN_ODD_PAGE}
@@ -608,7 +608,7 @@ public class LayoutContext {
/**
* Sets the value of the break before the current element.
- *
+ *
* @param breakBefore the value of the break-before
* @see #getBreakBefore()
*/
@@ -620,7 +620,7 @@ public class LayoutContext {
* Returns the value of the break after the element whose
* {@link LayoutManager#getNextKnuthElements(LayoutContext, int)} method has just been
* called.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE}, or
* {@link Constants#EN_ODD_PAGE}
@@ -632,7 +632,7 @@ public class LayoutContext {
/**
* Sets the value of the break after the current element.
- *
+ *
* @param breakAfter the value of the break-after
* @see #getBreakAfter()
*/
@@ -650,7 +650,7 @@ public class LayoutContext {
+ "\nTrailing Space: \t"
+ (getTrailingSpace() == null ? "null" : getTrailingSpace().toString())
+ "\nLeading Space: \t"
- + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
+ + (getLeadingSpace() == null ? "null" : getLeadingSpace().toString())
+ "\nReference IPD: \t" + getRefIPD()
+ "\nSpace Adjust: \t" + getSpaceAdjust()
+ "\nIPD Adjust: \t" + getIPDAdjust()
@@ -663,7 +663,7 @@ public class LayoutContext {
+ "\nKeeps: \t[keep-with-next=" + KeepUtil.keepStrengthToString(getKeepWithNextPending())
+ "][keep-with-previous="
+ KeepUtil.keepStrengthToString(getKeepWithPreviousPending()) + "] pending"
- + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ + "\nBreaks: \tforced [" + (breakBefore != Constants.EN_AUTO ? "break-before" : "") + "]["
+ (breakAfter != Constants.EN_AUTO ? "break-after" : "") + "]";
}
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutException.java b/src/java/org/apache/fop/layoutmgr/LayoutException.java
index 350cc758a..822607020 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutException.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutException.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,13 +28,13 @@ import org.apache.fop.events.EventExceptionManager.ExceptionFactory;
/**
* Exception thrown by FOP if an unrecoverable layout error occurs. An example: An area overflows
* a viewport that has overflow="error-if-overflow".
- *
+ *
* @todo Discuss if this should become a checked exception.
*/
public class LayoutException extends RuntimeException {
private static final long serialVersionUID = 5157080040923740433L;
-
+
private String localizedMessage;
private LayoutManager layoutManager;
@@ -80,7 +80,7 @@ public class LayoutException extends RuntimeException {
public LayoutManager getLayoutManager() {
return this.layoutManager;
}
-
+
/** Exception factory for {@link LayoutException}. */
public static class LayoutExceptionFactory implements ExceptionFactory {
@@ -95,11 +95,11 @@ public class LayoutException extends RuntimeException {
}
return ex;
}
-
+
/** {@inheritDoc} */
public Class getExceptionClass() {
return LayoutException.class;
}
-
- }
+
+ }
}
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManager.java b/src/java/org/apache/fop/layoutmgr/LayoutManager.java
index ad0d9f69c..f19588a77 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
import java.util.List;
@@ -45,11 +45,11 @@ public interface LayoutManager extends PercentBaseContext {
LayoutManager getParent();
/**
- * initialize the layout manager. Allows each layout manager
+ * initialize the layout manager. Allows each layout manager
* to calculate often used values.
*/
void initialize();
-
+
/**
* Get the active PageSequenceLayoutManager instance for this
* layout process.
@@ -130,9 +130,9 @@ public interface LayoutManager extends PercentBaseContext {
void addChildLMs(List newLMs);
/**
- * Get a sequence of KnuthElements representing the content
+ * Get a sequence of KnuthElements representing the content
* of the node assigned to the LM
- *
+ *
* @param context the LayoutContext used to store layout information
* @param alignment the desired text alignment
* @return the list of KnuthElements
@@ -140,54 +140,54 @@ public interface LayoutManager extends PercentBaseContext {
List getNextKnuthElements(LayoutContext context, int alignment);
/**
- * Get a sequence of KnuthElements representing the content
+ * Get a sequence of KnuthElements representing the content
* of the node assigned to the LM, after changes have been applied
*
* In the context of line breaking, this method is called after hyphenation has
- * been performed, in order to receive the sequence of elements representing the
+ * been performed, in order to receive the sequence of elements representing the
* text together with all possible hyphenation points.
* For example, if the text "representation" originates a single box element
* when getNextKnuthElements() is called, it will be now split in syllables
* (rep-re-sen-ta-tion) each one originating a box and divided by additional
* elements allowing a line break.
- *
+ *
* In the context of page breaking, this method is called only if the pages need
* to be "vertically justified" modifying (also) the quantity of lines created by
* the paragraphs, and after a first page breaking has been performed.
* According to the result of the first page breaking, each paragraph now knows
- * how many lines it must create (among the existing layout possibilities) and
+ * how many lines it must create (among the existing layout possibilities) and
* has to create a sequence of elements representing this layout; in particular,
* each box, representing a line, will contain a LineBreakPositions that will be
* used in the addAreas() phase.
- *
+ *
* LMs having children look at the old list of elements in order to know which
* ones they must get the new elements from, as break conditions of preserved
- * linefeeds can divide children into smaller groups (page sequences or
+ * linefeeds can divide children into smaller groups (page sequences or
* paragraphs).
* LMs having no children can simply return the old elements if they have nothing
* to change.
*
* Inline LMs need to know the text alignment because it affects the elements
* representing feasible breaks between syllables.
- *
+ *
* @param oldList the elements to replace
* @param alignment the desired text alignment
* @return the updated list of KnuthElements
*/
List getChangedKnuthElements(List oldList, int alignment);
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
*/
int getContentAreaIPD();
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
*/
int getContentAreaBPD();
-
+
/**
* Returns an indication if the layout manager generates a reference area.
* @return True if the layout manager generates a reference area
@@ -205,13 +205,13 @@ public interface LayoutManager extends PercentBaseContext {
* @return True if the layout manager generates a line area
*/
boolean getGeneratesLineArea();
-
+
/**
* Returns the fo this layout manager is associated with.
* @return The fo for this layout manager or null.
*/
FObj getFObj();
-
+
/**
* Adds a Position to the Position participating in the first|last determination by assigning
* it a unique position index.
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
index abb7f0f04..8efe5ce65 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ import org.apache.fop.area.Block;
* The interface for all LayoutManager makers
*/
public interface LayoutManagerMaker {
-
+
/**
* Make LayoutManagers for the node and add them to the list lms.
* @param node the FO node for which the LayoutManagers are made
diff --git a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
index 862c0a4be..26933ee4c 100644
--- a/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
+++ b/src/java/org/apache/fop/layoutmgr/LayoutManagerMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -145,7 +145,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void makeLayoutManagers(FONode node, List lms) {
Maker maker = (Maker) makers.get(node.getClass());
@@ -175,7 +175,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
} else if (lms.size() > 1) {
throw new IllegalStateException("Duplicate LayoutManagers for class "
+ node.getClass()
- + " found, only one may be declared.");
+ + " found, only one may be declared.");
}
return (LayoutManager) lms.get(0);
}
@@ -186,7 +186,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public FlowLayoutManager makeFlowLayoutManager(
PageSequenceLayoutManager pslm, Flow flow) {
@@ -194,21 +194,21 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
}
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public ContentLayoutManager makeContentLayoutManager(PageSequenceLayoutManager pslm,
Title title) {
return new ContentLayoutManager(pslm, title);
}
-
+
/*
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, SideRegion reg) {
return new StaticContentLayoutManager(pslm, sc, reg);
}
-
+
/** {@inheritDoc} */
public StaticContentLayoutManager makeStaticContentLayoutManager(
PageSequenceLayoutManager pslm, StaticContent sc, org.apache.fop.area.Block block) {
@@ -321,7 +321,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
public static class ListItemLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
lms.add(new ListItemLayoutManager((ListItem) node));
- }
+ }
}
public static class ListBlockLayoutManagerMaker extends Maker {
@@ -353,7 +353,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
lms.add(new PageNumberCitationLastLayoutManager((PageNumberCitationLast) node));
}
}
-
+
public static class TableLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Table table = (Table) node;
@@ -361,7 +361,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
lms.add(tlm);
}
}
-
+
public class RetrieveMarkerLayoutManagerMaker extends Maker {
public void make(FONode node, List lms) {
Iterator baseIter;
@@ -373,7 +373,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
FONode child = (FONode) baseIter.next();
makeLayoutManagers(child, lms);
}
- }
+ }
}
public class WrapperLayoutManagerMaker extends Maker {
@@ -390,7 +390,7 @@ public class LayoutManagerMapping implements LayoutManagerMaker {
FONode child = (FONode) baseIter.next();
makeLayoutManagers(child, lms);
}
- }
+ }
}
public ExternalDocumentLayoutManager makeExternalDocumentLayoutManager(
diff --git a/src/java/org/apache/fop/layoutmgr/LeafPosition.java b/src/java/org/apache/fop/layoutmgr/LeafPosition.java
index c43bb05c0..ed8cc94e2 100644
--- a/src/java/org/apache/fop/layoutmgr/LeafPosition.java
+++ b/src/java/org/apache/fop/layoutmgr/LeafPosition.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
public class LeafPosition extends Position {
@@ -31,11 +31,11 @@ public class LeafPosition extends Position {
public int getLeafPos() {
return iLeafPos;
}
-
+
public boolean generatesAreas() {
return getLM() != null;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/ListElement.java b/src/java/org/apache/fop/layoutmgr/ListElement.java
index de08a1e1e..74d8a666b 100644
--- a/src/java/org/apache/fop/layoutmgr/ListElement.java
+++ b/src/java/org/apache/fop/layoutmgr/ListElement.java
@@ -23,12 +23,12 @@ package org.apache.fop.layoutmgr;
* This class is the base class for all kinds of elements that are added to element lists. There
* are basically two kinds of list elements: Knuth elements and unresolved elements like spaces,
* border and padding elements which are converted to Knuth elements prior to the breaking
- * process.
+ * process.
*/
public abstract class ListElement {
private Position position;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -36,14 +36,14 @@ public abstract class ListElement {
public ListElement(Position position) {
this.position = position;
}
-
+
/**
* @return the Position instance for this element.
*/
public Position getPosition() {
return this.position;
}
-
+
/**
* Change the Position stored in this element.
* @param position the Position instance
@@ -78,14 +78,14 @@ public abstract class ListElement {
return false;
}
- /** @return true if the element is a penalty and represents a forced break. */
+ /** @return true if the element is a penalty and represents a forced break. */
public boolean isForcedBreak() {
return false;
}
- /** @return true if the element is an unresolved element such as a space or a border. */
+ /** @return true if the element is an unresolved element such as a space or a border. */
public boolean isUnresolvedElement() {
return true;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
index b58af1cfe..155abcd39 100644
--- a/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
+++ b/src/java/org/apache/fop/layoutmgr/MinOptMaxUtil.java
@@ -35,7 +35,7 @@ public class MinOptMaxUtil {
* @param lr restricting source
* @param context Percentage evaluation context
*/
- public static void restrict(MinOptMax mom, LengthRangeProperty lr,
+ public static void restrict(MinOptMax mom, LengthRangeProperty lr,
PercentBaseContext context) {
if (lr.getEnum() != Constants.EN_AUTO) {
if (lr.getMinimum(context).getEnum() != Constants.EN_AUTO) {
@@ -70,7 +70,7 @@ public class MinOptMaxUtil {
/**
* Extends the minimum length to the given length if necessary, and adjusts opt and
* max accordingly.
- *
+ *
* @param mom the min/opt/max trait
* @param len the new minimum length
*/
@@ -81,7 +81,7 @@ public class MinOptMaxUtil {
mom.max = Math.max(mom.opt, mom.max);
}
}
-
+
/**
* After a calculation on a MinOptMax, this can be called to set opt to
* a new effective value.
@@ -95,7 +95,7 @@ public class MinOptMaxUtil {
}
}
}
-
+
/**
* Converts a LengthRangeProperty to a MinOptMax.
* @param prop LengthRangeProperty
@@ -104,14 +104,14 @@ public class MinOptMaxUtil {
*/
public static MinOptMax toMinOptMax(LengthRangeProperty prop, PercentBaseContext context) {
MinOptMax mom = new MinOptMax(
- (prop.getMinimum(context).isAuto()
+ (prop.getMinimum(context).isAuto()
? 0 : prop.getMinimum(context).getLength().getValue(context)),
- (prop.getOptimum(context).isAuto()
+ (prop.getOptimum(context).isAuto()
? 0 : prop.getOptimum(context).getLength().getValue(context)),
- (prop.getMaximum(context).isAuto()
- ? Integer.MAX_VALUE
+ (prop.getMaximum(context).isAuto()
+ ? Integer.MAX_VALUE
: prop.getMaximum(context).getLength().getValue(context)));
return mom;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
index 9edb425c1..7089dabda 100644
--- a/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
+++ b/src/java/org/apache/fop/layoutmgr/NonLeafPosition.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
public class NonLeafPosition extends Position {
@@ -31,11 +31,11 @@ public class NonLeafPosition extends Position {
public Position getPosition() {
return subPos;
}
-
+
public boolean generatesAreas() {
return (subPos != null ? subPos.generatesAreas() : false);
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/layoutmgr/PaddingElement.java b/src/java/org/apache/fop/layoutmgr/PaddingElement.java
index ee0edcc38..3ec0c5054 100644
--- a/src/java/org/apache/fop/layoutmgr/PaddingElement.java
+++ b/src/java/org/apache/fop/layoutmgr/PaddingElement.java
@@ -42,10 +42,10 @@ public class PaddingElement extends BorderOrPaddingElement {
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position, condLength, side, isFirst, isLast, context);
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
- LayoutManager lm = getOriginatingLayoutManager();
+ LayoutManager lm = getOriginatingLayoutManager();
if (lm instanceof ConditionalElementListener) {
((ConditionalElementListener)lm).notifyPadding(
getSide(), effectiveLength);
@@ -62,5 +62,5 @@ public class PaddingElement extends BorderOrPaddingElement {
sb.append("]");
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/Page.java b/src/java/org/apache/fop/layoutmgr/Page.java
index 6d6dbb233..7e22cef67 100644
--- a/src/java/org/apache/fop/layoutmgr/Page.java
+++ b/src/java/org/apache/fop/layoutmgr/Page.java
@@ -34,39 +34,39 @@ public class Page {
private SimplePageMaster spm;
private PageViewport pageViewport;
-
+
/**
* Main constructor
* @param spm the simple-page-master used for this page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(SimplePageMaster spm, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = spm;
this.pageViewport = new PageViewport(spm, pageNumber, pageNumberStr, blank);
}
-
+
/**
* Auxiliary constructor used when there's no SimplePageMaster.
* @param viewArea the view area of the page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(Rectangle2D viewArea, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = null;
this.pageViewport = new PageViewport(viewArea, pageNumber, pageNumberStr, null, blank);
}
-
+
/** @return the simple-page-master that created this page */
public SimplePageMaster getSimplePageMaster() {
return this.spm;
}
-
+
/** @return the page viewport representing this page in the area tree */
public PageViewport getPageViewport() {
return this.pageViewport;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreaker.java b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
index b25e4bd4f..9ff520804 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreaker.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,14 +39,14 @@ import org.apache.fop.traits.MinOptMax;
* Handles the breaking of pages in an fo:flow
*/
public class PageBreaker extends AbstractBreaker {
-
+
private PageSequenceLayoutManager pslm;
private boolean firstPart = true;
private boolean pageBreakHandled;
private boolean needColumnBalancing;
private PageProvider pageProvider;
private Block separatorArea;
-
+
/**
* The FlowLayoutManager object, which processes
* the single fo:flow of the fo:page-sequence
@@ -61,23 +61,23 @@ public class PageBreaker extends AbstractBreaker {
this.childFLM = pslm.getLayoutManagerMaker().makeFlowLayoutManager(
pslm, pslm.getPageSequence().getMainFlow());
}
-
+
/** {@inheritDoc} */
protected void updateLayoutContext(LayoutContext context) {
int flowIPD = pslm.getCurrentPV().getCurrentSpan().getColumnWidth();
context.setRefIPD(flowIPD);
}
-
+
/** {@inheritDoc} */
protected LayoutManager getTopLevelLM() {
return pslm;
}
-
+
/** {@inheritDoc} */
protected PageProvider getPageProvider() {
return pslm.getPageProvider();
}
-
+
/** {@inheritDoc} */
protected PageBreakingLayoutListener createLayoutListener() {
return new PageBreakingLayoutListener() {
@@ -98,7 +98,7 @@ public class PageBreaker extends AbstractBreaker {
amount, needClip, canRecover,
body.getLocator());
}
-
+
};
}
@@ -118,7 +118,7 @@ public class PageBreaker extends AbstractBreaker {
}
/** {@inheritDoc} */
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
if (!firstPart) {
// if this is the first page that will be created by
@@ -129,15 +129,15 @@ public class PageBreaker extends AbstractBreaker {
}
firstPart = false;
pageBreakHandled = true;
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
return super.getNextBlockList(childLC, nextSequenceStartsOn);
}
-
+
/** {@inheritDoc} */
protected List getNextKnuthElements(LayoutContext context, int alignment) {
List contentList = null;
-
+
while (!childFLM.isFinished() && contentList == null) {
contentList = childFLM.getNextKnuthElements(context, alignment);
}
@@ -161,7 +161,7 @@ public class PageBreaker extends AbstractBreaker {
// store the lists of elements representing the footnote bodies
// in the box representing the line containing their references
while (footnoteBodyIterator.hasNext()) {
- FootnoteBodyLayoutManager fblm
+ FootnoteBodyLayoutManager fblm
= (FootnoteBodyLayoutManager) footnoteBodyIterator.next();
fblm.setParent(childFLM);
fblm.initialize();
@@ -178,7 +178,7 @@ public class PageBreaker extends AbstractBreaker {
footnoteSeparator = pslm.getPageSequence().getStaticContent("xsl-footnote-separator");
if (footnoteSeparator != null) {
// the footnote separator can contain page-dependent content such as
- // page numbers or retrieve markers, so its areas cannot simply be
+ // page numbers or retrieve markers, so its areas cannot simply be
// obtained now and repeated in each page;
// we need to know in advance the separator bpd: the actual separator
// could be different from page to page, but its bpd would likely be
@@ -199,7 +199,7 @@ public class PageBreaker extends AbstractBreaker {
}
return contentList;
}
-
+
/**
* @return current display alignment
*/
@@ -207,14 +207,14 @@ public class PageBreaker extends AbstractBreaker {
return pslm.getCurrentPage().getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY).getDisplayAlign();
}
-
+
/**
* @return whether or not this flow has more page break opportunities
*/
protected boolean hasMoreContent() {
return !childFLM.isFinished();
}
-
+
/**
* Adds an area to the flow layout manager
* @param posIter the position iterator
@@ -235,18 +235,18 @@ public class PageBreaker extends AbstractBreaker {
footnoteSeparatorLM.doLayout();
}
- childFLM.addAreas(posIter, context);
+ childFLM.addAreas(posIter, context);
}
-
+
/**
* Performs phase 3 operation
- *
+ *
* @param alg page breaking algorithm
* @param partCount part count
* @param originalList the block sequence original list
* @param effectiveList the block sequence effective list
*/
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
if (needColumnBalancing) {
doPhase3WithColumnBalancing(alg, partCount, originalList, effectiveList);
@@ -261,7 +261,7 @@ public class PageBreaker extends AbstractBreaker {
}
}
- private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
int newStartPos;
int restartPoint = pageProvider.getStartingPartIndexForLastPage(partCount);
@@ -281,13 +281,13 @@ public class PageBreaker extends AbstractBreaker {
}
AbstractBreaker.log.debug("Last page handling now!!!");
AbstractBreaker.log.debug("===================================================");
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
int currentPageNum = pslm.getCurrentPageNum();
- pageProvider.setStartOfNextElementList(currentPageNum,
+ pageProvider.setStartOfNextElementList(currentPageNum,
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
pageProvider.setLastPageIndex(currentPageNum);
@@ -295,7 +295,7 @@ public class PageBreaker extends AbstractBreaker {
PageBreakingAlgorithm algRestart = new PageBreakingAlgorithm(
getTopLevelLM(),
getPageProvider(), createLayoutListener(),
- alg.getAlignment(), alg.getAlignmentLast(),
+ alg.getAlignment(), alg.getAlignmentLast(),
footnoteSeparatorLength,
isPartOverflowRecoveryActivated(), false, false);
//alg.setConstantLineWidth(flowBPD);
@@ -304,8 +304,8 @@ public class PageBreaker extends AbstractBreaker {
1, true, BreakingAlgorithm.ALL_BREAKS);
AbstractBreaker.log.debug("restart: iOptPageCount= " + iOptPageCount
+ " pageBreaks.size()= " + algRestart.getPageBreaks().size());
- boolean replaceLastPage
- = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
+ boolean replaceLastPage
+ = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
if (replaceLastPage) {
//Replace last page
pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
@@ -322,7 +322,7 @@ public class PageBreaker extends AbstractBreaker {
AbstractBreaker.log.debug("===================================================");
}
- private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
AbstractBreaker.log.debug("Column balancing now!!!");
AbstractBreaker.log.debug("===================================================");
@@ -342,12 +342,12 @@ public class PageBreaker extends AbstractBreaker {
} else {
newStartPos = 0;
}
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
//Restart last page
@@ -376,15 +376,15 @@ public class PageBreaker extends AbstractBreaker {
addAreas(algRestart, iOptPageCount, originalList, effectiveList);
AbstractBreaker.log.debug("===================================================");
}
-
+
protected void startPart(BlockSequence list, int breakClass) {
AbstractBreaker.log.debug("startPart() breakClass=" + breakClass);
if (pslm.getCurrentPage() == null) {
throw new IllegalStateException("curPage must not be null");
}
if (!pageBreakHandled) {
-
- //firstPart is necessary because we need the first page before we start the
+
+ //firstPart is necessary because we need the first page before we start the
//algorithm so we have a BPD and IPD. This may subject to change later when we
//start handling more complex cases.
if (!firstPart) {
@@ -394,7 +394,7 @@ public class PageBreaker extends AbstractBreaker {
// otherwise, we may simply need a new page
handleBreakTrait(breakClass);
}
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
}
pageBreakHandled = false;
@@ -402,12 +402,12 @@ public class PageBreaker extends AbstractBreaker {
// finish page and add to area tree
firstPart = false;
}
-
+
/** {@inheritDoc} */
protected void handleEmptyContent() {
pslm.getCurrentPV().getPage().fakeNonEmpty();
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
// add footnote areas
if (pbp.footnoteFirstListIndex < pbp.footnoteLastListIndex
@@ -415,16 +415,16 @@ public class PageBreaker extends AbstractBreaker {
// call addAreas() for each FootnoteBodyLM
for (int i = pbp.footnoteFirstListIndex; i <= pbp.footnoteLastListIndex; i++) {
LinkedList elementList = alg.getFootnoteList(i);
- int firstIndex = (i == pbp.footnoteFirstListIndex
+ int firstIndex = (i == pbp.footnoteFirstListIndex
? pbp.footnoteFirstElementIndex : 0);
- int lastIndex = (i == pbp.footnoteLastListIndex
+ int lastIndex = (i == pbp.footnoteLastListIndex
? pbp.footnoteLastElementIndex : elementList.size() - 1);
- SpaceResolver.performConditionalsNotification(elementList,
+ SpaceResolver.performConditionalsNotification(elementList,
firstIndex, lastIndex, -1);
LayoutContext childLC = new LayoutContext(0);
- AreaAdditionUtil.addAreas(null,
- new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
+ AreaAdditionUtil.addAreas(null,
+ new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
childLC);
}
// set the offset from the top margin
@@ -438,20 +438,20 @@ public class PageBreaker extends AbstractBreaker {
}
pslm.getCurrentPV().getCurrentSpan().notifyFlowsFinished();
}
-
+
/**
* @return the current child flow layout manager
*/
protected LayoutManager getCurrentChildLM() {
return childFLM;
}
-
+
/** {@inheritDoc} */
protected void observeElementList(List elementList) {
- ElementListObserver.observe(elementList, "breaker",
+ ElementListObserver.observe(elementList, "breaker",
((PageSequence)pslm.getFObj()).getId());
}
-
+
/**
* Depending on the kind of break condition, move to next column
* or page. May need to make an empty page if next page would
@@ -471,17 +471,17 @@ public class PageBreaker extends AbstractBreaker {
|| breakVal <= 0
|| breakVal == Constants.EN_AUTO) {
PageViewport pv = curPage.getPageViewport();
-
+
//Check if previous page was spanned
boolean forceNewPageWithSpan = false;
RegionBody rb = (RegionBody)curPage.getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY);
- if (breakVal < 0
- && rb.getColumnCount() > 1
+ if (breakVal < 0
+ && rb.getColumnCount() > 1
&& pv.getCurrentSpan().getColumnCount() == 1) {
forceNewPageWithSpan = true;
}
-
+
if (forceNewPageWithSpan) {
curPage = pslm.makeNewPage(false, false);
curPage.getPageViewport().createSpan(true);
@@ -492,7 +492,7 @@ public class PageBreaker extends AbstractBreaker {
}
return;
}
- log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ " breakVal=" + breakVal);
if (needBlankPageBeforeNew(breakVal)) {
curPage = pslm.makeNewPage(true, false);
@@ -501,7 +501,7 @@ public class PageBreaker extends AbstractBreaker {
curPage = pslm.makeNewPage(false, false);
}
}
-
+
/**
* Check if a blank page is needed to accomodate
* desired even or odd page number.
@@ -520,7 +520,7 @@ public class PageBreaker extends AbstractBreaker {
}
}
}
-
+
/**
* See if need to generate a new page
* @param breakVal - value of break-before or break-after trait.
diff --git a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
index 9e0b42ecb..8095feba1 100644
--- a/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
+++ b/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
@@ -73,13 +73,13 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
/** Index of the last element of the last footnote inserted on the current page. */
private int footnoteElementIndex = -1;
- // demerits for a page break that splits a footnote
+ // demerits for a page break that splits a footnote
private int splitFootnoteDemerits = 5000;
- // demerits for a page break that defers a whole footnote to the following page
+ // demerits for a page break that defers a whole footnote to the following page
private int deferredFootnoteDemerits = 10000;
private MinOptMax footnoteSeparatorLength = null;
- // the method noBreakBetween(int, int) uses these variables
+ // the method noBreakBetween(int, int) uses these variables
// to store parameters and result of the last call, in order
// to reuse them and take less time
private int storedPrevBreakIndex = -1;
@@ -88,10 +88,10 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
//Controls whether overflows should be warned about or not
private boolean autoHeight = false;
-
+
//Controls whether a single part should be forced if possible (ex. block-container)
private boolean favorSinglePart = false;
-
+
public PageBreakingAlgorithm(LayoutManager topLevelLM,
PageProvider pageProvider,
PageBreakingLayoutListener layoutListener,
@@ -202,7 +202,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
totalWidth, totalStretch, totalShrink,
((BestPageRecords) best).getFootnotesLength(fitness),
((BestPageRecords) best).getFootnoteListIndex(fitness),
- ((BestPageRecords) best).getFootnoteElementIndex(fitness),
+ ((BestPageRecords) best).getFootnoteElementIndex(fitness),
best.getAdjust(fitness), best.getAvailableShrink(fitness),
best.getAvailableStretch(fitness), best.getDifference(fitness),
best.getDemerits(fitness), best.getNode(fitness));
@@ -247,11 +247,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
ListIterator elementListsIterator = elementLists.listIterator();
while (elementListsIterator.hasNext()) {
LinkedList noteList = (LinkedList) elementListsIterator.next();
-
- //Space resolution (Note: this does not respect possible stacking constraints
+
+ //Space resolution (Note: this does not respect possible stacking constraints
//between footnotes!)
SpaceResolver.resolveElementList(noteList);
-
+
int noteLength = 0;
footnotesList.add(noteList);
ListIterator noteListIterator = noteList.listIterator();
@@ -261,8 +261,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
noteLength += element.getW();
}
}
- int prevLength = (lengthList.size() == 0
- ? 0
+ int prevLength = (lengthList.size() == 0
+ ? 0
: ((Integer) lengthList.get(lengthList.size() - 1)).intValue());
lengthList.add(new Integer(prevLength + noteLength));
totalFootnotesLength += noteLength;
@@ -423,7 +423,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
index < breakIndex;
index++) {
if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox()
- || par.getElement(index).isPenalty()
+ || par.getElement(index).isPenalty()
&& ((KnuthElement) par.getElement(index)).getP() < KnuthElement.INFINITE) {
// break found
break;
@@ -520,7 +520,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
// as this method is called only if it is not possible to insert
// all footnotes, at this point listIndex and elementIndex points to
- // an existing element, the next one we will try to insert
+ // an existing element, the next one we will try to insert
}
// try adding a split of the next note
@@ -582,7 +582,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// prevIndex is -1 if we have added only some whole footnotes
footnoteListIndex = (prevIndex != -1) ? listIndex : listIndex - 1;
footnoteElementIndex = (prevIndex != -1)
- ? prevIndex
+ ? prevIndex
: ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1;
}
return prevSplitLength;
@@ -618,7 +618,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
}
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -649,11 +649,11 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
if (footnotesPending) {
if (footnoteListIndex < footnotesList.size() - 1) {
// add demerits for the deferred footnotes
- demerits += (footnotesList.size() - 1 - footnoteListIndex)
+ demerits += (footnotesList.size() - 1 - footnoteListIndex)
* deferredFootnoteDemerits;
}
if (footnoteListIndex < footnotesList.size()) {
- if (footnoteElementIndex
+ if (footnoteElementIndex
< ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1) {
// add demerits for the footnote split between pages
demerits += splitFootnoteDemerits;
@@ -710,7 +710,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// cannot add any content: create a new node and start again
KnuthPageNode node = (KnuthPageNode)
createNode(lastNode.position, prevNode.line + 1, 1,
- insertedFootnotesLength - prevNode.totalFootnotes,
+ insertedFootnotesLength - prevNode.totalFootnotes,
0, 0,
0, 0, 0,
0, 0, prevNode);
@@ -744,7 +744,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
pageBreaks.addFirst(pageBreak);
}
-
+
/**
* Removes all page breaks from the result list. This is used by block-containers and
* static-content when it is only desired to know where there is an overflow but later the
@@ -758,14 +758,14 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
pageBreaks.removeFirst();
}
}
-
+
public void updateData1(int total, double demerits) {
}
public void updateData2(KnuthNode bestActiveNode,
KnuthSequence sequence,
int total) {
- //int difference = (bestActiveNode.line < total)
+ //int difference = (bestActiveNode.line < total)
// ? bestActiveNode.difference : bestActiveNode.difference + fillerMinWidth;
int difference = bestActiveNode.difference;
if (difference + bestActiveNode.availableShrink < 0) {
@@ -818,10 +818,10 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
// add nodes at the beginning of the list, as they are found
// backwards, from the last one to the first one
if (log.isDebugEnabled()) {
- log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ " position=" + bestActiveNode.position);
}
- insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
+ insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
bestActiveNode.position,
firstListIndex, firstElementIndex,
((KnuthPageNode) bestActiveNode).footnoteListIndex,
@@ -834,8 +834,8 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
KnuthNode bestActiveNode = null;
for (int i = startLine; i < endLine; i++) {
for (KnuthNode node = getNode(i); node != null; node = node.next) {
- if (favorSinglePart
- && node.line > 1
+ if (favorSinglePart
+ && node.line > 1
&& bestActiveNode != null
&& Math.abs(bestActiveNode.difference) < bestActiveNode.availableShrink) {
//favor current best node, so just skip the current node because it would
@@ -854,12 +854,12 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
public LinkedList getFootnoteList(int index) {
return (LinkedList) footnotesList.get(index);
}
-
+
/** @return the associated top-level formatting object. */
public FObj getFObj() {
return topLevelLM.getFObj();
}
-
+
/** {@inheritDoc} */
protected int getLineWidth(int line) {
int bpd;
@@ -873,7 +873,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
}
return bpd;
}
-
+
/**
* Interface to notify about layout events during page breaking.
*/
@@ -886,7 +886,7 @@ class PageBreakingAlgorithm extends BreakingAlgorithm {
* @param obj the root FO object where this happens
*/
void notifyOverflow(int part, int amount, FObj obj);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/PageProvider.java b/src/java/org/apache/fop/layoutmgr/PageProvider.java
index a7918db6e..55c78ba52 100644
--- a/src/java/org/apache/fop/layoutmgr/PageProvider.java
+++ b/src/java/org/apache/fop/layoutmgr/PageProvider.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,38 +35,38 @@ import org.apache.fop.fo.pagination.SimplePageMaster;
*
InlineArea
- *
- * @param hasInlineParent true if the parent is an inline
+
+ /**
+ * Create and initialize an InlineArea
+ *
+ * @param hasInlineParent true if the parent is an inline
* @return the area
*/
protected InlineArea createArea(boolean hasInlineParent) {
@@ -209,7 +209,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}
return area;
}
-
+
/** {@inheritDoc} */
protected void setTraits(boolean isNotFirst, boolean isNotLast) {
if (borderProps != null) {
@@ -232,7 +232,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
return ((BlockLevelLayoutManager) lm).mustKeepTogether();
} else if (lm instanceof InlineLayoutManager) {
return ((InlineLayoutManager) lm).mustKeepTogether();
- } else {
+ } else {
return mustKeepTogether(lm.getParent());
}
}
@@ -249,12 +249,12 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
KnuthSequence lastSequence = null;
SpaceSpecifier leadingSpace = context.getLeadingSpace();
-
+
if (fobj instanceof Title) {
alignmentContext = new AlignmentContext(font,
lineHeight.getOptimum(this).getLength().getValue(this),
context.getWritingMode());
-
+
} else {
alignmentContext = new AlignmentContext(font
, lineHeight.getOptimum(this).getLength().getValue(this)
@@ -264,7 +264,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
, dominantBaseline
, context.getAlignmentContext());
}
-
+
childLC = new LayoutContext(context);
childLC.setAlignmentContext(alignmentContext);
@@ -300,9 +300,9 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
+ borderProps.getBorderEndWidth(true)
);
}
-
+
while ((curLM = getChildLM()) != null) {
-
+
if (!(curLM instanceof InlineLevelLayoutManager)) {
// A block LM
// Leave room for start/end border and padding
@@ -314,7 +314,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
- borderProps.getBorderEndWidth(hasNextChildLM()));
}
}
-
+
// get KnuthElements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
if (returnList.isEmpty() && childLC.isKeepWithPreviousPending()) {
@@ -326,7 +326,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
// just iterate once more to see if there is another child
continue;
}
-
+
if (curLM instanceof InlineLevelLayoutManager) {
context.clearKeepWithNextPending();
// "wrap" the Position stored in each element of returnedList
@@ -375,31 +375,31 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
lastSequence = (KnuthSequence) ListUtil.getLast(returnList);
lastChildLM = curLM;
}
-
+
if (lastSequence != null) {
addKnuthElementsForBorderPaddingEnd(lastSequence);
}
setFinished(true);
log.trace(trace);
-
+
if (returnList.isEmpty()) {
/*
- * if the FO itself is empty, but has an id specified
+ * if the FO itself is empty, but has an id specified
* or associated fo:markers, then we still need a dummy
* sequence to register its position in the area tree
*/
if (fobj.hasId() || fobj.hasMarkers()) {
InlineKnuthSequence emptySeq = new InlineKnuthSequence();
emptySeq.add(new KnuthInlineBox(
- 0,
- alignmentContext,
- notifyPos(getAuxiliaryPosition()),
+ 0,
+ alignmentContext,
+ notifyPos(getAuxiliaryPosition()),
true));
returnList.add(emptySeq);
}
}
-
+
return returnList.isEmpty() ? null : returnList;
}
@@ -414,7 +414,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
*/
public void addAreas(PositionIterator parentIter,
LayoutContext context) {
-
+
addId();
setChildContext(new LayoutContext(context)); // Store current value
@@ -454,11 +454,11 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}*/
addMarkersToPage(
- true,
- !areaCreated,
+ true,
+ !areaCreated,
lastPos == null || isLast(lastPos));
-
- InlineArea parent = createArea(lastLM == null
+
+ InlineArea parent = createArea(lastLM == null
|| lastLM instanceof InlineLevelLayoutManager);
parent.setBPD(alignmentContext.getHeight());
if (parent instanceof InlineParent) {
@@ -472,7 +472,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
}
}
setCurrentArea(parent);
-
+
StackingIter childPosIter
= new StackingIter(positionList.listIterator());
@@ -487,7 +487,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
prevLM = childLM;
}
-
+
/* If this LM has a trailing fence, resolve trailing space
* specs from descendants. Otherwise, propagate any trailing
* space specs to the parent LM via the layout context. If
@@ -496,7 +496,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
* must be the last area for the current LM too.
*/
boolean isLast = (getContext().isLastArea() && prevLM == lastChildLM);
-
+
if (hasTrailingFence(isLast)) {
addSpace(getCurrentArea(),
getContext().getTrailingSpace().resolve(false),
@@ -510,17 +510,17 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
if (context.getTrailingSpace() != null && getSpaceEnd() != null) {
context.getTrailingSpace().addSpace(new SpaceVal(getSpaceEnd(), this));
}
-
+
// Not sure if lastPos can legally be null or if that masks a different problem.
// But it seems to fix bug 38053.
setTraits(areaCreated, lastPos == null || !isLast(lastPos));
parentLM.addChildArea(getCurrentArea());
addMarkersToPage(
- false,
- !areaCreated,
+ false,
+ !areaCreated,
lastPos == null || isLast(lastPos));
-
+
context.setFlags(LayoutContext.LAST_AREA, isLast);
areaCreated = true;
checkEndOfLayout(lastPos);
@@ -545,7 +545,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
addKnuthElementsForBorderPaddingEnd(returnedList);
return returnedList;
}
-
+
/**
* Creates Knuth elements for start border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
@@ -604,5 +604,5 @@ public class InlineLayoutManager extends InlineStackingLayoutManager {
//}
return this.auxiliaryPosition;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
index 51d2720cb..c9c65e769 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelEventProducer.java
@@ -33,7 +33,7 @@ public interface InlineLevelEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -52,7 +52,7 @@ public interface InlineLevelEventProducer extends EventProducer {
* @event.severity ERROR
*/
void leaderWithoutContent(Object source, Locator loc);
-
+
/**
* A line overflows.
* @param source the event source
@@ -62,5 +62,5 @@ public interface InlineLevelEventProducer extends EventProducer {
* @event.severity WARN
*/
void lineOverflows(Object source, int line, int overflowLength, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
index 80a74ffc4..b080f926b 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLevelLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.inline;
import java.util.List;
@@ -30,7 +30,7 @@ import org.apache.fop.layoutmgr.Position;
public interface InlineLevelLayoutManager extends LayoutManager {
/**
- * Tell the LM to modify its data, adding a letter space
+ * Tell the LM to modify its data, adding a letter space
* to the word fragment represented by the given elements,
* and returning the corrected elements
*
@@ -40,7 +40,7 @@ public interface InlineLevelLayoutManager extends LayoutManager {
List addALetterSpaceTo(List oldList);
/**
- * Tell the LM to modify its data, removing the word space
+ * Tell the LM to modify its data, removing the word space
* represented by the given elements
*
* @param oldList the elements representing the word space
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
index 81fc7901d..a27fc6516 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineStackingLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,7 +43,7 @@ import org.apache.fop.traits.MinOptMax;
* which stack children in the inline direction, such as Inline or
* Line. It should not be instantiated directly.
*/
-public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
+public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
implements InlineLevelLayoutManager {
@@ -103,7 +103,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
}
/**
- * Returns the extra IPD needed for any leading or trailing fences for the
+ * Returns the extra IPD needed for any leading or trailing fences for the
* current area.
* @param bNotFirst true if not the first area for this layout manager
* @param bNotLast true if not the last area for this layout manager
@@ -139,7 +139,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
protected SpaceProperty getSpaceStart() {
return null;
}
-
+
/**
* Get the space at the end of the inline area.
* @return the space property describing the space
@@ -246,7 +246,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
// The last element may not have a layout manager (its position == null);
// this may happen if it is a padding box; see bug 39571.
- InlineLevelLayoutManager LM =
+ InlineLevelLayoutManager LM =
(InlineLevelLayoutManager) element.getLayoutManager();
if (LM != null) {
oldList = LM.addALetterSpaceTo(oldList);
@@ -362,7 +362,7 @@ public abstract class InlineStackingLayoutManager extends AbstractLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
// "unwrap" the Positions stored in the elements
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java b/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
index 5f9365f83..4a54f582d 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InstreamForeignObjectLM.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,10 +28,10 @@ import org.apache.fop.fo.flow.InstreamForeignObject;
* LayoutManager for the fo:instream-foreign-object formatting object
*/
public class InstreamForeignObjectLM extends AbstractGraphicsLayoutManager {
-
+
/**
* Constructor.
- *
+ *
* @param node
* the formatting object that creates this area
*/
@@ -48,6 +48,6 @@ public class InstreamForeignObjectLM extends AbstractGraphicsLayoutManager {
return new ForeignObject(doc, ns);
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
index 856fab051..6c8c7354b 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/KnuthInlineBox.java
@@ -5,9 +5,9 @@
* 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.
@@ -25,7 +25,7 @@ import org.apache.fop.layoutmgr.KnuthBox;
import org.apache.fop.layoutmgr.Position;
public class KnuthInlineBox extends KnuthBox {
-
+
private FootnoteBodyLayoutManager footnoteBodyLM = null;
private AlignmentContext alignmentContext = null;
@@ -69,8 +69,8 @@ public class KnuthInlineBox extends KnuthBox {
public boolean isAnchor() {
return (footnoteBodyLM != null);
}
-
-
+
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(super.toString());
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
index 3bb82aa11..1e163bef8 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeaderLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -51,10 +51,10 @@ import org.apache.fop.traits.MinOptMax;
public class LeaderLayoutManager extends LeafNodeLayoutManager {
private Leader fobj;
private Font font = null;
-
+
private List contentList = null;
private ContentLayoutManager clm = null;
-
+
private int contentAreaIPD = 0;
/**
@@ -66,7 +66,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public void initialize() {
FontInfo fi = fobj.getFOEventHandler().getFontInfo();
@@ -117,7 +117,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
if (fobj.getLeaderPattern() == EN_RULE) {
if (fobj.getRuleStyle() != EN_NONE) {
- org.apache.fop.area.inline.Leader leader
+ org.apache.fop.area.inline.Leader leader
= new org.apache.fop.area.inline.Leader();
leader.setRuleStyle(fobj.getRuleStyle());
leader.setRuleThickness(fobj.getRuleThickness().getValue(this));
@@ -167,7 +167,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
// child FOs are assigned to the InlineStackingLM
fobjIter = null;
-
+
// get breaks then add areas to FilledArea
FilledArea fa = new FilledArea();
@@ -262,7 +262,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
curArea.setAdjustingInfo(ipd.max - ipd.opt, ipd.opt - ipd.min, 0);
addKnuthElementsForBorderPaddingStart(seq);
-
+
// node is a fo:Leader
seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
@@ -272,20 +272,20 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
seq.add
(new KnuthGlue(areaInfo.ipdArea.opt,
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
- areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
+ areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
} else {
seq.add
(new KnuthGlue(areaInfo.ipdArea.opt,
0,
- 0,
+ 0,
new LeafPosition(this, 0), false));
}
seq.add(new KnuthInlineBox(0, alignmentContext,
new LeafPosition(this, -1), true));
addKnuthElementsForBorderPaddingEnd(seq);
-
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
setFinished(true);
@@ -314,7 +314,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
List returnList = new LinkedList();
addKnuthElementsForBorderPaddingStart(returnList);
-
+
returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
@@ -323,20 +323,20 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
returnList.add
(new KnuthGlue(areaInfo.ipdArea.opt,
areaInfo.ipdArea.max - areaInfo.ipdArea.opt,
- areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
+ areaInfo.ipdArea.opt - areaInfo.ipdArea.min,
new LeafPosition(this, 0), false));
} else {
returnList.add
(new KnuthGlue(areaInfo.ipdArea.opt,
0,
- 0,
+ 0,
new LeafPosition(this, 0), false));
}
returnList.add(new KnuthInlineBox(0, areaInfo.alignmentContext,
new LeafPosition(this, -1), true));
addKnuthElementsForBorderPaddingEnd(returnList);
-
+
setFinished(true);
return returnList;
}
@@ -353,9 +353,9 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager {
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
private void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
index 19a8cdf2d..ac501abb7 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LeafNodeLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -48,7 +48,7 @@ import org.apache.fop.traits.MinOptMax;
* This class can be extended to handle the creation and adding of the
* inline area.
*/
-public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
+public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
implements InlineLevelLayoutManager {
/**
@@ -64,7 +64,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
protected CommonBorderPaddingBackground commonBorderPaddingBackground = null;
/** The alignment context applying to this area */
protected AlignmentContext alignmentContext = null;
-
+
/** Flag to indicate if something was changed as part of the getChangeKnuthElements sequence */
protected boolean isSomethingChanged = false;
/** Our area info for the Knuth elements */
@@ -86,7 +86,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
bHyphenated = bHyph;
this.alignmentContext = alignmentContext;
}
-
+
}
@@ -201,7 +201,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
protected InlineArea getEffectiveArea() {
return curArea;
}
-
+
/**
* Offset this area.
* Offset the inline area in the bpd direction when adding the
@@ -247,18 +247,18 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
area.setIPD(width);
area.setAdjustment(width - areaInfo.ipdArea.opt);
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
curArea = get(context);
-
+
if (curArea == null) {
setFinished(true);
return null;
}
alignmentContext = makeAlignmentContext(context);
-
+
MinOptMax ipd = getAllocationIPD(context.getRefIPD());
// create the AreaInfo object to store the computed values
@@ -269,12 +269,12 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
KnuthSequence seq = new InlineKnuthSequence();
addKnuthElementsForBorderPaddingStart(seq);
-
+
seq.add(new KnuthInlineBox(areaInfo.ipdArea.opt, alignmentContext,
notifyPos(new LeafPosition(this, 0)), false));
addKnuthElementsForBorderPaddingEnd(seq);
-
+
LinkedList returnList = new LinkedList();
returnList.add(seq);
@@ -322,18 +322,18 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
LinkedList returnList = new LinkedList();
addKnuthElementsForBorderPaddingStart(returnList);
-
+
// fobj is a fo:ExternalGraphic, fo:InstreamForeignObject,
// fo:PageNumber or fo:PageNumberCitation
- returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
+ returnList.add(new KnuthInlineBox(areaInfo.ipdArea.opt, areaInfo.alignmentContext,
notifyPos(new LeafPosition(this, 0)), true));
addKnuthElementsForBorderPaddingEnd(returnList);
-
+
setFinished(true);
return returnList;
}
-
+
/**
* Creates Knuth elements for start border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
@@ -345,7 +345,7 @@ public abstract class LeafNodeLayoutManager extends AbstractLayoutManager
+ commonBorderPaddingBackground.getPaddingStart(false, this);
if (ipStart > 0) {
// Add a non breakable glue
- returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ returnList.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
false, new LeafPosition(this, -1), true));
returnList.add(new KnuthGlue(ipStart, 0, 0, new LeafPosition(this, -1), true));
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
index 87077ee77..3a0672f4e 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -75,7 +75,7 @@ import org.apache.fop.traits.MinOptMax;
* creates a line area to contain the inline areas added by the
* child layout managers.
*/
-public class LineLayoutManager extends InlineStackingLayoutManager
+public class LineLayoutManager extends InlineStackingLayoutManager
implements BlockLevelLayoutManager {
/**
@@ -85,7 +85,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
private Block fobj;
private boolean isFirstInBlock;
-
+
/** {@inheritDoc} */
public void initialize() {
textAlignment = fobj.getTextAlign();
@@ -108,7 +108,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
return textAlignment;
}
}
-
+
/**
* Private class to store information about inline breaks.
* Each value holds the start and end indexes into a List of
@@ -148,7 +148,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
spaceAfter = sa;
baseline = bl;
}
-
+
}
@@ -181,7 +181,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
/**
* this constant is used to create elements when text-align is center:
- * every TextLM descendant of LineLM must use the same value,
+ * every TextLM descendant of LineLM must use the same value,
* otherwise the line breaking algorithm does not find the right
* break point
*/
@@ -205,7 +205,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// this class represents a paragraph
private class Paragraph extends InlineKnuthSequence {
- /** Number of elements to ignore at the beginning of the list. */
+ /** Number of elements to ignore at the beginning of the list. */
private int ignoreAtStart = 0;
/** Number of elements to ignore at the end of the list. */
private int ignoreAtEnd = 0;
@@ -233,11 +233,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// set the minimum amount of empty space at the end of the
// last line
if (textAlignment == EN_CENTER) {
- lineFiller = new MinOptMax(lastLineEndIndent);
+ lineFiller = new MinOptMax(lastLineEndIndent);
} else {
- lineFiller = new MinOptMax(lastLineEndIndent,
- lastLineEndIndent,
- layoutManager.iLineWidth);
+ lineFiller = new MinOptMax(lastLineEndIndent,
+ lastLineEndIndent,
+ layoutManager.iLineWidth);
}
// add auxiliary elements at the beginning of the paragraph
@@ -251,7 +251,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// at the beginning of the first paragraph
if (isFirstInBlock && knuthParagraphs.size() == 0
&& textIndent != 0) {
- this.add(new KnuthInlineBox(textIndent, null,
+ this.add(new KnuthInlineBox(textIndent, null,
null, false));
ignoreAtStart++;
}
@@ -277,10 +277,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// add the elements representing the space
// at the end of the last line
// and the forced break
- this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
+ this.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, null, false));
- this.add(new KnuthGlue(0,
- lineFiller.max - lineFiller.opt,
+ this.add(new KnuthGlue(0,
+ lineFiller.max - lineFiller.opt,
lineFiller.opt - lineFiller.min, null, false));
this.add(new KnuthPenalty(lineFiller.opt, -KnuthElement.INFINITE,
false, null, false));
@@ -339,7 +339,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
follow = fl;
thisLLM = llm;
activePossibility = -1;
- maxDiff = fobj.getWidows() >= fobj.getOrphans()
+ maxDiff = fobj.getWidows() >= fobj.getOrphans()
? fobj.getWidows()
: fobj.getOrphans();
}
@@ -382,7 +382,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
if (log.isWarnEnabled()) {
- int lack = difference + bestActiveNode.availableShrink;
+ int lack = difference + bestActiveNode.availableShrink;
if (lack < 0) {
InlineLevelEventProducer eventProducer
= InlineLevelEventProducer.Provider.get(
@@ -391,15 +391,15 @@ public class LineLayoutManager extends InlineStackingLayoutManager
-lack, getFObj().getLocator());
}
}
-
- //log.debug("LLM> (" + (lineLayouts.getLineNumber(activePossibility) - addedPositions)
+
+ //log.debug("LLM> (" + (lineLayouts.getLineNumber(activePossibility) - addedPositions)
// + ") difference = " + difference + " ratio = " + ratio);
lineLayouts.addBreakPosition(makeLineBreakPosition(par,
(bestActiveNode.line > 1 ? bestActiveNode.previous.position + 1 : 0),
bestActiveNode.position,
- bestActiveNode.availableShrink - (addedPositions > 0
- ? 0 : ((Paragraph)par).lineFiller.opt - ((Paragraph)par).lineFiller.min),
- bestActiveNode.availableStretch,
+ bestActiveNode.availableShrink - (addedPositions > 0
+ ? 0 : ((Paragraph)par).lineFiller.opt - ((Paragraph)par).lineFiller.min),
+ bestActiveNode.availableStretch,
difference, ratio, indent), activePossibility);
addedPositions++;
}
@@ -413,8 +413,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager
private LineBreakPosition makeLineBreakPosition(KnuthSequence par,
int firstElementIndex,
int lastElementIndex,
- int availableShrink,
- int availableStretch,
+ int availableShrink,
+ int availableStretch,
int difference,
double ratio,
int indent) {
@@ -424,7 +424,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int spaceAfter = lineHeight - lead - follow - spaceBefore;
// height before the main baseline
int lineLead = lead;
- // maximum follow
+ // maximum follow
int lineFollow = follow;
// true if this line contains only zero-height, auxiliary boxes
// and the actual line width is 0; in this case, the line "collapses"
@@ -492,7 +492,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
firstElementIndex, lastElementIndex,
availableShrink, availableStretch,
difference, ratio, 0, indent,
- lineLead + lineFollow,
+ lineLead + lineFollow,
iLineWidth, spaceBefore, spaceAfter,
lineLead);
}
@@ -501,7 +501,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int findBreakingPoints(Paragraph par, /*int lineWidth,*/
double threshold, boolean force,
int allowedBreaks) {
- return super.findBreakingPoints(par, /*lineWidth,*/
+ return super.findBreakingPoints(par, /*lineWidth,*/
threshold, force, allowedBreaks);
}
@@ -548,9 +548,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
-
+
private int constantLineHeight = 12000;
-
+
/**
* Create a new Line Layout Manager.
@@ -641,19 +641,19 @@ public class LineLayoutManager extends InlineStackingLayoutManager
*/
private void collectInlineKnuthElements(LayoutContext context) {
LayoutContext inlineLC = new LayoutContext(context);
-
+
InlineLevelLayoutManager curLM;
List returnedList = null;
iLineWidth = context.getStackLimitIP().opt;
-
+
// convert all the text in a sequence of paragraphs made
// of KnuthBox, KnuthGlue and KnuthPenalty objects
boolean bPrevWasKnuthBox = false;
-
+
StringBuffer trace = new StringBuffer("LineLM:");
-
+
Paragraph lastPar = null;
-
+
while ((curLM = (InlineLevelLayoutManager) getChildLM()) != null) {
returnedList = curLM.getNextKnuthElements(inlineLC, effectiveAlignment);
if (returnedList == null
@@ -663,10 +663,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
* so just iterate once more to see if there are other children */
continue;
}
-
+
if (lastPar != null) {
KnuthSequence firstSeq = (KnuthSequence) returnedList.get(0);
-
+
// finish last paragraph before a new block sequence
if (!firstSeq.isInlineSequence()) {
lastPar.endParagraph();
@@ -677,7 +677,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
bPrevWasKnuthBox = false;
}
-
+
// does the first element of the first paragraph add to an existing word?
if (lastPar != null) {
KnuthElement thisElement;
@@ -688,28 +688,28 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
// loop over the KnuthSequences (and single KnuthElements) in returnedList
ListIterator iter = returnedList.listIterator();
while (iter.hasNext()) {
KnuthSequence sequence = (KnuthSequence) iter.next();
// the sequence contains inline Knuth elements
if (sequence.isInlineSequence()) {
- // look at the last element
+ // look at the last element
ListElement lastElement = sequence.getLast();
if (lastElement == null) {
throw new NullPointerException(
"Sequence was empty! lastElement is null");
}
- bPrevWasKnuthBox = lastElement.isBox()
- && !((KnuthElement) lastElement).isAuxiliary()
+ bPrevWasKnuthBox = lastElement.isBox()
+ && !((KnuthElement) lastElement).isAuxiliary()
&& ((KnuthElement) lastElement).getW() != 0;
-
+
// if last paragraph is open, add the new elements to the paragraph
// else this is the last paragraph
- if (lastPar == null) {
- lastPar = new Paragraph(this,
- textAlignment, textAlignmentLast,
+ if (lastPar == null) {
+ lastPar = new Paragraph(this,
+ textAlignment, textAlignmentLast,
textIndent.getValue(this),
lastLineEndIndent.getValue(this));
lastPar.startSequence();
@@ -725,7 +725,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (log.isTraceEnabled()) {
trace.append(" I");
}
-
+
// finish last paragraph if it was closed with a linefeed
if (lastElement.isPenalty()
&& ((KnuthPenalty) lastElement).getP()
@@ -735,7 +735,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// which forces a line break
lastPar.removeLast();
if (!lastPar.containsBox()) {
- //only a forced linefeed on this line
+ //only a forced linefeed on this line
//-> compensate with an auxiliary glue
lastPar.add(new KnuthGlue(iLineWidth, 0, iLineWidth, null, true));
}
@@ -765,11 +765,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
log.trace(trace);
}
-
+
/**
* Find a set of breaking points.
- * This method is called only once by getNextBreakPoss, and it
- * subsequently calls the other findBreakingPoints() method with
+ * This method is called only once by getNextBreakPoss, and it
+ * subsequently calls the other findBreakingPoints() method with
* different parameters, until a set of breaking points is found.
*
* @param par the list of elements that must be parted
@@ -805,7 +805,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
private boolean findBreakingPoints(Paragraph par, int lineWidth,
double threshold, boolean force) {
KnuthParagraph knuthPara = new KnuthParagraph(par);
@@ -813,11 +813,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (lines == 0) {
return false;
}
-
+
for (int i = lines-1; i >= 0; i--) {
int line = i+1;
if (log.isTraceEnabled()) {
- log.trace("Making line from " + knuthPara.getStart(i) + " to " +
+ log.trace("Making line from " + knuthPara.getStart(i) + " to " +
knuthPara.getEnd(i));
}
// compute indent and adjustment ratio, according to
@@ -826,7 +826,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int difference = knuthPara.getDifference(i);
if (line == lines) {
difference += par.lineFillerWidth;
- }
+ }
int textAlign = (line < lines)
? textAlignment : textAlignmentLast;
int indent = (textAlign == EN_CENTER)
@@ -841,7 +841,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
int end = knuthPara.getEnd(i);
makeLineBreakPosition(par, start, end, 0, ratio, indent);
}
- return true;
+ return true;
}
private void makeLineBreakPosition(Paragraph par,
@@ -893,7 +893,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineLead));
}*/
-
+
/**
* Phase 2 of Knuth algorithm: find optimal break points.
* @param alignment alignment in BP direction of the paragraph
@@ -918,9 +918,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
lineLayoutsList.add(0, llPoss);
}
-
+
setFinished(true);
-
+
//Post-process the line breaks found
return postProcessLineBreaks(alignment, context);
}
@@ -944,12 +944,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
hyphenationLadderCount.getEnum() == EN_NO_LIMIT
? 0 : hyphenationLadderCount.getValue(),
this);
-
- if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
+
+ if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
&& fobj.getWrapOption() != EN_NO_WRAP) {
findHyphenationPoints(currPar);
}
-
+
// first try
int allowedBreaks;
if (wrapOption == EN_NO_WRAP) {
@@ -969,7 +969,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// the first try failed
log.debug("No set of breaking points found with maxAdjustment = " + maxAdjustment);
}
-
+
// now try something different
log.debug("Hyphenation possible? " + (hyphenationProperties.hyphenate.getEnum() == EN_TRUE));
if (hyphenationProperties.hyphenate.getEnum() == EN_TRUE
@@ -980,7 +980,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// try with a higher threshold
maxAdjustment = 5;
}
-
+
if ((iBPcount
= alg.findBreakingPoints(currPar,
maxAdjustment, false, allowedBreaks)) == 0) {
@@ -998,12 +998,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
= alg.findBreakingPoints(currPar,
maxAdjustment, true, allowedBreaks);
}
-
+
// use non-hyphenated breaks, when possible
lineLayouts.restorePossibilities();
-
+
/* extension (not in the XSL FO recommendation): if vertical alignment
- is justify and the paragraph has only one layout, try using
+ is justify and the paragraph has only one layout, try using
shorter or longer lines */
//TODO This code snippet is disabled. Reenable?
if (false && alignment == EN_JUSTIFY && textAlignment == EN_JUSTIFY) {
@@ -1048,9 +1048,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
* @return the newly built element list
*/
private List postProcessLineBreaks(int alignment, LayoutContext context) {
-
+
List returnList = new LinkedList();
-
+
for (int p = 0; p < knuthParagraphs.size(); p++) {
// penalty between paragraphs
if (p > 0) {
@@ -1061,7 +1061,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
new Position(this), penalty, context));
}
}
-
+
LineLayoutPossibilities llPoss;
llPoss = (LineLayoutPossibilities) lineLayoutsList.get(p);
KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(p);
@@ -1078,10 +1078,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
targetList.add(tempElement);
}
- returnList.addAll(targetList);
+ returnList.addAll(targetList);
} else if (seq.isInlineSequence() && alignment == EN_JUSTIFY) {
/* justified vertical alignment (not in the XSL FO recommendation):
- create a multi-layout sequence whose elements will contain
+ create a multi-layout sequence whose elements will contain
a conventional Position */
Position returnPosition = new LeafPosition(this, p);
createElements(returnList, llPoss, returnPosition);
@@ -1107,7 +1107,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
int endIndex
= ((LineBreakPosition) llPoss.getChosenPosition(i)).getLeafPos();
- // create a list of the FootnoteBodyLM handling footnotes
+ // create a list of the FootnoteBodyLM handling footnotes
// whose citations are in this line
List footnoteList = new LinkedList();
ListIterator elementIterator = seq.listIterator(startIndex);
@@ -1138,7 +1138,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
}
}
-
+
return returnList;
}
@@ -1286,7 +1286,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int getKeepTogetherStrength() {
return ((BlockLevelLayoutManager) getParent()).getKeepTogetherStrength();
}
-
+
/** {@inheritDoc} */
public boolean mustKeepWithPrevious() {
return getKeepWithPreviousStrength() > KEEP_AUTO;
@@ -1306,7 +1306,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
LeafPosition pos = (LeafPosition)lastElement.getPosition();
@@ -1331,7 +1331,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
List returnList = new LinkedList();
@@ -1354,8 +1354,8 @@ public class LineLayoutManager extends InlineStackingLayoutManager
MinOptMax contentIPD;
if (alignment == EN_JUSTIFY) {
contentIPD = new MinOptMax(
- lbp.lineWidth - lbp.difference - lbp.availableShrink,
- lbp.lineWidth - lbp.difference,
+ lbp.lineWidth - lbp.difference - lbp.availableShrink,
+ lbp.lineWidth - lbp.difference,
lbp.lineWidth - lbp.difference + lbp.availableStretch);
} else if (alignment == EN_CENTER) {
contentIPD = new MinOptMax(lbp.lineWidth - 2 * lbp.startIndent);
@@ -1397,10 +1397,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// find all hyphenation points
while (currParIterator.hasNext()) {
firstElement = (KnuthElement) currParIterator.next();
- //
+ //
if (firstElement.getLayoutManager() != currLM) {
currLM = (InlineLevelLayoutManager) firstElement.getLayoutManager();
- if (currLM != null) {
+ if (currLM != null) {
updateList.add(new Update(currLM, currParIterator.previousIndex()));
} else {
break;
@@ -1409,7 +1409,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
break;
}
//TODO Something's not right here. See block_hyphenation_linefeed_preserve.xml
-
+
// collect word fragments, ignoring auxiliary elements;
// each word fragment was created by a different TextLM
if (firstElement.isBox() && !firstElement.isAuxiliary()) {
@@ -1432,7 +1432,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
} else if (!nextElement.isAuxiliary()) {
// a non-auxiliary non-box KnuthElement: stop
// go back to the last box or auxiliary element
- currParIterator.previous();
+ currParIterator.previous();
break;
} else {
if (currLM != nextElement.getLayoutManager()) {
@@ -1475,7 +1475,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
//int iRemovedElements = 0;
while (updateListIterator.hasNext()) {
- // ask the LMs to apply the changes and return
+ // ask the LMs to apply the changes and return
// the new KnuthElements to replace the old ones
currUpdate = (Update) updateListIterator.next();
int fromIndex = currUpdate.iFirstIndex;
@@ -1584,11 +1584,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
} else if ((pos instanceof NonLeafPosition) && pos.generatesAreas()) {
addBlockArea(context, pos, isLastPosition);
} else {
- /*
+ /*
* pos was the Position inside a penalty item, nothing to do;
* or Pos does not generate an area,
* i.e. it stand for spaces, borders and padding.
- */
+ */
}
}
setCurrentArea(null); // ?? necessary
@@ -1605,14 +1605,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager
KnuthElement tempElement = null;
// the TLM which created the last KnuthElement in this line
LayoutManager lastLM = null;
-
+
LineBreakPosition lbp = (LineBreakPosition) pos;
int iCurrParIndex;
iCurrParIndex = lbp.iParIndex;
KnuthSequence seq = (KnuthSequence) knuthParagraphs.get(iCurrParIndex);
int iStartElement = lbp.iStartIndex;
int iEndElement = lbp.getLeafPos();
-
+
LineArea lineArea
= new LineArea((lbp.getLeafPos() < seq.size() - 1
? textAlignment : textAlignmentLast),
@@ -1625,12 +1625,12 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
lineArea.addTrait(Trait.SPACE_AFTER, new Integer(lbp.spaceAfter));
alignmentContext.resizeLine(lbp.lineHeight, lbp.baseline);
-
+
if (seq instanceof Paragraph) {
Paragraph currPar = (Paragraph) seq;
// ignore the first elements added by the LineLayoutManager
iStartElement += (iStartElement == 0) ? currPar.ignoreAtStart : 0;
-
+
// if this is the last line area that for this paragraph,
// ignore the last elements added by the LineLayoutManager and
// subtract the last-line-end-indent from the area ipd
@@ -1639,10 +1639,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.setIPD(lineArea.getIPD() - lastLineEndIndent.getValue(this));
}
}
-
+
// Remove trailing spaces if allowed so
if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
- || whiteSpaceTreament == EN_IGNORE
+ || whiteSpaceTreament == EN_IGNORE
|| whiteSpaceTreament == EN_IGNORE_IF_BEFORE_LINEFEED) {
// ignore the last element in the line if it is a KnuthGlue object
seqIterator = seq.listIterator(iEndElement);
@@ -1661,10 +1661,10 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lastLM = tempElement.getLayoutManager();
}
}
-
+
// Remove leading spaces if allowed so
if (whiteSpaceTreament == EN_IGNORE_IF_SURROUNDING_LINEFEED
- || whiteSpaceTreament == EN_IGNORE
+ || whiteSpaceTreament == EN_IGNORE
|| whiteSpaceTreament == EN_IGNORE_IF_AFTER_LINEFEED) {
// ignore KnuthGlue and KnuthPenalty objects
// at the beginning of the line
@@ -1678,13 +1678,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager
// Add the inline areas to lineArea
PositionIterator inlinePosIter
= new KnuthPossPosIter(seq, iStartElement, iEndElement + 1);
-
+
iStartElement = lbp.getLeafPos() + 1;
if (iStartElement == seq.size()) {
// advance to next paragraph
iStartElement = 0;
}
-
+
LayoutContext lc = new LayoutContext(0);
lc.setAlignmentContext(alignmentContext);
lc.setSpaceAdjust(lbp.dAdjust);
@@ -1692,7 +1692,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lc.setLeadingSpace(new SpaceSpecifier(true));
lc.setTrailingSpace(new SpaceSpecifier(false));
lc.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true);
-
+
/*
* extension (not in the XSL FO recommendation): if the left and right margins
* have been optimized, recompute indents and / or adjust ratio, according
@@ -1718,11 +1718,11 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
} else if (false && textAlignment == EN_END) {
// re-compute indent
- int updatedIndent = lbp.startIndent
+ int updatedIndent = lbp.startIndent
+ (context.getStackLimitIP().opt - lbp.lineWidth);
lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
}
-
+
setCurrentArea(lineArea);
setChildContext(lc);
LayoutManager childLM;
@@ -1732,9 +1732,9 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lc.setLeadingSpace(lc.getTrailingSpace());
lc.setTrailingSpace(new SpaceSpecifier(false));
}
-
+
// when can this be null?
- // if display-align is distribute, add space after
+ // if display-align is distribute, add space after
if (context.getSpaceAfter() > 0
&& (!context.isLastArea() || !isLastPosition)) {
lineArea.setBPD(lineArea.getBPD() + context.getSpaceAfter());
@@ -1742,7 +1742,7 @@ public class LineLayoutManager extends InlineStackingLayoutManager
lineArea.finalise();
parentLM.addChildArea(lineArea);
}
-
+
/**
* Add a line with block content
* @param context the context for adding areas
@@ -1766,13 +1766,13 @@ public class LineLayoutManager extends InlineStackingLayoutManager
if (isLastPosition) {
lastLM = innerPosition.getLM();
}
-
+
LineArea lineArea = new LineArea();
setCurrentArea(lineArea);
LayoutContext lc = new LayoutContext(0);
lc.setAlignmentContext(alignmentContext);
setChildContext(lc);
-
+
PositionIterator childPosIter = new StackingIter(positionList.listIterator());
LayoutContext blocklc = new LayoutContext(0);
blocklc.setLeadingSpace(new SpaceSpecifier(true));
@@ -1810,14 +1810,14 @@ public class LineLayoutManager extends InlineStackingLayoutManager
}
// --------- Property Resolution related functions --------- //
-
+
/**
* {@inheritDoc}
*/
public boolean getGeneratesBlockArea() {
return true;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
index 59dd9c3c4..c1b81c4ab 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutPossibilities.java
@@ -29,7 +29,7 @@ public class LineLayoutPossibilities {
/** logger instance */
protected static Log log = LogFactory.getLog(LineLayoutPossibilities.class);
-
+
private class Possibility {
private int lineCount;
private double demerits;
@@ -50,8 +50,8 @@ public class LineLayoutPossibilities {
}
private void addBreakPosition(Position pos) {
- // Positions are always added with index 0 because
- // they are created backward, from the last one to
+ // Positions are always added with index 0 because
+ // they are created backward, from the last one to
// the first one
breakPositions.add(0, pos);
}
@@ -74,7 +74,7 @@ public class LineLayoutPossibilities {
savedPossibilities = new java.util.ArrayList();
optimumIndex = -1;
}
-
+
public void addPossibility(int ln, double dem) {
possibilitiesList.add(new Possibility(ln, dem));
if (possibilitiesList.size() == 1) {
@@ -145,8 +145,8 @@ public class LineLayoutPossibilities {
} else {
// this should not happen
log.error("LineLayoutPossibilities restorePossibilities(),"
- + " min= " + getMinLineCount()
- + " max= " + getMaxLineCount()
+ + " min= " + getMinLineCount()
+ + " max= " + getMaxLineCount()
+ " restored= " + restoredPossibility.getLineCount());
return;
}
@@ -158,7 +158,7 @@ public class LineLayoutPossibilities {
chosenIndex = optimumIndex;
}
}
- //log.debug(">> minLineCount = " + getMinLineCount()
+ //log.debug(">> minLineCount = " + getMinLineCount()
// + " optLineCount = " + getOptLineCount() + " maxLineCount() = " + getMaxLineCount());
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
index 331d48b75..d33f2cca1 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLastLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -43,13 +43,13 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationLastInlineArea(parentLM);
return curArea;
}
-
+
/**
* if id can be resolved then simply return a word, otherwise
* return a resolvable area
@@ -71,12 +71,12 @@ public class PageNumberCitationLastLayoutManager extends AbstractPageNumberCitat
int width = getStringWidth(str);
text.addWord(str, 0);
text.setIPD(width);
-
+
resolved = true;
}
-
+
updateTextAreaTraits(text);
-
+
return text;
}
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
index 8e6633ab8..583f73d24 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberCitationLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -41,13 +41,13 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL
public PageNumberCitationLayoutManager(PageNumberCitation node) {
super(node);
}
-
+
/** {@inheritDoc} */
public InlineArea get(LayoutContext context) {
curArea = getPageNumberCitationInlineArea();
return curArea;
}
-
+
/**
* if id can be resolved then simply return a word, otherwise
* return a resolvable area
@@ -71,9 +71,9 @@ public class PageNumberCitationLayoutManager extends AbstractPageNumberCitationL
text.setIPD(width);
}
updateTextAreaTraits(text);
-
+
return text;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
index 1aaaaf527..6b0e88cbb 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/PageNumberLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,10 +34,10 @@ import org.apache.fop.traits.MinOptMax;
* LayoutManager for the fo:page-number formatting object
*/
public class PageNumberLayoutManager extends LeafNodeLayoutManager {
-
+
private PageNumber fobj;
private Font font;
-
+
/**
* Constructor
*
@@ -48,7 +48,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
super(node);
fobj = node;
}
-
+
/** {@inheritDoc} */
public void initialize() {
FontInfo fi = fobj.getFOEventHandler().getFontInfo();
@@ -84,13 +84,13 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
text.setBPD(font.getAscender() - font.getDescender());
text.setBaselineOffset(font.getAscender());
TraitSetter.addFontTraits(text, font);
- text.addTrait(Trait.COLOR, fobj.getColor());
+ text.addTrait(Trait.COLOR, fobj.getColor());
TraitSetter.addTextDecoration(text, fobj.getTextDecoration());
return text;
}
-
+
/** {@inheritDoc} */
protected InlineArea getEffectiveArea() {
TextArea baseArea = (TextArea)curArea;
@@ -108,7 +108,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
updateContent(ta);
return ta;
}
-
+
private void updateContent(TextArea area) {
// get the page number of the page actually being built
area.removeText();
@@ -130,6 +130,6 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager {
}
return width;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
index 25bcb7d0e..a2a1dce27 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTable.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,19 +23,19 @@ import org.apache.fop.datatypes.Length;
/**
* The FOP specific incarnation of the XSL-FO scaled baseline table.
- * All baseline tables are scaled to the font size of the font they
- * apply to. This interface uses a coordinate system with its origin
+ * All baseline tables are scaled to the font size of the font they
+ * apply to. This interface uses a coordinate system with its origin
* where the dominant baseline intersects the start edge of the box.
* All measurements are in mpt.
*/
public interface ScaledBaselineTable {
-
+
/**
* Return the dominant baseline identifer for this alignment context.
* @return the dominant baseline identifier
*/
int getDominantBaselineIdentifier();
-
+
/**
* Return the writing mode for this aligment context.
* @return the writing mode
@@ -49,7 +49,7 @@ public interface ScaledBaselineTable {
* @return the baseline offset
*/
int getBaseline(int baselineIdentifier);
-
+
/**
* Sets the position of the before and after baselines.
* This is usually only done for line areas. For other
@@ -59,7 +59,7 @@ public interface ScaledBaselineTable {
* @param afterBaseline the offset of the after-edge baseline from the dominant baseline
*/
void setBeforeAndAfterBaselines(int beforeBaseline, int afterBaseline);
-
+
/**
* Return a new baseline table for the given baseline based
* on the current baseline table.
diff --git a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
index e47f107e3..1536552c4 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/ScaledBaselineTableFactory.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,7 +44,7 @@ public class ScaledBaselineTableFactory implements Constants {
return new BasicScaledBaselineTable(font.getAscender(), font.getDescender()
, font.getXHeight(), dominantBaselineIdentifier, writingMode);
}
-
+
/**
* Creates a new instance of BasicScaledBaselineTable for the given
* font and writingmode. It assumes an alphabetic baseline.
@@ -55,7 +55,7 @@ public class ScaledBaselineTableFactory implements Constants {
public static ScaledBaselineTable makeFontScaledBaselineTable(Font font, int writingMode) {
return makeFontScaledBaselineTable(font, EN_ALPHABETIC, writingMode);
}
-
+
/**
* Creates a new instance of BasicScaledBaselineTable for the given
* height, baseline and writingmode. This is used for non font based areas like
@@ -71,5 +71,5 @@ public class ScaledBaselineTableFactory implements Constants {
return new BasicScaledBaselineTable(height, 0, height
, dominantBaselineIdentifier, writingMode);
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
index c6210edce..459bce0e8 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/TextLayoutManager.java
@@ -203,7 +203,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
public void initialize() {
this.foText.resetBuffer();
-
+
this.spaceFont = FontSelector.selectFontForCharacterInText(' ', this.foText, this);
// With CID fonts, space isn't neccesary currentFontState.width(32)
diff --git a/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
index 342e0a6f1..97f07da54 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/WrapperLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,7 +34,7 @@ import java.util.LinkedList;
* This is the layout manager for the fo:wrapper formatting object.
*/
public class WrapperLayoutManager extends LeafNodeLayoutManager {
-
+
/**
* Creates a new LM for fo:wrapper.
* @param node the fo:wrapper
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
index 11e69970e..1cd3ab9d2 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.list;
import java.util.Iterator;
@@ -48,7 +48,7 @@ import org.apache.fop.traits.SpaceVal;
* A list block contains list items which are stacked within
* the list block area..
*/
-public class ListBlockLayoutManager extends BlockStackingLayoutManager
+public class ListBlockLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
@@ -102,38 +102,38 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
foSpaceAfter = new SpaceVal(
getListBlockFO().getCommonMarginBlock().spaceAfter, this).getSpace();
startIndent = getListBlockFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getListBlockFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getListBlockFO().getCommonMarginBlock().endIndent.getValue(this);
}
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
- resetSpaces();
+ resetSpaces();
List returnList = super.getNextKnuthElements(context, alignment);
//fox:widow-content-limit
- int widowRowLimit = getListBlockFO().getWidowContentLimit().getValue();
+ int widowRowLimit = getListBlockFO().getWidowContentLimit().getValue();
if (widowRowLimit != 0) {
ElementListUtils.removeLegalBreaks(returnList, widowRowLimit);
}
//fox:orphan-content-limit
- int orphanRowLimit = getListBlockFO().getOrphanContentLimit().getValue();
+ int orphanRowLimit = getListBlockFO().getOrphanContentLimit().getValue();
if (orphanRowLimit != 0) {
ElementListUtils.removeLegalBreaksFromEnd(returnList, orphanRowLimit);
}
return returnList;
}
-
+
/** {@inheritDoc} */
public List getChangedKnuthElements(List oldList, int alignment) {
//log.debug("LBLM.getChangedKnuthElements>");
@@ -169,7 +169,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
Position lastPos = null;
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -208,17 +208,17 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
// We are done with this area add the background
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getListBlockFO().getCommonBorderPaddingBackground(),
this);
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
checkEndOfLayout(lastPos);
}
@@ -238,30 +238,30 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
public Area getParentArea(Area childArea) {
if (curBlockArea == null) {
curBlockArea = new Block();
-
+
// Set up dimensions
// Must get dimensions from parent area
/*Area parentArea =*/ parentLM.getParentArea(curBlockArea);
// set traits
TraitSetter.setProducerID(curBlockArea, getListBlockFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getListBlockFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getListBlockFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getListBlockFO().getCommonBorderPaddingBackground(),
+ getListBlockFO().getCommonBorderPaddingBackground(),
getListBlockFO().getCommonMarginBlock(),
this);
- TraitSetter.addBreaks(curBlockArea,
- getListBlockFO().getBreakBefore(),
+ TraitSetter.addBreaks(curBlockArea,
+ getListBlockFO().getBreakBefore(),
getListBlockFO().getBreakAfter());
-
+
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
-
+
setCurrentArea(curBlockArea);
}
return curBlockArea;
@@ -285,7 +285,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KeepUtil.getCombinedBlockLevelKeepStrength(getListBlockFO().getKeepWithNext());
@@ -300,13 +300,13 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
index 124827976..0a2dec945 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.list;
import java.util.Iterator;
@@ -85,7 +85,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
protected AbstractListItemPart getPartFO() {
return (AbstractListItemPart)fobj;
}
-
+
/**
* Set the x offset of this list item.
* This offset is used to set the absolute position
@@ -114,7 +114,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
public void addAreas(PositionIterator parentIter,
LayoutContext layoutContext) {
getParentArea(null);
-
+
addId();
LayoutManager childLM;
@@ -125,7 +125,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
Position lastPos = null;
// "unwrap" the NonLeafPositions stored in parentIter
- // and put them in a new list;
+ // and put them in a new list;
LinkedList positionList = new LinkedList();
Position pos;
while (parentIter.hasNext()) {
@@ -154,7 +154,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
}
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
-
+
StackingIter childPosIter = new StackingIter(positionList.listIterator());
while ((childLM = childPosIter.getNextChildLM()) != null) {
// Add the block areas to Area
@@ -167,11 +167,11 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
}
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
-
+
flush();
curBlockArea = null;
-
+
checkEndOfLayout(lastPos);
}
@@ -198,7 +198,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
//curBlockArea.setHeight();
TraitSetter.setProducerID(curBlockArea, getPartFO().getId());
-
+
// Set up dimensions
Area parentArea = parentLM.getParentArea(curBlockArea);
int referenceIPD = parentArea.getIPD();
@@ -226,7 +226,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager {
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
index 37ec4964d..f027922f7 100644
--- a/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -59,7 +59,7 @@ import org.apache.fop.traits.SpaceVal;
* LayoutManager for a list-item FO.
* The list item contains a list item label and a list item body.
*/
-public class ListItemLayoutManager extends BlockStackingLayoutManager
+public class ListItemLayoutManager extends BlockStackingLayoutManager
implements ConditionalElementListener {
/**
@@ -81,19 +81,19 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
private boolean discardPaddingAfter;
private MinOptMax effSpaceBefore;
private MinOptMax effSpaceAfter;
-
+
private int keepWithNextPendingOnLabel;
private int keepWithNextPendingOnBody;
private int listItemHeight;
-
+
private class ListItemPosition extends Position {
private int iLabelFirstIndex;
private int iLabelLastIndex;
private int iBodyFirstIndex;
private int iBodyLastIndex;
- public ListItemPosition(LayoutManager lm, int labelFirst, int labelLast,
+ public ListItemPosition(LayoutManager lm, int labelFirst, int labelLast,
int bodyFirst, int bodyLast) {
super(lm);
iLabelFirstIndex = labelFirst;
@@ -101,11 +101,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
iBodyFirstIndex = bodyFirst;
iBodyLastIndex = bodyLast;
}
-
+
public int getLabelFirstIndex() {
return iLabelFirstIndex;
}
-
+
public int getLabelLastIndex() {
return iLabelLastIndex;
}
@@ -113,11 +113,11 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
public int getBodyFirstIndex() {
return iBodyFirstIndex;
}
-
+
public int getBodyLastIndex() {
return iBodyLastIndex;
}
-
+
/** {@inheritDoc} */
public boolean generatesAreas() {
return true;
@@ -166,7 +166,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
* @param node the fo:list-item-body FO
*/
public void setBody(ListItemBody node) {
- body = new ListItemContentLayoutManager(node);
+ body = new ListItemContentLayoutManager(node);
body.setParent(this);
}
@@ -177,25 +177,25 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
foSpaceAfter = new SpaceVal(
getListItemFO().getCommonMarginBlock().spaceAfter, this).getSpace();
startIndent = getListItemFO().getCommonMarginBlock().startIndent.getValue(this);
- endIndent = getListItemFO().getCommonMarginBlock().endIndent.getValue(this);
+ endIndent = getListItemFO().getCommonMarginBlock().endIndent.getValue(this);
}
private void resetSpaces() {
- this.discardBorderBefore = false;
- this.discardBorderAfter = false;
- this.discardPaddingBefore = false;
+ this.discardBorderBefore = false;
+ this.discardBorderAfter = false;
+ this.discardPaddingBefore = false;
this.discardPaddingAfter = false;
this.effSpaceBefore = null;
this.effSpaceAfter = null;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
referenceIPD = context.getRefIPD();
LayoutContext childLC;
-
+
List returnList = new LinkedList();
-
+
if (!breakBeforeServed) {
try {
if (addKnuthElementsForBreakBefore(returnList, context)) {
@@ -207,7 +207,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
addKnuthElementsForSpaceBefore(returnList, alignment);
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
@@ -219,12 +219,12 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
childLC.setRefIPD(context.getRefIPD());
label.initialize();
labelList = label.getNextKnuthElements(childLC, alignment);
-
+
//Space resolution as if the contents were placed in a new reference area
//(see 6.8.3, XSL 1.0, section on Constraints, last paragraph)
SpaceResolver.resolveElementList(labelList);
ElementListObserver.observe(labelList, "list-item-label", label.getPartFO().getId());
-
+
context.updateKeepWithPreviousPending(childLC.getKeepWithPreviousPending());
this.keepWithNextPendingOnLabel = childLC.getKeepWithNextPending();
@@ -238,7 +238,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
//(see 6.8.3, XSL 1.0, section on Constraints, last paragraph)
SpaceResolver.resolveElementList(bodyList);
ElementListObserver.observe(bodyList, "list-item-body", body.getPartFO().getId());
-
+
context.updateKeepWithPreviousPending(childLC.getKeepWithPreviousPending());
this.keepWithNextPendingOnBody = childLC.getKeepWithNextPending();
@@ -247,7 +247,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// "wrap" the Position inside each element
wrapPositionElements(returnedList, returnList, true);
-
+
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
addKnuthElementsForBreakAfter(returnList, context);
@@ -280,7 +280,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
LinkedList returnList = new LinkedList();
while ((step = getNextStep(elementLists, start, end, partialHeights)) > 0) {
-
+
if (end[0] + 1 == elementLists[0].size()) {
keepWithNextActive = Math.max(keepWithNextActive, keepWithNextPendingOnLabel);
}
@@ -289,10 +289,10 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
// compute penalty height and box height
- int penaltyHeight = step
- + getMaxRemainingHeight(fullHeights, partialHeights)
+ int penaltyHeight = step
+ + getMaxRemainingHeight(fullHeights, partialHeights)
- totalHeight;
-
+
//Additional penalty height from penalties in the source lists
int additionalPenaltyHeight = 0;
int stepPenalty = 0;
@@ -307,7 +307,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
additionalPenaltyHeight, endEl.getW());
stepPenalty = Math.max(stepPenalty, endEl.getP());
}
-
+
int boxHeight = step - addedBoxHeight - penaltyHeight;
penaltyHeight += additionalPenaltyHeight; //Add AFTER calculating boxHeight!
@@ -330,7 +330,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// add the new elements
addedBoxHeight += boxHeight;
- ListItemPosition stepPosition = new ListItemPosition(this,
+ ListItemPosition stepPosition = new ListItemPosition(this,
start[0], end[0], start[1], end[1]);
if (footnoteList == null) {
returnList.add(new KnuthBox(boxHeight, stepPosition, false));
@@ -394,7 +394,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
if (seqCount == 0) {
return 0;
}
-
+
// determine next step
int step;
if (backupHeights[0] == 0 && backupHeights[1] == 0) {
@@ -426,7 +426,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
//log.debug(" LILM.getChanged> label");
@@ -441,10 +441,10 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement)oldListIterator.next();
Position innerPosition = oldElement.getPosition().getPosition();
- //log.debug(" BLM> unwrapping: " + (oldElement.isBox()
- // ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
+ //log.debug(" BLM> unwrapping: " + (oldElement.isBox()
+ // ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
// + " creato da " + oldElement.getLayoutManager().getClass().getName());
- //log.debug(" BLM> unwrapping: "
+ //log.debug(" BLM> unwrapping: "
// + oldElement.getPosition().getClass().getName());
if (innerPosition != null) {
// oldElement was created by a descendant of this BlockLM
@@ -508,7 +508,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(true, isFirst(firstPos), isLast(lastPos));
- // use the first and the last ListItemPosition to determine the
+ // use the first and the last ListItemPosition to determine the
// corresponding indexes in the original labelList and bodyList
int labelFirstIndex = ((ListItemPosition) positionList.getFirst()).getLabelFirstIndex();
int labelLastIndex = ((ListItemPosition) positionList.getLast()).getLabelLastIndex();
@@ -517,17 +517,17 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
//Determine previous break if any
int previousBreak = ElementListUtils.determinePreviousBreak(labelList, labelFirstIndex);
- SpaceResolver.performConditionalsNotification(labelList,
+ SpaceResolver.performConditionalsNotification(labelList,
labelFirstIndex, labelLastIndex, previousBreak);
//Determine previous break if any
previousBreak = ElementListUtils.determinePreviousBreak(bodyList, bodyFirstIndex);
- SpaceResolver.performConditionalsNotification(bodyList,
+ SpaceResolver.performConditionalsNotification(bodyList,
bodyFirstIndex, bodyLastIndex, previousBreak);
-
+
// add label areas
if (labelFirstIndex <= labelLastIndex) {
- KnuthPossPosIter labelIter = new KnuthPossPosIter(labelList,
+ KnuthPossPosIter labelIter = new KnuthPossPosIter(labelList,
labelFirstIndex, labelLastIndex + 1);
lc.setFlags(LayoutContext.FIRST_AREA, layoutContext.isFirstArea());
lc.setFlags(LayoutContext.LAST_AREA, layoutContext.isLastArea());
@@ -548,7 +548,7 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// add body areas
if (bodyFirstIndex <= bodyLastIndex) {
- KnuthPossPosIter bodyIter = new KnuthPossPosIter(bodyList,
+ KnuthPossPosIter bodyIter = new KnuthPossPosIter(bodyList,
bodyFirstIndex, bodyLastIndex + 1);
lc.setFlags(LayoutContext.FIRST_AREA, layoutContext.isFirstArea());
lc.setFlags(LayoutContext.LAST_AREA, layoutContext.isLastArea());
@@ -567,17 +567,17 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
addMarkersToPage(false, isFirst(firstPos), isLast(lastPos));
// We are done with this area add the background
- TraitSetter.addBackground(curBlockArea,
+ TraitSetter.addBackground(curBlockArea,
getListItemFO().getCommonBorderPaddingBackground(),
this);
- TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
+ TraitSetter.addSpaceBeforeAfter(curBlockArea, layoutContext.getSpaceAdjust(),
effSpaceBefore, effSpaceAfter);
flush();
curBlockArea = null;
resetSpaces();
-
+
checkEndOfLayout(lastPos);
}
@@ -610,22 +610,22 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
// Set up dimensions
/*Area parentArea =*/ parentLM.getParentArea(curBlockArea);
-
+
// set traits
TraitSetter.setProducerID(curBlockArea, getListItemFO().getId());
- TraitSetter.addBorders(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addBorders(curBlockArea,
+ getListItemFO().getCommonBorderPaddingBackground(),
discardBorderBefore, discardBorderAfter, false, false, this);
- TraitSetter.addPadding(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ TraitSetter.addPadding(curBlockArea,
+ getListItemFO().getCommonBorderPaddingBackground(),
discardPaddingBefore, discardPaddingAfter, false, false, this);
TraitSetter.addMargins(curBlockArea,
- getListItemFO().getCommonBorderPaddingBackground(),
+ getListItemFO().getCommonBorderPaddingBackground(),
getListItemFO().getCommonMarginBlock(), this);
- TraitSetter.addBreaks(curBlockArea,
- getListItemFO().getBreakBefore(),
+ TraitSetter.addBreaks(curBlockArea,
+ getListItemFO().getBreakBefore(),
getListItemFO().getBreakAfter());
-
+
int contentIPD = referenceIPD - getIPIndents();
curBlockArea.setIPD(contentIPD);
@@ -669,13 +669,13 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
public void notifySpace(RelSide side, MinOptMax effectiveLength) {
if (RelSide.BEFORE == side) {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceBefore + "-> " + effectiveLength);
}
this.effSpaceBefore = effectiveLength;
} else {
if (log.isDebugEnabled()) {
- log.debug(this + ": Space " + side + ", "
+ log.debug(this + ": Space " + side + ", "
+ this.effSpaceAfter + "-> " + effectiveLength);
}
this.effSpaceAfter = effectiveLength;
@@ -710,6 +710,6 @@ public class ListItemLayoutManager extends BlockStackingLayoutManager
}
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
index 4012b0c00..a9da7a3ca 100644
--- a/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
+++ b/src/java/org/apache/fop/layoutmgr/table/ActiveCell.java
@@ -173,7 +173,7 @@ class ActiveCell {
* Returns the actual length of the content represented by the given element. In the
* case where this element is used as a filler to match a row's fixed height, the
* value returned by the getW() method will be higher than the actual content.
- *
+ *
* @param el an element
* @return the actual content length corresponding to the element
*/
@@ -226,7 +226,7 @@ class ActiveCell {
/**
* Modifies the cell's element list by putting filler elements, so that the cell's or
* row's explicit height is always reached.
- *
+ *
* TODO this will work properly only for the first break. Then the limitation
* explained on http://wiki.apache.org/xmlgraphics-fop/TableLayout/KnownProblems
* occurs. The list of elements needs to be re-adjusted after each break.
@@ -269,7 +269,7 @@ class ActiveCell {
/**
* Returns true if this cell ends on the given row.
- *
+ *
* @param rowIndex index of a row in the row-group, zero-based
* @return true if this cell ends on the given row
*/
@@ -280,7 +280,7 @@ class ActiveCell {
/**
* Returns the length of this cell's content not yet included in the steps, plus the
* cell's borders and paddings if applicable.
- *
+ *
* @return the remaining length, zero if the cell is finished
*/
int getRemainingLength() {
@@ -341,12 +341,12 @@ class ActiveCell {
afterNextStep.end = knuthIter.nextIndex() - 1;
afterNextStep.totalLength = bpBeforeNormal
+ afterNextStep.contentLength + afterNextStep.penaltyLength
- + bpAfterTrailing;
+ + bpAfterTrailing;
}
/**
* Returns the minimal step that is needed for this cell to contribute some content.
- *
+ *
* @return the step for this cell's first legal break
*/
int getFirstStep() {
@@ -363,7 +363,7 @@ class ActiveCell {
* infinite penalty, plus the cell's content won't be taken into account since the
* final step will be smaller than the current one (see {@link #signalNextStep(int)}).
* This actually means that the content will be swallowed.
- *
+ *
* @return the length of last step
*/
int getLastStep() {
@@ -377,7 +377,7 @@ class ActiveCell {
/**
* Increases the next step up to the given limit.
- *
+ *
* @param limit the length up to which the next step is allowed to increase
* @see #signalRowFirstStep(int)
* @see #signalRowLastStep(int)
@@ -398,7 +398,7 @@ class ActiveCell {
* Gets the selected first step for the current row. If this cell's first step is
* smaller, then it may be able to add some more of its content, since there will be
* no break before the given step anyway.
- *
+ *
* @param firstStep the current row's first step
*/
void signalRowFirstStep(int firstStep) {
@@ -418,7 +418,7 @@ class ActiveCell {
/**
* Returns the total length up to the next legal break, not yet included in the steps.
- *
+ *
* @return the total length up to the next legal break (-1 signals no further step)
*/
int getNextStep() {
@@ -446,7 +446,7 @@ class ActiveCell {
/**
* Signals the length of the chosen next step, so that this cell determines whether
* its own step may be included or not.
- *
+ *
* @param minStep length of the chosen next step
* @return the break class of the step, if any. One of {@link Constants#EN_AUTO},
* {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
@@ -487,7 +487,7 @@ class ActiveCell {
/**
* Receives indication that the current row is ending, and that (collapse) borders
* must be updated accordingly.
- *
+ *
* @param rowIndex the index of the ending row
*/
void endRow(int rowIndex) {
@@ -508,7 +508,7 @@ class ActiveCell {
/**
* Returns true if this cell would be finished after the given step. That is, it would
* be included in the step and the end of its content would be reached.
- *
+ *
* @param step the next step
* @return true if this cell finishes at the given step
*/
@@ -519,7 +519,7 @@ class ActiveCell {
/**
* Creates and returns a CellPart instance for the content of this cell which
* is included in the next step.
- *
+ *
* @return a CellPart instance
*/
CellPart createCellPart() {
@@ -557,7 +557,7 @@ class ActiveCell {
/**
* Adds the footnotes (if any) that are part of the next step, if this cell
* contributes content to the next step.
- *
+ *
* @param footnoteList the list to which this cell must add its footnotes
*/
void addFootnotes(List footnoteList) {
diff --git a/src/java/org/apache/fop/layoutmgr/table/CellPart.java b/src/java/org/apache/fop/layoutmgr/table/CellPart.java
index 560b70344..7dd2bc201 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CellPart.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CellPart.java
@@ -44,7 +44,7 @@ class CellPart {
/**
* Creates a new CellPart.
- *
+ *
* @param pgu Primary grid unit
* @param start starting element
* @param end ending element
diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
index c3df74800..ede6210ca 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModel.java
@@ -131,7 +131,7 @@ public abstract class CollapsingBorderModel {
/**
* Compares the two given styles (see {@link Constants}).
- *
+ *
* @param style1 a style constant
* @param style2 another style constant
* @return a value < 0 if style1 has less priority than style2, 0 if both are
@@ -161,7 +161,7 @@ public abstract class CollapsingBorderModel {
/**
* Compares the two given FO ids ({@link Constants}.FO*) in terms of border
* declaration.
- *
+ *
* @param id1 a FO id ({@link Constants#FO_TABLE}, {@link Constants#FO_TABLE_BODY},
* etc.)
* @param id2 another FO id
@@ -178,7 +178,7 @@ public abstract class CollapsingBorderModel {
* Returns the border which wins the border conflict resolution. In case the two
* borders are equivalent (identical, or only the color is different), null is
* returned.
- *
+ *
* @param border1 a border specification
* @param border2 another border specification
* @param discard true if the .conditionality component of the border width must be
@@ -192,7 +192,7 @@ public abstract class CollapsingBorderModel {
* Returns the border which wins the border conflict resolution. Same as
* {@link #determineWinner(BorderSpecification, BorderSpecification, boolean)
* determineWinner(border1, border2, false)}.
- *
+ *
* @param border1 a border specification
* @param border2 another border specification
* @return the winning border, null if the two borders are equivalent
diff --git a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
index c1a9380a3..7aed158de 100644
--- a/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
+++ b/src/java/org/apache/fop/layoutmgr/table/CollapsingBorderModelEyeCatching.java
@@ -26,7 +26,7 @@ import org.apache.fop.fo.properties.CommonBorderPaddingBackground.BorderInfo;
/**
* Implements the normal "collapse" border model defined in 6.7.10 in XSL 1.0.
- *
+ *
* TODO Column groups are not yet checked in this algorithm!
*/
public class CollapsingBorderModelEyeCatching extends CollapsingBorderModel {
diff --git a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
index 9dbd31653..c32c6eb3d 100644
--- a/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
+++ b/src/java/org/apache/fop/layoutmgr/table/ColumnSetup.java
@@ -45,9 +45,9 @@ public class ColumnSetup {
private Table table;
private List columns = new java.util.ArrayList();
private List colWidths = new java.util.ArrayList();
-
+
private int maxColIndexReferenced = 0;
-
+
/**
* Main Constructor.
* @param table the table to construct this column setup for
@@ -57,7 +57,7 @@ public class ColumnSetup {
prepareColumns();
initializeColumnWidths();
}
-
+
private void prepareColumns() {
List rawCols = table.getColumns();
if (rawCols != null) {
@@ -124,7 +124,7 @@ public class ColumnSetup {
return (TableColumn) columns.get(index - 1);
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return columns.toString();
@@ -138,15 +138,15 @@ public class ColumnSetup {
return columns.size();
}
}
-
+
/** @return an Iterator over all columns */
public Iterator iterator() {
return this.columns.iterator();
}
-
+
/*
private void createColumnsFromFirstRow() {
- //TODO Create oldColumns from first row here
+ //TODO Create oldColumns from first row here
//--> rule 2 in "fixed table layout", see CSS2, 17.5.2
//Alternative: extend oldColumns on-the-fly, but in this case we need the
//new property evaluation context so proportional-column-width() works
@@ -159,13 +159,13 @@ public class ColumnSetup {
/**
* Initializes the column's widths
- *
+ *
*/
private void initializeColumnWidths() {
-
+
TableColumn col;
Length colWidth;
-
+
for (int i = columns.size(); --i >= 0;) {
if (columns.get(i) != null) {
col = (TableColumn) columns.get(i);
@@ -175,21 +175,21 @@ public class ColumnSetup {
}
colWidths.add(0, null);
}
-
+
/**
* Works out the base unit for resolving proportional-column-width()
* [p-c-w(x) = x * base_unit_ipd]
- *
+ *
* @param tlm the TableLayoutManager
* @return the computed base unit (in millipoint)
*/
protected double computeTableUnit(TableLayoutManager tlm) {
-
+
int sumCols = 0;
float factors = 0;
double unit = 0;
-
- /* calculate the total width (specified absolute/percentages),
+
+ /* calculate the total width (specified absolute/percentages),
* and work out the total number of factors to use to distribute
* the remaining space (if any)
*/
@@ -204,9 +204,9 @@ public class ColumnSetup {
}
}
}
-
- /* distribute the remaining space over the accumulated
- * factors (if any)
+
+ /* distribute the remaining space over the accumulated
+ * factors (if any)
*/
if (factors > 0) {
if (sumCols < tlm.getContentAreaIPD()) {
@@ -215,10 +215,10 @@ public class ColumnSetup {
log.warn("No space remaining to distribute over columns.");
}
}
-
+
return unit;
}
-
+
/**
* @param col column index (1 is first column)
* @param context the context for percentage based calculations
@@ -258,5 +258,5 @@ public class ColumnSetup {
}
return sum;
}
-
+
}
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
index 7f91808d0..54cb1ebfe 100644
--- a/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/RowGroupLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -66,7 +66,7 @@ class RowGroupLayoutManager {
int breakBefore = Constants.EN_AUTO;
TableRow firstRow = rowGroup[0].getTableRow();
if (firstRow != null) {
- breakBefore = firstRow.getBreakBefore();
+ breakBefore = firstRow.getBreakBefore();
}
context.setBreakBefore(BreakUtil.compareBreakClasses(breakBefore,
rowGroup[0].getBreakBefore()));
@@ -74,7 +74,7 @@ class RowGroupLayoutManager {
int breakAfter = Constants.EN_AUTO;
TableRow lastRow = rowGroup[rowGroup.length - 1].getTableRow();
if (lastRow != null) {
- breakAfter = lastRow.getBreakAfter();
+ breakAfter = lastRow.getBreakAfter();
}
context.setBreakAfter(BreakUtil.compareBreakClasses(breakAfter,
rowGroup[rowGroup.length - 1].getBreakAfter()));
@@ -89,7 +89,7 @@ class RowGroupLayoutManager {
* @param bodyType Indicates what kind of body is being processed (BODY, HEADER or FOOTER)
* @param returnList List to received the generated elements
*/
- private void createElementsForRowGroup(LayoutContext context, int alignment,
+ private void createElementsForRowGroup(LayoutContext context, int alignment,
int bodyType, LinkedList returnList) {
log.debug("Handling row group with " + rowGroup.length + " rows...");
EffRow row;
@@ -113,7 +113,7 @@ class RowGroupLayoutManager {
LayoutContext childLC = new LayoutContext(0);
childLC.setStackLimitBP(context.getStackLimitBP()); //necessary?
childLC.setRefIPD(spanWidth);
-
+
//Get the element list for the cell contents
List elems = primary.getCellLM().getNextKnuthElements(
childLC, alignment);
@@ -131,7 +131,7 @@ class RowGroupLayoutManager {
/**
* Calculate the heights of the rows in the row group, see CSS21, 17.5.3 Table height
* algorithms.
- *
+ *
* TODO this method will need to be adapted once clarification has been made by the
* W3C regarding whether borders or border-separation must be included or not
*/
@@ -174,7 +174,7 @@ class RowGroupLayoutManager {
int borderWidths = primary.getBeforeAfterBorderWidth();
int padding = 0;
CommonBorderPaddingBackground cbpb = primary.getCell()
- .getCommonBorderPaddingBackground();
+ .getCommonBorderPaddingBackground();
padding += cbpb.getPaddingBefore(false, primary.getCellLM());
padding += cbpb.getPaddingAfter(false, primary.getCellLM());
int effRowHeight = effectiveCellBPD + padding + borderWidths;
@@ -195,13 +195,13 @@ class RowGroupLayoutManager {
// if (maxCellBPD > row.getExplicitHeight().max) {
//old:
// log.warn(FONode.decorateWithContextInfo(
-// "The contents of row " + (row.getIndex() + 1)
+// "The contents of row " + (row.getIndex() + 1)
// + " are taller than they should be (there is a"
// + " block-progression-dimension or height constraint
// + " on the indicated row)."
// + " Due to its contents the row grows"
// + " to " + maxCellBPD + " millipoints, but the row shouldn't get"
-// + " any taller than " + row.getExplicitHeight() + " millipoints.",
+// + " any taller than " + row.getExplicitHeight() + " millipoints.",
// row.getTableRow()));
//new (with events):
// BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Factory.create(
diff --git a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
index 38f1a7b30..b2851c39f 100644
--- a/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
+++ b/src/java/org/apache/fop/layoutmgr/table/RowPainter.java
@@ -107,7 +107,7 @@ class RowPainter {
/**
* Signals that the end of the current table part is reached.
- *
+ *
* @param lastInBody true if the part is the last table-body element to be displayed
* on the current page. In which case all the cells must be flushed even if they
* aren't finished, plus the proper collapsed borders must be selected (trailing
@@ -118,7 +118,7 @@ class RowPainter {
*/
void endTablePart(boolean lastInBody, boolean lastOnPage) {
addAreasAndFlushRow(lastInBody, lastOnPage);
-
+
if (tablePartBackground != null) {
TableLayoutManager tableLM = tclm.getTableLM();
for (Iterator iter = tablePartBackgroundAreas.iterator(); iter.hasNext();) {
@@ -139,7 +139,7 @@ class RowPainter {
/**
* Records the fragment of row represented by the given position. If it belongs to
* another (grid) row than the current one, that latter is painted and flushed first.
- *
+ *
* @param tcpos a position representing the row fragment
*/
void handleTableContentPosition(TableContentPosition tcpos) {
@@ -173,7 +173,7 @@ class RowPainter {
firstCellParts[colIndex] = cellPart;
cellHeights[colIndex] = cellPart.getBorderPaddingBefore(firstCellOnPage[colIndex]);
} else {
- assert firstCellParts[colIndex].pgu == cellPart.pgu;
+ assert firstCellParts[colIndex].pgu == cellPart.pgu;
cellHeights[colIndex] += cellPart.getConditionalBeforeContentLength();
}
cellHeights[colIndex] += cellPart.getLength();
@@ -185,7 +185,7 @@ class RowPainter {
* Creates the areas corresponding to the last row. That is, an area with background
* for the row, plus areas for all the cells that finish on the row (not spanning over
* further rows).
- *
+ *
* @param lastInPart true if the row is the last from its table part to be displayed
* on the current page. In which case all the cells must be flushed even if they
* aren't finished, plus the proper collapsed borders must be selected (trailing
@@ -204,7 +204,7 @@ class RowPainter {
// Need to compute the actual row height first
int actualRowHeight = 0;
for (int i = 0; i < colCount; i++) {
- GridUnit currentGU = currentRow.getGridUnit(i);
+ GridUnit currentGU = currentRow.getGridUnit(i);
if (!currentGU.isEmpty() && currentGU.getColSpanIndex() == 0
&& (lastInPart || currentGU.isLastGridUnitRowSpan())
&& firstCellParts[i] != null) {
@@ -396,7 +396,7 @@ class RowPainter {
* set when the areas for the cell are created since at that moment this bpd is yet
* unknown. So they will instead be set in
* {@link #addAreasAndFlushRow(boolean, boolean)}.
- *
+ *
* @param backgroundArea the block of the cell's dimensions that will hold the part
* background
*/
@@ -407,7 +407,7 @@ class RowPainter {
/**
* Records the y-offset of the row with the given index.
- *
+ *
* @param rowIndex index of the row
* @param offset y-offset of the row on the page
*/
@@ -419,7 +419,7 @@ class RowPainter {
* considered as finished, since it contains no cell ending on this row. Thus no
* TableContentPosition will be created for this row. Thus its index will never be
* recorded by the #handleTableContentPosition method.
- *
+ *
* The offset of such a row is the same as the next non-empty row. It's needed
* to correctly offset blocks for cells starting on this row. Hence the loop
* below.
@@ -431,7 +431,7 @@ class RowPainter {
/**
* Returns the offset of the row with the given index.
- *
+ *
* @param rowIndex index of the row
* @return its y-offset on the page
*/
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
index c20060723..4cf68b97b 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableAndCaptionLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.table;
import org.apache.fop.area.Area;
@@ -55,7 +55,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
public TableAndCaption getTableAndCaptionFO() {
return (TableAndCaption)this.fobj;
}
-
+
/**
* Get the next break possibility.
*
@@ -199,7 +199,7 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
curBlockArea.addBlock((Block) childArea);
}
}
-
+
/** {@inheritDoc} */
public int getKeepTogetherStrength() {
int strength = KEEP_AUTO;
@@ -209,8 +209,8 @@ public class TableAndCaptionLayoutManager extends BlockStackingLayoutManager {
*/
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
- }
-
+ }
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
index 615145fa1..071082624 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCaptionLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr.table;
import org.apache.fop.area.Area;
@@ -50,7 +50,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
public TableCaption getTableCaptionFO() {
return (TableCaption)this.fobj;
}
-
+
/**
* Get the next break position for the caption.
*
@@ -195,7 +195,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
curBlockArea.addBlock((Block) childArea);
}
}
-
+
/** {@inheritDoc} */
public int getKeepTogetherStrength() {
int strength = KEEP_AUTO;
@@ -208,7 +208,7 @@ public class TableCaptionLayoutManager extends BlockStackingLayoutManager {
strength = Math.max(strength, getParentKeepTogetherStrength());
return strength;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
diff --git a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
index 52915c008..ba5e232e9 100644
--- a/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/table/TableCellLayoutManager.java
@@ -5,9 +5,9 @@
* 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.
@@ -240,7 +240,7 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
/**
* Sets the total height of this cell on the current page. That is, the cell's bpd
* plus before and after borders and paddings, plus the table's border-separation.
- *
+ *
* @param h the height of cell
*/
public void setTotalHeight(int h) {
@@ -250,12 +250,12 @@ public class TableCellLayoutManager extends BlockStackingLayoutManager
/**
* Add the areas for the break points. The cell contains block stacking layout
* managers that add block areas.
- *
+ *
*
@@ -61,7 +61,7 @@ public class PDFFilterList { public PDFFilterList() { //nop } - + /** * Use this descriptor if you want to have ASCII filters (such as ASCIIHex * and ASCII85) ignored, for example, when encryption is active. @@ -78,7 +78,7 @@ public class PDFFilterList { public void setDisableAllFilters(boolean value) { this.disableAllFilters = value; } - + /** * Returns true if all filters are disabled. * @return true if all filters are disabled @@ -86,7 +86,7 @@ public class PDFFilterList { public boolean isDisableAllFilters() { return this.disableAllFilters; } - + /** * Indicates whether the filter list is already initialized. * @return true if more there are filters present @@ -111,7 +111,7 @@ public class PDFFilterList { filters.add(filter); } } - + /** * Add a filter for compression of the stream by name. * @param filterType name of the filter to add @@ -211,7 +211,7 @@ public class PDFFilterList { int nonNullParams = populateNamesAndParms(names, parms); // now build up the filter entries for the dictionary - return buildFilterEntries(names) + return buildFilterEntries(names) + (nonNullParams > 0 ? buildDecodeParms(parms) : ""); } return ""; @@ -238,7 +238,7 @@ public class PDFFilterList { putDecodeParams(dict, parms); } } - + private int populateNamesAndParms(List names, List parms) { // run the filters int nonNullParams = 0; @@ -247,7 +247,7 @@ public class PDFFilterList { // place the names in our local vector in reverse order if (filter.getName().length() > 0) { names.add(0, filter.getName()); - PDFObject param = filter.getDecodeParms(); + PDFObject param = filter.getDecodeParms(); if (param != null) { parms.add(0, param); nonNullParams++; @@ -297,7 +297,7 @@ public class PDFFilterList { } } } - + private String buildDecodeParms(List parms) { StringBuffer sb = new StringBuffer(); boolean needParmsEntry = false; @@ -346,9 +346,9 @@ public class PDFFilterList { } } } - + /** - * Applies all registered filters as necessary. The method returns an + * Applies all registered filters as necessary. The method returns an * OutputStream which will receive the filtered contents. * @param stream raw data output stream * @return OutputStream filtered output stream diff --git a/src/java/org/apache/fop/pdf/PDFFont.java b/src/java/org/apache/fop/pdf/PDFFont.java index 1f76f1e11..6ba6ab9a2 100644 --- a/src/java/org/apache/fop/pdf/PDFFont.java +++ b/src/java/org/apache/fop/pdf/PDFFont.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -37,7 +37,7 @@ public class PDFFont extends PDFDictionary { /** Internal F-number for each font (it is not written to the font dict) */ private String fontname; - + /** * create the /Font object * @@ -74,7 +74,7 @@ public class PDFFont extends PDFDictionary { put("Encoding", new PDFName(encoding)); } } - + /** * Sets the Encoding value of the font. * @param encoding the encoding @@ -84,7 +84,7 @@ public class PDFFont extends PDFDictionary { put("Encoding", encoding); } } - + /** * factory method with the basic parameters * @@ -122,7 +122,7 @@ public class PDFFont extends PDFDictionary { public String getName() { return this.fontname; } - + /** * Returns the name of the BaseFont. * @return the BaseFont @@ -158,7 +158,7 @@ public class PDFFont extends PDFDictionary { protected void validate() { if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) { if (this.getClass() == PDFFont.class) { - throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + ", all fonts, even the base 14" + " fonts, have to be embedded! Offending font: " + getBaseFont()); } @@ -170,5 +170,5 @@ public class PDFFont extends PDFDictionary { validate(); return super.output(stream); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java index aa40bc35b..d4b412e4c 100644 --- a/src/java/org/apache/fop/pdf/PDFFontDescriptor.java +++ b/src/java/org/apache/fop/pdf/PDFFontDescriptor.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -59,16 +59,16 @@ public class PDFFontDescriptor extends PDFDictionary { /** * Set the optional metrics. - * @param avgWidth The average width of characters in this font. + * @param avgWidth The average width of characters in this font. * The default value is 0. - * @param maxWidth The maximum width of characters in this font. + * @param maxWidth The maximum width of characters in this font. * The default value is 0. * @param missingWidth missing width - * @param leading the desired spacing between lines of text. + * @param leading the desired spacing between lines of text. * The default value is 0. - * @param stemH The vertical width of the dominant horizontal stems of + * @param stemH The vertical width of the dominant horizontal stems of * glyphs in the font. The default value is 0. - * @param xHeight The y-coordinate of the top of flat non-ascending + * @param xHeight The y-coordinate of the top of flat non-ascending * lowercase letters, measured from the baseline. The default value is 0. */ public void setMetrics(int avgWidth, int maxWidth, int missingWidth, @@ -119,7 +119,7 @@ public class PDFFontDescriptor extends PDFDictionary { } return stream; } - + /** * Sets the CIDSet stream for this font descriptor. (Optional) * @param cidSet the CIDSet stream @@ -127,19 +127,19 @@ public class PDFFontDescriptor extends PDFDictionary { public void setCIDSet(AbstractPDFStream cidSet) { put("CIDSet", cidSet); } - + /** @return the CIDSet stream or null if not applicable */ public AbstractPDFStream getCIDSet() { return (AbstractPDFStream)get("CIDSet"); } - + /** * {@inheritDoc} */ /* public String toPDFString() { StringBuffer p = new StringBuffer(128); - p.append(getObjectID() + p.append(getObjectID() + "<< /Type /FontDescriptor" + "\n/FontName /" + this.basefont); diff --git a/src/java/org/apache/fop/pdf/PDFFontNonBase14.java b/src/java/org/apache/fop/pdf/PDFFontNonBase14.java index b97d5deec..9b6cef618 100644 --- a/src/java/org/apache/fop/pdf/PDFFontNonBase14.java +++ b/src/java/org/apache/fop/pdf/PDFFontNonBase14.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -70,7 +70,7 @@ public abstract class PDFFontNonBase14 extends PDFFont { public PDFFontDescriptor getDescriptor() { return (PDFFontDescriptor)get("FontDescriptor"); } - + /** * Sets a ToUnicode CMap. * @param cmap the ToUnicode character map @@ -78,15 +78,15 @@ public abstract class PDFFontNonBase14 extends PDFFont { public void setToUnicode(PDFCMap cmap) { put("ToUnicode", cmap); } - + /** {@inheritDoc} */ protected void validate() { if (getDocumentSafely().getProfile().isFontEmbeddingRequired()) { if (this.getDescriptor().getFontFile() == null) { - throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + throw new PDFConformanceException("For " + getDocumentSafely().getProfile() + ", all fonts have to be embedded!"); } } } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFontTrueType.java b/src/java/org/apache/fop/pdf/PDFFontTrueType.java index a5636f951..99c9f1c1f 100644 --- a/src/java/org/apache/fop/pdf/PDFFontTrueType.java +++ b/src/java/org/apache/fop/pdf/PDFFontTrueType.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -36,7 +36,7 @@ public class PDFFontTrueType extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontTrueType(String fontname, + public PDFFontTrueType(String fontname, String basefont, Object encoding) { super(fontname, FontType.TRUETYPE, basefont, encoding); diff --git a/src/java/org/apache/fop/pdf/PDFFontType0.java b/src/java/org/apache/fop/pdf/PDFFontType0.java index 29d6d1b4f..2f5e037f3 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType0.java +++ b/src/java/org/apache/fop/pdf/PDFFontType0.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -35,7 +35,7 @@ public class PDFFontType0 extends PDFFont { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType0(String fontname, + public PDFFontType0(String fontname, String basefont, Object encoding) { super(fontname, FontType.TYPE0, basefont, encoding); @@ -49,9 +49,9 @@ public class PDFFontType0 extends PDFFont { * @param encoding the character encoding schema used by the font * @param descendantFonts the CIDFont upon which this font is based */ - public PDFFontType0(String fontname, + public PDFFontType0(String fontname, String basefont, - Object encoding, + Object encoding, PDFCIDFont descendantFonts) { super(fontname, FontType.TYPE0, basefont, encoding); diff --git a/src/java/org/apache/fop/pdf/PDFFontType1.java b/src/java/org/apache/fop/pdf/PDFFontType1.java index 8c9a7dc4d..884cb3e30 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType1.java +++ b/src/java/org/apache/fop/pdf/PDFFontType1.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -40,7 +40,7 @@ public class PDFFontType1 extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType1(String fontname, + public PDFFontType1(String fontname, String basefont, Object encoding) { diff --git a/src/java/org/apache/fop/pdf/PDFFontType3.java b/src/java/org/apache/fop/pdf/PDFFontType3.java index 96ecb6b5a..03d5469ea 100644 --- a/src/java/org/apache/fop/pdf/PDFFontType3.java +++ b/src/java/org/apache/fop/pdf/PDFFontType3.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import org.apache.fop.fonts.FontType; @@ -38,7 +38,7 @@ public class PDFFontType3 extends PDFFontNonBase14 { * @param basefont the base font name * @param encoding the character encoding schema used by the font */ - public PDFFontType3(String fontname, + public PDFFontType3(String fontname, String basefont, Object encoding) { super(fontname, FontType.TYPE3, basefont, encoding); @@ -54,7 +54,7 @@ public class PDFFontType3 extends PDFFontNonBase14 { * @param fontMatrix the font's transformation matrix * @param charProcs the glyphs' definitions */ - public PDFFontType3(String fontname, + public PDFFontType3(String fontname, String basefont, Object encoding, PDFRectangle fontBBox, PDFArray fontMatrix, diff --git a/src/java/org/apache/fop/pdf/PDFFormXObject.java b/src/java/org/apache/fop/pdf/PDFFormXObject.java index 6ccf76c6c..5ede9b487 100644 --- a/src/java/org/apache/fop/pdf/PDFFormXObject.java +++ b/src/java/org/apache/fop/pdf/PDFFormXObject.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -32,7 +32,7 @@ import java.io.OutputStream; * dictionary but a stream of image data. */ public class PDFFormXObject extends PDFXObject { - + private PDFStream contents; private PDFReference resRef; @@ -49,7 +49,7 @@ public class PDFFormXObject extends PDFXObject { put("Name", new PDFName("Form" + xnumber)); this.resRef = resources; this.contents = contents; - + put("Type", new PDFName("XObject")); put("Subtype", new PDFName("Form")); put("FormType", new Integer(1)); @@ -76,7 +76,7 @@ public class PDFFormXObject extends PDFXObject { array.set(3, bbox.getHeight()); } } - + /** * Returns the bounding box. * @return the BBox value @@ -95,7 +95,7 @@ public class PDFFormXObject extends PDFXObject { return null; } } - + /** * Sets the Matrix value * @param at the AffineTransform defining the transformation matrix @@ -122,7 +122,7 @@ public class PDFFormXObject extends PDFXObject { array.set(5, m[5]); } } - + /** * Returns the Matrix value. * @return the Matrix @@ -143,7 +143,7 @@ public class PDFFormXObject extends PDFXObject { return null; } } - + /** * Used to set the contents of the PDF stream. * @param data the contents as a byte array @@ -161,7 +161,7 @@ public class PDFFormXObject extends PDFXObject { /** {@inheritDoc} */ protected int output(OutputStream stream) throws IOException { final int len = super.output(stream); - + //Now that the data has been written, it can be discarded. this.contents = null; return len; @@ -175,6 +175,6 @@ public class PDFFormXObject extends PDFXObject { put("Resources", resRef); super.populateStreamDict(lengthEntry); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFFunction.java b/src/java/org/apache/fop/pdf/PDFFunction.java index fdf419a2b..14cc318ba 100644 --- a/src/java/org/apache/fop/pdf/PDFFunction.java +++ b/src/java/org/apache/fop/pdf/PDFFunction.java @@ -5,9 +5,9 @@ * 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. diff --git a/src/java/org/apache/fop/pdf/PDFGState.java b/src/java/org/apache/fop/pdf/PDFGState.java index 03608994d..93151149b 100644 --- a/src/java/org/apache/fop/pdf/PDFGState.java +++ b/src/java/org/apache/fop/pdf/PDFGState.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.Map; @@ -81,7 +81,7 @@ public class PDFGState extends PDFObject { public static final String GSTATE_ALPHA_SOURCE_FLAG = "AIS"; /** Text Knockout Flag (TK, PDF 1.4) */ public static final String GSTATE_TEXT_KNOCKOUT = "TK"; - + /** Default GState object */ public static final PDFGState DEFAULT; @@ -99,7 +99,7 @@ public class PDFGState extends PDFObject { vals.put(op, Boolean.FALSE); vals.put(OPM, new Integer(1)); vals.put(Font, "");*/ - + vals.put(GSTATE_ALPHA_STROKE, new Float(1.0)); vals.put(GSTATE_ALPHA_NONSTROKE, new Float(1.0)); } @@ -117,7 +117,7 @@ public class PDFGState extends PDFObject { /** * Sets the alpha value. * @param val alpha value (0.0 - 1.0) - * @param fill True if alpha should be set for non-stroking operations, + * @param fill True if alpha should be set for non-stroking operations, * False if for stroking operations */ public void setAlpha(float val, boolean fill) { diff --git a/src/java/org/apache/fop/pdf/PDFGoTo.java b/src/java/org/apache/fop/pdf/PDFGoTo.java index ae35928d2..b3ff6bcdc 100644 --- a/src/java/org/apache/fop/pdf/PDFGoTo.java +++ b/src/java/org/apache/fop/pdf/PDFGoTo.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.geom.Point2D; @@ -128,7 +128,7 @@ public class PDFGoTo extends PDFAction { } else { dest = "/D [" + this.pageReference + " " + destination + "]\n"; } - return getObjectID() + return getObjectID() + "<< /Type /Action\n/S /GoTo\n" + dest + ">>\nendobj\n"; } diff --git a/src/java/org/apache/fop/pdf/PDFGoToRemote.java b/src/java/org/apache/fop/pdf/PDFGoToRemote.java index 2cd937df3..e04a1668f 100644 --- a/src/java/org/apache/fop/pdf/PDFGoToRemote.java +++ b/src/java/org/apache/fop/pdf/PDFGoToRemote.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java index e0cac0746..66753f37f 100644 --- a/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java +++ b/src/java/org/apache/fop/pdf/PDFICCBasedColorSpace.java @@ -33,7 +33,7 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { private PDFICCStream iccStream; private String explicitName; - + /** * Constructs a the ICCBased color space with an explicit name (ex. "DefaultRGB"). * @param explicitName an explicit name or null if a name should be generated @@ -43,7 +43,7 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { this.explicitName = explicitName; this.iccStream = iccStream; } - + /** * Constructs a the ICCBased color space. * @param iccStream the ICC stream to associate with this color space @@ -51,12 +51,12 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { public PDFICCBasedColorSpace(PDFICCStream iccStream) { this(null, iccStream); } - + /** @return the ICC stream associated with this color space */ public PDFICCStream getICCStream() { return this.iccStream; } - + /** {@inheritDoc} */ public int getNumComponents() { return iccStream.getICCProfile().getNumComponents(); @@ -151,5 +151,5 @@ public class PDFICCBasedColorSpace extends PDFObject implements PDFColorSpace { sRGBProfile.setColorSpace(profile, null); return sRGBProfile; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFICCStream.java b/src/java/org/apache/fop/pdf/PDFICCStream.java index f242c0cae..b70ed017a 100644 --- a/src/java/org/apache/fop/pdf/PDFICCStream.java +++ b/src/java/org/apache/fop/pdf/PDFICCStream.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.color.ICC_Profile; @@ -27,7 +27,7 @@ import java.io.OutputStream; * Special PDFStream for ICC profiles (color profiles). */ public class PDFICCStream extends PDFStream { - + private ICC_Profile cp; private PDFDeviceColorSpace pdfColorSpace; @@ -53,7 +53,7 @@ public class PDFICCStream extends PDFStream { public ICC_Profile getICCProfile() { return this.cp; } - + /** * overload the base object method so we don't have to copy * byte arrays around so much @@ -65,12 +65,12 @@ public class PDFICCStream extends PDFStream { this.cp = null; //Free ICC stream when it's not used anymore return length; } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { cp.write(out); } - + /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { put("N", cp.getNumComponents()); diff --git a/src/java/org/apache/fop/pdf/PDFImage.java b/src/java/org/apache/fop/pdf/PDFImage.java index e0aaa44fa..e2b9e521c 100644 --- a/src/java/org/apache/fop/pdf/PDFImage.java +++ b/src/java/org/apache/fop/pdf/PDFImage.java @@ -5,9 +5,9 @@ * 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. @@ -111,14 +111,14 @@ public interface PDFImage { /** @return true for CMYK images generated by Adobe Photoshop */ boolean isInverted(); - + /** * Get the PDF Filter to be applied to the image. * * @return the PDF Filter or null */ PDFFilter getPDFFilter(); - + // get the image bytes, and bytes properties /** @@ -132,11 +132,11 @@ public interface PDFImage { /** * Populates the XObject's dictionary with additional values. The values are added to the * dictionary after all the values obtained from other methods from this interface have - * been put into the dictionary. That allows to override certain values. + * been put into the dictionary. That allows to override certain values. * @param dict the dictionary to fill */ void populateXObjectDictionary(PDFDictionary dict); - + /** * Get the ICC stream for this image. * diff --git a/src/java/org/apache/fop/pdf/PDFImageXObject.java b/src/java/org/apache/fop/pdf/PDFImageXObject.java index 14fbeed4d..7104422e7 100644 --- a/src/java/org/apache/fop/pdf/PDFImageXObject.java +++ b/src/java/org/apache/fop/pdf/PDFImageXObject.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -37,7 +37,7 @@ import java.io.OutputStream; * document in another place. */ public class PDFImageXObject extends PDFXObject { - + private PDFImage pdfimage; /** @@ -63,7 +63,7 @@ public class PDFImageXObject extends PDFXObject { */ protected int output(OutputStream stream) throws IOException { int length = super.output(stream); - + // let it gc // this object is retained as a reference to inserting // the same image but the image data is no longer needed @@ -80,7 +80,7 @@ public class PDFImageXObject extends PDFXObject { populateDictionaryFromImage(); } } - + private void populateDictionaryFromPS() { getDocumentSafely().getProfile().verifyPSXObjectsAllowed(); put("Subtype", new PDFName("PS")); @@ -139,7 +139,7 @@ public class PDFImageXObject extends PDFXObject { //Important: do this at the end so previous values can be overwritten. pdfimage.populateXObjectDictionary(this); } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { pdfimage.outputContents(out); @@ -157,7 +157,7 @@ public class PDFImageXObject extends PDFXObject { getFilterList().ensureFilterInPlace(pdfFilter); } } - + /** * This sets up the default filters for XObjects. It uses the PDFImage * instance to determine what default filters to apply. @@ -166,11 +166,11 @@ public class PDFImageXObject extends PDFXObject { protected void setupFilterList() { if (!getFilterList().isInitialized()) { getFilterList().addDefaultFilters( - getDocumentSafely().getFilterMap(), + getDocumentSafely().getFilterMap(), pdfimage.getFilterHint()); } super.setupFilterList(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFInfo.java b/src/java/org/apache/fop/pdf/PDFInfo.java index 888fdb2c6..14937bfd7 100644 --- a/src/java/org/apache/fop/pdf/PDFInfo.java +++ b/src/java/org/apache/fop/pdf/PDFInfo.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.Date; @@ -50,7 +50,7 @@ public class PDFInfo extends PDFObject { public String getProducer() { return this.producer; } - + /** * set the producer string * @@ -64,7 +64,7 @@ public class PDFInfo extends PDFObject { public String getCreator() { return this.creator; } - + /** * set the creator string * @@ -92,7 +92,7 @@ public class PDFInfo extends PDFObject { public String getAuthor() { return this.author; } - + /** * set the author string * @@ -106,7 +106,7 @@ public class PDFInfo extends PDFObject { public String getSubject() { return this.subject; } - + /** * set the subject string * @@ -120,7 +120,7 @@ public class PDFInfo extends PDFObject { public String getKeywords() { return this.keywords; } - + /** * set the keywords string * @@ -162,7 +162,7 @@ public class PDFInfo extends PDFObject { * {@inheritDoc} */ public byte[] toPDF() { - PDFProfile profile = getDocumentSafely().getProfile(); + PDFProfile profile = getDocumentSafely().getProfile(); ByteArrayOutputStream bout = new ByteArrayOutputStream(128); try { bout.write(encode(getObjectID())); @@ -189,17 +189,17 @@ public class PDFInfo extends PDFObject { bout.write(encodeText(this.keywords)); bout.write(encode("\n")); } - + if (creator != null) { bout.write(encode("/Creator ")); bout.write(encodeText(this.creator)); bout.write(encode("\n")); } - + bout.write(encode("/Producer ")); bout.write(encodeText(this.producer)); bout.write(encode("\n")); - + // creation date in form (D:YYYYMMDDHHmmSSOHH'mm') if (creationDate == null) { creationDate = new Date(); @@ -207,7 +207,7 @@ public class PDFInfo extends PDFObject { bout.write(encode("/CreationDate ")); bout.write(encodeString(formatDateTime(creationDate))); bout.write(encode("\n")); - + if (profile.isModDateRequired() && this.modDate == null) { this.modDate = this.creationDate; } @@ -224,7 +224,7 @@ public class PDFInfo extends PDFObject { if (profile.isTrappedEntryRequired()) { bout.write(encode("/Trapped /False\n")); } - + bout.write(encode(">>\nendobj\n")); } catch (IOException ioe) { log.error("Ignored I/O exception", ioe); diff --git a/src/java/org/apache/fop/pdf/PDFInternalLink.java b/src/java/org/apache/fop/pdf/PDFInternalLink.java index fcdc2e1bc..faa6070a1 100644 --- a/src/java/org/apache/fop/pdf/PDFInternalLink.java +++ b/src/java/org/apache/fop/pdf/PDFInternalLink.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFLink.java b/src/java/org/apache/fop/pdf/PDFLink.java index fb8544f6b..a7c4c6548 100644 --- a/src/java/org/apache/fop/pdf/PDFLink.java +++ b/src/java/org/apache/fop/pdf/PDFLink.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java diff --git a/src/java/org/apache/fop/pdf/PDFMetadata.java b/src/java/org/apache/fop/pdf/PDFMetadata.java index e0833a30f..6d15a67d4 100644 --- a/src/java/org/apache/fop/pdf/PDFMetadata.java +++ b/src/java/org/apache/fop/pdf/PDFMetadata.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -43,7 +43,7 @@ import org.apache.xmlgraphics.xmp.schemas.pdf.PDFAXMPSchema; * @since PDF 1.4 */ public class PDFMetadata extends PDFStream { - + private Metadata xmpMetadata; private boolean readOnly = true; @@ -62,7 +62,7 @@ public class PDFMetadata extends PDFStream { protected void setupFilterList() { if (!getFilterList().isInitialized()) { getFilterList().addDefaultFilters( - getDocumentSafely().getFilterMap(), + getDocumentSafely().getFilterMap(), PDFFilterList.METADATA_FILTER); } super.setupFilterList(); @@ -74,7 +74,7 @@ public class PDFMetadata extends PDFStream { public Metadata getMetadata() { return this.xmpMetadata; } - + /** * overload the base object method so we don't have to copy * byte arrays around so much @@ -86,24 +86,24 @@ public class PDFMetadata extends PDFStream { this.xmpMetadata = null; //Release DOM when it's not used anymore return length; } - + /** {@inheritDoc} */ protected void outputRawStreamData(OutputStream out) throws IOException { try { XMPSerializer.writeXMPPacket(xmpMetadata, out, this.readOnly); } catch (TransformerConfigurationException tce) { - throw new IOException("Error setting up Transformer for XMP stream serialization: " + throw new IOException("Error setting up Transformer for XMP stream serialization: " + tce.getMessage()); } catch (SAXException saxe) { - throw new IOException("Error while serializing XMP stream: " + throw new IOException("Error while serializing XMP stream: " + saxe.getMessage()); } } - + /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { final String filterEntry = getFilterList().buildFilterDictEntries(); - if (getDocumentSafely().getProfile().getPDFAMode().isPDFA1LevelB() + if (getDocumentSafely().getProfile().getPDFAMode().isPDFA1LevelB() && filterEntry != null && filterEntry.length() > 0) { throw new PDFConformanceException( "The Filter key is prohibited when PDF/A-1 is active"); @@ -112,7 +112,7 @@ public class PDFMetadata extends PDFStream { put("Subtype", new PDFName("XML")); super.populateStreamDict(lengthEntry); } - + /** * Creates an XMP document based on the settings on the PDF Document. * @param pdfDoc the PDF Document @@ -120,7 +120,7 @@ public class PDFMetadata extends PDFStream { */ public static Metadata createXMPFromPDFDocument(PDFDocument pdfDoc) { Metadata meta = new Metadata(); - + PDFInfo info = pdfDoc.getInfo(); PDFRoot root = pdfDoc.getRoot(); @@ -129,7 +129,7 @@ public class PDFMetadata extends PDFStream { Date d = new Date(); info.setCreationDate(d); } - + //Important: Acrobat 7's preflight check for PDF/A-1b wants the creation date in the Info //object and in the XMP metadata to have the same timezone or else it shows a validation //error even if the times are essentially equal. @@ -153,7 +153,7 @@ public class PDFMetadata extends PDFStream { dc.addDate(info.getCreationDate()); //PDF/A identification - PDFAMode pdfaMode = pdfDoc.getProfile().getPDFAMode(); + PDFAMode pdfaMode = pdfDoc.getProfile().getPDFAMode(); if (pdfaMode.isPDFA1LevelB()) { PDFAAdapter pdfa = PDFAXMPSchema.getAdapter(meta); pdfa.setPart(1); @@ -163,7 +163,7 @@ public class PDFMetadata extends PDFStream { pdfa.setConformance("B"); //PDF/A-1b } } - + //XMP Basic Schema XMPBasicAdapter xmpBasic = XMPBasicSchema.getAdapter(meta); xmpBasic.setCreateDate(info.getCreationDate()); @@ -186,8 +186,8 @@ public class PDFMetadata extends PDFStream { adobePDF.setProducer(info.getProducer()); } adobePDF.setPDFVersion(pdfDoc.getPDFVersionString()); - - + + return meta; } @@ -206,14 +206,14 @@ public class PDFMetadata extends PDFStream { } else { info.setAuthor(null); } - + //dc:description["x-default"] maps to Subject as per ISO-19005-1:2005/Cor.1:2007 info.setSubject(dc.getDescription()); - + AdobePDFAdapter pdf = AdobePDFSchema.getAdapter(meta); info.setKeywords(pdf.getKeywords()); info.setProducer(pdf.getProducer()); - + XMPBasicAdapter xmpBasic = XMPBasicSchema.getAdapter(meta); info.setCreator(xmpBasic.getCreatorTool()); Date d; diff --git a/src/java/org/apache/fop/pdf/PDFName.java b/src/java/org/apache/fop/pdf/PDFName.java index 26d449591..6dabc3ac4 100644 --- a/src/java/org/apache/fop/pdf/PDFName.java +++ b/src/java/org/apache/fop/pdf/PDFName.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -29,9 +29,9 @@ import org.apache.commons.io.output.CountingOutputStream; * Class representing a PDF name object. */ public class PDFName extends PDFObject { - + private String name; - + /** * Creates a new PDF name object. * @param name the name value @@ -58,8 +58,8 @@ public class PDFName extends PDFObject { } return sb.toString(); } - - private static final char[] DIGITS + + private static final char[] DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; @@ -71,7 +71,7 @@ public class PDFName extends PDFObject { sb.append(DIGITS[ch >>> 4 & 0x0F]); sb.append(DIGITS[ch & 0x0F]); } - + /** {@inheritDoc} */ public String toString() { return this.name; @@ -86,15 +86,15 @@ public class PDFName extends PDFObject { } writer.write(toString()); - + if (hasObjectNumber()) { writer.write("\nendobj\n"); } - + writer.flush(); return cout.getCount(); } - + /** {@inheritDoc} */ public void outputInline(OutputStream out, Writer writer) throws IOException { if (hasObjectNumber()) { @@ -103,5 +103,5 @@ public class PDFName extends PDFObject { writer.write(toString()); } } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNameTreeNode.java b/src/java/org/apache/fop/pdf/PDFNameTreeNode.java index 4dcf0e03e..4bc00ef9c 100644 --- a/src/java/org/apache/fop/pdf/PDFNameTreeNode.java +++ b/src/java/org/apache/fop/pdf/PDFNameTreeNode.java @@ -43,7 +43,7 @@ public class PDFNameTreeNode extends PDFDictionary { public void setKids(PDFArray kids) { put(KIDS, kids); } - + /** * Returns the Kids array. * @return the Kids array @@ -51,7 +51,7 @@ public class PDFNameTreeNode extends PDFDictionary { public PDFArray getKids() { return (PDFArray)get(KIDS); } - + /** * Sets the Names array. * @param names the Names array @@ -59,7 +59,7 @@ public class PDFNameTreeNode extends PDFDictionary { public void setNames(PDFArray names) { put(NAMES, names); } - + /** * Returns the Names array. * @return the Names array @@ -67,7 +67,7 @@ public class PDFNameTreeNode extends PDFDictionary { public PDFArray getNames() { return (PDFArray)get(NAMES); } - + /** * Sets the lower limit value of the Limits array. * @param key the lower limit value @@ -116,6 +116,6 @@ public class PDFNameTreeNode extends PDFDictionary { } return limits; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNames.java b/src/java/org/apache/fop/pdf/PDFNames.java index d2d895771..4253dd6d1 100644 --- a/src/java/org/apache/fop/pdf/PDFNames.java +++ b/src/java/org/apache/fop/pdf/PDFNames.java @@ -5,9 +5,9 @@ * 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. @@ -16,14 +16,14 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** * Class representing a PDF Names object */ public class PDFNames extends PDFDictionary { - + /** * Create the Names object */ @@ -39,7 +39,7 @@ public class PDFNames extends PDFDictionary { public PDFDests getDests() { return (PDFDests)get("Dests"); } - + /** * Set the Dests object * @param dests the Dests object @@ -47,5 +47,5 @@ public class PDFNames extends PDFDictionary { public void setDests(PDFDests dests) { put("Dests", dests); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNull.java b/src/java/org/apache/fop/pdf/PDFNull.java index b1af30dc0..01ec7898c 100644 --- a/src/java/org/apache/fop/pdf/PDFNull.java +++ b/src/java/org/apache/fop/pdf/PDFNull.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -27,10 +27,10 @@ import java.io.Writer; * Class representing a PDF name object. */ public final class PDFNull implements PDFWritable { - + /** Instance for the "null" object. */ public static final PDFNull INSTANCE = new PDFNull(); - + /** * Creates a new PDF name object. * @param name the name value @@ -42,10 +42,10 @@ public final class PDFNull implements PDFWritable { public String toString() { return "null"; } - + /** {@inheritDoc} */ public void outputInline(OutputStream out, Writer writer) throws IOException { writer.write(toString()); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNumber.java b/src/java/org/apache/fop/pdf/PDFNumber.java index 2a8d6c472..55834f529 100644 --- a/src/java/org/apache/fop/pdf/PDFNumber.java +++ b/src/java/org/apache/fop/pdf/PDFNumber.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.text.DecimalFormat; @@ -24,7 +24,7 @@ import java.text.DecimalFormatSymbols; import java.util.Locale; /** - * This class represents a simple number object. It also contains contains some + * This class represents a simple number object. It also contains contains some * utility methods for outputing numbers to PDF. */ public class PDFNumber extends PDFObject { @@ -38,7 +38,7 @@ public class PDFNumber extends PDFObject { public Number getNumber() { return this.number; } - + /** * Sets the number. * @param number the number @@ -69,9 +69,9 @@ public class PDFNumber extends PDFObject { // Static cache. Possible concurrency implications. See comment in doubleOut(double, int). private static DecimalFormat[] decimalFormatCache = new DecimalFormat[17]; - + private static final String BASE_FORMAT = "0.################"; - + /** * Output a double value to a string suitable for PDF. * In this method it is possible to set the maximum @@ -83,7 +83,7 @@ public class PDFNumber extends PDFObject { */ public static String doubleOut(double doubleDown, int dec) { if (dec < 0 || dec >= decimalFormatCache.length) { - throw new IllegalArgumentException("Parameter dec must be between 1 and " + throw new IllegalArgumentException("Parameter dec must be between 1 and " + (decimalFormatCache.length + 1)); } if (decimalFormatCache[dec] == null) { diff --git a/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java b/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java index ef1ccb452..72fbcd1c6 100644 --- a/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java +++ b/src/java/org/apache/fop/pdf/PDFNumberTreeNode.java @@ -43,7 +43,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public void setKids(PDFArray kids) { put(KIDS, kids); } - + /** * Returns the Kids array. * @return the Kids array @@ -51,7 +51,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public PDFArray getKids() { return (PDFArray)get(KIDS); } - + /** * Sets the Nums array. * @param nums the Nums array @@ -59,7 +59,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public void setNums(PDFNumsArray nums) { put(NUMS, nums); } - + /** * Returns the Nums array. * @return the Nums array @@ -67,7 +67,7 @@ public class PDFNumberTreeNode extends PDFDictionary { public PDFNumsArray getNums() { return (PDFNumsArray)get(NUMS); } - + /** * Sets the lower limit value of the Limits array. * @param key the lower limit value @@ -116,6 +116,6 @@ public class PDFNumberTreeNode extends PDFDictionary { } return limits; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFNumsArray.java b/src/java/org/apache/fop/pdf/PDFNumsArray.java index 0a86754e8..e1c38dd48 100644 --- a/src/java/org/apache/fop/pdf/PDFNumsArray.java +++ b/src/java/org/apache/fop/pdf/PDFNumsArray.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -32,7 +32,7 @@ import org.apache.commons.io.output.CountingOutputStream; * Class representing an "Nums" array object (for Number Trees). */ public class PDFNumsArray extends PDFObject { - + /** Sorted Map holding the values of this array. */ protected SortedMap map = new java.util.TreeMap(); @@ -51,7 +51,7 @@ public class PDFNumsArray extends PDFObject { public int length() { return this.map.size(); } - + /** * Sets an entry. * @param key the key of the value to set @@ -60,7 +60,7 @@ public class PDFNumsArray extends PDFObject { public void put(int key, Object obj) { this.map.put(new Integer(key), obj); } - + /** * Gets an entry. * @param key the key of requested value @@ -69,7 +69,7 @@ public class PDFNumsArray extends PDFObject { public Object get(int key) { return this.map.get(new Integer(key)); } - + /** {@inheritDoc} */ protected int output(OutputStream stream) throws IOException { CountingOutputStream cout = new CountingOutputStream(stream); @@ -77,7 +77,7 @@ public class PDFNumsArray extends PDFObject { if (hasObjectNumber()) { writer.write(getObjectID()); } - + writer.write('['); boolean first = true; Iterator iter = this.map.entrySet().iterator(); @@ -92,13 +92,13 @@ public class PDFNumsArray extends PDFObject { formatObject(entry.getValue(), cout, writer); } writer.write(']'); - + if (hasObjectNumber()) { writer.write("\nendobj\n"); } - + writer.flush(); return cout.getCount(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFObject.java b/src/java/org/apache/fop/pdf/PDFObject.java index 8dc4d8794..97e9f4976 100644 --- a/src/java/org/apache/fop/pdf/PDFObject.java +++ b/src/java/org/apache/fop/pdf/PDFObject.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -61,7 +61,7 @@ public abstract class PDFObject implements PDFWritable { /** the parent PDFObject (may be null and may not always be set, needed for encryption) */ private PDFObject parent; - + /** * Returns the object's number. * @return the PDF Object number @@ -72,14 +72,14 @@ public abstract class PDFObject implements PDFWritable { } return this.objnum; } - + /** * Default constructor. */ public PDFObject() { //nop } - + /** * Constructor for direct objects. * @param parent the containing PDFObject instance @@ -87,9 +87,9 @@ public abstract class PDFObject implements PDFWritable { public PDFObject(PDFObject parent) { setParent(parent); } - + /** - * Indicates whether this PDFObject has already been assigned an + * Indicates whether this PDFObject has already been assigned an * object number. * @return True if it has an object number */ @@ -164,7 +164,7 @@ public abstract class PDFObject implements PDFWritable { public PDFObject getParent() { return this.parent; } - + /** * Sets the direct parent object. * @param parent the direct parent @@ -201,7 +201,7 @@ public abstract class PDFObject implements PDFWritable { public PDFReference makeReference() { return new PDFReference(this); } - + /** * Write the PDF represention of this object * @@ -224,7 +224,7 @@ public abstract class PDFObject implements PDFWritable { output(out); } } - + /** * Encodes the object as a byte array for output to a PDF file. * @@ -233,12 +233,12 @@ public abstract class PDFObject implements PDFWritable { protected byte[] toPDF() { return encode(toPDFString()); } - - + + /** * This method returns a String representation of the PDF object. The result - * is normally converted/encoded to a byte array by toPDF(). Only use - * this method to implement the serialization if the object can be fully + * is normally converted/encoded to a byte array by toPDF(). Only use + * this method to implement the serialization if the object can be fully * represented as text. If the PDF representation of the object contains * binary content use toPDF() or output(OutputStream) instead. This applies * to any object potentially containing a string object because string object @@ -249,7 +249,7 @@ public abstract class PDFObject implements PDFWritable { throw new UnsupportedOperationException("Not implemented. " + "Use output(OutputStream) instead."); } - + /** * Converts text to a byte array for writing to a PDF file. * @param text text to convert/encode @@ -258,7 +258,7 @@ public abstract class PDFObject implements PDFWritable { public static final byte[] encode(String text) { return PDFDocument.encode(text); } - + /** * Encodes a Text String (3.8.1 in PDF 1.4 specs) * @param text the text to encode @@ -273,7 +273,7 @@ public abstract class PDFObject implements PDFWritable { return encode(PDFText.escapeText(text, false)); } } - + /** * Encodes a String (3.2.3 in PDF 1.4 specs) * @param string the string to encode @@ -282,7 +282,7 @@ public abstract class PDFObject implements PDFWritable { protected byte[] encodeString(String string) { return encodeText(string); } - + /** * Encodes binary data as hexadecimal string object. * @param data the binary data @@ -299,7 +299,7 @@ public abstract class PDFObject implements PDFWritable { out.write(encoded); out.write('>'); } - + /** * Formats an object for serialization to PDF. * @param obj the object @@ -329,7 +329,7 @@ public abstract class PDFObject implements PDFWritable { out.write(encodeText(obj.toString())); } } - + /** Formatting pattern for PDF date */ protected static final SimpleDateFormat DATE_FORMAT; @@ -337,9 +337,9 @@ public abstract class PDFObject implements PDFWritable { DATE_FORMAT = new SimpleDateFormat("'D:'yyyyMMddHHmmss", Locale.ENGLISH); DATE_FORMAT.setTimeZone(TimeZone.getTimeZone("GMT")); } - + /** - * Formats a date/time according to the PDF specification + * Formats a date/time according to the PDF specification * (D:YYYYMMDDHHmmSSOHH'mm'). * @param time date/time value to format * @param tz the time zone @@ -348,17 +348,17 @@ public abstract class PDFObject implements PDFWritable { protected String formatDateTime(Date time, TimeZone tz) { Calendar cal = Calendar.getInstance(tz, Locale.ENGLISH); cal.setTime(time); - + int offset = cal.get(Calendar.ZONE_OFFSET); offset += cal.get(Calendar.DST_OFFSET); - + //DateFormat is operating on GMT so adjust for time zone offset Date dt1 = new Date(time.getTime() + offset); StringBuffer sb = new StringBuffer(); sb.append(DATE_FORMAT.format(dt1)); - + offset /= (1000 * 60); //Convert to minutes - + if (offset == 0) { sb.append('Z'); } else { @@ -392,5 +392,5 @@ public abstract class PDFObject implements PDFWritable { protected String formatDateTime(Date time) { return formatDateTime(time, TimeZone.getDefault()); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFOutline.java b/src/java/org/apache/fop/pdf/PDFOutline.java index b4b7cb6be..57e210a7a 100644 --- a/src/java/org/apache/fop/pdf/PDFOutline.java +++ b/src/java/org/apache/fop/pdf/PDFOutline.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.ByteArrayOutputStream; @@ -50,10 +50,10 @@ public class PDFOutline extends PDFObject { private PDFOutline last; private int count; - + // whether to show this outline item's child outline items private boolean openItem = false; - + /** * title to display for the bookmark entry */ @@ -158,7 +158,7 @@ public class PDFOutline extends PDFObject { bout.write(encode(" /Last " + last.referencePDF() + "\n")); } if (count > 0) { - bout.write(encode(" /Count " + (openItem ? "" : "-") + bout.write(encode(" /Count " + (openItem ? "" : "-") + count + "\n")); } if (actionRef != null) { diff --git a/src/java/org/apache/fop/pdf/PDFOutputIntent.java b/src/java/org/apache/fop/pdf/PDFOutputIntent.java index 17badfd5a..ea073829b 100644 --- a/src/java/org/apache/fop/pdf/PDFOutputIntent.java +++ b/src/java/org/apache/fop/pdf/PDFOutputIntent.java @@ -33,14 +33,14 @@ public class PDFOutputIntent extends PDFObject { public static final String GTS_PDFX = "GTS_PDFX"; /** Subtype for PDF/A-1 output intents */ public static final String GTS_PDFA1 = "GTS_PDFA1"; - + private String subtype; //S in the PDF spec private String outputCondition; private String outputConditionIdentifier; private String registryName; private String info; private PDFICCStream destOutputProfile; - + /** @return the output intent subtype. */ public String getSubtype() { @@ -119,7 +119,7 @@ public class PDFOutputIntent extends PDFObject { /** * Sets the destination ICC profile. - * @param destOutputProfile An ICC profile stream defining the transformation from the PDF + * @param destOutputProfile An ICC profile stream defining the transformation from the PDF * document's source colors to output device colorants. */ public void setDestOutputProfile(PDFICCStream destOutputProfile) { @@ -137,33 +137,33 @@ public class PDFOutputIntent extends PDFObject { bout.write(encode("/S /")); bout.write(encode(this.subtype)); bout.write(encode("\n")); - + if (outputCondition != null) { bout.write(encode("/OutputCondition ")); bout.write(encodeText(this.outputCondition)); bout.write(encode("\n")); } - + bout.write(encode("/OutputConditionIdentifier ")); bout.write(encodeText(this.outputConditionIdentifier)); bout.write(encode("\n")); - + if (registryName != null) { bout.write(encode("/RegistryName ")); bout.write(encodeText(this.registryName)); bout.write(encode("\n")); } - + if (info != null) { bout.write(encode("/Info ")); bout.write(encodeText(this.info)); bout.write(encode("\n")); } - + if (destOutputProfile != null) { bout.write(encode("/DestOutputProfile " + destOutputProfile.referencePDF() + "\n")); } - + bout.write(encode(">>\nendobj\n")); } catch (IOException ioe) { log.error("Ignored I/O exception", ioe); @@ -171,5 +171,5 @@ public class PDFOutputIntent extends PDFObject { return bout.toByteArray(); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFPage.java b/src/java/org/apache/fop/pdf/PDFPage.java index ee105f39b..d1472e154 100644 --- a/src/java/org/apache/fop/pdf/PDFPage.java +++ b/src/java/org/apache/fop/pdf/PDFPage.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.awt.geom.Rectangle2D; @@ -33,7 +33,7 @@ public class PDFPage extends PDFResourceContext { /** the page index (zero-based) */ protected int pageIndex; - + /** * Create a /Page object * @@ -75,12 +75,12 @@ public class PDFPage extends PDFResourceContext { setBleedBox(box); //Recommended by PDF/X setTrimBox(box); //Needed for PDF/X } - + private PDFArray toPDFArray(Rectangle2D box) { return new PDFArray(this, new double[] { box.getX(), box.getY(), box.getMaxX(), box.getMaxY()}); } - + /** * Sets the "MediaBox" entry * @param box the media rectangle @@ -88,7 +88,7 @@ public class PDFPage extends PDFResourceContext { public void setMediaBox(Rectangle2D box) { put("MediaBox", toPDFArray(box)); } - + /** * Sets the "TrimBox" entry * @param box the trim rectangle @@ -96,7 +96,7 @@ public class PDFPage extends PDFResourceContext { public void setTrimBox(Rectangle2D box) { put("TrimBox", toPDFArray(box)); } - + /** * Sets the "BleedBox" entry * @param box the bleed rectangle @@ -104,7 +104,7 @@ public class PDFPage extends PDFResourceContext { public void setBleedBox(Rectangle2D box) { put("BleedBox", toPDFArray(box)); } - + /** * set this page contents * diff --git a/src/java/org/apache/fop/pdf/PDFPageLabels.java b/src/java/org/apache/fop/pdf/PDFPageLabels.java index 1a51c4155..2c1a977b4 100644 --- a/src/java/org/apache/fop/pdf/PDFPageLabels.java +++ b/src/java/org/apache/fop/pdf/PDFPageLabels.java @@ -5,9 +5,9 @@ * 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. @@ -16,14 +16,14 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** * Class representing a PDF /PageLabels dictionary. */ public class PDFPageLabels extends PDFNumberTreeNode { - + /** * Create the /PageLabels dictionary */ @@ -44,5 +44,5 @@ public class PDFPageLabels extends PDFNumberTreeNode { } return nums; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFPages.java b/src/java/org/apache/fop/pdf/PDFPages.java index 37a2394db..bef4bdbc4 100644 --- a/src/java/org/apache/fop/pdf/PDFPages.java +++ b/src/java/org/apache/fop/pdf/PDFPages.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -67,7 +67,7 @@ public class PDFPages extends PDFObject { page.setParent(this); this.incrementCount(); } - + /** * Use this method to notify the PDFPages object that a child page * @param page the child page @@ -79,7 +79,7 @@ public class PDFPages extends PDFObject { this.kids.add(null); } if (this.kids.get(idx) != null) { - throw new IllegalStateException("A page already exists at index " + throw new IllegalStateException("A page already exists at index " + idx + " (zero-based)."); } this.kids.set(idx, page.referencePDF()); diff --git a/src/java/org/apache/fop/pdf/PDFPathPaint.java b/src/java/org/apache/fop/pdf/PDFPathPaint.java index 0bcb19a7e..5133e54a4 100644 --- a/src/java/org/apache/fop/pdf/PDFPathPaint.java +++ b/src/java/org/apache/fop/pdf/PDFPathPaint.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFPattern.java b/src/java/org/apache/fop/pdf/PDFPattern.java index 3bb190c48..4e862c3f2 100644 --- a/src/java/org/apache/fop/pdf/PDFPattern.java +++ b/src/java/org/apache/fop/pdf/PDFPattern.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -118,8 +118,8 @@ public class PDFPattern extends PDFPathPaint { * @param thePatternDataStream The stream of pattern data to be tiled. */ public PDFPattern(PDFResources theResources, int thePatternType, // 1 - int thePaintType, int theTilingType, List theBBox, - double theXStep, double theYStep, + int thePaintType, int theTilingType, List theBBox, + double theXStep, double theYStep, List theMatrix, List theXUID, StringBuffer thePatternDataStream) { super(); @@ -272,9 +272,9 @@ public class PDFPattern extends PDFPathPaint { pdfStream.setDocument(getDocumentSafely()); pdfStream.add(this.patternDataStream.toString()); pdfStream.getFilterList().addDefaultFilters( - getDocument().getFilterMap(), + getDocument().getFilterMap(), PDFFilterList.CONTENT_FILTER); - encodedStream = pdfStream.encodeStream(); + encodedStream = pdfStream.encodeStream(); p.append(pdfStream.getFilterList().buildFilterDictEntries()); p.append("/Length " + (encodedStream.getSize() + 1) + " \n"); diff --git a/src/java/org/apache/fop/pdf/PDFProfile.java b/src/java/org/apache/fop/pdf/PDFProfile.java index 3264e1f44..20af4e212 100644 --- a/src/java/org/apache/fop/pdf/PDFProfile.java +++ b/src/java/org/apache/fop/pdf/PDFProfile.java @@ -26,25 +26,25 @@ import java.text.MessageFormat; * the libarary and its users to enable the generation of PDFs conforming to the enabled PDF * profiles. *
- * Some profile from PDF/X and PDF/A can be active simultaneously (example: PDF/A-1 and + * Some profile from PDF/X and PDF/A can be active simultaneously (example: PDF/A-1 and * PDF/X-3:2003). */ public class PDFProfile { /** - * Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e. + * Indicates the PDF/A mode currently active. Defaults to "no restrictions", i.e. * PDF/A not active. */ protected PDFAMode pdfAMode = PDFAMode.DISABLED; - + /** - * Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e. + * Indicates the PDF/X mode currently active. Defaults to "no restrictions", i.e. * PDF/X not active. */ protected PDFXMode pdfXMode = PDFXMode.DISABLED; - + private PDFDocument doc; - + /** * Main constructor * @param doc the PDF document @@ -52,7 +52,7 @@ public class PDFProfile { public PDFProfile(PDFDocument doc) { this.doc = doc; } - + /** * Validates if the requested profile combination is compatible. */ @@ -69,22 +69,22 @@ public class PDFProfile { } } } - + /** @return the PDFDocument this profile is attached to */ public PDFDocument getDocument() { return this.doc; } - + /** @return the PDF/A mode */ public PDFAMode getPDFAMode() { return this.pdfAMode; } - + /** @return true if any PDF/A mode is active */ public boolean isPDFAActive() { return getPDFAMode() != PDFAMode.DISABLED; } - + /** * Sets the PDF/A mode * @param mode the PDF/A mode @@ -96,17 +96,17 @@ public class PDFProfile { this.pdfAMode = mode; validateProfileCombination(); } - + /** @return the PDF/X mode */ public PDFXMode getPDFXMode() { return this.pdfXMode; } - + /** @return true if any PDF/X mode is active */ public boolean isPDFXActive() { return getPDFXMode() != PDFXMode.DISABLED; } - + /** * Sets the PDF/X mode * @param mode the PDF/X mode @@ -133,13 +133,13 @@ public class PDFProfile { } return sb.toString(); } - + //---------=== Info and validation methods ===--------- - + private String format(String pattern, Object arg) { return MessageFormat.format(pattern, new Object[] {arg}); } - + /** Checks if encryption is allowed. */ public void verifyEncryptionAllowed() { final String err = "{0} doesn't allow encrypted PDFs"; @@ -170,11 +170,11 @@ public class PDFProfile { public void verifyTransparencyAllowed(String context) { final String err = "{0} does not allow the use of transparency. ({1})"; if (isPDFAActive()) { - throw new PDFConformanceException(MessageFormat.format(err, + throw new PDFConformanceException(MessageFormat.format(err, new Object[] {getPDFAMode(), context})); } if (isPDFXActive()) { - throw new PDFConformanceException(MessageFormat.format(err, + throw new PDFConformanceException(MessageFormat.format(err, new Object[] {getPDFXMode(), context})); } } @@ -182,16 +182,16 @@ public class PDFProfile { /** Checks if the right PDF version is set. */ public void verifyPDFVersion() { final String err = "PDF version must be 1.4 for {0}"; - if (getPDFAMode().isPDFA1LevelB() + if (getPDFAMode().isPDFA1LevelB() && getDocument().getPDFVersion() != PDFDocument.PDF_VERSION_1_4) { throw new PDFConformanceException(format(err, getPDFAMode())); } - if (getPDFXMode() == PDFXMode.PDFX_3_2003 + if (getPDFXMode() == PDFXMode.PDFX_3_2003 && getDocument().getPDFVersion() != PDFDocument.PDF_VERSION_1_4) { throw new PDFConformanceException(format(err, getPDFXMode())); } } - + /** @return true if the ID entry must be present in the trailer. */ public boolean isIDEntryRequired() { return isPDFAActive() || isPDFXActive(); @@ -224,7 +224,7 @@ public class PDFProfile { public boolean isAnnotationAllowed() { return !isPDFXActive(); } - + /** Checks if annotations are allowed. */ public void verifyAnnotAllowed() { if (!isAnnotationAllowed()) { diff --git a/src/java/org/apache/fop/pdf/PDFRectangle.java b/src/java/org/apache/fop/pdf/PDFRectangle.java index ca97c2474..ce5b46440 100644 --- a/src/java/org/apache/fop/pdf/PDFRectangle.java +++ b/src/java/org/apache/fop/pdf/PDFRectangle.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; diff --git a/src/java/org/apache/fop/pdf/PDFReference.java b/src/java/org/apache/fop/pdf/PDFReference.java index da388d368..5c3bdf3dc 100644 --- a/src/java/org/apache/fop/pdf/PDFReference.java +++ b/src/java/org/apache/fop/pdf/PDFReference.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -32,11 +32,11 @@ import java.lang.ref.SoftReference; * PDF file. */ public class PDFReference implements PDFWritable { - + private String indirectReference; - + private Reference objReference; - + /** * Creates a new PDF reference. * @param obj the object to be referenced @@ -45,7 +45,7 @@ public class PDFReference implements PDFWritable { this.indirectReference = obj.referencePDF(); this.objReference = new SoftReference(obj); } - + /** * Creates a new PDF reference, but without a reference to the original object. * @param ref an object reference @@ -72,15 +72,15 @@ public class PDFReference implements PDFWritable { return null; } } - + /** {@inheritDoc} */ public String toString() { return this.indirectReference; } - + /** {@inheritDoc} */ public void outputInline(OutputStream out, Writer writer) throws IOException { writer.write(toString()); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFResourceContext.java b/src/java/org/apache/fop/pdf/PDFResourceContext.java index 6be18ce9d..16c1976db 100644 --- a/src/java/org/apache/fop/pdf/PDFResourceContext.java +++ b/src/java/org/apache/fop/pdf/PDFResourceContext.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFResources.java b/src/java/org/apache/fop/pdf/PDFResources.java index da213bb87..cbfc9d53a 100644 --- a/src/java/org/apache/fop/pdf/PDFResources.java +++ b/src/java/org/apache/fop/pdf/PDFResources.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.HashMap; @@ -67,10 +67,10 @@ public class PDFResources extends PDFObject { /** Map of color spaces (key: color space name) */ protected Map colorSpaces = new HashMap(); - + /** Map of ICC color spaces (key: ICC profile description) */ protected Map iccColorSpaces = new HashMap(); - + /** * create a /Resources object. * @@ -93,7 +93,7 @@ public class PDFResources extends PDFObject { /** * Add the fonts in the font info to this PDF document's Font Resources. - * + * * @param doc PDF document to add fonts to * @param fontInfo font info object to get font information from */ @@ -103,7 +103,7 @@ public class PDFResources extends PDFObject { while (e.hasNext()) { String f = (String)e.next(); Typeface font = (Typeface)usedFonts.get(f); - + //Check if the font actually had any mapping operations. If not, it is an indication //that it has never actually been used and therefore doesn't have to be embedded. if (font.hadMappingOperations()) { @@ -159,7 +159,7 @@ public class PDFResources extends PDFObject { /** * Add a ColorSpace dictionary to the resources. - * @param colorSpace the color space + * @param colorSpace the color space */ public void addColorSpace(PDFICCBasedColorSpace colorSpace) { this.colorSpaces.put(colorSpace.getName(), colorSpace); diff --git a/src/java/org/apache/fop/pdf/PDFRoot.java b/src/java/org/apache/fop/pdf/PDFRoot.java index 0dd9b890c..1ea316390 100644 --- a/src/java/org/apache/fop/pdf/PDFRoot.java +++ b/src/java/org/apache/fop/pdf/PDFRoot.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** @@ -50,7 +50,7 @@ public class PDFRoot extends PDFDictionary { new PDFName("UseThumbs"), new PDFName("FullScreen"), }; - + /** * create a Root (/Catalog) object. NOTE: The PDFRoot * object must be created before the PDF document is @@ -94,7 +94,7 @@ public class PDFRoot extends PDFDictionary { return PAGEMODE_USENONE; } } - + /** * add a /Page object to the root /Pages object * @@ -123,7 +123,7 @@ public class PDFRoot extends PDFDictionary { PDFReference ref = (PDFReference)get("Pages"); return (ref != null ? (PDFPages)ref.getObject() : null); } - + /** * Sets the /PageLabels object. * @param pageLabels the /PageLabels object @@ -131,7 +131,7 @@ public class PDFRoot extends PDFDictionary { public void setPageLabels(PDFPageLabels pageLabels) { put("PageLabels", pageLabels.makeReference()); } - + /** * Returns the /PageLabels object. * @return the /PageLabels object if set, null otherwise. @@ -141,7 +141,7 @@ public class PDFRoot extends PDFDictionary { PDFReference ref = (PDFReference)get("PageLabels"); return (ref != null ? (PDFPageLabels)ref.getObject() : null); } - + /** * Set the root outline for the PDF document. * @@ -149,7 +149,7 @@ public class PDFRoot extends PDFDictionary { */ public void setRootOutline(PDFOutline out) { put("Outlines", out.makeReference()); - + //Set /PageMode to /UseOutlines by default if no other mode has been set PDFName mode = (PDFName)get("PageMode"); if (mode == null) { @@ -166,7 +166,7 @@ public class PDFRoot extends PDFDictionary { PDFReference ref = (PDFReference)get("Outlines"); return (ref != null ? (PDFOutline)ref.getObject() : null); } - + /** * Set the /Names object. * @param names the Names object @@ -175,7 +175,7 @@ public class PDFRoot extends PDFDictionary { public void setNames(PDFNames names) { put("Names", names.makeReference()); } - + /** * Returns the /Names object. * @return the Names object if set, null otherwise. @@ -185,7 +185,7 @@ public class PDFRoot extends PDFDictionary { PDFReference ref = (PDFReference)get("Names"); return (ref != null ? (PDFNames)ref.getObject() : null); } - + /** * Set the optional Metadata object. * @param meta the Metadata object @@ -196,7 +196,7 @@ public class PDFRoot extends PDFDictionary { put("Metadata", meta.makeReference()); } } - + /** * Returns the /Metadata object * @return the /Metadata object if set, null otherwise. @@ -215,7 +215,7 @@ public class PDFRoot extends PDFDictionary { public PDFArray getOutputIntents() { return (PDFArray)get("OutputIntents"); } - + /** * Adds an OutputIntent to the PDF * @param outputIntent the OutputIntent dictionary @@ -223,7 +223,7 @@ public class PDFRoot extends PDFDictionary { */ public void addOutputIntent(PDFOutputIntent outputIntent) { if (getDocumentSafely().getPDFVersion() >= PDFDocument.PDF_VERSION_1_4) { - PDFArray outputIntents = getOutputIntents(); + PDFArray outputIntents = getOutputIntents(); if (outputIntents == null) { outputIntents = new PDFArray(this); put("OutputIntents", outputIntents); @@ -231,7 +231,7 @@ public class PDFRoot extends PDFDictionary { outputIntents.add(outputIntent); } } - + /** * Returns the language identifier of the document. * @return the language identifier of the document (or null if not set or undefined) @@ -240,7 +240,7 @@ public class PDFRoot extends PDFDictionary { public String getLanguage() { return (String)get("Lang"); } - + /** * Sets the language identifier of the document. * @param lang the language identifier of the document. @@ -251,5 +251,5 @@ public class PDFRoot extends PDFDictionary { } put("Lang", lang); } - + } diff --git a/src/java/org/apache/fop/pdf/PDFShading.java b/src/java/org/apache/fop/pdf/PDFShading.java index a782eaf36..5ac7245c9 100644 --- a/src/java/org/apache/fop/pdf/PDFShading.java +++ b/src/java/org/apache/fop/pdf/PDFShading.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java... @@ -338,7 +338,7 @@ public class PDFShading extends PDFObject { int vectorSize; int tempInt; StringBuffer p = new StringBuffer(128); - p.append(getObjectID() + p.append(getObjectID() + "<< \n/ShadingType " + this.shadingType + " \n"); if (this.colorSpace != null) { p.append("/ColorSpace /" diff --git a/src/java/org/apache/fop/pdf/PDFState.java b/src/java/org/apache/fop/pdf/PDFState.java index e453d7b51..2e9bd6074 100644 --- a/src/java/org/apache/fop/pdf/PDFState.java +++ b/src/java/org/apache/fop/pdf/PDFState.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.Serializable; @@ -50,7 +50,7 @@ import java.awt.geom.GeneralPath; public class PDFState { private Data data = new Data(); - + private List stateStack = new java.util.ArrayList(); /** @@ -82,7 +82,7 @@ public class PDFState { public Data getData() { return data; } - + /** * Pop the state from the stack and set current values to popped state. * This should be called when a Q operator is used so @@ -154,7 +154,7 @@ public class PDFState { return false; } } - + /** * Set the current color. * Check if the new color is a change and then set the current color. @@ -272,7 +272,7 @@ public class PDFState { public void setTransform(AffineTransform tf) { concatenate(tf); } - + /** * Concatenates the given AffineTransform to the current one. * @param tf the transform to concatenate to the current level transform @@ -343,9 +343,9 @@ public class PDFState { return newstate; } - + public class Data implements Cloneable, Serializable { - + public Color color = Color.black; public Color backcolor = Color.black; public Paint paint = null; @@ -363,7 +363,7 @@ public class PDFState { public Shape clip = null; public PDFGState gstate = null; - + /** {@inheritDoc} */ public Object clone() throws CloneNotSupportedException { Data obj = new Data(); @@ -385,7 +385,7 @@ public class PDFState { obj.gstate = this.gstate; return obj; } - + /** * Get the current Transform. */ @@ -407,7 +407,7 @@ public class PDFState { public void concatenate(AffineTransform at) { transform.concatenate(at); } - + /** {@inheritDoc} */ public String toString() { return super.toString() + ", " + this.transform; diff --git a/src/java/org/apache/fop/pdf/PDFStream.java b/src/java/org/apache/fop/pdf/PDFStream.java index a213340e3..5f74a2613 100644 --- a/src/java/org/apache/fop/pdf/PDFStream.java +++ b/src/java/org/apache/fop/pdf/PDFStream.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -32,14 +32,14 @@ import java.io.Writer; * length. */ public class PDFStream extends AbstractPDFStream { - + /** * The stream of PDF commands */ protected StreamCache data; private transient Writer streamWriter; - + /** * Create an empty stream object */ @@ -70,11 +70,11 @@ public class PDFStream extends AbstractPDFStream { ex.printStackTrace(); } } - + private void flush() throws IOException { this.streamWriter.flush(); } - + /** * Returns a Writer that writes to the OutputStream of the buffer. * @return the Writer @@ -95,7 +95,7 @@ public class PDFStream extends AbstractPDFStream { } return this.data.getOutputStream(); } - + /** * Used to set the contents of the PDF stream. * @param data the contents as a byte array @@ -138,7 +138,7 @@ public class PDFStream extends AbstractPDFStream { */ protected int output(OutputStream stream) throws IOException { final int len = super.output(stream); - + //Now that the data has been written, it can be discarded. this.data = null; return len; diff --git a/src/java/org/apache/fop/pdf/PDFT1Stream.java b/src/java/org/apache/fop/pdf/PDFT1Stream.java index d122743b0..8181287b5 100644 --- a/src/java/org/apache/fop/pdf/PDFT1Stream.java +++ b/src/java/org/apache/fop/pdf/PDFT1Stream.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -29,7 +29,7 @@ import org.apache.fop.fonts.type1.PFBData; * Special PDFStream for embedding Type 1 fonts. */ public class PDFT1Stream extends AbstractPDFStream { - + private PFBData pfb; /** @@ -76,9 +76,9 @@ public class PDFT1Stream extends AbstractPDFStream { protected void outputRawStreamData(OutputStream out) throws IOException { this.pfb.outputAllParts(out); } - + /** - * Used to set the PFBData object that represents the embeddable Type 1 + * Used to set the PFBData object that represents the embeddable Type 1 * font. * @param pfb The PFB file * @throws IOException in case of an I/O problem diff --git a/src/java/org/apache/fop/pdf/PDFTTFStream.java b/src/java/org/apache/fop/pdf/PDFTTFStream.java index 5570c62f3..6c68ea8bf 100644 --- a/src/java/org/apache/fop/pdf/PDFTTFStream.java +++ b/src/java/org/apache/fop/pdf/PDFTTFStream.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -25,7 +25,7 @@ import java.io.IOException; * Special PDFStream for embeddable TrueType fonts. */ public class PDFTTFStream extends PDFStream { - + private int origLength; /** @@ -58,7 +58,7 @@ public class PDFTTFStream extends PDFStream { put("Length1", origLength); super.populateStreamDict(lengthEntry); } - + /** * Sets the TrueType font data. * @param data the font payload diff --git a/src/java/org/apache/fop/pdf/PDFText.java b/src/java/org/apache/fop/pdf/PDFText.java index d380ac8dd..02f845266 100644 --- a/src/java/org/apache/fop/pdf/PDFText.java +++ b/src/java/org/apache/fop/pdf/PDFText.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.ByteArrayOutputStream; @@ -24,15 +24,15 @@ import java.io.ByteArrayOutputStream; import org.apache.avalon.framework.CascadingRuntimeException; /** - * This class represents a simple number object. It also contains contains some + * This class represents a simple number object. It also contains contains some * utility methods for outputting numbers to PDF. */ public class PDFText extends PDFObject { - private static final char[] DIGITS + private static final char[] DIGITS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F'}; - + private String text; /** @@ -42,7 +42,7 @@ public class PDFText extends PDFObject { public String getText() { return this.text; } - + /** * Sets the text. * @param text the text @@ -97,7 +97,7 @@ public class PDFText extends PDFObject { } } } - + if (hexMode) { final byte[] uniBytes; try { @@ -114,7 +114,7 @@ public class PDFText extends PDFObject { if (unicode) { // byte order marker (0xfeff) result.append("\\376\\377"); - + for (int i = 0; i < l; i++) { final char ch = text.charAt(i); final int high = (ch & 0xff00) >>> 8; @@ -162,7 +162,7 @@ public class PDFText extends PDFObject { } return sb.toString(); } - + /** * Converts a byte array to a Hexadecimal String (3.2.3 in PDF 1.4 specs) * @param data the data to encode @@ -171,7 +171,7 @@ public class PDFText extends PDFObject { public static final String toHex(byte[] data) { return toHex(data, true); } - + /** * Converts a String to UTF-16 (big endian). * @param text text to convert @@ -206,7 +206,7 @@ public class PDFText extends PDFObject { } return buf.toString(); } - + /** * Escaped a String as described in section 4.4 in the PDF 1.3 specs. * @param s String to escape diff --git a/src/java/org/apache/fop/pdf/PDFTextUtil.java b/src/java/org/apache/fop/pdf/PDFTextUtil.java index 224bb6a1d..735a7894d 100644 --- a/src/java/org/apache/fop/pdf/PDFTextUtil.java +++ b/src/java/org/apache/fop/pdf/PDFTextUtil.java @@ -5,9 +5,9 @@ * 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. @@ -27,9 +27,9 @@ import java.awt.geom.AffineTransform; */ public abstract class PDFTextUtil { - /** The number of decimal places. */ + /** The number of decimal places. */ private static final int DEC = 8; - + /** PDF text rendering mode: Fill text */ public static final int TR_FILL = 0; /** PDF text rendering mode: Stroke text */ @@ -46,30 +46,30 @@ public abstract class PDFTextUtil { public static final int TR_FILL_STROKE_CLIP = 6; /** PDF text rendering mode: Add text to path for clipping */ public static final int TR_CLIP = 7; - + private boolean inTextObject = false; private String startText; private String endText; private boolean useMultiByte; private StringBuffer bufTJ; private int textRenderingMode = TR_FILL; - + private String currentFontName; private double currentFontSize; - + /** * Main constructor. */ public PDFTextUtil() { //nop } - + /** * Writes PDF code. * @param code the PDF code to write */ protected abstract void write(String code); - + private void writeAffineTransform(AffineTransform at, StringBuffer sb) { double[] lt = new double[6]; at.getMatrix(lt); @@ -100,13 +100,13 @@ public abstract class PDFTextUtil { sb.append(PDFText.toUnicodeHex(ch)); } } - + private void checkInTextObject() { if (!inTextObject) { throw new IllegalStateException("Not in text object"); } } - + /** * Indicates whether we are in a text object or not. * @return true if we are in a text object @@ -114,7 +114,7 @@ public abstract class PDFTextUtil { public boolean isInTextObject() { return inTextObject; } - + /** * Called when a new text object should be started. Be sure to call setFont() before * issuing any text painting commands. @@ -126,7 +126,7 @@ public abstract class PDFTextUtil { write("BT\n"); this.inTextObject = true; } - + /** * Called when a text object should be ended. */ @@ -136,7 +136,7 @@ public abstract class PDFTextUtil { this.inTextObject = false; initValues(); } - + /** * Resets the state fields. */ @@ -145,14 +145,14 @@ public abstract class PDFTextUtil { this.currentFontSize = 0.0; this.textRenderingMode = TR_FILL; } - + /** * Creates a "q" command, pushing a copy of the entire graphics state onto the stack. */ public void saveGraphicsState() { write("q\n"); } - + /** * Creates a "Q" command, restoring the entire graphics state to its former value by popping * it from the stack. @@ -160,7 +160,7 @@ public abstract class PDFTextUtil { public void restoreGraphicsState() { write("Q\n"); } - + /** * Creates a "cm" command. * @param at the transformation matrix @@ -174,7 +174,7 @@ public abstract class PDFTextUtil { write(sb.toString()); } } - + /** * Writes a "Tf" command, setting a new current font. * @param fontName the name of the font to select @@ -183,7 +183,7 @@ public abstract class PDFTextUtil { public void writeTf(String fontName, double fontSize) { checkInTextObject(); write("/" + fontName + " " + PDFNumber.doubleOut(fontSize) + " Tf\n"); - + this.startText = useMultiByte ? "<" : "("; this.endText = useMultiByte ? ">" : ")"; } @@ -220,7 +220,7 @@ public abstract class PDFTextUtil { write(this.textRenderingMode + " Tr\n"); } } - + /** * Sets the text rendering mode. * @param fill true if the text should be filled @@ -239,7 +239,7 @@ public abstract class PDFTextUtil { } setTextRenderingMode(mode); } - + /** * Writes a "Tm" command, setting a new text transformation matrix. * @param localTransform the new text transformation matrix diff --git a/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java b/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java index 3d25e28cb..b70430af4 100644 --- a/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java +++ b/src/java/org/apache/fop/pdf/PDFToUnicodeCMap.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -61,9 +61,9 @@ public class PDFToUnicodeCMap extends PDFCMap { protected CMapBuilder createCMapBuilder(Writer writer) { return new ToUnicodeCMapBuilder(writer); } - + class ToUnicodeCMapBuilder extends CMapBuilder { - + public ToUnicodeCMapBuilder(Writer writer) { super(writer, null); } @@ -82,7 +82,7 @@ public class PDFToUnicodeCMap extends PDFCMap { writeBFEntries(); writeWrapUp(); } - + /** * Writes the character mappings for this font. * @param p StingBuffer to write to @@ -99,7 +99,7 @@ public class PDFToUnicodeCMap extends PDFCMap { * expressed as part of a character range). * @param p StringBuffer to write to * @param charArray all the characters to map - * @throws IOException + * @throws IOException */ protected void writeBFCharEntries(char[] charArray) throws IOException { int totalEntries = 0; @@ -136,7 +136,7 @@ public class PDFToUnicodeCMap extends PDFCMap { * Writes the entries for character ranges for a base font. * @param p StringBuffer to write to * @param charArray all the characters to map - * @throws IOException + * @throws IOException */ protected void writeBFRangeEntries(char[] charArray) throws IOException { int totalEntries = 0; @@ -283,6 +283,6 @@ public class PDFToUnicodeCMap extends PDFCMap { return returnString.toString(); } - } - + } + } diff --git a/src/java/org/apache/fop/pdf/PDFUri.java b/src/java/org/apache/fop/pdf/PDFUri.java index 19617e368..296e38945 100644 --- a/src/java/org/apache/fop/pdf/PDFUri.java +++ b/src/java/org/apache/fop/pdf/PDFUri.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/pdf/PDFWArray.java b/src/java/org/apache/fop/pdf/PDFWArray.java index 04351c77d..ad6d2ac29 100644 --- a/src/java/org/apache/fop/pdf/PDFWArray.java +++ b/src/java/org/apache/fop/pdf/PDFWArray.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.util.List; @@ -31,12 +31,12 @@ public class PDFWArray { */ private List entries = new java.util.ArrayList(); - /** - * Default constructor + /** + * Default constructor */ public PDFWArray() { } - + /** * Convenience constructor * @param metrics the metrics array to initially add diff --git a/src/java/org/apache/fop/pdf/PDFWritable.java b/src/java/org/apache/fop/pdf/PDFWritable.java index 4f024fb92..6e71dc7d8 100644 --- a/src/java/org/apache/fop/pdf/PDFWritable.java +++ b/src/java/org/apache/fop/pdf/PDFWritable.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -28,7 +28,7 @@ import java.io.Writer; * serializing the object or by writing a indirect reference to the actual object. */ public interface PDFWritable { - + /** * Writes a "direct object" (inline object) representation to the stream. A Writer is given * for optimized encoding of text content. Since the Writer is buffered, make sure @@ -38,5 +38,5 @@ public interface PDFWritable { * @throws IOException if an I/O error occurs */ void outputInline(OutputStream out, Writer writer) throws IOException; - + } diff --git a/src/java/org/apache/fop/pdf/PDFXMode.java b/src/java/org/apache/fop/pdf/PDFXMode.java index 05df3e32a..03813273b 100644 --- a/src/java/org/apache/fop/pdf/PDFXMode.java +++ b/src/java/org/apache/fop/pdf/PDFXMode.java @@ -26,7 +26,7 @@ public final class PDFXMode { public static final PDFXMode DISABLED = new PDFXMode("PDF/X disabled"); /** PDF/X-3:2003 enabled */ public static final PDFXMode PDFX_3_2003 = new PDFXMode("PDF/X-3:2003"); - + private String name; /** @@ -41,7 +41,7 @@ public final class PDFXMode { public String getName() { return this.name; } - + /** * Returns the mode enum object given a String. * @param s the string @@ -54,10 +54,10 @@ public final class PDFXMode { return DISABLED; } } - + /** {@inheritDoc} */ public String toString() { return name; } - + } diff --git a/src/java/org/apache/fop/pdf/PDFXObject.java b/src/java/org/apache/fop/pdf/PDFXObject.java index d0115fe66..d1ce6d75e 100644 --- a/src/java/org/apache/fop/pdf/PDFXObject.java +++ b/src/java/org/apache/fop/pdf/PDFXObject.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -33,7 +33,7 @@ import java.io.IOException; * document in another place. */ public abstract class PDFXObject extends AbstractPDFStream { - + /** * Create an XObject with the given number. */ @@ -48,13 +48,13 @@ public abstract class PDFXObject extends AbstractPDFStream { public PDFName getName() { return (PDFName)get("Name"); } - + /** {@inheritDoc} */ protected void populateStreamDict(Object lengthEntry) { put("Type", new PDFName("XObject")); super.populateStreamDict(lengthEntry); } - + /** {@inheritDoc} */ protected int getSizeHint() throws IOException { return 0; diff --git a/src/java/org/apache/fop/pdf/StreamCache.java b/src/java/org/apache/fop/pdf/StreamCache.java index 8ac6e13e1..95d21ab80 100644 --- a/src/java/org/apache/fop/pdf/StreamCache.java +++ b/src/java/org/apache/fop/pdf/StreamCache.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.OutputStream; diff --git a/src/java/org/apache/fop/pdf/StreamCacheFactory.java b/src/java/org/apache/fop/pdf/StreamCacheFactory.java index 00cfe933e..4e2d12eb2 100644 --- a/src/java/org/apache/fop/pdf/StreamCacheFactory.java +++ b/src/java/org/apache/fop/pdf/StreamCacheFactory.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; import java.io.IOException; @@ -31,7 +31,7 @@ public class StreamCacheFactory { private static StreamCacheFactory memoryInstance = null; private boolean cacheToFile = false; - + /** * Returns an instance of a StreamCacheFactory with the requested features. * @param cacheToFile True if file shall be cached using a temporary file @@ -50,7 +50,7 @@ public class StreamCacheFactory { return memoryInstance; } } - + /** * Returns an instance of a StreamCacheFactory depending on the default * setting for cacheToFile. @@ -59,7 +59,7 @@ public class StreamCacheFactory { public static StreamCacheFactory getInstance() { return getInstance(defaultCacheToFile); } - + /** * Sets the global default for cacheToFile * @param cacheToFile True if stream caches should be held in files. @@ -75,7 +75,7 @@ public class StreamCacheFactory { public StreamCacheFactory(boolean cacheToFile) { this.cacheToFile = cacheToFile; } - + /** * Get the correct implementation (based on cacheToFile) of * StreamCache. @@ -89,7 +89,7 @@ public class StreamCacheFactory { return new InMemoryStreamCache(); } } - + /** * Get the correct implementation (based on cacheToFile) of * StreamCache. @@ -104,7 +104,7 @@ public class StreamCacheFactory { return new InMemoryStreamCache(hintSize); } } - + /** * Get the value of the global cacheToFile flag. * @return the current cache to file flag @@ -112,6 +112,6 @@ public class StreamCacheFactory { public boolean getCacheToFile() { return this.cacheToFile; } - + } diff --git a/src/java/org/apache/fop/pdf/TempFileStreamCache.java b/src/java/org/apache/fop/pdf/TempFileStreamCache.java index e29595989..9920a334d 100644 --- a/src/java/org/apache/fop/pdf/TempFileStreamCache.java +++ b/src/java/org/apache/fop/pdf/TempFileStreamCache.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; // Java @@ -75,7 +75,7 @@ public class TempFileStreamCache implements StreamCache { public void write(byte[] data) throws IOException { getOutputStream().write(data); } - + /** * Outputs the cached bytes to the given stream. * diff --git a/src/java/org/apache/fop/pdf/TransitionDictionary.java b/src/java/org/apache/fop/pdf/TransitionDictionary.java index 5c779d8fe..6711c9508 100644 --- a/src/java/org/apache/fop/pdf/TransitionDictionary.java +++ b/src/java/org/apache/fop/pdf/TransitionDictionary.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.pdf; /** diff --git a/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java b/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java index b122db56f..0d891efe9 100644 --- a/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java +++ b/src/java/org/apache/fop/render/AbstractFOEventHandlerMaker.java @@ -5,9 +5,9 @@ * 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. @@ -30,7 +30,7 @@ import org.apache.fop.fo.FOEventHandler; * about them. */ public abstract class AbstractFOEventHandlerMaker { - + /** * Instantiates a new FOEventHandler. * @param ua the user agent @@ -45,7 +45,7 @@ public abstract class AbstractFOEventHandlerMaker { * @return Indicates whether this renderer requires an OutputStream to work with. */ public abstract boolean needsOutputStream(); - + /** * @return an array of MIME types the renderer supports. */ @@ -65,5 +65,5 @@ public abstract class AbstractFOEventHandlerMaker { } return false; } - + } diff --git a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java index 2c47875d9..2d4b20e6a 100644 --- a/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java +++ b/src/java/org/apache/fop/render/AbstractGenericSVGHandler.java @@ -5,9 +5,9 @@ * 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. @@ -49,7 +49,7 @@ import org.apache.fop.svg.SVGUserAgent; public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererContextConstants { /** {@inheritDoc} */ - public void handleXML(RendererContext context, + public void handleXML(RendererContext context, Document doc, String ns) throws Exception { if (SVGDOMImplementation.SVG_NAMESPACE_URI.equals(ns)) { @@ -111,8 +111,8 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC //Let the painter paint the SVG on the Graphics2D instance Graphics2DAdapter adapter = context.getRenderer().getGraphics2DAdapter(); - adapter.paintImage(painter, context, - x, y, wrappedContext.getWidth(), wrappedContext.getHeight()); + adapter.paintImage(painter, context, + x, y, wrappedContext.getWidth(), wrappedContext.getHeight()); } /** @@ -128,7 +128,7 @@ public abstract class AbstractGenericSVGHandler implements XMLHandler, RendererC } return docURI; } - + /** * Override this method to update the renderer context if it needs special settings for * certain conditions. diff --git a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java index e91947ba5..3f9135d2a 100644 --- a/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/AbstractGraphics2DAdapter.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; import java.awt.Color; @@ -52,7 +52,7 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { * @return the generated BufferedImage */ protected BufferedImage paintToBufferedImage( - org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, + org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, RendererContextWrapper context, int resolution, boolean gray, boolean withAlpha) { int bmw = (int)Math.ceil(UnitConv.mpt2px(context.getWidth(), resolution)); int bmh = (int)Math.ceil(UnitConv.mpt2px(context.getHeight(), resolution)); @@ -72,10 +72,10 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { } Graphics2D g2d = bi.createGraphics(); try { - g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, + g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON); setRenderingHintsForBufferedImage(g2d); - + g2d.setBackground(Color.white); g2d.setColor(Color.black); if (!withAlpha) { @@ -130,18 +130,18 @@ public abstract class AbstractGraphics2DAdapter implements Graphics2DAdapter { * @param g2d the Graphics2D instance */ protected void setRenderingHintsForBufferedImage(Graphics2D g2d) { - g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, + g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF); - g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, + g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_OFF); } /** {@inheritDoc} */ - public void paintImage(Graphics2DImagePainter painter, + public void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException { paintImage((org.apache.xmlgraphics.java2d.Graphics2DImagePainter)painter, context, x, y, width, height); } - + } diff --git a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java index a6c08747f..bf9f660be 100644 --- a/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java +++ b/src/java/org/apache/fop/render/AbstractPathOrientedRenderer.java @@ -66,7 +66,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { protected void handleBlockTraits(Block block) { int borderPaddingStart = block.getBorderAndPaddingWidthStart(); int borderPaddingBefore = block.getBorderAndPaddingWidthBefore(); - + float startx = currentIPPosition / 1000f; float starty = currentBPPosition / 1000f; float width = block.getIPD() / 1000f; @@ -151,10 +151,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { BorderProps bpsEnd = (BorderProps)borderArea.getTrait(Trait.BORDER_END); drawBackground(startx, starty, width, height, - (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND), + (Trait.Background) backgroundArea.getTrait(Trait.BACKGROUND), bpsBefore, bpsAfter, bpsStart, bpsEnd); drawBorders(startx, starty, width, height, - bpsBefore, bpsAfter, bpsStart, bpsEnd); + bpsBefore, bpsAfter, bpsStart, bpsEnd); } /** @@ -204,13 +204,13 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { fillRect(sx, sy, paddRectWidth, paddRectHeight); } if (back.getImageInfo() != null) { - ImageSize imageSize = back.getImageInfo().getSize(); + ImageSize imageSize = back.getImageInfo().getSize(); saveGraphicsState(); clipRect(sx, sy, paddRectWidth, paddRectHeight); - int horzCount = (int)((paddRectWidth - * 1000 / imageSize.getWidthMpt()) + 1.0f); - int vertCount = (int)((paddRectHeight - * 1000 / imageSize.getHeightMpt()) + 1.0f); + int horzCount = (int)((paddRectWidth + * 1000 / imageSize.getWidthMpt()) + 1.0f); + int vertCount = (int)((paddRectHeight + * 1000 / imageSize.getHeightMpt()) + 1.0f); if (back.getRepeat() == EN_NOREPEAT) { horzCount = 1; vertCount = 1; @@ -233,7 +233,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { // place once Rectangle2D pos; // Image positions are relative to the currentIP/BP - pos = new Rectangle2D.Float(sx - currentIPPosition + pos = new Rectangle2D.Float(sx - currentIPPosition + (x * imageSize.getWidthMpt()), sy - currentBPPosition + (y * imageSize.getHeightMpt()), @@ -242,7 +242,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { drawImage(back.getURL(), pos); } } - + restoreGraphicsState(); } } @@ -277,14 +277,14 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param bpsStart the border specification on the start side * @param bpsEnd the border specification on the end side */ - protected void drawBorders(Rectangle2D.Float borderRect, + protected void drawBorders(Rectangle2D.Float borderRect, BorderProps bpsBefore, BorderProps bpsAfter, BorderProps bpsStart, BorderProps bpsEnd) { float startx = borderRect.x; float starty = borderRect.y; float width = borderRect.width; float height = borderRect.height; boolean[] b = new boolean[] { - (bpsBefore != null), (bpsEnd != null), + (bpsBefore != null), (bpsEnd != null), (bpsAfter != null), (bpsStart != null)}; if (!b[0] && !b[1] && !b[2] && !b[3]) { return; @@ -295,9 +295,9 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { (b[2] ? bpsAfter.width / 1000f : 0.0f), (b[3] ? bpsStart.width / 1000f : 0.0f)}; float[] clipw = new float[] { - BorderProps.getClippedWidth(bpsBefore) / 1000f, - BorderProps.getClippedWidth(bpsEnd) / 1000f, - BorderProps.getClippedWidth(bpsAfter) / 1000f, + BorderProps.getClippedWidth(bpsBefore) / 1000f, + BorderProps.getClippedWidth(bpsEnd) / 1000f, + BorderProps.getClippedWidth(bpsAfter) / 1000f, BorderProps.getClippedWidth(bpsStart) / 1000f}; starty += clipw[0]; height -= clipw[0]; @@ -305,7 +305,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { startx += clipw[3]; width -= clipw[3]; width -= clipw[1]; - + boolean[] slant = new boolean[] { (b[3] && b[0]), (b[0] && b[1]), (b[1] && b[2]), (b[2] && b[3])}; if (bpsBefore != null) { @@ -338,7 +338,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { lineTo(sx2, innery); closePath(); clip(); - drawBorderLine(sx1a, outery, ex1a, innery, true, true, + drawBorderLine(sx1a, outery, ex1a, innery, true, true, bpsBefore.style, bpsBefore.color); restoreGraphicsState(); } @@ -352,7 +352,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { float outerx = startx + width + clipw[1]; float clipx = outerx - clipw[1]; float innerx = outerx - bw[1]; - + saveGraphicsState(); moveTo(clipx, sy1); float sy1a = sy1; @@ -442,8 +442,8 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { restoreGraphicsState(); } } - - /** + + /** * Common method to render the background and borders for any inline area. * The all borders and padding are drawn outside the specified area. * @param area the inline area for which the background, border and padding is to be @@ -456,22 +456,22 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { float height = area.getBPD() / 1000f; float borderPaddingStart = area.getBorderAndPaddingWidthStart() / 1000f; float borderPaddingBefore = area.getBorderAndPaddingWidthBefore() / 1000f; - float bpwidth = borderPaddingStart + float bpwidth = borderPaddingStart + (area.getBorderAndPaddingWidthEnd() / 1000f); float bpheight = borderPaddingBefore + (area.getBorderAndPaddingWidthAfter() / 1000f); - + if (height != 0.0f || bpheight != 0.0f && bpwidth != 0.0f) { drawBackAndBorders(area, x, y - borderPaddingBefore , width + bpwidth , height + bpheight); } - + } - + private static final QName FOX_TRANSFORM = new QName(ExtensionElementMapping.URI, "fox:transform"); - + /** {@inheritDoc} */ protected void renderBlockViewport(BlockViewport bv, List children) { // clip and position viewport if necessary @@ -497,10 +497,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { if (bv.getPositioning() == Block.FIXED) { breakOutList = breakOutOfStateStack(); } - + AffineTransform positionTransform = new AffineTransform(); positionTransform.translate(bv.getXOffset(), bv.getYOffset()); - + //"left/"top" (bv.getX/YOffset()) specify the position of the content rectangle positionTransform.translate(-borderPaddingStart, -borderPaddingBefore); @@ -515,7 +515,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { saveGraphicsState(); //Viewport position concatenateTransformationMatrix(mptToPt(positionTransform)); - + //Background and borders float bpwidth = (borderPaddingStart + bv.getBorderAndPaddingWidthEnd()) / 1000f; float bpheight = (borderPaddingBefore + bv.getBorderAndPaddingWidthAfter()) / 1000f; @@ -525,7 +525,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { AffineTransform contentRectTransform = new AffineTransform(); contentRectTransform.translate(borderPaddingStart, borderPaddingBefore); concatenateTransformationMatrix(mptToPt(contentRectTransform)); - + //Clipping if (bv.getClip()) { clipRect(0f, 0f, width, height); @@ -535,18 +535,18 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { //Set up coordinate system for content rectangle AffineTransform contentTransform = ctm.toAffineTransform(); concatenateTransformationMatrix(mptToPt(contentTransform)); - + currentIPPosition = 0; currentBPPosition = 0; renderBlocks(bv, children); restoreGraphicsState(); restoreGraphicsState(); - + if (breakOutList != null) { restoreStateStackAfterBreakOut(breakOutList); } - + currentIPPosition = saveIP; currentBPPosition = saveBP; } else { @@ -561,16 +561,16 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { CTM tempctm = new CTM(containingIPPosition, currentBPPosition); ctm = tempctm.multiply(ctm); - + //Now adjust for border/padding currentBPPosition += borderPaddingBefore; Rectangle2D clippingRect = null; if (bv.getClip()) { - clippingRect = new Rectangle(currentIPPosition, currentBPPosition, + clippingRect = new Rectangle(currentIPPosition, currentBPPosition, bv.getIPD(), bv.getBPD()); } - + startVParea(ctm, clippingRect); currentIPPosition = 0; currentBPPosition = 0; @@ -579,7 +579,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { currentIPPosition = saveIP; currentBPPosition = saveBP; - + currentBPPosition += (int)(bv.getAllocBPD()); } } @@ -595,7 +595,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { at.translate(currentIPPosition, currentBPPosition); at.translate(block.getXOffset(), block.getYOffset()); at.translate(0, block.getSpaceBefore()); - + if (!at.isIdentity()) { saveGraphicsState(); concatenateTransformationMatrix(mptToPt(at)); @@ -613,12 +613,12 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { if (!at.isIdentity()) { restoreGraphicsState(); } - + // stacked and relative blocks effect stacking currentIPPosition = saveIP; currentBPPosition = saveBP; } - + /** {@inheritDoc} */ protected void renderFlow(NormalFlow flow) { // save position and offset @@ -628,7 +628,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { //Establish a new coordinate system AffineTransform at = new AffineTransform(); at.translate(currentIPPosition, currentBPPosition); - + if (!at.isIdentity()) { saveGraphicsState(); concatenateTransformationMatrix(mptToPt(at)); @@ -637,23 +637,23 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { currentIPPosition = 0; currentBPPosition = 0; super.renderFlow(flow); - + if (!at.isIdentity()) { restoreGraphicsState(); } - + // stacked and relative blocks effect stacking currentIPPosition = saveIP; currentBPPosition = saveBP; } - + /** * Concatenates the current transformation matrix with the given one, therefore establishing * a new coordinate system. * @param at the transformation matrix to process (coordinates in points) */ protected abstract void concatenateTransformationMatrix(AffineTransform at); - + /** * Render an inline viewport. * This renders an inline viewport by clipping if necessary. @@ -665,10 +665,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { float y = (currentBPPosition + viewport.getOffset()) / 1000f; float width = viewport.getIPD() / 1000f; float height = viewport.getBPD() / 1000f; - // TODO: Calculate the border rect correctly. + // TODO: Calculate the border rect correctly. float borderPaddingStart = viewport.getBorderAndPaddingWidthStart() / 1000f; float borderPaddingBefore = viewport.getBorderAndPaddingWidthBefore() / 1000f; - float bpwidth = borderPaddingStart + float bpwidth = borderPaddingStart + (viewport.getBorderAndPaddingWidthEnd() / 1000f); float bpheight = borderPaddingBefore + (viewport.getBorderAndPaddingWidthAfter() / 1000f); @@ -692,7 +692,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param breakOutList the state stack to restore. */ protected abstract void restoreStateStackAfterBreakOut(List breakOutList); - + /** * Breaks out of the state stack to handle fixed block-containers. * @return the saved state stack to recreate later @@ -701,16 +701,16 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { /** Saves the graphics state of the rendering engine. */ protected abstract void saveGraphicsState(); - + /** Restores the last graphics state of the rendering engine. */ protected abstract void restoreGraphicsState(); /** Indicates the beginning of a text object. */ protected abstract void beginTextObject(); - + /** Indicates the end of a text object. */ protected abstract void endTextObject(); - + /** * Paints the text decoration marks. * @param fm Current typeface @@ -719,10 +719,10 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param baseline position of the baseline * @param startx start IPD */ - protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline, + protected void renderTextDecoration(FontMetrics fm, int fontsize, InlineArea inline, int baseline, int startx) { - boolean hasTextDeco = inline.hasUnderline() - || inline.hasOverline() + boolean hasTextDeco = inline.hasUnderline() + || inline.hasOverline() || inline.hasLineThrough(); if (hasTextDeco) { endTextObject(); @@ -733,22 +733,22 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { if (inline.hasUnderline()) { Color ct = (Color) inline.getTrait(Trait.UNDERLINE_COLOR); float y = baseline - descender / 2f; - drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, - endx, (y + halfLineWidth) / 1000f, + drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, + endx, (y + halfLineWidth) / 1000f, true, true, Constants.EN_SOLID, ct); } if (inline.hasOverline()) { Color ct = (Color) inline.getTrait(Trait.OVERLINE_COLOR); float y = (float)(baseline - (1.1 * capHeight)); - drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, - endx, (y + halfLineWidth) / 1000f, + drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, + endx, (y + halfLineWidth) / 1000f, true, true, Constants.EN_SOLID, ct); } if (inline.hasLineThrough()) { Color ct = (Color) inline.getTrait(Trait.LINETHROUGH_COLOR); float y = (float)(baseline - (0.45 * capHeight)); - drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, - endx, (y + halfLineWidth) / 1000f, + drawBorderLine(startx / 1000f, (y - halfLineWidth) / 1000f, + endx, (y + halfLineWidth) / 1000f, true, true, Constants.EN_SOLID, ct); } } @@ -756,7 +756,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { /** Clip using the current path. */ protected abstract void clip(); - + /** * Clip using a rectangular area. * @param x the x coordinate (in points) @@ -765,28 +765,28 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param height the height of the rectangle (in points) */ protected abstract void clipRect(float x, float y, float width, float height); - + /** - * Moves the current point to (x, y), omitting any connecting line segment. + * Moves the current point to (x, y), omitting any connecting line segment. * @param x x coordinate * @param y y coordinate */ protected abstract void moveTo(float x, float y); - + /** - * Appends a straight line segment from the current point to (x, y). The - * new current point is (x, y). + * Appends a straight line segment from the current point to (x, y). The + * new current point is (x, y). * @param x x coordinate * @param y y coordinate */ protected abstract void lineTo(float x, float y); - + /** - * Closes the current subpath by appending a straight line segment from + * Closes the current subpath by appending a straight line segment from * the current point to the starting point of the subpath. */ protected abstract void closePath(); - + /** * Fill a rectangular area. * @param x the x coordinate @@ -802,7 +802,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param fill true to set the fill color, false for the foreground color */ protected abstract void updateColor(Color col, boolean fill); - + /** * Draw an image at the indicated location. * @param url the URI/URL of the image @@ -810,7 +810,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param foreignAttributes an optional Map with foreign attributes, may be null */ protected abstract void drawImage(String url, Rectangle2D pos, Map foreignAttributes); - + /** * Draw an image at the indicated location. * @param url the URI/URL of the image @@ -819,7 +819,7 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { protected final void drawImage(String url, Rectangle2D pos) { drawImage(url, pos, null); } - + /** * Draw a border segment of an XSL-FO style border. * @param x1 starting x coordinate @@ -827,12 +827,12 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { * @param x2 ending x coordinate * @param y2 ending y coordinate * @param horz true for horizontal border segments, false for vertical border segments - * @param startOrBefore true for border segments on the start or before edge, + * @param startOrBefore true for border segments on the start or before edge, * false for end or after. * @param style the border style (one of Constants.EN_DASHED etc.) * @param col the color for the border segment */ - protected abstract void drawBorderLine(float x1, float y1, float x2, float y2, + protected abstract void drawBorderLine(float x1, float y1, float x2, float y2, boolean horz, boolean startOrBefore, int style, Color col); /** {@inheritDoc} */ @@ -842,5 +842,5 @@ public abstract class AbstractPathOrientedRenderer extends PrintRenderer { String ns = fo.getNameSpace(); renderDocument(doc, ns, pos, fo.getForeignAttributes()); } - + } diff --git a/src/java/org/apache/fop/render/AbstractRenderer.java b/src/java/org/apache/fop/render/AbstractRenderer.java index ebff5323b..e80775890 100644 --- a/src/java/org/apache/fop/render/AbstractRenderer.java +++ b/src/java/org/apache/fop/render/AbstractRenderer.java @@ -5,9 +5,9 @@ * 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. @@ -75,12 +75,12 @@ import org.apache.fop.fonts.FontInfo; * top level processing of the area tree and adds some abstract methods to * handle viewports. This keeps track of the current block and inline position. */ -public abstract class AbstractRenderer +public abstract class AbstractRenderer implements Renderer, Constants { /** logging instance */ protected static Log log = LogFactory.getLog("org.apache.fop.render"); - + /** * user agent */ @@ -110,9 +110,9 @@ public abstract class AbstractRenderer /** the currently active PageViewport */ protected PageViewport currentPageViewport; - + private Set warnedXMLHandlers; - + /** {@inheritDoc} */ public abstract void setupFontInfo(FontInfo fontInfo); @@ -153,7 +153,7 @@ public abstract class AbstractRenderer } /** - * {@inheritDoc} + * {@inheritDoc} */ public void processOffDocumentItem(OffDocumentItem odi) { } @@ -161,17 +161,17 @@ public abstract class AbstractRenderer public Graphics2DAdapter getGraphics2DAdapter() { return null; } - + /** {@inheritDoc} */ public ImageAdapter getImageAdapter() { return null; } - + /** @return the current PageViewport or null, if none is active */ protected PageViewport getCurrentPageViewport() { return this.currentPageViewport; } - + /** {@inheritDoc} */ public void preparePage(PageViewport page) { } @@ -212,7 +212,7 @@ public abstract class AbstractRenderer public void startPageSequence(LineArea seqTitle) { //do nothing } - + /** {@inheritDoc} */ public void startPageSequence(PageSequence pageSequence) { startPageSequence(pageSequence.getTitle()); @@ -300,7 +300,7 @@ public abstract class AbstractRenderer * Establishes a new viewport area. * * @param ctm the coordinate transformation matrix to use - * @param clippingRect the clipping rectangle if the viewport should be clipping, + * @param clippingRect the clipping rectangle if the viewport should be clipping, * null if no clipping is performed. */ protected abstract void startVParea(CTM ctm, Rectangle2D clippingRect); @@ -462,7 +462,7 @@ public abstract class AbstractRenderer if (bv.getClip()) { clippingRect = new Rectangle(saveIP, saveBP, bv.getIPD(), bv.getBPD()); } - + CTM ctm = bv.getCTM(); currentIPPosition = 0; currentBPPosition = 0; @@ -495,12 +495,12 @@ public abstract class AbstractRenderer * @param block the block area */ protected abstract void renderReferenceArea(Block block); - + /** * Renders a list of block areas. * * @param parent the parent block if the parent is a block, otherwise - * a null value. + * a null value. * @param blocks The block areas */ protected void renderBlocks(Block parent, List blocks) { @@ -517,7 +517,7 @@ public abstract class AbstractRenderer currentIPPosition += spaceStart.intValue(); }*/ } - + // the position of the containing block is used for // absolutely positioned areas int contBP = currentBPPosition; @@ -538,8 +538,8 @@ public abstract class AbstractRenderer // a line area is rendered from the top left position // of the line, each inline object is offset from there LineArea line = (LineArea) obj; - currentIPPosition = contIP - + parent.getStartIndent() + currentIPPosition = contIP + + parent.getStartIndent() + line.getStartIndent(); renderLineArea(line); //InlineArea child = (InlineArea) line.getInlineAreas().get(0); @@ -637,14 +637,14 @@ public abstract class AbstractRenderer } } - /** + /** * Common method to render the background and borders for any inline area. * The all borders and padding are drawn outside the specified area. * @param area the inline area for which the background, border and padding is to be * rendered */ protected abstract void renderInlineAreaBackAndBorders(InlineArea area); - + /** * Render the given Space. * @param space the space to render @@ -676,7 +676,7 @@ public abstract class AbstractRenderer int saveBP = currentBPPosition; Iterator iter = text.getChildAreas().iterator(); while (iter.hasNext()) { - renderInlineArea((InlineArea) iter.next()); + renderInlineArea((InlineArea) iter.next()); } currentIPPosition = saveIP + text.getAllocIPD(); } @@ -709,7 +709,7 @@ public abstract class AbstractRenderer currentBPPosition += ip.getOffset(); Iterator iter = ip.getChildAreas().iterator(); while (iter.hasNext()) { - renderInlineArea((InlineArea) iter.next()); + renderInlineArea((InlineArea) iter.next()); } currentIPPosition = saveIP + ip.getAllocIPD(); currentBPPosition = saveBP; @@ -809,7 +809,7 @@ public abstract class AbstractRenderer handler.handleXML(ctx, doc, namespace); } catch (Exception e) { // could not handle document - ResourceEventProducer eventProducer + ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get( ctx.getUserAgent().getEventBroadcaster()); eventProducer.foreignXMLProcessingError(this, doc, namespace, e); @@ -830,7 +830,7 @@ public abstract class AbstractRenderer /** * Get the MIME type of the renderer. - * + * * @return The MIME type of the renderer */ public String getMimeType() { diff --git a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java index 982b23f05..33d5a3bcf 100644 --- a/src/java/org/apache/fop/render/AbstractRendererConfigurator.java +++ b/src/java/org/apache/fop/render/AbstractRendererConfigurator.java @@ -5,9 +5,9 @@ * 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. diff --git a/src/java/org/apache/fop/render/AbstractRendererMaker.java b/src/java/org/apache/fop/render/AbstractRendererMaker.java index 381d2e134..fadfda94d 100644 --- a/src/java/org/apache/fop/render/AbstractRendererMaker.java +++ b/src/java/org/apache/fop/render/AbstractRendererMaker.java @@ -5,9 +5,9 @@ * 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. @@ -26,7 +26,7 @@ import org.apache.fop.apps.FOUserAgent; * about them. */ public abstract class AbstractRendererMaker { - + /** * Instantiates a new renderer. * @param userAgent the user agent @@ -38,7 +38,7 @@ public abstract class AbstractRendererMaker { * @return Indicates whether this renderer requires an OutputStream to work with. */ public abstract boolean needsOutputStream(); - + /** * @return an array of MIME types the renderer supports. */ diff --git a/src/java/org/apache/fop/render/DefaultFontResolver.java b/src/java/org/apache/fop/render/DefaultFontResolver.java index d25328b9f..6fb7e0f01 100644 --- a/src/java/org/apache/fop/render/DefaultFontResolver.java +++ b/src/java/org/apache/fop/render/DefaultFontResolver.java @@ -30,7 +30,7 @@ import org.apache.fop.fonts.FontResolver; public class DefaultFontResolver implements FontResolver { private FOUserAgent userAgent; - + /** * Main constructor. * @param userAgent the user agent @@ -38,10 +38,10 @@ public class DefaultFontResolver implements FontResolver { public DefaultFontResolver(FOUserAgent userAgent) { this.userAgent = userAgent; } - + /** {@inheritDoc} */ public Source resolve(String href) { return userAgent.resolveURI(href, userAgent.getFontBaseURL()); } - + } diff --git a/src/java/org/apache/fop/render/Graphics2DAdapter.java b/src/java/org/apache/fop/render/Graphics2DAdapter.java index 4fbdbe09a..6c389d0ec 100644 --- a/src/java/org/apache/fop/render/Graphics2DAdapter.java +++ b/src/java/org/apache/fop/render/Graphics2DAdapter.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; import java.io.IOException; @@ -43,10 +43,10 @@ public interface Graphics2DAdapter { * @param height height of the image * @throws IOException In case of an I/O error while writing the output format */ - void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, + void paintImage(org.apache.xmlgraphics.java2d.Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException; - + /** * Paints an arbitrary images on a given Graphics2D instance. The renderer * providing this functionality must set up a Graphics2D instance so that @@ -62,8 +62,8 @@ public interface Graphics2DAdapter { * @throws IOException In case of an I/O error while writing the output format * @deprecated Use the variant with the Graphics2DImagePainter from XML Graphics Commons instead */ - void paintImage(Graphics2DImagePainter painter, + void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException; - + } diff --git a/src/java/org/apache/fop/render/Graphics2DImagePainter.java b/src/java/org/apache/fop/render/Graphics2DImagePainter.java index 0167417fe..da802418c 100644 --- a/src/java/org/apache/fop/render/Graphics2DImagePainter.java +++ b/src/java/org/apache/fop/render/Graphics2DImagePainter.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; /** diff --git a/src/java/org/apache/fop/render/ImageAdapter.java b/src/java/org/apache/fop/render/ImageAdapter.java index 1984cfa96..a67d43bdc 100644 --- a/src/java/org/apache/fop/render/ImageAdapter.java +++ b/src/java/org/apache/fop/render/ImageAdapter.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; import java.awt.image.RenderedImage; @@ -40,8 +40,8 @@ public interface ImageAdapter { * @param height height of the image * @throws IOException In case of an I/O error while writing the output format */ - void paintImage(RenderedImage image, + void paintImage(RenderedImage image, RendererContext context, int x, int y, int width, int height) throws IOException; - + } diff --git a/src/java/org/apache/fop/render/PrintRendererConfigurator.java b/src/java/org/apache/fop/render/PrintRendererConfigurator.java index 6849f867f..4409c62b8 100644 --- a/src/java/org/apache/fop/render/PrintRendererConfigurator.java +++ b/src/java/org/apache/fop/render/PrintRendererConfigurator.java @@ -5,9 +5,9 @@ * 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. @@ -71,7 +71,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator /** * Builds a list of EmbedFontInfo objects for use with the setup() method. - * + * * @param renderer print renderer * @throws FOPException if something's wrong with the config data */ @@ -105,7 +105,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator /** * Builds a list of EmbedFontInfo objects for use with the setup() method. - * + * * @param cfg Configuration object * @param fontResolver the FontResolver to use * @param strict true if an Exception should be thrown if an error is found. @@ -285,7 +285,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator /** * Creates a new FontTriplet given a triple Configuration - * + * * @param tripletCfg a triplet configuration * @param strict use strict validation * @return a font triplet font key @@ -323,7 +323,7 @@ public class PrintRendererConfigurator extends AbstractRendererConfigurator /** * Returns a font info from a font node Configuration definition - * + * * @param fontCfg Configuration object (font node) * @param fontResolver font resolver used to resolve font * @param strict validate configuration strictly diff --git a/src/java/org/apache/fop/render/Renderer.java b/src/java/org/apache/fop/render/Renderer.java index 03b4582f7..0ff37db0e 100644 --- a/src/java/org/apache/fop/render/Renderer.java +++ b/src/java/org/apache/fop/render/Renderer.java @@ -5,9 +5,9 @@ * 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. @@ -54,7 +54,7 @@ public interface Renderer { /** * Get the MIME type of the renderer. - * + * * @return The MIME type of the renderer, may return null if not applicable. */ String getMimeType(); @@ -93,7 +93,7 @@ public interface Renderer { * @return the user agent */ FOUserAgent getUserAgent(); - + /** * Set up the given FontInfo. * @@ -115,7 +115,7 @@ public interface Renderer { boolean supportsOutOfOrder(); /** - * Tells the renderer to process an item not explicitly placed on the + * Tells the renderer to process an item not explicitly placed on the * document (e.g., PDF bookmarks). Note - not all renderers will process * all off-document items. * @@ -127,12 +127,12 @@ public interface Renderer { * @return the adapter for painting Java2D images (or null if not supported) */ Graphics2DAdapter getGraphics2DAdapter(); - + /** * @return the adapter for painting RenderedImages (or null if not supported) */ ImageAdapter getImageAdapter(); - + /** * This is called if the renderer supports out of order rendering. The * renderer should prepare the page so that a page further on in the set of diff --git a/src/java/org/apache/fop/render/RendererConfigurator.java b/src/java/org/apache/fop/render/RendererConfigurator.java index 028a4863b..6dceeb74d 100644 --- a/src/java/org/apache/fop/render/RendererConfigurator.java +++ b/src/java/org/apache/fop/render/RendererConfigurator.java @@ -5,9 +5,9 @@ * 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. diff --git a/src/java/org/apache/fop/render/RendererContext.java b/src/java/org/apache/fop/render/RendererContext.java index feffc05ed..08ca76957 100644 --- a/src/java/org/apache/fop/render/RendererContext.java +++ b/src/java/org/apache/fop/render/RendererContext.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; //Java @@ -54,7 +54,7 @@ public class RendererContext { public AbstractRenderer getRenderer() { return renderer; } - + /** * Returns the MIME type associated with this RendererContext. * @@ -121,7 +121,7 @@ public class RendererContext { /** The wrapped RendererContext */ protected RendererContext context; - + /** * Main constructor * @param context the RendererContent instance @@ -129,7 +129,7 @@ public class RendererContext { public RendererContextWrapper(RendererContext context) { this.context = context; } - + /** @return the user agent */ public FOUserAgent getUserAgent() { return context.getUserAgent(); @@ -158,7 +158,7 @@ public class RendererContext { /** @return the foreign attributes */ public Map getForeignAttributes() { return (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES); - } - } + } + } } diff --git a/src/java/org/apache/fop/render/RendererContextConstants.java b/src/java/org/apache/fop/render/RendererContextConstants.java index ff7f1f6af..05d802e54 100644 --- a/src/java/org/apache/fop/render/RendererContextConstants.java +++ b/src/java/org/apache/fop/render/RendererContextConstants.java @@ -26,10 +26,10 @@ public interface RendererContextConstants { /** The output stream that the document is being sent to. */ String OUTPUT_STREAM = "outputStream"; - + /** The current PageViewport being rendered. */ String PAGE_VIEWPORT = "pageViewport"; - + /** The target width of the image being painted. */ String WIDTH = "width"; @@ -44,11 +44,11 @@ public interface RendererContextConstants { /** The configuration for the XMLHandler. */ String HANDLER_CONFIGURATION = "cfg"; - + /** - * An optional Map (keys: QName, values: String) with attributes containing additional hints + * An optional Map (keys: QName, values: String) with attributes containing additional hints * for rendering. */ String FOREIGN_ATTRIBUTES = "foreign-attributes"; - + } diff --git a/src/java/org/apache/fop/render/RendererEventProducer.java b/src/java/org/apache/fop/render/RendererEventProducer.java index 365c8f430..c61e4a8ee 100644 --- a/src/java/org/apache/fop/render/RendererEventProducer.java +++ b/src/java/org/apache/fop/render/RendererEventProducer.java @@ -31,7 +31,7 @@ public interface RendererEventProducer extends EventProducer { /** Provider class for the event producer. */ class Provider { - + /** * Returns an event producer. * @param broadcaster the event broadcaster to use diff --git a/src/java/org/apache/fop/render/RendererFactory.java b/src/java/org/apache/fop/render/RendererFactory.java index d81f900e0..a77ee6a03 100644 --- a/src/java/org/apache/fop/render/RendererFactory.java +++ b/src/java/org/apache/fop/render/RendererFactory.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; import java.io.OutputStream; @@ -39,14 +39,14 @@ import org.apache.fop.fo.FOEventHandler; * Factory for FOEventHandlers and Renderers. */ public class RendererFactory { - + /** the logger */ private static Log log = LogFactory.getLog(RendererFactory.class); private Map rendererMakerMapping = new java.util.HashMap(); private Map eventHandlerMakerMapping = new java.util.HashMap(); - - + + /** * Main constructor. */ @@ -54,7 +54,7 @@ public class RendererFactory { discoverRenderers(); discoverFOEventHandlers(); } - + /** * Add a new RendererMaker. If another maker has already been registered for a * particular MIME type, this call overwrites the existing one. @@ -65,13 +65,13 @@ public class RendererFactory { for (int i = 0; i < mimes.length; i++) { //This overrides any renderer previously set for a MIME type if (rendererMakerMapping.get(mimes[i]) != null) { - log.trace("Overriding renderer for " + mimes[i] + log.trace("Overriding renderer for " + mimes[i] + " with " + maker.getClass().getName()); } rendererMakerMapping.put(mimes[i], maker); } } - + /** * Add a new FOEventHandlerMaker. If another maker has already been registered for a * particular MIME type, this call overwrites the existing one. @@ -82,13 +82,13 @@ public class RendererFactory { for (int i = 0; i < mimes.length; i++) { //This overrides any event handler previously set for a MIME type if (eventHandlerMakerMapping.get(mimes[i]) != null) { - log.trace("Overriding FOEventHandler for " + mimes[i] + log.trace("Overriding FOEventHandler for " + mimes[i] + " with " + maker.getClass().getName()); } eventHandlerMakerMapping.put(mimes[i], maker); } } - + /** * Add a new RendererMaker. If another maker has already been registered for a * particular MIME type, this call overwrites the existing one. @@ -114,7 +114,7 @@ public class RendererFactory { + AbstractRendererMaker.class.getName()); } } - + /** * Add a new FOEventHandlerMaker. If another maker has already been registered for a * particular MIME type, this call overwrites the existing one. @@ -140,7 +140,7 @@ public class RendererFactory { + AbstractFOEventHandlerMaker.class.getName()); } } - + /** * Returns a RendererMaker which handles the given MIME type. * @param mime the requested output format @@ -151,7 +151,7 @@ public class RendererFactory { = (AbstractRendererMaker)rendererMakerMapping.get(mime); return maker; } - + /** * Returns a FOEventHandlerMaker which handles the given MIME type. * @param mime the requested output format @@ -162,7 +162,7 @@ public class RendererFactory { = (AbstractFOEventHandlerMaker)eventHandlerMakerMapping.get(mime); return maker; } - + /** * Creates a Renderer object based on render-type desired * @param userAgent the user agent for access to configuration @@ -170,7 +170,7 @@ public class RendererFactory { * @return the new Renderer instance * @throws FOPException if the renderer cannot be properly constructed */ - public Renderer createRenderer(FOUserAgent userAgent, String outputFormat) + public Renderer createRenderer(FOUserAgent userAgent, String outputFormat) throws FOPException { if (userAgent.getRendererOverride() != null) { return userAgent.getRendererOverride(); @@ -189,8 +189,8 @@ public class RendererFactory { return rend; } } - - + + /** * Creates FOEventHandler instances based on the desired output. * @param userAgent the user agent for access to configuration @@ -199,7 +199,7 @@ public class RendererFactory { * @return the newly constructed FOEventHandler * @throws FOPException if the FOEventHandler cannot be properly constructed */ - public FOEventHandler createFOEventHandler(FOUserAgent userAgent, + public FOEventHandler createFOEventHandler(FOUserAgent userAgent, String outputFormat, OutputStream out) throws FOPException { if (userAgent.getFOEventHandlerOverride() != null) { @@ -214,8 +214,8 @@ public class RendererFactory { + " Neither an FOEventHandler, nor a Renderer could be found" + " for this output format."); } else { - if (out == null - && userAgent.getRendererOverride() == null + if (out == null + && userAgent.getRendererOverride() == null && rendMaker.needsOutputStream()) { throw new FOPException( "OutputStream has not been set"); @@ -228,7 +228,7 @@ public class RendererFactory { } } } - + /** * @return an array of all supported MIME types */ @@ -245,7 +245,7 @@ public class RendererFactory { Collections.sort(lst); return (String[])lst.toArray(new String[lst.size()]); } - + /** * Discovers Renderer implementations through the classpath and dynamically * registers them. @@ -259,7 +259,7 @@ public class RendererFactory { AbstractRendererMaker maker = (AbstractRendererMaker)providers.next(); try { if (log.isDebugEnabled()) { - log.debug("Dynamically adding maker for Renderer: " + log.debug("Dynamically adding maker for Renderer: " + maker.getClass().getName()); } addRendererMaker(maker); @@ -270,7 +270,7 @@ public class RendererFactory { } } } - + /** * Discovers FOEventHandler implementations through the classpath and dynamically * registers them. @@ -284,7 +284,7 @@ public class RendererFactory { AbstractFOEventHandlerMaker maker = (AbstractFOEventHandlerMaker)providers.next(); try { if (log.isDebugEnabled()) { - log.debug("Dynamically adding maker for FOEventHandler: " + log.debug("Dynamically adding maker for FOEventHandler: " + maker.getClass().getName()); } addFOEventHandlerMaker(maker); @@ -295,5 +295,5 @@ public class RendererFactory { } } } - + } diff --git a/src/java/org/apache/fop/render/XMLHandler.java b/src/java/org/apache/fop/render/XMLHandler.java index 7966b3b06..f8152fcbf 100644 --- a/src/java/org/apache/fop/render/XMLHandler.java +++ b/src/java/org/apache/fop/render/XMLHandler.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render; import org.w3c.dom.Document; @@ -46,9 +46,9 @@ public interface XMLHandler { * @param ns The Namespace of the foreign object * @exception Exception If an error occurs during processing. */ - void handleXML(RendererContext context, + void handleXML(RendererContext context, Document doc, String ns) throws Exception; - + /** * Checks if this XMLHandler supports handling an XML namespace for a particular renderer. * @param renderer the renderer for which to check. @@ -57,7 +57,7 @@ public interface XMLHandler { boolean supportsRenderer(Renderer renderer); /** - * @return the XML namespace for the XML dialect this XMLHandler supports, + * @return the XML namespace for the XML dialect this XMLHandler supports, * null if all XML content is handled by this instance. */ String getNamespace(); diff --git a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java index 78822e9c0..fb2420572 100644 --- a/src/java/org/apache/fop/render/XMLHandlerConfigurator.java +++ b/src/java/org/apache/fop/render/XMLHandlerConfigurator.java @@ -5,9 +5,9 @@ * 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. @@ -27,13 +27,13 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.apps.FOUserAgent; /** - * Configurator for XMLHandler objects. + * Configurator for XMLHandler objects. */ public class XMLHandlerConfigurator extends AbstractRendererConfigurator { /** logger instance */ protected static Log log = LogFactory.getLog(XMLHandlerConfigurator.class); - + /** * Default constructor * @param userAgent the user agent diff --git a/src/java/org/apache/fop/render/XMLHandlerRegistry.java b/src/java/org/apache/fop/render/XMLHandlerRegistry.java index 533534c4c..81d9fcc93 100644 --- a/src/java/org/apache/fop/render/XMLHandlerRegistry.java +++ b/src/java/org/apache/fop/render/XMLHandlerRegistry.java @@ -5,9 +5,9 @@ * 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. @@ -37,17 +37,17 @@ public class XMLHandlerRegistry { /** the logger */ private static Log log = LogFactory.getLog(XMLHandlerRegistry.class); - + /** Map containing XML handlers for various document types */ private Map handlers = new java.util.HashMap(); - + /** * Default constructor. */ public XMLHandlerRegistry() { discoverXMLHandlers(); } - + /** * Add a default XML handler which is able to handle any namespace. * @param handler XMLHandler to use @@ -55,7 +55,7 @@ public class XMLHandlerRegistry { private void setDefaultXMLHandler(XMLHandler handler) { addXMLHandler(XMLHandler.HANDLE_ALL, handler); } - + /** * Add an XML handler. The handler itself is inspected to find out what it supports. * @param classname the fully qualified class name @@ -75,11 +75,11 @@ public class XMLHandlerRegistry { + classname); } catch (ClassCastException e) { throw new IllegalArgumentException(classname - + " is not an " + + " is not an " + XMLHandler.class.getName()); } } - + /** * Add an XML handler. The handler itself is inspected to find out what it supports. * @param handler the XMLHandler instance @@ -92,7 +92,7 @@ public class XMLHandlerRegistry { addXMLHandler(ns, handler); } } - + /** * Add an XML handler for the given MIME type and XML namespace. * @param ns Namespace URI @@ -107,7 +107,7 @@ public class XMLHandlerRegistry { } lst.add(handler); } - + /** * Returns an XMLHandler which handles an XML dialect of the given namespace and for * a specified output format defined by its MIME type. @@ -140,7 +140,7 @@ public class XMLHandlerRegistry { } return null; //No handler found } - + /** * Discovers XMLHandler implementations through the classpath and dynamically * registers them. diff --git a/src/java/org/apache/fop/render/afp/AFPEventProducer.java b/src/java/org/apache/fop/render/afp/AFPEventProducer.java index 615c54c32..08641b20e 100644 --- a/src/java/org/apache/fop/render/afp/AFPEventProducer.java +++ b/src/java/org/apache/fop/render/afp/AFPEventProducer.java @@ -31,7 +31,7 @@ public interface AFPEventProducer extends EventProducer { /** Provider class for the event producer. */ class Provider { - + /** * Returns an event producer. * @param broadcaster the event broadcaster to use @@ -50,14 +50,14 @@ public interface AFPEventProducer extends EventProducer { public EventModel createEventModel() { return loadModel(getClass(), "event-model.xml"); } - + } - + /** * Warn about using default font setup. * @param source the event source * @event.severity WARN */ void warnDefaultFontSetup(Object source); - + } diff --git a/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java b/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java index 687a0373e..18ac4dbb6 100644 --- a/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java +++ b/src/java/org/apache/fop/render/afp/AFPGraphics2DAdapter.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render.afp; import java.awt.image.BufferedImage; @@ -37,9 +37,9 @@ public class AFPGraphics2DAdapter extends AbstractGraphics2DAdapter { */ public AFPGraphics2DAdapter() { } - + /** {@inheritDoc} */ - public void paintImage(Graphics2DImagePainter painter, + public void paintImage(Graphics2DImagePainter painter, RendererContext context, int x, int y, int width, int height) throws IOException { RendererContext.RendererContextWrapper wrappedContext @@ -47,7 +47,7 @@ public class AFPGraphics2DAdapter extends AbstractGraphics2DAdapter { AFPRenderer afp = (AFPRenderer)context.getRenderer(); Boolean grayObj = (Boolean)context.getProperty(AFPRendererContextConstants.AFP_GRAYSCALE); boolean gray = (grayObj != null ? grayObj.booleanValue() : false); - + //Paint to a BufferedImage int resolution = (int)Math.round(context.getUserAgent().getTargetResolution()); BufferedImage bi = paintToBufferedImage(painter, wrappedContext, resolution, gray, false); diff --git a/src/java/org/apache/fop/render/afp/AFPRenderer.java b/src/java/org/apache/fop/render/afp/AFPRenderer.java index 00a569ac9..b77ce9396 100644 --- a/src/java/org/apache/fop/render/afp/AFPRenderer.java +++ b/src/java/org/apache/fop/render/afp/AFPRenderer.java @@ -544,8 +544,8 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** {@inheritDoc} */ protected void renderReferenceArea(Block block) { - //TODO Remove this method once concatenateTransformationMatrix() is implemented - + //TODO Remove this method once concatenateTransformationMatrix() is implemented + // save position and offset int saveIP = currentIPPosition; int saveBP = currentBPPosition; @@ -555,7 +555,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { at.translate(currentIPPosition, currentBPPosition); at.translate(block.getXOffset(), block.getYOffset()); at.translate(0, block.getSpaceBefore()); - + if (!at.isIdentity()) { Rectangle2D contentRect = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(), @@ -575,12 +575,12 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { if (!at.isIdentity()) { popViewPortPos(); } - + // stacked and relative blocks effect stacking currentIPPosition = saveIP; currentBPPosition = saveBP; } - + /** {@inheritDoc} */ protected void renderFlow(NormalFlow flow) { // save position and offset @@ -590,7 +590,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { //Establish a new coordinate system AffineTransform at = new AffineTransform(); at.translate(currentIPPosition, currentBPPosition); - + if (!at.isIdentity()) { Rectangle2D contentRect = new Rectangle2D.Double(at.getTranslateX(), at.getTranslateY(), @@ -601,17 +601,17 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { currentIPPosition = 0; currentBPPosition = 0; super.renderFlow(flow); - + if (!at.isIdentity()) { popViewPortPos(); } - + // stacked and relative blocks effect stacking currentIPPosition = saveIP; currentBPPosition = saveBP; } - - + + /** {@inheritDoc} */ protected void concatenateTransformationMatrix(AffineTransform at) { //Not used here since AFPRenderer defines its own renderBlockViewport() method. @@ -1077,7 +1077,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { * } else if (MimeConstants.MIME_JPEG.equals(mime)) { if * (!fopimage.load(FopImage.ORIGINAL_DATA)) { return; } * fact.releaseImage(url, userAgent); - * + * * int x = mpts2units(pos.getX() + currentIPPosition); int y = * mpts2units(pos.getY() + currentBPPosition); int w = * mpts2units(pos.getWidth()); int h = @@ -1165,7 +1165,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Writes a RenderedImage to an OutputStream as raw sRGB bitmaps. - * + * * @param image * the RenderedImage * @param out @@ -1180,7 +1180,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Draws a BufferedImage to AFP. - * + * * @param image * the RenderedImage * @param imageResolution @@ -1486,7 +1486,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Sets the rotation to be used for portrait pages, valid values are 0 * (default), 90, 180, 270. - * + * * @param rotation * The rotation in degrees. */ @@ -1508,7 +1508,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Sets the rotation to be used for landsacpe pages, valid values are 0, 90, * 180, 270 (default). - * + * * @param rotation * The rotation in degrees. */ @@ -1528,7 +1528,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Get the MIME type of the renderer. - * + * * @return The MIME type of the renderer */ public String getMimeType() { @@ -1538,7 +1538,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer { /** * Method to render the page extension. *
- *
+ *
* @param pageViewport the page object
*/
private void renderPageObjectExtensions(PageViewport pageViewport) {
@@ -1605,7 +1605,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/**
* Converts FOP mpt measurement to afp measurement units
- *
+ *
* @param mpt
* the millipoints value
* @return afp measurement unit value
@@ -1617,7 +1617,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/**
* Converts a byte array containing 24 bit RGB image data to a grayscale
* image.
- *
+ *
* @param io
* the target image object
* @param raw
@@ -1792,7 +1792,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/**
* Sets the number of bits used per pixel
- *
+ *
* @param bitsPerPixel
* number of bits per pixel
*/
@@ -1812,7 +1812,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/**
* Sets whether images are color or not
- *
+ *
* @param colorImages
* color image output
*/
@@ -1822,7 +1822,7 @@ public class AFPRenderer extends AbstractPathOrientedRenderer {
/**
* Sets the output/device resolution
- *
+ *
* @param resolution
* the output resolution (dpi)
*/
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
index b9eb8229f..65e39daad 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,10 +38,10 @@ import org.apache.fop.render.afp.fonts.RasterFont;
import org.apache.fop.util.LogUtil;
/**
- * AFP Renderer configurator
+ * AFP Renderer configurator
*/
public class AFPRendererConfigurator extends PrintRendererConfigurator {
-
+
/**
* Default constructor
* @param userAgent user agent
@@ -181,7 +181,7 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator {
}
return null;
}
-
+
/**
* Builds a list of AFPFontInfo objects for use with the setup() method.
* @param cfg Configuration object
@@ -229,14 +229,14 @@ public class AFPRendererConfigurator extends PrintRendererConfigurator {
LogUtil.handleException(log, e,
userAgent.getFactory().validateUserConfigStrictly());
}
-
+
Configuration imagesCfg = cfg.getChild("images");
if (!"color".equalsIgnoreCase(imagesCfg.getAttribute("mode", "b+w"))) {
afpRenderer.setBitsPerPixel(imagesCfg.getAttributeAsInteger("bits-per-pixel", 8));
} else {
afpRenderer.setColorImages(true);
}
-
+
Configuration rendererResolutionCfg = cfg.getChild("renderer-resolution", false);
if (rendererResolutionCfg != null) {
afpRenderer.setResolution(rendererResolutionCfg.getValueAsInteger(240));
diff --git a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
index 7a48d3675..428e5b1ca 100644
--- a/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/afp/AFPRendererContextConstants.java
@@ -27,7 +27,7 @@ import org.apache.fop.render.RendererContextConstants;
public interface AFPRendererContextConstants extends RendererContextConstants {
/**
- * Key for a Boolean value that enables grayscale processing instead of color
+ * Key for a Boolean value that enables grayscale processing instead of color
* processing.
*/
String AFP_GRAYSCALE = "afpGrayscale";
diff --git a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
index 19e6e409c..5f077fdc6 100644
--- a/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
+++ b/src/java/org/apache/fop/render/afp/AFPSVGHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,13 +35,13 @@ public class AFPSVGHandler extends AbstractGenericSVGHandler {
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof AFPRenderer);
}
-
+
/** {@inheritDoc} */
protected void updateRendererContext(RendererContext context) {
//Work around a problem in Batik: Gradients cannot be done in ColorSpace.CS_GRAY
context.setProperty(AFPRendererContextConstants.AFP_GRAYSCALE,
Boolean.FALSE);
}
-
+
}
diff --git a/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java b/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
index 2a5eb6d5f..070e631dc 100644
--- a/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
+++ b/src/java/org/apache/fop/render/afp/exceptions/NestedRuntimeException.java
@@ -30,10 +30,10 @@ import java.io.PrintWriter;
*
*/
public abstract class NestedRuntimeException extends RuntimeException {
-
+
/** Root cause of this nested exception */
private Throwable underlyingException;
-
+
/**
* Construct a NestedRuntimeException
with the specified detail message.
* @param msg The detail message.
@@ -41,7 +41,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
public NestedRuntimeException(String msg) {
super(msg);
}
-
+
/**
* Construct a NestedRuntimeException
with the specified
* detail message and nested exception.
@@ -51,26 +51,26 @@ public abstract class NestedRuntimeException extends RuntimeException {
public NestedRuntimeException(String msg, Throwable t) {
super(msg);
underlyingException = t;
-
+
}
-
+
/**
* Gets the original triggering exception
* @return The original exception as a throwable.
*/
public Throwable getUnderlyingException() {
-
+
return underlyingException;
-
+
}
-
+
/**
* Return the detail message, including the message from the nested
* exception if there is one.
* @return The detail message.
*/
public String getMessage() {
-
+
if (underlyingException == null) {
return super.getMessage();
} else {
@@ -78,9 +78,9 @@ public abstract class NestedRuntimeException extends RuntimeException {
+ "; nested exception is "
+ underlyingException.getClass().getName();
}
-
+
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified stream.
* @param ps the print stream
@@ -93,7 +93,7 @@ public abstract class NestedRuntimeException extends RuntimeException {
underlyingException.printStackTrace(ps);
}
}
-
+
/**
* Print the composite message and the embedded stack trace to the specified writer.
* @param pw the print writer
@@ -106,5 +106,5 @@ public abstract class NestedRuntimeException extends RuntimeException {
underlyingException.printStackTrace(pw);
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java b/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
index 3cec455a0..fe9ec87c0 100644
--- a/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
+++ b/src/java/org/apache/fop/render/afp/exceptions/RendererRuntimeException.java
@@ -24,7 +24,7 @@ package org.apache.fop.render.afp.exceptions;
*
Use PreviewPanel when you want to embed a preview in your own application * with your own controls. Use PreviewDialog when you want to use the standard * Fop controls. - *
+ * *In order to embed a PreviewPanel in your own app, create your own renderer, * and your own agent. In order to support reloads, you may also implement your * own Renderable extension or the default InputHandler. Setting the Renderable @@ -109,7 +109,7 @@ public class PreviewPanel extends JPanel { /** The FOUserAgent associated with this panel - often shared with PreviewDialog */ protected FOUserAgent foUserAgent; /** - * Renderable instance that can be used to reload and re-render a document after + * Renderable instance that can be used to reload and re-render a document after * modifications. */ protected Renderable renderable; @@ -142,7 +142,7 @@ public class PreviewPanel extends JPanel { */ private ViewportScroller scroller; - + /** * Creates a new PreviewPanel instance. * @param foUserAgent the user agent @@ -170,7 +170,7 @@ public class PreviewPanel extends JPanel { previewArea.setMinimumSize(new Dimension(50, 50)); add(previewArea); } - + /** * @return the currently visible page */ @@ -242,12 +242,12 @@ public class PreviewPanel extends JPanel { private int startPosX = 0; /** Starting position of a mouse drag - Y co-ordinate */ private int startPosY = 0; - + ViewportScroller(JViewport vp) { viewport = vp; } - // ***** MouseMotionListener ***** + // ***** MouseMotionListener ***** public synchronized void mouseDragged(MouseEvent e) { if (viewport == null) { @@ -261,7 +261,7 @@ public class PreviewPanel extends JPanel { int viewHeight = viewport.getExtentSize().height; int imageWidth = viewport.getViewSize().width; int imageHeight = viewport.getViewSize().height; - + Point viewPoint = viewport.getViewPosition(); int viewX = Math.max(0, Math.min(imageWidth - viewWidth, viewPoint.x - xmove)); int viewY = Math.max(0, Math.min(imageHeight - viewHeight, viewPoint.y - ymove)); diff --git a/src/java/org/apache/fop/render/awt/viewer/Renderable.java b/src/java/org/apache/fop/render/awt/viewer/Renderable.java index 5324ff8d7..c40272220 100644 --- a/src/java/org/apache/fop/render/awt/viewer/Renderable.java +++ b/src/java/org/apache/fop/render/awt/viewer/Renderable.java @@ -35,5 +35,5 @@ public interface Renderable { */ void renderTo(FOUserAgent userAgent, String outputFormat) throws FOPException; - + } diff --git a/src/java/org/apache/fop/render/awt/viewer/StatusListener.java b/src/java/org/apache/fop/render/awt/viewer/StatusListener.java index 6a7cf7d9b..d145d7718 100644 --- a/src/java/org/apache/fop/render/awt/viewer/StatusListener.java +++ b/src/java/org/apache/fop/render/awt/viewer/StatusListener.java @@ -26,9 +26,9 @@ public interface StatusListener { /** Called when a page has been renderered. */ void notifyPageRendered(); - + /** Called when the renderer has stopped. */ void notifyRendererStopped(); - + } diff --git a/src/java/org/apache/fop/render/awt/viewer/Translator.java b/src/java/org/apache/fop/render/awt/viewer/Translator.java index 6ae76be5b..df07a987f 100644 --- a/src/java/org/apache/fop/render/awt/viewer/Translator.java +++ b/src/java/org/apache/fop/render/awt/viewer/Translator.java @@ -5,9 +5,9 @@ * 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. @@ -16,7 +16,7 @@ */ /* $Id$ */ - + package org.apache.fop.render.awt.viewer; //Java @@ -29,7 +29,7 @@ import java.util.Locale; * Stanislav.Gorkhover@jCatalog.com */ public class Translator { - + private ResourceBundle bundle; private static String bundleBaseName = "org/apache/fop/render/awt/viewer/resources/Viewer"; diff --git a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java index 7b26d0771..6688e40ea 100644 --- a/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java +++ b/src/java/org/apache/fop/render/bitmap/BitmapRendererEventProducer.java @@ -33,7 +33,7 @@ public interface BitmapRendererEventProducer extends EventProducer { /** Provider class for the event producer. */ class Provider { - + /** * Returns an event producer. * @param broadcaster the event broadcaster to use @@ -52,23 +52,23 @@ public interface BitmapRendererEventProducer extends EventProducer { public EventModel createEventModel() { return loadModel(getClass(), "event-model.xml"); } - + } - + /** * No filename information available. Stopping early after the first page. * @param source the event source * @event.severity WARN */ void stoppingAfterFirstPageNoFilename(Object source); - + /** * Image writer does not support multiple images. Only the first page has been produced. * @param source the event source * @event.severity WARN */ void stoppingAfterFirstPageNoMultiWriter(Object source); - + /** * No ImageWriter found. * @param source the event source diff --git a/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java b/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java index 7c1c4ee31..1e3770542 100644 --- a/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java +++ b/src/java/org/apache/fop/render/bitmap/MultiFileRenderingUtil.java @@ -7,7 +7,7 @@ import java.io.IOException; import java.io.OutputStream; /** - * This utility class helps renderers who generate one file per page, + * This utility class helps renderers who generate one file per page, * like the PNG renderer. */ public class MultiFileRenderingUtil { @@ -16,10 +16,10 @@ public class MultiFileRenderingUtil { private String filePrefix; private String fileExtension; - + /** The output directory where images are to be written */ private File outputDir; - + /** * Creates a new instance. *
@@ -60,7 +60,7 @@ public class MultiFileRenderingUtil {
filePrefix = s.substring(0, i);
}
}
-
+
public OutputStream createOutputStream(int pageNumber) throws IOException {
if (filePrefix == null) {
return null;
@@ -71,5 +71,5 @@ public class MultiFileRenderingUtil {
return os;
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
index 8613ef7b8..3733bf2f2 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRenderer.java
@@ -48,7 +48,7 @@ public class PNGRenderer extends Java2DRenderer {
/** The OutputStream for the first Image */
private OutputStream firstOutputStream;
-
+
/** Helper class for generating multiple files */
private MultiFileRenderingUtil multiFileUtil;
@@ -60,7 +60,7 @@ public class PNGRenderer extends Java2DRenderer {
/** {@inheritDoc} */
public void startRenderer(OutputStream outputStream) throws IOException {
log.info("rendering areas to PNG");
- multiFileUtil = new MultiFileRenderingUtil(PNG_FILE_EXTENSION,
+ multiFileUtil = new MultiFileRenderingUtil(PNG_FILE_EXTENSION,
getUserAgent().getOutputFile());
this.firstOutputStream = outputStream;
}
@@ -84,7 +84,7 @@ public class PNGRenderer extends Java2DRenderer {
// Do the rendering: get the image for this page
PageViewport pv = (PageViewport)pageViewportList.get(i);
RenderedImage image = (RenderedImage)getPageImage(pv);
-
+
// Encode this image
if (log.isDebugEnabled()) {
log.debug("Encoding page " + (i + 1));
@@ -102,7 +102,7 @@ public class PNGRenderer extends Java2DRenderer {
private void writeImage(OutputStream os, RenderedImage image) throws IOException {
ImageWriterParams params = new ImageWriterParams();
params.setResolution(Math.round(userAgent.getTargetResolution()));
-
+
// Encode PNG image
ImageWriter writer = ImageWriterRegistry.getInstance().getWriterFor(getMimeType());
if (writer == null) {
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java b/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
index 0f4c4c4fb..7d321791a 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,8 +32,8 @@ import org.apache.fop.render.java2d.Java2DRendererConfigurator;
public class PNGRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PNG};
-
-
+
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent ua) {
return new PNGRenderer();
diff --git a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java b/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
index 36dd093b2..a6a6e8dfe 100644
--- a/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
+++ b/src/java/org/apache/fop/render/bitmap/PNGRenderer_onthefly.java
@@ -96,7 +96,7 @@ public class PNGRenderer_onthefly extends Java2DRenderer {
fileSyntax = s.substring(0, i);
}
- /**
+ /**
* {@inheritDoc}
*/
public void renderPage(PageViewport pageViewport) throws IOException {
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
index 9291427d2..fea831a9b 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRenderer.java
@@ -80,13 +80,13 @@ public class TIFFRenderer extends Java2DRenderer {
//private static final String COMPRESSION_ZLIB = "ZLib";
public static final String COMPRESSION_CCITT_T6 = "CCITT T.6"; //CCITT Group 4
public static final String COMPRESSION_CCITT_T4 = "CCITT T.4"; //CCITT Group 3
-
+
/** ImageWriter parameters */
private ImageWriterParams writerParams;
-
+
/** Image Type as parameter for the BufferedImage constructor (see BufferedImage.TYPE_*) */
private int bufferedImageType = BufferedImage.TYPE_INT_ARGB;
-
+
private OutputStream outputStream;
/** {@inheritDoc} */
@@ -160,7 +160,7 @@ public class TIFFRenderer extends Java2DRenderer {
clearViewportList();
log.debug("TIFF encoding done.");
}
-
+
/** {@inheritDoc} */
protected BufferedImage getBufferedImage(int bitmapWidth, int bitmapHeight) {
return new BufferedImage(bitmapWidth, bitmapHeight, bufferedImageType);
@@ -210,7 +210,7 @@ public class TIFFRenderer extends Java2DRenderer {
//Decorate the image with a packed sample model for encoding by the codec
SinglePixelPackedSampleModel sppsm;
sppsm = (SinglePixelPackedSampleModel)pageImage.getSampleModel();
-
+
int bands = sppsm.getNumBands();
int[] off = new int[bands];
int w = pageImage.getWidth();
@@ -220,7 +220,7 @@ public class TIFFRenderer extends Java2DRenderer {
}
SampleModel sm = new PixelInterleavedSampleModel(
DataBuffer.TYPE_BYTE, w, h, bands, w * bands, off);
-
+
RenderedImage rimg = new FormatRed(GraphicsUtil.wrap(pageImage), sm);
return rimg;
}
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java b/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
index 71ad0b286..ff5e22ceb 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.fop.render.PrintRendererConfigurator;
import org.apache.fop.render.Renderer;
/**
- * TIFF Renderer configurator
+ * TIFF Renderer configurator
*/
public class TIFFRendererConfigurator extends PrintRendererConfigurator {
@@ -47,7 +47,7 @@ public class TIFFRendererConfigurator extends PrintRendererConfigurator {
* @throws FOPException fop exception
* {@inheritDoc}
*/
- public void configure(Renderer renderer) throws FOPException {
+ public void configure(Renderer renderer) throws FOPException {
Configuration cfg = super.getRendererConfig(renderer);
if (cfg != null) {
TIFFRenderer tiffRenderer = (TIFFRenderer)renderer;
diff --git a/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java b/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
index 69463d127..e3c567995 100644
--- a/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
+++ b/src/java/org/apache/fop/render/bitmap/TIFFRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class TIFFRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_TIFF};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new TIFFRenderer();
diff --git a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
index ca4a4bce3..29e80dc2f 100644
--- a/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/Base14FontCollection.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
index 3a773a2db..63b04da32 100644
--- a/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/CustomFontMetricsMapper.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
index ff246af2b..2f87b62ea 100644
--- a/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/FontMetricsMapper.java
@@ -5,9 +5,9 @@
* 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.
@@ -34,5 +34,5 @@ public interface FontMetricsMapper extends FontMetrics {
* @return font with the desired characteristics.
*/
java.awt.Font getFont(int size);
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
index 4eac922e8..fe4e04766 100644
--- a/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
+++ b/src/java/org/apache/fop/render/java2d/InstalledFontCollection.java
@@ -5,9 +5,9 @@
* 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.
@@ -61,7 +61,7 @@ public class InstalledFontCollection implements FontCollection {
/**
* Main constructor
- *
+ *
* @param graphics2D a graphics 2D
*/
public InstalledFontCollection(Graphics2D graphics2D) {
diff --git a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
index 64e329c62..10af3aa86 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DFontMetrics.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java
@@ -63,17 +63,17 @@ public class Java2DFontMetrics {
* The typical height of a small cap latter (often derived from "x", value in mpt)
*/
private int xHeight = 0;
-
+
/**
* The highest point of the font above the baseline (usually derived from "d", value in mpt)
*/
private int ascender = 0;
-
+
/**
* The lowest point of the font under the baseline (usually derived from "p", value in mpt)
*/
private int descender = 0;
-
+
/**
* Buffered font.
* f1 is bufferd for metric measurements during layout.
@@ -103,7 +103,7 @@ public class Java2DFontMetrics {
/** A LineMetrics to access high-resolution metrics information. */
private LineMetrics lineMetrics;
-
+
/**
* Temp graphics object needed to get the font metrics
*/
@@ -130,7 +130,7 @@ public class Java2DFontMetrics {
setFont(family, style, size);
return Math.round(lineMetrics.getAscent() * FONT_FACTOR);
}
-
+
/**
* Determines the font ascent of the Font described by this
* FontMetrics object
@@ -159,7 +159,7 @@ public class Java2DFontMetrics {
* Rectangle FontMetrics.getStringBounds(..) method can be called.
* The y value of the rectangle is the offset from the origin
* (baseline) apparently needed by the sample test program
- *
+ *
* xxxxx@xxxxx 2001-05-15
*/
/* I don't think this is right.
@@ -231,7 +231,7 @@ public class Java2DFontMetrics {
Rectangle2D rect = fmt.getStringBounds(ch, 0, 1, this.graphics);
return (int)Math.round(rect.getWidth() * 1000);
}
-
+
/**
* Return widths (in 1/1000ths of point size) of all
* characters
@@ -265,7 +265,7 @@ public class Java2DFontMetrics {
atts.put(TextAttribute.SIZE, new Float(size)); //size in pt
return new Font(atts);
}
-
+
/**
* Checks whether the font for which values are
* requested is the one used immediately before or
@@ -301,17 +301,17 @@ public class Java2DFontMetrics {
TextLayout layout = new TextLayout("x", f1, graphics.getFontRenderContext());
Rectangle2D rect = layout.getBounds();
xHeight = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible ascent
layout = new TextLayout("d", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
ascender = (int)Math.round(-rect.getY() * 1000);
-
+
//PostScript-compatible descent
layout = new TextLayout("p", f1, graphics.getFontRenderContext());
rect = layout.getBounds();
descender = (int)Math.round((rect.getY() + rect.getHeight()) * -1000);
-
+
//Alternative way to get metrics but the ascender is again wrong for our purposes
lineMetrics = f1.getLineMetrics("", graphics.getFontRenderContext());
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
index b29378a96..8fe93d051 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
import java.awt.Color;
@@ -40,12 +40,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -56,12 +56,12 @@ public class Java2DGraphics2DAdapter extends AbstractGraphics2DAdapter {
Java2DRenderer renderer = (Java2DRenderer)context.getRenderer();
Java2DGraphicsState state = renderer.state;
-
+
//Create copy and paint on that
Graphics2D g2d = (Graphics2D)state.getGraph().create();
g2d.setColor(Color.black);
g2d.setBackground(Color.black);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
diff --git a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
index 31da90c95..1c5fa8427 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DGraphicsState.java
@@ -73,14 +73,14 @@ public class Java2DGraphicsState {
* @param org the instance to copy
*/
public Java2DGraphicsState(Java2DGraphicsState org) {
- this.currentGraphics = (Graphics2D)org.currentGraphics.create();
+ this.currentGraphics = (Graphics2D)org.currentGraphics.create();
this.fontInfo = org.fontInfo;
this.initialTransform = org.initialTransform;
this.currentStroke = org.currentStroke;
this.currentStrokeStyle = org.currentStrokeStyle;
this.currentStrokeWidth = org.currentStrokeWidth;
}
-
+
/**
* @return the currently valid state
*/
@@ -92,7 +92,7 @@ public class Java2DGraphicsState {
public void dispose() {
this.currentGraphics.dispose();
this.currentGraphics = null;
-
+
}
/**
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
index a18f71cc0..0709d4ea9 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
index 0fd87f910..0157b7411 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DRendererContextConstants.java
@@ -29,5 +29,5 @@ public interface Java2DRendererContextConstants extends
/** The current Java2DGraphicsState. */
String JAVA2D_STATE = "state";
-
+
}
diff --git a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
index 64ac823fc..12b269a44 100644
--- a/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
+++ b/src/java/org/apache/fop/render/java2d/Java2DSVGHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -94,7 +94,7 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
+ "currentYPosition = " + currentYPosition + "}";
}
}
-
+
/** {@inheritDoc} */
protected void renderSVGDocument(RendererContext context,
Document doc) {
@@ -105,12 +105,12 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
int x = info.currentXPosition;
int y = info.currentYPosition;
-
+
SVGUserAgent ua = new SVGUserAgent(context.getUserAgent(), new AffineTransform());
-
+
GVTBuilder builder = new GVTBuilder();
BridgeContext ctx = new BridgeContext(ua);
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -120,20 +120,20 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
eventProducer.svgNotBuilt(this, e, getDocumentURI(doc));
return;
}
-
+
// If no viewbox is defined in the svg file, a viewbox of 100x100 is
// assumed, as defined in SVGUserAgent.getViewportSize()
float iw = (float) ctx.getDocumentSize().getWidth() * 1000f;
float ih = (float) ctx.getDocumentSize().getHeight() * 1000f;
-
+
float w = (float) info.width;
float h = (float) info.height;
AffineTransform origTransform = info.state.getGraph().getTransform();
-
+
// correct integer roundoff
info.state.getGraph().translate(x / 1000f, y / 1000f);
-
+
//SVGSVGElement svg = ((SVGDocument) doc).getRootElement();
// Aspect ratio preserved by layout engine, not here
AffineTransform at = AffineTransform.getScaleInstance(w / iw, h / ih);
@@ -148,10 +148,10 @@ public class Java2DSVGHandler extends AbstractGenericSVGHandler
context.getUserAgent().getEventBroadcaster());
eventProducer.svgRenderingError(this, e, getDocumentURI(doc));
}
-
+
info.state.getGraph().setTransform(origTransform);
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof Java2DRenderer);
diff --git a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
index 19e9a4d1d..afcf088cc 100644
--- a/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
+++ b/src/java/org/apache/fop/render/java2d/SystemFontMetricsMapper.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.java2d;
// Java
diff --git a/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
index 10fcfde3d..418810401 100644
--- a/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/DefaultMonochromeBitmapConverter.java
@@ -36,10 +36,10 @@ public class DefaultMonochromeBitmapConverter implements
public void setHint(String name, String value) {
//ignore, not supported
}
-
+
/** {@inheritDoc} */
public RenderedImage convertToMonochrome(BufferedImage img) {
- BufferedImage buf = new BufferedImage(img.getWidth(), img.getHeight(),
+ BufferedImage buf = new BufferedImage(img.getWidth(), img.getHeight(),
BufferedImage.TYPE_BYTE_BINARY);
RenderingHints hints = new RenderingHints(null);
//This hint doesn't seem to make a difference :-(
diff --git a/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
index 89e54b917..e9611edac 100644
--- a/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/JAIMonochromeBitmapConverter.java
@@ -46,20 +46,20 @@ public class JAIMonochromeBitmapConverter implements
MonochromeBitmapConverter {
private boolean isErrorDiffusion = false;
-
+
/** {@inheritDoc} */
public void setHint(String name, String value) {
if ("quality".equalsIgnoreCase(name)) {
isErrorDiffusion = "true".equalsIgnoreCase(value);
}
}
-
+
/** {@inheritDoc} */
public RenderedImage convertToMonochrome(BufferedImage img) {
if (img.getColorModel().getColorSpace().getNumComponents() != 1) {
throw new IllegalArgumentException("Source image must be a grayscale image!");
}
-
+
// Load the ParameterBlock for the dithering operation
// and set the operation name.
ParameterBlock pb = new ParameterBlock();
@@ -78,7 +78,7 @@ public class JAIMonochromeBitmapConverter implements
pb.add(colorMap);
pb.add(KernelJAI.DITHER_MASK_441);
}
-
+
//Create an image layout for a monochrome b/w image
ImageLayout layout = new ImageLayout();
byte[] map = new byte[] {(byte)0x00, (byte)0xff};
@@ -89,8 +89,8 @@ public class JAIMonochromeBitmapConverter implements
RenderingHints hints = new RenderingHints(JAI.KEY_IMAGE_LAYOUT, layout);
// Dither the image.
- PlanarImage dst = JAI.create(opName, pb, hints);
-
+ PlanarImage dst = JAI.create(opName, pb, hints);
+
//Convert it to a BufferedImage
return dst.getAsBufferedImage();
}
diff --git a/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java b/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
index aae0b90ce..9a960f871 100644
--- a/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
+++ b/src/java/org/apache/fop/render/pcl/MonochromeBitmapConverter.java
@@ -33,12 +33,12 @@ public interface MonochromeBitmapConverter {
* @param value the value
*/
void setHint(String name, String value);
-
+
/**
- * Converts a grayscale bitmap image to a monochrome (1-bit) b/w bitmap image.
+ * Converts a grayscale bitmap image to a monochrome (1-bit) b/w bitmap image.
* @param img the grayscale image
* @return the converted monochrome image
*/
RenderedImage convertToMonochrome(BufferedImage img);
-
+
}
diff --git a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
index 3e72de293..3e95bd4f9 100644
--- a/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
+++ b/src/java/org/apache/fop/render/pcl/PCLEventProducer.java
@@ -31,7 +31,7 @@ public interface PCLEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PCLEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Paper type could not be determined. Falling back to another.
* @param source the event source
@@ -62,5 +62,5 @@ public interface PCLEventProducer extends EventProducer {
* @event.severity WARN
*/
void paperTypeUnavailable(Object source, long pageWidth, long pageHeight, String fallbackPaper);
-
+
}
diff --git a/src/java/org/apache/fop/render/pcl/PCLGenerator.java b/src/java/org/apache/fop/render/pcl/PCLGenerator.java
index 6a4425012..d1b6f6578 100644
--- a/src/java/org/apache/fop/render/pcl/PCLGenerator.java
+++ b/src/java/org/apache/fop/render/pcl/PCLGenerator.java
@@ -55,24 +55,24 @@ public class PCLGenerator {
/** The ESC (escape) character */
public static final char ESC = '\033';
-
+
/** A list of all supported resolutions in PCL (values in dpi) */
public static final int[] PCL_RESOLUTIONS = new int[] {75, 100, 150, 200, 300, 600};
-
+
/** Selects a 4x4 Bayer dither matrix (17 grayscales) */
public static final int DITHER_MATRIX_4X4 = 4;
/** Selects a 8x8 Bayer dither matrix (65 grayscales) */
public static final int DITHER_MATRIX_8X8 = 8;
-
- private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
+
+ private final DecimalFormatSymbols symbols = new DecimalFormatSymbols(Locale.US);
private final DecimalFormat df2 = new DecimalFormat("0.##", symbols);
private final DecimalFormat df4 = new DecimalFormat("0.####", symbols);
-
+
private OutputStream out;
-
+
private boolean currentSourceTransparency = true;
private boolean currentPatternTransparency = true;
-
+
private int maxBitmapResolution = PCL_RESOLUTIONS[PCL_RESOLUTIONS.length - 1];
/**
@@ -80,7 +80,7 @@ public class PCLGenerator {
* to create custom dither patterns for better grayscale quality.
*/
private boolean usePCLShades = false;
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -88,7 +88,7 @@ public class PCLGenerator {
public PCLGenerator(OutputStream out) {
this.out = out;
}
-
+
/**
* Main constructor.
* @param out the OutputStream to write the PCL stream to
@@ -108,17 +108,17 @@ public class PCLGenerator {
}
this.maxBitmapResolution = maxResolution;
}
-
+
/** @return the OutputStream that this generator writes to */
public OutputStream getOutputStream() {
return this.out;
}
-
+
/** @return the maximum resolution to encode bitmap images at */
public int getMaximumBitmapResolution() {
return this.maxBitmapResolution;
}
-
+
/**
* Writes a PCL escape command to the output stream.
* @param cmd the command (without the ESCAPE character)
@@ -128,7 +128,7 @@ public class PCLGenerator {
out.write(27); //ESC
out.write(cmd.getBytes("US-ASCII"));
}
-
+
/**
* Writes raw text (in ISO-8859-1 encoding) to the output stream.
* @param s the text
@@ -140,7 +140,7 @@ public class PCLGenerator {
/**
* Formats a double value with two decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -150,7 +150,7 @@ public class PCLGenerator {
/**
* Formats a double value with four decimal positions for PCL output.
- *
+ *
* @param value value to format
* @return the formatted value
*/
@@ -165,7 +165,7 @@ public class PCLGenerator {
public void universalEndOfLanguage() throws IOException {
writeCommand("%-12345X");
}
-
+
/**
* Resets the printer and restores the user default environment.
* @throws IOException In case of an I/O error
@@ -173,7 +173,7 @@ public class PCLGenerator {
public void resetPrinter() throws IOException {
writeCommand("E");
}
-
+
/**
* Sends the job separation command.
* @throws IOException In case of an I/O error
@@ -181,7 +181,7 @@ public class PCLGenerator {
public void separateJobs() throws IOException {
writeCommand("&l1T");
}
-
+
/**
* Sends the form feed character.
* @throws IOException In case of an I/O error
@@ -198,7 +198,7 @@ public class PCLGenerator {
public void setUnitOfMeasure(int value) throws IOException {
writeCommand("&u" + value + "D");
}
-
+
/**
* Sets the raster graphics resolution
* @param value the resolution value (units per inch)
@@ -207,7 +207,7 @@ public class PCLGenerator {
public void setRasterGraphicsResolution(int value) throws IOException {
writeCommand("*t" + value + "R");
}
-
+
/**
* Selects the page size.
* @param selector the integer representing the page size
@@ -218,7 +218,7 @@ public class PCLGenerator {
}
/**
- * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
+ * Selects the paper source. The parameter is usually printer-specific. Usually, "1" is the
* default tray, "2" is the manual paper feed, "3" is the manual envelope feed, "4" is the
* "lower" tray and "7" is "auto-select". Consult the technical reference for your printer
* for all available values.
@@ -230,8 +230,8 @@ public class PCLGenerator {
}
/**
- * Selects the duplexing mode for the page.
- * The parameter is usually printer-specific.
+ * Selects the duplexing mode for the page.
+ * The parameter is usually printer-specific.
* "0" means Simplex,
* "1" means Duplex, Long-Edge Binding,
* "2" means Duplex, Short-Edge Binding.
@@ -249,7 +249,7 @@ public class PCLGenerator {
public void clearHorizontalMargins() throws IOException {
writeCommand("9");
}
-
+
/**
* The Top Margin command designates the number of lines between
* the top of the logical page and the top of the text area.
@@ -303,7 +303,7 @@ public class PCLGenerator {
public void pushCursorPos() throws IOException {
writeCommand("&f0S");
}
-
+
/**
* Pops the current cursor position from the stack.
* @throws IOException In case of an I/O error
@@ -311,7 +311,7 @@ public class PCLGenerator {
public void popCursorPos() throws IOException {
writeCommand("&f1S");
}
-
+
/**
* Changes the current print direction while maintaining the current cursor position.
* @param rotate the rotation angle (counterclockwise), one of 0, 90, 180 and 270.
@@ -320,10 +320,10 @@ public class PCLGenerator {
public void changePrintDirection(int rotate) throws IOException {
writeCommand("&a" + rotate + "P");
}
-
+
/**
* Enters the HP GL/2 mode.
- * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
+ * @param restorePreviousHPGL2Cursor true if the previous HP GL/2 pen position should be
* restored, false if the current position is maintained
* @throws IOException In case of an I/O error
*/
@@ -334,7 +334,7 @@ public class PCLGenerator {
writeCommand("%1B");
}
}
-
+
/**
* Enters the PCL mode.
* @param restorePreviousPCLCursor true if the previous PCL cursor position should be restored,
@@ -348,7 +348,7 @@ public class PCLGenerator {
writeCommand("%1A");
}
}
-
+
/**
* Generate a filled rectangle at the current cursor position.
*
@@ -367,10 +367,10 @@ public class PCLGenerator {
//y += h;
}
setPatternTransparencyMode(false);
- if (usePCLShades
+ if (usePCLShades
|| Color.black.equals(col)
|| Color.white.equals(col)) {
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
int lineshade = convertToPCLShade(col);
writeCommand("*c" + lineshade + "G");
@@ -378,7 +378,7 @@ public class PCLGenerator {
} else {
defineGrayscalePattern(col, 32, DITHER_MATRIX_4X4);
- writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ writeCommand("*c" + formatDouble4(w / 100.0) + "h"
+ formatDouble4(h / 100.0) + "V");
writeCommand("*c32G");
writeCommand("*c4P"); //User-defined pattern
@@ -391,19 +391,19 @@ public class PCLGenerator {
private static final int[] BAYER_D2 = new int[] {0, 2, 3, 1};
private static final int[] BAYER_D4;
private static final int[] BAYER_D8;
-
+
static {
BAYER_D4 = deriveBayerMatrix(BAYER_D2);
BAYER_D8 = deriveBayerMatrix(BAYER_D4);
}
-
+
private static void setValueInMatrix(int[] dn, int half, int part, int idx, int value) {
int xoff = (part & 1) * half;
int yoff = (part & 2) * half * half;
int matrixIndex = yoff + ((int)(idx / half) * half * 2) + (idx % half) + xoff;
dn[matrixIndex] = value;
}
-
+
private static int[] deriveBayerMatrix(int[] d) {
int[] dn = new int[d.length * 4];
int half = (int)Math.sqrt(d.length);
@@ -414,7 +414,7 @@ public class PCLGenerator {
}
return dn;
}
-
+
/**
* Generates a user-defined pattern for a dithering pattern matching the grayscale value
* of the color given.
@@ -423,7 +423,7 @@ public class PCLGenerator {
* @param ditherMatrixSize the size of the Bayer dither matrix to use (4 or 8 supported)
* @throws IOException In case of an I/O error
*/
- public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
+ public void defineGrayscalePattern(Color col, int patternID, int ditherMatrixSize)
throws IOException {
ByteArrayOutputStream baout = new ByteArrayOutputStream();
DataOutputStream data = new DataOutputStream(baout);
@@ -436,36 +436,36 @@ public class PCLGenerator {
//data.writeShort(600); //X Resolution (didn't manage to get that to work)
//data.writeShort(600); //Y Resolution
int gray255 = convertToGray(col.getRed(), col.getGreen(), col.getBlue());
-
+
byte[] pattern;
if (ditherMatrixSize == 8) {
int gray65 = gray255 * 65 / 255;
-
+
pattern = new byte[BAYER_D8.length / 8];
-
+
for (int i = 0, c = BAYER_D8.length; i < c; i++) {
boolean dot = !(BAYER_D8[i] < gray65 - 1);
if (dot) {
int byteIdx = i / 8;
- pattern[byteIdx] |= 1 << (i % 8);
+ pattern[byteIdx] |= 1 << (i % 8);
}
}
} else {
int gray17 = gray255 * 17 / 255;
-
- //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
- //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
+
+ //Since a 4x4 pattern did not work, the 4x4 pattern is applied 4 times to an
+ //8x8 pattern. Maybe this could be changed to use an 8x8 bayer dither pattern
//instead of the 4x4 one.
pattern = new byte[BAYER_D4.length / 8 * 4];
-
+
for (int i = 0, c = BAYER_D4.length; i < c; i++) {
boolean dot = !(BAYER_D4[i] < gray17 - 1);
if (dot) {
int byteIdx = i / 4;
- pattern[byteIdx] |= 1 << (i % 4);
- pattern[byteIdx] |= 1 << ((i % 4) + 4);
- pattern[byteIdx + 4] |= 1 << (i % 4);
- pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx] |= 1 << (i % 4);
+ pattern[byteIdx] |= 1 << ((i % 4) + 4);
+ pattern[byteIdx + 4] |= 1 << (i % 4);
+ pattern[byteIdx + 4] |= 1 << ((i % 4) + 4);
}
}
}
@@ -525,7 +525,7 @@ public class PCLGenerator {
public final int convertToGray(int r, int g, int b) {
return (r * 30 + g * 59 + b * 11) / 100;
}
-
+
/**
* Convert a Color value to a PCL shade value (0-100).
* @param col the color
@@ -535,7 +535,7 @@ public class PCLGenerator {
float gray = convertToGray(col.getRed(), col.getGreen(), col.getBlue()) / 255f;
return (int)(100 - (gray * 100f));
}
-
+
/**
* Selects the current grayscale color (the given color is converted to grayscales).
* @param col the color
@@ -555,7 +555,7 @@ public class PCLGenerator {
}
}
}
-
+
/**
* Select the current pattern
* @param patternID the pattern ID ( Converts the sourceMatrix to a string for use in the PDFRenderer cm operations. For example:
* Converts the AffineTransform instance to a string for use in the PDFRenderer
+ * Converts the AffineTransform instance to a string for use in the PDFRenderer
* cm operations. Creates a new CTM based in the sourceMatrix. For example:
* Creates an array of six doubles from the source CTM. For example:
*
* Set this value to false if you experience unwanted blank pages in your
* postscript output.
* @param dscCompliant boolean value (default is true)
*/
public void setDSCCompliant(boolean dscCompliant) {
- this.dscCompliant = dscCompliant;
+ this.dscCompliant = dscCompliant;
}
}
diff --git a/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java b/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
index 3ce9751b5..867888ea5 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -27,7 +27,7 @@ import org.apache.fop.render.Renderer;
import org.apache.xmlgraphics.ps.PSGenerator;
/**
- * Postscript renderer config
+ * Postscript renderer config
*/
public class PSRendererConfigurator extends PrintRendererConfigurator {
@@ -50,7 +50,7 @@ public class PSRendererConfigurator extends PrintRendererConfigurator {
super.configure(renderer);
PSRenderer psRenderer = (PSRenderer)renderer;
-
+
psRenderer.setAutoRotateLandscape(
cfg.getChild("auto-rotate-landscape").getValueAsBoolean(false));
Configuration child;
diff --git a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
index f5a5cc89f..433f2ce7c 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererContextConstants.java
@@ -32,5 +32,5 @@ public interface PSRendererContextConstants extends RendererContextConstants {
/** The font information for the PostScript renderer. */
public static final String PS_FONT_INFO = "psFontInfo";
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSRendererMaker.java b/src/java/org/apache/fop/render/ps/PSRendererMaker.java
index 657a65f70..8c64f2806 100644
--- a/src/java/org/apache/fop/render/ps/PSRendererMaker.java
+++ b/src/java/org/apache/fop/render/ps/PSRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PSRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_POSTSCRIPT};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PSRenderer();
diff --git a/src/java/org/apache/fop/render/ps/PSSVGHandler.java b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
index ebe098282..1d293fa71 100644
--- a/src/java/org/apache/fop/render/ps/PSSVGHandler.java
+++ b/src/java/org/apache/fop/render/ps/PSSVGHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -246,7 +246,7 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
nativeTextHandler = new NativeTextHandler(graphics, psInfo.getFontInfo());
graphics.setCustomTextHandler(nativeTextHandler);
PSTextPainter textPainter = new PSTextPainter(nativeTextHandler);
- ctx.setTextPainter(textPainter);
+ ctx.setTextPainter(textPainter);
PSTextElementBridge tBridge = new PSTextElementBridge(textPainter);
ctx.putBridge(tBridge);
}
@@ -279,10 +279,10 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
* an fo:block-container
*/
gen.writeln("newpath");
- gen.defineRect(xOffset / 1000f, yOffset / 1000f,
+ gen.defineRect(xOffset / 1000f, yOffset / 1000f,
psInfo.getWidth() / 1000f, psInfo.getHeight() / 1000f);
gen.writeln("clip");
-
+
// transform so that the coordinates (0,0) is from the top left
// and positive is down and to the right. (0,0) is where the
// viewBox puts it.
@@ -323,6 +323,6 @@ public class PSSVGHandler extends AbstractGenericSVGHandler
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PSRenderer);
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java b/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
index 8ccfa8e26..b5c42c99e 100644
--- a/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
+++ b/src/java/org/apache/fop/render/ps/PSSupportedFlavors.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import org.apache.xmlgraphics.image.loader.ImageFlavor;
@@ -31,8 +31,8 @@ public interface PSSupportedFlavors {
{ImageFlavor.RAW_EPS,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
/** The flavors supported inline with PostScript level 3 and higher. */
@@ -41,17 +41,17 @@ public interface PSSupportedFlavors {
ImageFlavor.RAW_JPEG,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE,
ImageFlavor.XML_DOM};
-
+
/** The flavors supported as forms with PostScript level 2. */
ImageFlavor[] LEVEL_2_FLAVORS_FORM = new ImageFlavor[]
{//ImageFlavor.RAW_EPS,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE/*,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE/*,
ImageFlavor.XML_DOM*/};
/** The flavors supported as forms with PostScript level 3 or higher. */
@@ -60,8 +60,8 @@ public interface PSSupportedFlavors {
ImageFlavor.RAW_JPEG,
ImageFlavor.RAW_CCITTFAX,
ImageFlavor.GRAPHICS2D,
- ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE/*,
+ ImageFlavor.BUFFERED_IMAGE,
+ ImageFlavor.RENDERED_IMAGE/*,
ImageFlavor.XML_DOM*/};
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSTextElementBridge.java b/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
index 0f41ca525..ab0c2d723 100644
--- a/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
+++ b/src/java/org/apache/fop/render/ps/PSTextElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ import org.w3c.dom.Node;
* @version $Id$
*/
public class PSTextElementBridge extends SVGTextElementBridge {
-
+
private PSTextPainter textPainter;
/**
diff --git a/src/java/org/apache/fop/render/ps/PSTextPainter.java b/src/java/org/apache/fop/render/ps/PSTextPainter.java
index 08cea6517..31cb4b605 100644
--- a/src/java/org/apache/fop/render/ps/PSTextPainter.java
+++ b/src/java/org/apache/fop/render/ps/PSTextPainter.java
@@ -5,9 +5,9 @@
* 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.
@@ -70,10 +70,10 @@ import org.apache.fop.fonts.FontTriplet;
* @version $Id$
*/
public class PSTextPainter implements TextPainter {
-
+
/** the logger for this class */
protected Log log = LogFactory.getLog(PSTextPainter.class);
-
+
private NativeTextHandler nativeTextHandler;
private FontInfo fontInfo;
@@ -81,7 +81,7 @@ public class PSTextPainter implements TextPainter {
* Use the stroking text painter to get the bounds and shape.
* Also used as a fallback to draw the string with strokes.
*/
- protected static final TextPainter
+ protected static final TextPainter
PROXY_PAINTER = StrokingTextPainter.getInstance();
/**
@@ -102,19 +102,19 @@ public class PSTextPainter implements TextPainter {
public void paint(TextNode node, Graphics2D g2d) {
String txt = node.getText();
Point2D loc = node.getLocation();
-
+
if (hasUnsupportedAttributes(node)) {
PROXY_PAINTER.paint(node, g2d);
} else {
paintTextRuns(node.getTextRuns(), g2d, loc);
}
}
-
-
+
+
private boolean hasUnsupportedAttributes(TextNode node) {
Iterator i = node.getTextRuns().iterator();
while (i.hasNext()) {
- StrokingTextPainter.TextRun
+ StrokingTextPainter.TextRun
run = (StrokingTextPainter.TextRun)i.next();
AttributedCharacterIterator aci = run.getACI();
boolean hasUnsupported = hasUnsupportedAttributes(aci);
@@ -127,17 +127,17 @@ public class PSTextPainter implements TextPainter {
private boolean hasUnsupportedAttributes(AttributedCharacterIterator aci) {
boolean hasunsupported = false;
-
+
String text = getText(aci);
Font font = makeFont(aci);
if (hasUnsupportedGlyphs(text, font)) {
log.trace("-> Unsupported glyphs found");
hasunsupported = true;
}
-
+
TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
- if ((tpi != null)
+ if ((tpi != null)
&& ((tpi.strokeStroke != null && tpi.strokePaint != null)
|| (tpi.strikethroughStroke != null)
|| (tpi.underlineStroke != null)
@@ -169,7 +169,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> word spacing found");
hasunsupported = true;
}
-
+
Object lengthAdjust = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.LENGTH_ADJUST);
if (lengthAdjust != null) {
@@ -179,7 +179,7 @@ public class PSTextPainter implements TextPainter {
Object writeMod = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE);
- if (writeMod != null
+ if (writeMod != null
&& !GVTAttributedCharacterIterator.TextAttribute.WRITING_MODE_LTR.equals(
writeMod)) {
log.trace("-> Unsupported writing modes found");
@@ -193,7 +193,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> vertical orientation found");
hasunsupported = true;
}
-
+
Object rcDel = aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.TEXT_COMPOUND_DELIMITER);
//Batik 1.6 returns null here which makes it impossible to determine whether this can
@@ -202,7 +202,7 @@ public class PSTextPainter implements TextPainter {
log.trace("-> spans found");
hasunsupported = true; //Filter spans
}
-
+
if (hasunsupported) {
log.trace("Unsupported attributes found in ACI, using StrokingTextPainter");
}
@@ -219,7 +219,7 @@ public class PSTextPainter implements TextPainter {
Point2D currentloc = loc;
Iterator i = textRuns.iterator();
while (i.hasNext()) {
- StrokingTextPainter.TextRun
+ StrokingTextPainter.TextRun
run = (StrokingTextPainter.TextRun)i.next();
currentloc = paintTextRun(run, g2d, currentloc);
}
@@ -251,7 +251,7 @@ public class PSTextPainter implements TextPainter {
}
/**
- * Paint an ACI on a Graphics2D at a given location. The method has to
+ * Paint an ACI on a Graphics2D at a given location. The method has to
* update the location after painting.
* @param aci ACI to paint
* @param g2d Graphics2D to paint on
@@ -260,18 +260,18 @@ public class PSTextPainter implements TextPainter {
*/
protected Point2D paintACI(AttributedCharacterIterator aci, Graphics2D g2d, Point2D loc) {
//ACIUtils.dumpAttrs(aci);
-
+
aci.first();
updateLocationFromACI(aci, loc);
TextPaintInfo tpi = (TextPaintInfo) aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.PAINT_INFO);
-
+
if (tpi == null) {
return loc;
}
-
+
TextNode.Anchor anchor = (TextNode.Anchor)aci.getAttribute(
GVTAttributedCharacterIterator.TextAttribute.ANCHOR_TYPE);
@@ -315,7 +315,7 @@ public class PSTextPainter implements TextPainter {
default: //nop
}
}
-
+
drawPrimitiveString(g2d, loc, font, txt, tx);
loc.setLocation(loc.getX() + (double)advance, loc.getY());
return loc;
@@ -354,25 +354,25 @@ public class PSTextPainter implements TextPainter {
}
if (ypos != null) {
loc.setLocation(loc.getX(), ypos.doubleValue());
- }
+ }
if (dxpos != null) {
loc.setLocation(loc.getX() + dxpos.doubleValue(), loc.getY());
- }
+ }
if (dypos != null) {
loc.setLocation(loc.getX(), loc.getY() + dypos.doubleValue());
- }
+ }
}
private String getStyle(AttributedCharacterIterator aci) {
Float posture = (Float)aci.getAttribute(TextAttribute.POSTURE);
return ((posture != null) && (posture.floatValue() > 0.0))
- ? "italic"
+ ? "italic"
: "normal";
}
private int getWeight(AttributedCharacterIterator aci) {
Float taWeight = (Float)aci.getAttribute(TextAttribute.WEIGHT);
- return ((taWeight != null) && (taWeight.floatValue() > 1.0))
+ return ((taWeight != null) && (taWeight.floatValue() > 1.0))
? Font.WEIGHT_BOLD
: Font.WEIGHT_NORMAL;
}
@@ -479,8 +479,8 @@ public class PSTextPainter implements TextPainter {
* @return the bounds of the text
*/
public Rectangle2D getBounds2D(TextNode node) {
- /* (todo) getBounds2D() is too slow
- * because it uses the StrokingTextPainter. We should implement this
+ /* (todo) getBounds2D() is too slow
+ * because it uses the StrokingTextPainter. We should implement this
* method ourselves. */
return PROXY_PAINTER.getBounds2D(node);
}
diff --git a/src/java/org/apache/fop/render/ps/PSTranscoder.java b/src/java/org/apache/fop/render/ps/PSTranscoder.java
index fd252b447..3585ab2f8 100644
--- a/src/java/org/apache/fop/render/ps/PSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/PSTranscoder.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/ps/ResourceHandler.java b/src/java/org/apache/fop/render/ps/ResourceHandler.java
index 1a363c90e..bdd305164 100644
--- a/src/java/org/apache/fop/render/ps/ResourceHandler.java
+++ b/src/java/org/apache/fop/render/ps/ResourceHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -94,18 +94,18 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
* @throws DSCException If there's an error in the DSC structure of the PS file
* @throws IOException In case of an I/O error
*/
- public static void process(FOUserAgent userAgent, InputStream in, OutputStream out,
+ public static void process(FOUserAgent userAgent, InputStream in, OutputStream out,
FontInfo fontInfo, ResourceTracker resTracker, Map formResources,
int pageCount, Rectangle2D documentBoundingBox)
throws DSCException, IOException {
DSCParser parser = new DSCParser(in);
PSGenerator gen = new PSGenerator(out);
parser.setNestedDocumentHandler(new DefaultNestedDocumentHandler(gen));
-
+
//Skip DSC header
DSCHeaderComment header = DSCTools.checkAndSkipDSC30Header(parser);
header.generate(gen);
-
+
parser.setFilter(new DSCFilter() {
private final Set filtered = new java.util.HashSet();
{
@@ -141,15 +141,15 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
PSFontUtils.determineSuppliedFonts(resTracker, fontInfo, fontInfo.getUsedFonts());
registerSuppliedForms(resTracker, formResources);
-
+
//Supplied Resources
- DSCCommentDocumentSuppliedResources supplied
+ DSCCommentDocumentSuppliedResources supplied
= new DSCCommentDocumentSuppliedResources(
resTracker.getDocumentSuppliedResources());
supplied.generate(gen);
-
+
//Needed Resources
- DSCCommentDocumentNeededResources needed
+ DSCCommentDocumentNeededResources needed
= new DSCCommentDocumentNeededResources(
resTracker.getDocumentNeededResources());
needed.generate(gen);
@@ -167,7 +167,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
}
event.generate(gen);
}
-
+
//Skip to the FOPFontSetup
PostScriptComment fontSetupPlaceholder = parser.nextPSComment("FOPFontSetup", gen);
if (fontSetupPlaceholder == null) {
@@ -181,7 +181,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
if (pageOrTrailer == null) {
throw new DSCException("Page expected, but none found");
}
-
+
//Process individual pages (and skip as necessary)
while (true) {
DSCCommentPage page = (DSCCommentPage)pageOrTrailer;
@@ -194,7 +194,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
break;
}
}
-
+
//Write the rest
while (parser.hasNext()) {
DSCEvent event = parser.nextEvent();
@@ -218,7 +218,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
}
}
- private static void generateForms(ResourceTracker resTracker, FOUserAgent userAgent,
+ private static void generateForms(ResourceTracker resTracker, FOUserAgent userAgent,
Map formResources, PSGenerator gen) throws IOException {
if (formResources == null) {
return;
@@ -227,13 +227,13 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
while (iter.hasNext()) {
PSImageFormResource form = (PSImageFormResource)iter.next();
final String uri = form.getImageURI();
-
+
ImageManager manager = userAgent.getFactory().getImageManager();
ImageInfo info = null;
try {
ImageSessionContext sessionContext = userAgent.getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
ImageFlavor[] flavors;
if (gen.getPSLevel() >= 3) {
flavors = LEVEL_3_FLAVORS_FORM;
@@ -243,7 +243,7 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, flavors, hints, sessionContext);
-
+
String imageDescription = info.getMimeType() + " " + info.getOriginalURI();
final Dimension2D dimensionsPt = info.getSize().getDimensionPt();
final Dimension2D dimensionsMpt = info.getSize().getDimensionMpt();
@@ -261,12 +261,12 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
PSGraphics2DAdapter adapter = new PSGraphics2DAdapter(gen, false);
adapter.paintImage(imageG2D.getGraphics2DImagePainter(),
null,
- 0, 0,
+ 0, 0,
(int)Math.round(dimensionsMpt.getWidth()),
(int)Math.round(dimensionsMpt.getHeight()));
gen.writeln("EndEPSF");
}
-
+
};
formGen.generate(gen);
} else if (img instanceof ImageRendered) {
@@ -349,9 +349,9 @@ public class ResourceHandler implements DSCParserConstants, PSSupportedFlavors {
gen.writeln("1 0 lineto");
gen.writeln("stroke");
}
-
+
};
return formGen;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
index 1eb1d9d13..a8bab26b6 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSCommentElement.java
@@ -30,17 +30,17 @@ public abstract class AbstractPSCommentElement extends AbstractPSExtensionElemen
/**
* Default constructor
- *
+ *
* @param parent parent of this node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
public AbstractPSCommentElement(FONode parent) {
super(parent);
- }
-
+ }
+
/**
* @throws FOPException if there's a problem during processing
- * @see org.apache.fop.fo.FONode#startOfNode()
+ * @see org.apache.fop.fo.FONode#startOfNode()
*/
protected void startOfNode() throws FOPException {
if (parent.getNameId() != Constants.FO_DECLARATIONS
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
index 31e44d2d2..14865a8c9 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
// FOP
@@ -37,10 +37,10 @@ public abstract class AbstractPSExtensionElement extends FONode {
* extension attachment
*/
protected PSExtensionAttachment attachment;
-
+
/**
* Default constructor
- *
+ *
* @param parent parent of this node
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
@@ -50,14 +50,14 @@ public abstract class AbstractPSExtensionElement extends FONode {
/**
* Blocks XSL FO's from having non-FO parents.
- *
+ *
* @param loc location in the FO source file
* @param nsURI namespace of incoming node
* @param localName (e.g. "table" for "fo:table")
* @throws ValidationException if incoming node not valid for parent
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -69,7 +69,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
* @param data array of characters containing text to be added
* @param start starting array element to add
* @param length of data array to add
- * @param pList currently applicable PropertyList
+ * @param pList currently applicable PropertyList
* @param locator location in fo source file.
* @see org.apache.fop.fo.FONode#addCharacters(char[], int, int, PropertyList, Locator)
*/
@@ -92,7 +92,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
public String getNamespaceURI() {
return PSExtensionElementMapping.NAMESPACE;
}
-
+
/**
* @return a String representation of this object
* @see org.apache.fop.fo.FONode#getNormalNamespacePrefix()
@@ -112,7 +112,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
missingChildElementError("#PCDATA");
}
}
-
+
/**
* @return the extension attachment if one is created by the extension element, null otherwise.
* @see org.apache.fop.fo.FONode#getExtensionAttachment()
@@ -123,7 +123,7 @@ public abstract class AbstractPSExtensionElement extends FONode {
}
return this.attachment;
}
-
+
/**
* Instantiates extension attachment object
* @return extension attachment
diff --git a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
index 78b2f91eb..92108b551 100644
--- a/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
+++ b/src/java/org/apache/fop/render/ps/extensions/AbstractPSExtensionObject.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
// FOP
@@ -35,7 +35,7 @@ import org.apache.fop.fo.extensions.ExtensionAttachment;
public abstract class AbstractPSExtensionObject extends FONode {
private PSSetupCode setupCode = new PSSetupCode();
-
+
/**
* Main constructor.
* @param parent the parent node
@@ -46,7 +46,7 @@ public abstract class AbstractPSExtensionObject extends FONode {
}
/** {@inheritDoc} */
- protected void validateChildNode(Locator loc, String nsURI, String localName)
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
throws ValidationException {
if (FO_URI.equals(nsURI)) {
invalidChildError(loc, nsURI, localName);
@@ -69,14 +69,14 @@ public abstract class AbstractPSExtensionObject extends FONode {
public String getNamespaceURI() {
return PSExtensionElementMapping.NAMESPACE;
}
-
+
/**{@inheritDoc} */
public String getNormalNamespacePrefix() {
return "ps";
}
/** {@inheritDoc} */
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList)
throws FOPException {
String name = attlist.getValue("name");
@@ -88,12 +88,12 @@ public abstract class AbstractPSExtensionObject extends FONode {
/** {@inheritDoc} */
protected void endOfNode() throws FOPException {
super.endOfNode();
- String s = setupCode.getContent();
+ String s = setupCode.getContent();
if (s == null || s.length() == 0) {
missingChildElementError("#PCDATA");
}
}
-
+
/** {@inheritDoc} */
public ExtensionAttachment getExtensionAttachment() {
return this.setupCode;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java b/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
index 1dd0f4be6..c47649eb1 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSCommentAfterElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,7 +39,7 @@ public class PSCommentAfterElement extends AbstractPSCommentElement {
}
/**
- * @return local name
+ * @return local name
* @see org.apache.fop.fo.FONode#getLocalName()
*/
public String getLocalName() {
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
index 5d3c863f5..f441553b7 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSCommentBeforeElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -51,5 +51,5 @@ public class PSCommentBeforeElement extends AbstractPSCommentElement {
*/
protected ExtensionAttachment instantiateExtensionAttachment() {
return new PSCommentBefore();
- }
+ }
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
index 9da2b0911..efee86aa8 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionAttachment.java
@@ -31,7 +31,7 @@ import org.apache.fop.fo.extensions.ExtensionAttachment;
* This is the pass-through value object for the PostScript extension.
*/
public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLizable {
-
+
/** extension node content */
protected String content;
@@ -59,12 +59,12 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
public String getCategory() {
return CATEGORY;
}
-
+
/** @return the content */
public String getContent() {
return content;
}
-
+
/**
* Sets the content for the setup code object.
* @param content The content to set.
@@ -72,10 +72,10 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
public void setContent(String content) {
this.content = content;
}
-
+
/**
* Generates SAX events representing the object's state.
- *
+ *
* @param handler ContentHandler instance to send the SAX events to
* @throws SAXException if there's a problem generating the SAX events
* @see org.apache.xmlgraphics.util.XMLizable#toSAX(org.xml.sax.ContentHandler)
@@ -96,7 +96,7 @@ public abstract class PSExtensionAttachment implements ExtensionAttachment, XMLi
String className = getClass().getName();
return className.substring(className.lastIndexOf('.') + 3);
}
-
+
/**
* @return a string representation of this object
* @see java.lang.Object#toString()
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 45ace5f80..d1a1ede37 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionElementMapping.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps.extensions;
import org.apache.fop.fo.FONode;
@@ -28,7 +28,7 @@ import org.apache.fop.fo.ElementMapping;
public class PSExtensionElementMapping extends ElementMapping {
/** Namespace for the extension */
- public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/postscript";
+ public static final String NAMESPACE = "http://xmlgraphics.apache.org/fop/postscript";
/** Main constructor */
public PSExtensionElementMapping() {
@@ -64,7 +64,7 @@ public class PSExtensionElementMapping extends ElementMapping {
return new PSSetPageDeviceElement(parent);
}
}
-
+
static class PSCommentBeforeMaker extends ElementMapping.Maker {
public FONode make(FONode parent) {
return new PSCommentBeforeElement(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 e69500736..dee918f19 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandler.java
@@ -32,7 +32,7 @@ import org.apache.fop.util.ContentHandlerFactory.ObjectBuiltListener;
/**
* ContentHandler (parser) for restoring PSExtension objects from XML.
*/
-public class PSExtensionHandler extends DefaultHandler
+public class PSExtensionHandler extends DefaultHandler
implements ContentHandlerFactory.ObjectSource {
/** Logger instance */
@@ -40,12 +40,12 @@ public class PSExtensionHandler extends DefaultHandler
private StringBuffer content = new StringBuffer();
private Attributes lastAttributes;
-
+
private PSExtensionAttachment returnedObject;
private ObjectBuiltListener listener;
-
+
/** {@inheritDoc} */
- public void startElement(String uri, String localName, String qName, Attributes attributes)
+ public void startElement(String uri, String localName, String qName, Attributes attributes)
throws SAXException {
boolean handled = false;
if (PSExtensionAttachment.CATEGORY.equals(uri)) {
@@ -61,10 +61,10 @@ public class PSExtensionHandler extends DefaultHandler
}
if (!handled) {
if (PSExtensionAttachment.CATEGORY.equals(uri)) {
- throw new SAXException("Unhandled element " + localName
+ throw new SAXException("Unhandled element " + localName
+ " in namespace: " + uri);
} else {
- log.warn("Unhandled element " + localName
+ log.warn("Unhandled element " + localName
+ " in namespace: " + uri);
}
}
@@ -78,13 +78,13 @@ public class PSExtensionHandler extends DefaultHandler
this.returnedObject = new PSSetupCode(name, content.toString());
} else if (PSSetPageDevice.ELEMENT.equals(localName)) {
String name = lastAttributes.getValue("name");
- this.returnedObject = new PSSetPageDevice(name, content.toString());
+ this.returnedObject = new PSSetPageDevice(name, content.toString());
} else if (PSCommentBefore.ELEMENT.equals(localName)) {
- this.returnedObject = new PSCommentBefore(content.toString());
+ this.returnedObject = new PSCommentBefore(content.toString());
} else if (PSCommentAfter.ELEMENT.equals(localName)) {
this.returnedObject = new PSCommentAfter(content.toString());
}
- }
+ }
content.setLength(0); //Reset text buffer (see characters())
}
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
index 655c96260..d94e236f7 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSExtensionHandlerFactory.java
@@ -28,7 +28,7 @@ import org.xml.sax.ContentHandler;
public class PSExtensionHandlerFactory implements ContentHandlerFactory {
private static final String[] NAMESPACES = new String[] {PSSetupCode.CATEGORY};
-
+
/** {@inheritDoc} */
public String[] getSupportedNamespaces() {
return NAMESPACES;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
index 207c11e76..686667c3d 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSPageSetupCodeElement.java
@@ -24,13 +24,13 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
/**
- * Extension element for fox:ps-page-setup-code.
+ * Extension element for fox:ps-page-setup-code.
*/
public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
/** The element name */
protected static final String ELEMENT = "ps-page-setup-code";
-
+
/**
* Main constructor
* @param parent parent FO node
@@ -47,7 +47,7 @@ public class PSPageSetupCodeElement extends AbstractPSExtensionObject {
"rule.childOfSPM");
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return ELEMENT;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
index 28ea3c24c..8bdb2adc0 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDevice.java
@@ -62,12 +62,12 @@ public class PSSetPageDevice extends PSExtensionAttachment {
*/
public PSSetPageDevice() {
}
-
+
/** @return the name */
public String getName() {
return name;
}
-
+
/**
* Sets the name of the setup code object.
* @param name The name to set.
@@ -77,7 +77,7 @@ public class PSSetPageDevice extends PSExtensionAttachment {
}
/**
- * @return a string representation of this object
+ * @return a string representation of this object
* @see java.lang.Object#toString()
*/
public String toString() {
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
index 21acc8001..6cdd1c60c 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetPageDeviceElement.java
@@ -29,7 +29,7 @@ import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.extensions.ExtensionAttachment;
/**
- * Extension element for ps:ps-setpagedevice.
+ * Extension element for ps:ps-setpagedevice.
*/
public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
@@ -69,7 +69,7 @@ public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
* @throws FOPException if there's a problem during processing
* @see org.apache.fop.fo.FONode#processNode
*/
- public void processNode(String elementName, Locator locator,
+ public void processNode(String elementName, Locator locator,
Attributes attlist, PropertyList propertyList)
throws FOPException {
String name = attlist.getValue("name");
@@ -79,7 +79,7 @@ public class PSSetPageDeviceElement extends AbstractPSExtensionElement {
}
/**
- * @return local name
+ * @return local name
* @see org.apache.fop.fo.FONode#getLocalName() */
public String getLocalName() {
return ELEMENT;
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
index eb3ed0e39..e2236629c 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetupCode.java
@@ -31,7 +31,7 @@ public class PSSetupCode extends PSExtensionAttachment {
* element name
*/
protected static final String ELEMENT = "ps-setup-code";
-
+
private static final String ATT_NAME = "name";
/**
@@ -44,7 +44,7 @@ public class PSSetupCode extends PSExtensionAttachment {
*/
public PSSetupCode() {
}
-
+
/**
* Default constructor.
* @param name the name of the setup code object, may be null
@@ -54,12 +54,12 @@ public class PSSetupCode extends PSExtensionAttachment {
super(content);
this.name = name;
}
-
+
/** @return the name */
public String getName() {
return name;
}
-
+
/**
* Sets the name of the setup code object.
* @param name The name to set.
@@ -72,7 +72,7 @@ public class PSSetupCode extends PSExtensionAttachment {
public String getCategory() {
return CATEGORY;
}
-
+
/** {@inheritDoc} */
public String toString() {
return "PSSetupCode(name=" + getName() + ", content='" + getContent() + "')";
@@ -85,7 +85,7 @@ public class PSSetupCode extends PSExtensionAttachment {
protected String getElement() {
return ELEMENT;
}
-
+
/** {@inheritDoc} */
public void toSAX(ContentHandler handler) throws SAXException {
AttributesImpl atts = new AttributesImpl();
diff --git a/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java b/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
index e76dfeb64..4ac0af2b7 100644
--- a/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
+++ b/src/java/org/apache/fop/render/ps/extensions/PSSetupCodeElement.java
@@ -24,13 +24,13 @@ import org.apache.fop.fo.Constants;
import org.apache.fop.fo.FONode;
/**
- * Extension element for fox:ps-setup-code.
+ * Extension element for fox:ps-setup-code.
*/
public class PSSetupCodeElement extends AbstractPSExtensionObject {
/** The element name */
protected static final String ELEMENT = "ps-setup-code";
-
+
/**
* Main constructor
* @param parent parent FO node
@@ -38,7 +38,7 @@ public class PSSetupCodeElement extends AbstractPSExtensionObject {
public PSSetupCodeElement(FONode parent) {
super(parent);
}
-
+
/** {@inheritDoc} */
protected void startOfNode() throws FOPException {
super.startOfNode();
@@ -47,10 +47,10 @@ public class PSSetupCodeElement extends AbstractPSExtensionObject {
"rule.childOfDeclarations");
}
}
-
+
/** {@inheritDoc} */
public String getLocalName() {
return ELEMENT;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
index 5d6a7f64e..216802c8f 100644
--- a/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/BorderAttributesConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -42,12 +42,12 @@ public final class BorderAttributesConverter {
*/
private BorderAttributesConverter() {
}
-
+
/**
- * Create a border control word in attributes, with border properties
+ * Create a border control word in attributes, with border properties
* as specified in color, style and width.
* @param border The CommonBorderPaddingBackground object.
- * @param side The START, END, BEFORE, AFTER enum from CommonBorderPaddingBackground.
+ * @param side The START, END, BEFORE, AFTER enum from CommonBorderPaddingBackground.
* @param attributes The attributes list to set the border control word.
* @param controlWord The border control word.
*/
@@ -61,18 +61,18 @@ public final class BorderAttributesConverter {
//division by 50 to convert millipoints to twips
attrs.set(IBorderAttributes.BORDER_WIDTH, border.getBorderWidth(side, false) / 50);
attributes.set(controlWord, attrs);
- //Don't set BORDER_SPACE, because it makes the table look quite broken:
+ //Don't set BORDER_SPACE, because it makes the table look quite broken:
//vertical and horizontal borders don't meet at corners.
//attrs.setTwips(IBorderAttributes.BORDER_SPACE, border.getPadding(side, false, null));
//attributes.set(controlWord, attrs);
} else {
// Here padding specified, but corresponding border is not available
-
+
// Padding in millipoints
double paddingPt = border.getPadding(side, false, null) / 1000.0;
// Padding in twips
int padding = (int) Math.round(paddingPt * FoUnitsConverter.POINT_TO_TWIPS);
-
+
// Add padding to corresponding space (space-before or space-after)
// if side == START or END, do nothing
if (side == CommonBorderPaddingBackground.BEFORE) {
diff --git a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
index 20100fb7d..0cfa3e0fe 100755
--- a/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/FOPRtfAttributes.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfColorTable;
/**
- * A RtfAttributes subclass that adds some helper set methods.
+ * A RtfAttributes subclass that adds some helper set methods.
*/
public class FOPRtfAttributes extends RtfAttributes {
@@ -83,16 +83,16 @@ public class FOPRtfAttributes extends RtfAttributes {
}
private static class DummyPercentBaseContext implements PercentBaseContext {
-
+
static DummyPercentBaseContext singleton = new DummyPercentBaseContext();
-
+
private DummyPercentBaseContext() {
// noop
}
-
+
public int getBaseLength(int lengthBase, FObj fo) {
return 0;
}
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
index fa95b8502..caf11323f 100644
--- a/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
+++ b/src/java/org/apache/fop/render/rtf/FoUnitsConverter.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java b/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
index 4131b814d..e778c902b 100644
--- a/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/ListAttributesConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -38,13 +38,13 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
* Provides methods to convert list attributes to RtfAttributes.
*/
public final class ListAttributesConverter {
-
+
/**
* Constructor is private, because it's just a utility class.
*/
private ListAttributesConverter() {
}
-
+
/**
* Reads an FO object's properties and adds returns them as RtfAttributes.
* @param fobj FO object
@@ -53,12 +53,12 @@ public final class ListAttributesConverter {
*/
static RtfAttributes convertAttributes(ListBlock fobj)
throws FOPException {
-
+
FOPRtfAttributes attrib = new FOPRtfAttributes();
-
+
attrib.setTwips(RtfListTable.LIST_INDENT, fobj.getCommonMarginBlock().startIndent);
attrib.setTwips(RtfText.LEFT_INDENT_BODY, fobj.getCommonMarginBlock().endIndent);
-
+
/*
* set list table defaults
*/
@@ -67,7 +67,7 @@ public final class ListAttributesConverter {
attrib.set(RtfListTable.LIST, "simple");
//set following char as tab
attrib.set(RtfListTable.LIST_FOLLOWING_CHAR, 0);
-
+
return attrib;
}
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
index 50355e145..c7f97ef4f 100644
--- a/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/PageAttributesConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -46,19 +46,19 @@ final class PageAttributesConverter {
*/
private PageAttributesConverter() {
}
-
+
/** convert xsl:fo attributes to RTF text attributes */
static RtfAttributes convertPageAttributes(SimplePageMaster pagemaster) {
FOPRtfAttributes attrib = new FOPRtfAttributes();
-
+
try {
RegionBA before = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_BEFORE);
RegionBody body = (RegionBody) pagemaster.getRegion(Constants.FO_REGION_BODY);
RegionBA after = (RegionBA) pagemaster.getRegion(Constants.FO_REGION_AFTER);
-
+
attrib.setTwips(RtfPage.PAGE_WIDTH, pagemaster.getPageWidth());
attrib.setTwips(RtfPage.PAGE_HEIGHT, pagemaster.getPageHeight());
-
+
Object widthRaw = attrib.getValue(RtfPage.PAGE_WIDTH);
Object heightRaw = attrib.getValue(RtfPage.PAGE_HEIGHT);
if ((widthRaw instanceof Integer) && (heightRaw instanceof Integer)
@@ -84,7 +84,7 @@ final class PageAttributesConverter {
bodyLeft = (Length) NumericOp.addition(pageLeft, bodyMargin.marginLeft);
bodyRight = (Length) NumericOp.addition(pageRight, bodyMargin.marginRight);
}
-
+
attrib.setTwips(RtfPage.MARGIN_TOP, bodyTop);
attrib.setTwips(RtfPage.MARGIN_BOTTOM, bodyBottom);
attrib.setTwips(RtfPage.MARGIN_LEFT, bodyLeft);
@@ -104,7 +104,7 @@ final class PageAttributesConverter {
}
attrib.setTwips(RtfPage.FOOTERY, beforeTop);
} catch (Exception e) {
- log.error("Exception in convertPageAttributes: "
+ log.error("Exception in convertPageAttributes: "
+ e.getMessage() + "- page attributes ignored");
attrib = new FOPRtfAttributes();
}
diff --git a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
index a2646af46..69058501f 100644
--- a/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
+++ b/src/java/org/apache/fop/render/rtf/RTFEventProducer.java
@@ -34,7 +34,7 @@ public interface RTFEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -53,9 +53,9 @@ public interface RTFEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* The RTF handler only supports simple-page-masters.
* @param source the event source
@@ -64,7 +64,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void onlySPMSupported(Object source, String masterReference, Locator loc);
-
+
/**
* No simple-page-master could be determined-
* @param source the event source
@@ -72,7 +72,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void noSPMFound(Object source, Locator loc);
-
+
/**
* The RTF handler requires explicit table-columns for now.
* @param source the event source
@@ -80,7 +80,7 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void explicitTableColumnsRequired(Object source, Locator loc);
-
+
/**
* The RTF handler ignored some deferred event (i.e. an unsupported element).
* @param source the event source
@@ -90,5 +90,5 @@ public interface RTFEventProducer extends EventProducer {
* @event.severity WARN
*/
void ignoredDeferredEvent(Object source, FONode node, boolean start, Locator loc);
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java b/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
index a15d206ee..afcfbf702 100644
--- a/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
+++ b/src/java/org/apache/fop/render/rtf/RTFFOEventHandlerMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,8 +35,8 @@ public class RTFFOEventHandlerMaker extends AbstractFOEventHandlerMaker {
MimeConstants.MIME_RTF,
MimeConstants.MIME_RTF_ALT1,
MimeConstants.MIME_RTF_ALT2};
-
-
+
+
/**
* {@inheritDoc}
* @param ua FOUserAgent
diff --git a/src/java/org/apache/fop/render/rtf/RTFHandler.java b/src/java/org/apache/fop/render/rtf/RTFHandler.java
index 6171e68b4..1adba9e2b 100644
--- a/src/java/org/apache/fop/render/rtf/RTFHandler.java
+++ b/src/java/org/apache/fop/render/rtf/RTFHandler.java
@@ -213,7 +213,7 @@ public class RTFHandler extends FOEventHandler {
RTFEventProducer eventProducer = RTFEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
eventProducer.onlySPMSupported(this, reference, pageSeq.getLocator());
- PageSequenceMaster master
+ PageSequenceMaster master
= pageSeq.getRoot().getLayoutMasterSet().getPageSequenceMaster(reference);
this.pagemaster = master.getNextSimplePageMaster(
false, false, false, false, false);
@@ -306,7 +306,7 @@ public class RTFHandler extends FOEventHandler {
contAfter.newAfter(attr);
}
handled = true;
- } else if (regionBefore != null
+ } else if (regionBefore != null
&& fl.getFlowName().equals(regionBefore.getRegionName())) {
bHeaderSpecified = true;
bPrevHeaderSpecified = true;
@@ -325,7 +325,7 @@ public class RTFHandler extends FOEventHandler {
RtfBefore before = c.newBefore(beforeAttributes);
builderContext.pushContainer(before);
handled = true;
- } else if (regionAfter != null
+ } else if (regionAfter != null
&& fl.getFlowName().equals(regionAfter.getRegionName())) {
bFooterSpecified = true;
bPrevFooterSpecified = true;
@@ -371,10 +371,10 @@ public class RTFHandler extends FOEventHandler {
Region regionAfter = pagemaster.getRegion(Constants.FO_REGION_AFTER);
if (fl.getFlowName().equals(regionBody.getRegionName())) {
//just do nothing
- } else if (regionBefore != null
+ } else if (regionBefore != null
&& fl.getFlowName().equals(regionBefore.getRegionName())) {
builderContext.popContainer();
- } else if (regionAfter != null
+ } else if (regionAfter != null
&& fl.getFlowName().equals(regionAfter.getRegionName())) {
builderContext.popContainer();
}
@@ -514,15 +514,15 @@ public class RTFHandler extends FOEventHandler {
final IRtfTableContainer tc
= (IRtfTableContainer)builderContext.getContainer(
IRtfTableContainer.class, true, null);
-
+
RtfAttributes atts
= TableAttributesConverter.convertTableAttributes(tbl);
-
+
RtfTable table = tc.newTable(atts, tableContext);
-
+
CommonBorderPaddingBackground border = tbl.getCommonBorderPaddingBackground();
RtfAttributes borderAttributes = new RtfAttributes();
-
+
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.BEFORE,
borderAttributes, ITableAttributes.CELL_BORDER_TOP);
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.AFTER,
@@ -531,9 +531,9 @@ public class RTFHandler extends FOEventHandler {
borderAttributes, ITableAttributes.CELL_BORDER_LEFT);
BorderAttributesConverter.makeBorder(border, CommonBorderPaddingBackground.END,
borderAttributes, ITableAttributes.CELL_BORDER_RIGHT);
-
+
table.setBorderAttributes(borderAttributes);
-
+
builderContext.pushContainer(table);
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -576,16 +576,16 @@ public class RTFHandler extends FOEventHandler {
* rest of the document will be rendered. Usage of the
* TableLayoutManager is not welcome due to design reasons and
* it also does not provide the correct values.
- * TODO: Make proportional-column-width working for rtf output
+ * TODO: Make proportional-column-width working for rtf output
*/
SimplePercentBaseContext context
= new SimplePercentBaseContext(null,
LengthBase.TABLE_UNITS,
100000);
-
+
Integer iWidth
= new Integer(tc.getColumnWidth().getValue(context) / 1000);
-
+
String strWidth = iWidth.toString() + FixedLength.POINT;
Float width = new Float(
FoUnitsConverter.getInstance().convertToTwips(strWidth));
@@ -708,7 +708,7 @@ public class RTFHandler extends FOEventHandler {
} catch (Exception e) {
log.error("startPart: " + e.getMessage());
throw new RuntimeException(e.getMessage());
- }
+ }
}
private void endPart(TablePart tb) {
@@ -724,10 +724,10 @@ public class RTFHandler extends FOEventHandler {
} catch (Exception e) {
log.error("endPart: " + e.getMessage());
throw new RuntimeException(e.getMessage());
- }
+ }
}
-
+
/**
* {@inheritDoc}
*/
@@ -735,7 +735,7 @@ public class RTFHandler extends FOEventHandler {
startPart(body);
}
-
+
/**
* {@inheritDoc}
*/
@@ -782,7 +782,7 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
try {
TableContext tctx = builderContext.getTableContext();
final RtfTableRow row = (RtfTableRow)builderContext.getContainer(RtfTableRow.class,
@@ -795,11 +795,11 @@ public class RTFHandler extends FOEventHandler {
RtfTableCell vCell = row.newTableCellMergedVertically(
(int)tctx.getColumnWidth(),
tctx.getColumnRowSpanningAttrs());
-
+
if (!tctx.getFirstSpanningCol()) {
vCell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
}
-
+
tctx.selectNextColumn();
}
} catch (IOException ioe) {
@@ -837,11 +837,11 @@ public class RTFHandler extends FOEventHandler {
RtfTableCell vCell = row.newTableCellMergedVertically(
(int)tctx.getColumnWidth(),
tctx.getColumnRowSpanningAttrs());
-
+
if (!tctx.getFirstSpanningCol()) {
vCell.setHMerge(RtfTableCell.MERGE_WITH_PREVIOUS);
}
-
+
tctx.selectNextColumn();
}
@@ -851,14 +851,14 @@ public class RTFHandler extends FOEventHandler {
// create an RtfTableCell in the current RtfTableRow
RtfAttributes atts = TableAttributesConverter.convertCellAttributes(tc);
RtfTableCell cell = row.newTableCell((int)width, atts);
-
+
//process number-rows-spanned attribute
if (numberRowsSpanned > 1) {
// Start vertical merge
cell.setVMerge(RtfTableCell.MERGE_START);
// set the number of rows spanned
- tctx.setCurrentColumnRowSpanning(new Integer(numberRowsSpanned),
+ tctx.setCurrentColumnRowSpanning(new Integer(numberRowsSpanned),
cell.getRtfAttributes());
} else {
tctx.setCurrentColumnRowSpanning(
@@ -870,23 +870,23 @@ public class RTFHandler extends FOEventHandler {
// Get the number of columns spanned
RtfTable table = row.getTable();
tctx.setCurrentFirstSpanningCol(true);
-
+
// We widthdraw one cell because the first cell is already created
// (it's the current cell) !
for (int i = 0; i < numberColumnsSpanned - 1; ++i) {
tctx.selectNextColumn();
-
+
tctx.setCurrentFirstSpanningCol(false);
RtfTableCell hCell = row.newTableCellMergedHorizontally(
0, null);
-
+
if (numberRowsSpanned > 1) {
// Start vertical merge
hCell.setVMerge(RtfTableCell.MERGE_START);
// set the number of rows spanned
tctx.setCurrentColumnRowSpanning(
- new Integer(numberRowsSpanned),
+ new Integer(numberRowsSpanned),
cell.getRtfAttributes());
} else {
tctx.setCurrentColumnRowSpanning(
@@ -894,7 +894,7 @@ public class RTFHandler extends FOEventHandler {
}
}
}
-
+
builderContext.pushContainer(cell);
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -962,12 +962,12 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
// create an RtfListItem in the current RtfList
try {
RtfList list = (RtfList)builderContext.getContainer(
RtfList.class, true, this);
-
+
/**
* If the current list already contains a list item, then close the
* list and open a new one, so every single list item gets its own
@@ -981,11 +981,11 @@ public class RTFHandler extends FOEventHandler {
this.endList((ListBlock) li.getParent());
this.startList((ListBlock) li.getParent());
this.startListBody();
-
+
list = (RtfList)builderContext.getContainer(
RtfList.class, true, this);
- }
-
+ }
+
builderContext.pushContainer(list.newListItem());
} catch (IOException ioe) {
handleIOTrouble(ioe);
@@ -1136,7 +1136,7 @@ public class RTFHandler extends FOEventHandler {
FOUserAgent userAgent = eg.getUserAgent();
ImageManager manager = userAgent.getFactory().getImageManager();
info = manager.getImageInfo(uri, userAgent.getImageSessionContext());
-
+
putGraphic(eg, info);
} catch (ImageException ie) {
ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
@@ -1160,18 +1160,18 @@ public class RTFHandler extends FOEventHandler {
if (bDefer) {
return;
}
-
+
try {
XMLObj child = (XMLObj) ifo.getChildXMLObj();
Document doc = child.getDOMDocument();
String ns = child.getNamespaceURI();
-
+
ImageInfo info = new ImageInfo(null, null);
// Set the resolution to that of the FOUserAgent
FOUserAgent ua = ifo.getUserAgent();
ImageSize size = new ImageSize();
size.setResolution(ua.getSourceResolution());
-
+
// Set the image size to the size of the svg.
Point2D csize = new Point2D.Float(-1, -1);
Point2D intrinsicDimensions = child.getDimension(csize);
@@ -1188,12 +1188,12 @@ public class RTFHandler extends FOEventHandler {
info.setSize(size);
ImageXMLDOM image = new ImageXMLDOM(info, doc, ns);
-
+
FOUserAgent userAgent = ifo.getUserAgent();
ImageManager manager = userAgent.getFactory().getImageManager();
Image converted = manager.convertImage(image, FLAVORS);
putGraphic(ifo, converted);
-
+
} catch (ImageException ie) {
ResourceEventProducer eventProducer = ResourceEventProducer.Provider.get(
getUserAgent().getEventBroadcaster());
@@ -1208,14 +1208,14 @@ public class RTFHandler extends FOEventHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_EMF, ImageFlavor.RAW_PNG, ImageFlavor.RAW_JPEG
};
-
+
/**
* Puts a graphic/image into the generated RTF file.
* @param abstractGraphic the graphic (external-graphic or instream-foreign-object)
* @param info the image info object
* @throws IOException In case of an I/O error
*/
- private void putGraphic(AbstractGraphics abstractGraphic, ImageInfo info)
+ private void putGraphic(AbstractGraphics abstractGraphic, ImageInfo info)
throws IOException {
try {
FOUserAgent userAgent = abstractGraphic.getUserAgent();
@@ -1231,17 +1231,17 @@ public class RTFHandler extends FOEventHandler {
eventProducer.imageError(this, null, ie, null);
}
}
-
+
/**
* Puts a graphic/image into the generated RTF file.
* @param abstractGraphic the graphic (external-graphic or instream-foreign-object)
* @param image the image
* @throws IOException In case of an I/O error
*/
- private void putGraphic(AbstractGraphics abstractGraphic, Image image)
+ private void putGraphic(AbstractGraphics abstractGraphic, Image image)
throws IOException {
byte[] rawData = null;
-
+
ImageInfo info = image.getInfo();
if (image instanceof ImageRawStream) {
@@ -1266,7 +1266,7 @@ public class RTFHandler extends FOEventHandler {
IRtfTextrunContainer.class, true, this);
final RtfExternalGraphic rtfGraphic = c.getTextrun().newImage();
-
+
//set URL
if (info.getOriginalURI() != null) {
rtfGraphic.setURL(info.getOriginalURI());
@@ -1341,7 +1341,7 @@ public class RTFHandler extends FOEventHandler {
}
}
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
index a28d91d36..764c2c93e 100644
--- a/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TableAttributesConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -64,7 +64,7 @@ public final class TableAttributesConverter {
//////////////////////////////////////////////////
/**
* Converts table-only attributes to rtf attributes.
- *
+ *
* @param attrs Given attributes
* @param defaultAttributes Default rtf attributes
*
@@ -75,14 +75,14 @@ public final class TableAttributesConverter {
static RtfAttributes convertTableAttributes(Table fobj)
throws FOPException {
FOPRtfAttributes attrib = new FOPRtfAttributes();
- attrib.setTwips(ITableAttributes.ATTR_ROW_LEFT_INDENT,
+ attrib.setTwips(ITableAttributes.ATTR_ROW_LEFT_INDENT,
fobj.getCommonMarginBlock().marginLeft);
return attrib;
}
/**
* Converts table-only attributes to rtf attributes.
- *
+ *
* @param attrs Given attributes
* @param defaultAttributes Default rtf attributes
*
@@ -109,7 +109,7 @@ public final class TableAttributesConverter {
//Property p;
//RtfColorTable colorTable = RtfColorTable.getInstance();
-
+
FOPRtfAttributes attrib = new FOPRtfAttributes();
//boolean isBorderPresent = false;
@@ -121,7 +121,7 @@ public final class TableAttributesConverter {
//If there is no background-color specified for the cell,
//then try to read it from table-row or table-header.
CommonBorderPaddingBackground brd = null;
-
+
if (fobj.getParent() instanceof TableRow) {
TableRow parentRow = (TableRow)fobj.getParent();
brd = parentRow.getCommonBorderPaddingBackground();
@@ -131,20 +131,20 @@ public final class TableAttributesConverter {
brd = parentHeader.getCommonBorderPaddingBackground();
color = brd.backgroundColor;
}
-
+
if (color == null
- && fobj.getParent() != null
- && fobj.getParent().getParent() != null
+ && fobj.getParent() != null
+ && fobj.getParent().getParent() != null
&& fobj.getParent().getParent().getParent() instanceof Table) {
Table table = (Table)fobj.getParent().getParent().getParent();
brd = table.getCommonBorderPaddingBackground();
color = brd.backgroundColor;
}
-
-
+
+
}
- if ((color != null)
+ if ((color != null)
&& (color.getAlpha() != 0
|| color.getRed() != 0
|| color.getGreen() != 0
@@ -198,13 +198,13 @@ public final class TableAttributesConverter {
attrib.setTwips(ITableAttributes.ATTR_CELL_PADDING_BOTTOM, padding);
attrib.set(ITableAttributes.ATTR_CELL_U_PADDING_BOTTOM, 3 /*=twips*/);
}
-
+
int n = fobj.getNumberColumnsSpanned();
// Column spanning :
if (n > 1) {
attrib.set(ITableAttributes.COLUMN_SPAN, n);
}
-
+
switch (fobj.getDisplayAlign()) {
case Constants.EN_BEFORE:
attrib.set(ITableAttributes.ATTR_CELL_VERT_ALIGN_TOP);
@@ -328,7 +328,7 @@ public final class TableAttributesConverter {
isBorderPresent = true;
}
- //Currently there is only one border width supported in each cell.
+ //Currently there is only one border width supported in each cell.
p = fobj.getProperty(Constants.PR_BORDER_LEFT_WIDTH);
if(p == null) {
p = fobj.getProperty(Constants.PR_BORDER_RIGHT_WIDTH);
diff --git a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
index d40c6a826..792193b15 100644
--- a/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
+++ b/src/java/org/apache/fop/render/rtf/TextAttributesConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -52,13 +52,13 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfText;
* @author rmarra
*/
final class TextAttributesConverter {
-
+
/**
* Constructor is private, because it's just a utility class.
*/
private TextAttributesConverter() {
}
-
+
/**
* Converts all known text FO properties to RtfAttributes
* @param props list of FO properites, which are to be converted
@@ -106,7 +106,7 @@ final class TextAttributesConverter {
attrBaseLineShift(fobj.getBaseLineShift(), attrib);
return attrib;
}
-
+
/**
* Converts all character related FO properties to RtfAttributes.
* @param fobj FObj whose properties are to be converted
@@ -150,7 +150,7 @@ final class TextAttributesConverter {
} else {
rtfAttr.set("b", 0);
}
-
+
if (font.getFontStyle() == Constants.EN_ITALIC) {
rtfAttr.set(RtfText.ATTR_ITALIC, 1);
} else {
@@ -176,20 +176,20 @@ final class TextAttributesConverter {
- private static void attrTextDecoration(CommonTextDecoration textDecoration,
+ private static void attrTextDecoration(CommonTextDecoration textDecoration,
RtfAttributes rtfAttr) {
if (textDecoration == null) {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 0);
rtfAttr.set(RtfText.ATTR_STRIKETHROUGH, 0);
return;
}
-
+
if (textDecoration.hasUnderline()) {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 1);
} else {
rtfAttr.set(RtfText.ATTR_UNDERLINE, 0);
}
-
+
if (textDecoration.hasLineThrough()) {
rtfAttr.set(RtfText.ATTR_STRIKETHROUGH, 1);
} else {
@@ -198,9 +198,9 @@ final class TextAttributesConverter {
}
private static void attrBlockMargin(CommonMarginBlock cmb, FOPRtfAttributes rtfAttr) {
- rtfAttr.setTwips(RtfText.SPACE_BEFORE,
+ rtfAttr.setTwips(RtfText.SPACE_BEFORE,
cmb.spaceBefore.getOptimum(null).getLength());
- rtfAttr.setTwips(RtfText.SPACE_AFTER,
+ rtfAttr.setTwips(RtfText.SPACE_AFTER,
cmb.spaceAfter.getOptimum(null).getLength());
rtfAttr.setTwips(RtfText.LEFT_INDENT_BODY, cmb.startIndent);
rtfAttr.setTwips(RtfText.RIGHT_INDENT_BODY, cmb.endIndent);
@@ -283,20 +283,20 @@ final class TextAttributesConverter {
CommonBorderPaddingBackground commonBorderPaddingBackground = null;
if (node instanceof Block) {
Block block = (Block) node;
- commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
- } else if (node instanceof BlockContainer) {
+ commonBorderPaddingBackground = block.getCommonBorderPaddingBackground();
+ } else if (node instanceof BlockContainer) {
BlockContainer container = (BlockContainer) node;
commonBorderPaddingBackground = container.getCommonBorderPaddingBackground();
- }
+ }
- if (commonBorderPaddingBackground != null
+ if (commonBorderPaddingBackground != null
&& commonBorderPaddingBackground.hasBorder()) {
return true;
}
node = node.getParent();
}
- return false;
+ return false;
}
/** Adds inline border information from
* Chars of string map in turn.
- *
+ *
* @param row x coordinate
* @param col y coordinate
* @param s string to add
@@ -181,7 +181,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Render TextArea to Text.
- *
+ *
* @param area inline area to render
*/
protected void renderText(TextArea area) {
@@ -211,7 +211,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
pageWidth = Helper.ceilPosition((int) width, CHAR_WIDTH);
pageHeight = Helper.ceilPosition((int) height, CHAR_HEIGHT);
-
+
// init buffers
charData = new StringBuffer[pageHeight];
decoData = new StringBuffer[pageHeight];
@@ -229,8 +229,8 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Projects current page borders (i.e. KEY_AUTO_FONTS to disable the auto-detection of fonts installed in the system.
* The PDF Transcoder cannot use AWT's font subsystem and that's why the fonts have to be
* configured differently. By default, font auto-detection is enabled to match the behaviour
@@ -93,25 +93,25 @@ public class PDFTranscoder extends AbstractFOPTranscoder
/**
* The key is used to specify the resolution for on-the-fly images generated
- * due to complex effects like gradients and filters.
+ * due to complex effects like gradients and filters.
*/
public static final TranscodingHints.Key KEY_DEVICE_RESOLUTION = new FloatKey();
/**
* The key is used to specify whether the available fonts should be automatically
* detected. The alternative is to configure the transcoder manually using a configuration
- * file.
+ * file.
*/
public static final TranscodingHints.Key KEY_AUTO_FONTS = new BooleanKey();
private Configuration cfg = null;
-
+
/** Graphics2D instance that is used to paint to */
protected PDFDocumentGraphics2D graphics = null;
private ImageManager imageManager;
private ImageSessionContext imageSessionContext;
-
+
/**
* Constructs a new PDFTranscoder.
*/
@@ -132,7 +132,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
}
};
}
-
+
/** {@inheritDoc} */
public void configure(Configuration cfg) throws ConfigurationException {
this.cfg = cfg;
@@ -147,21 +147,21 @@ public class PDFTranscoder extends AbstractFOPTranscoder
* @exception TranscoderException if an error occured while transcoding
*/
protected void transcode(Document document, String uri,
- TranscoderOutput output)
+ TranscoderOutput output)
throws TranscoderException {
graphics = new PDFDocumentGraphics2D(isTextStroked());
- graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
- + Version.getVersion()
+ graphics.getPDFDocument().getInfo().setProducer("Apache FOP Version "
+ + Version.getVersion()
+ ": PDF Transcoder for Batik");
if (hints.containsKey(KEY_DEVICE_RESOLUTION)) {
graphics.setDeviceDPI(((Float)hints.get(KEY_DEVICE_RESOLUTION)).floatValue());
}
-
+
setupImageInfrastructure(uri);
-
+
try {
- Configuration effCfg = this.cfg;
+ Configuration effCfg = this.cfg;
if (effCfg == null) {
//By default, enable font auto-detection if no cfg is given
boolean autoFonts = true;
@@ -177,7 +177,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
effCfg = c;
}
}
-
+
if (effCfg != null) {
PDFDocumentGraphics2DConfigurator configurator
= new PDFDocumentGraphics2DConfigurator();
@@ -195,14 +195,14 @@ public class PDFTranscoder extends AbstractFOPTranscoder
if (getLogger().isTraceEnabled()) {
getLogger().trace("document size: " + width + " x " + height);
}
-
+
// prepare the image to be painted
- UnitProcessor.Context uctx = UnitProcessor.createContext(ctx,
+ UnitProcessor.Context uctx = UnitProcessor.createContext(ctx,
document.getDocumentElement());
- float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT,
+ float widthInPt = UnitProcessor.userSpaceToSVG(width, SVGLength.SVG_LENGTHTYPE_PT,
UnitProcessor.HORIZONTAL_LENGTH, uctx);
int w = (int)(widthInPt + 0.5);
- float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT,
+ float heightInPt = UnitProcessor.userSpaceToSVG(height, SVGLength.SVG_LENGTHTYPE_PT,
UnitProcessor.HORIZONTAL_LENGTH, uctx);
int h = (int)(heightInPt + 0.5);
if (getLogger().isTraceEnabled()) {
@@ -271,7 +271,7 @@ public class PDFTranscoder extends AbstractFOPTranscoder
return null;
}
}
-
+
};
}
@@ -291,5 +291,5 @@ public class PDFTranscoder extends AbstractFOPTranscoder
this.imageManager, this.imageSessionContext);
return ctx;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/SVGEventProducer.java b/src/java/org/apache/fop/svg/SVGEventProducer.java
index 8894f3f58..27d7da215 100644
--- a/src/java/org/apache/fop/svg/SVGEventProducer.java
+++ b/src/java/org/apache/fop/svg/SVGEventProducer.java
@@ -31,7 +31,7 @@ public interface SVGEventProducer extends EventProducer {
* Provider class for the event producer.
*/
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -51,7 +51,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void error(Object source, String message, Exception e);
-
+
/**
* Alert during SVG processing.
* @param source the event source
@@ -59,7 +59,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity WARN
*/
void alert(Object source, String message);
-
+
/**
* Info during SVG processing.
* @param source the event source
@@ -67,7 +67,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity INFO
*/
void info(Object source, String message);
-
+
/**
* SVG graphic could not be built due to an exception.
* @param source the event source
@@ -76,7 +76,7 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void svgNotBuilt(Object source, Exception e, String uri);
-
+
/**
* SVG graphic could not be rendered due to an exception.
* @param source the event source
@@ -85,5 +85,5 @@ public interface SVGEventProducer extends EventProducer {
* @event.severity ERROR
*/
void svgRenderingError(Object source, Exception e, String uri);
-
+
}
diff --git a/src/java/org/apache/fop/svg/SVGUserAgent.java b/src/java/org/apache/fop/svg/SVGUserAgent.java
index 8d7754fcb..65a581776 100644
--- a/src/java/org/apache/fop/svg/SVGUserAgent.java
+++ b/src/java/org/apache/fop/svg/SVGUserAgent.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.geom.AffineTransform;
@@ -27,7 +27,7 @@ import org.apache.fop.apps.FOUserAgent;
* The SVG user agent. This is an implementation of the Batik SVG user agent.
*/
public class SVGUserAgent extends SimpleSVGUserAgent {
-
+
private SVGEventProducer eventProducer;
private Exception lastException;
@@ -48,7 +48,7 @@ public class SVGUserAgent extends SimpleSVGUserAgent {
public SVGUserAgent(FOUserAgent foUserAgent) {
this(foUserAgent, new AffineTransform());
}
-
+
/**
* Returns the last exception sent to the {@link #displayError(Exception)} method.
* @return the last exception or null if no exception occurred
diff --git a/src/java/org/apache/fop/svg/SVGUtilities.java b/src/java/org/apache/fop/svg/SVGUtilities.java
index 1ea11465b..cb07ab1f1 100644
--- a/src/java/org/apache/fop/svg/SVGUtilities.java
+++ b/src/java/org/apache/fop/svg/SVGUtilities.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
index 4df1af34e..2b27945a4 100644
--- a/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
+++ b/src/java/org/apache/fop/svg/SimpleSVGUserAgent.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Dimension;
@@ -33,7 +33,7 @@ import org.apache.batik.bridge.UserAgentAdapter;
* by Batik.
*/
public class SimpleSVGUserAgent extends UserAgentAdapter {
-
+
private AffineTransform currentTransform = null;
private float pixelUnitToMillimeter = 0.0f;
@@ -46,7 +46,7 @@ public class SimpleSVGUserAgent extends UserAgentAdapter {
pixelUnitToMillimeter = pixelUnitToMM;
currentTransform = at;
}
-
+
/**
* Returns a customized the pixel to mm factor.
* @return the pixel unit to millimeter conversion factor
diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
index 94e018c75..15f3434d9 100644
--- a/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
+++ b/src/java/org/apache/fop/text/linebreak/LineBreakStatus.java
@@ -1,13 +1,13 @@
-/*
+/*
* 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.
@@ -48,8 +48,8 @@ public class LineBreakStatus {
public LineBreakStatus() {
reset();
}
-
-
+
+
/**
* Reset the status.
* This method will reset the status to the initial state. It is meant
@@ -63,44 +63,44 @@ public class LineBreakStatus {
/**
* Check whether a line break may happen according to the rules described in
* the Unicode Line Breaking Algorithm.
- * The function returns the line breaking status of the point before the given character.
- * The algorithm is the table-driven algorithm, as described in
+ * The function returns the line breaking status of the point before the given character.
+ * The algorithm is the table-driven algorithm, as described in
*
* Unicode Technical Report #14.
* The pair table is taken from {@link LineBreakUtils}.
- *
+ *
* TODO: Better handling for AI, SA, SG and XX line break classes.
- *
+ *
* @param c the character to check
* @return the break action to be taken
- * one of: {@link #DIRECT_BREAK},
- * {@link #INDIRECT_BREAK},
- * {@link #COMBINING_INDIRECT_BREAK},
+ * one of: {@link #DIRECT_BREAK},
+ * {@link #INDIRECT_BREAK},
+ * {@link #COMBINING_INDIRECT_BREAK},
* {@link #COMBINING_PROHIBITED_BREAK},
* {@link #PROHIBITED_BREAK},
* {@link #EXPLICIT_BREAK}
*/
public byte nextChar(char c) {
-
+
byte currentClass = LineBreakUtils.getLineBreakProperty(c);
-
+
/* Initial conversions */
switch (currentClass) {
case LineBreakUtils.LINE_BREAK_PROPERTY_AI:
case LineBreakUtils.LINE_BREAK_PROPERTY_SG:
case LineBreakUtils.LINE_BREAK_PROPERTY_XX:
- // LB 1: Resolve AI, ... SG and XX into other line breaking classes
+ // LB 1: Resolve AI, ... SG and XX into other line breaking classes
// depending on criteria outside the scope of this algorithm.
- // In the absence of such criteria, it is recommended that
+ // In the absence of such criteria, it is recommended that
// classes AI, ... SG and XX be resolved to AL
currentClass = LineBreakUtils.LINE_BREAK_PROPERTY_AL;
break;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_SA:
- // LB 1: Resolve ... SA ... into other line breaking classes
+ // LB 1: Resolve ... SA ... into other line breaking classes
// depending on criteria outside the scope of this algorithm.
- // In the absence of such criteria, it is recommended that
- // ... SA be resolved to AL, except that characters of
+ // In the absence of such criteria, it is recommended that
+ // ... SA be resolved to AL, except that characters of
// class SA that have General_Category Mn or Mc be resolved to CM
switch (Character.getType(c)) {
case Character.COMBINING_SPACING_MARK: //General_Category "Mc"
@@ -110,11 +110,11 @@ public class LineBreakStatus {
default:
currentClass = LineBreakUtils.LINE_BREAK_PROPERTY_AL;
}
-
+
default:
//nop
}
-
+
/* Check 1: First character or initial character after a reset/mandatory break? */
switch (leftClass) {
case -1:
@@ -126,7 +126,7 @@ public class LineBreakStatus {
}
// LB 2: Never break at the start of text
return PROHIBITED_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_BK:
case LineBreakUtils.LINE_BREAK_PROPERTY_LF:
case LineBreakUtils.LINE_BREAK_PROPERTY_NL:
@@ -136,9 +136,9 @@ public class LineBreakStatus {
reset();
leftClass = currentClass;
return EXPLICIT_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_CR:
- //first character after a carriage return:
+ //first character after a carriage return:
// LB 5: Treat CR followed by LF, as well as CR ... as hard line breaks
// If current is LF, then fall through to Check 2 (see below),
// and the hard break will be signaled for the character after LF (see above)
@@ -147,11 +147,11 @@ public class LineBreakStatus {
leftClass = currentClass;
return EXPLICIT_BREAK;
}
-
+
default:
//nop
}
-
+
/* Check 2: current is a mandatory break or space? */
switch (currentClass) {
case LineBreakUtils.LINE_BREAK_PROPERTY_BK:
@@ -161,17 +161,17 @@ public class LineBreakStatus {
// LB 6: Do not break before a hard break
leftClass = currentClass;
return PROHIBITED_BREAK;
-
+
case LineBreakUtils.LINE_BREAK_PROPERTY_SP:
// LB 7: Do not break before spaces ...
// Zero-width spaces are in the pair-table (see below)
hadSpace = true;
return PROHIBITED_BREAK;
-
+
default:
//nop
}
-
+
/* Normal treatment, if the first two checks did not return */
boolean savedHadSpace = hadSpace;
hadSpace = false;
@@ -181,7 +181,7 @@ public class LineBreakStatus {
case DIRECT_BREAK:
leftClass = currentClass;
return breakAction;
-
+
case INDIRECT_BREAK:
leftClass = currentClass;
if (savedHadSpace) {
@@ -189,7 +189,7 @@ public class LineBreakStatus {
} else {
return PROHIBITED_BREAK;
}
-
+
case COMBINING_INDIRECT_BREAK:
if (savedHadSpace) {
leftClass = currentClass;
@@ -197,19 +197,19 @@ public class LineBreakStatus {
} else {
return PROHIBITED_BREAK;
}
-
+
case COMBINING_PROHIBITED_BREAK:
if (savedHadSpace) {
leftClass = currentClass;
}
return COMBINING_PROHIBITED_BREAK;
-
+
default:
assert false;
return breakAction;
}
}
-
+
/**
* for debugging only
*/
diff --git a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
index 5e84e1004..49557a6c9 100644
--- a/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
+++ b/src/java/org/apache/fop/text/linebreak/LineBreakUtils.java
@@ -5,9 +5,9 @@
* 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.
@@ -19,10 +19,10 @@
package org.apache.fop.text.linebreak;
-/*
- * !!! THIS IS A GENERATED FILE !!!
+/*
+ * !!! THIS IS A GENERATED FILE !!!
* If updates to the source are needed, then:
- * - apply the necessary modifications to
+ * - apply the necessary modifications to
* 'src/codegen/unicode/java/org/apache/fop/text/linebreak/GenerateLineBreakUtils.java'
* - run 'ant codegen-unicode', which will generate a new LineBreakUtils.java
* in 'src/java/org/apache/fop/text/linebreak'
@@ -45,41 +45,41 @@ public final class LineBreakUtils {
public static final byte EXPLICIT_BREAK = 5;
private static final byte PAIR_TABLE[][] = {
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 4, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 4, 1, 0, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 0, 1, 4, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 4, 4, 4, 4, 0, 0, 4, 3, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 4, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
- {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
- {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 4, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 4, 1, 0, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 0, 1, 4, 1, 0, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 0, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 1, 1, 0, 0, 1, 0, 0, 1, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 1, 4, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 4, 4, 4, 4, 0, 0, 4, 3, 0, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 0, 0, 4, 4, 4, 4, 4, 4, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 0, 4, 1, 1, 1, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 4, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
+ {0, 0, 0, 1, 0, 0, 0, 4, 2, 0, 4, 1, 0, 0, 1, 0, 0, 4, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 1, 1, 1, 1, 0, 0, 4, 2, 0, 4, 1, 1, 1, 1, 1, 1, 4, 1, 1, 1, 0, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 4, 4, 0, 4},
+ {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 4}};
private static byte lineBreakProperties[][] = new byte[512][];
@@ -680,8 +680,8 @@ public final class LineBreakUtils {
/** Linebreak property constant */
public static final byte LINE_BREAK_PROPERTY_ZW = 36;
- private static String lineBreakPropertyShortNames[] = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", "CR", "EX",
- "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", "PO", "PR", "QU", "SA", "SG", "SP",
+ private static String lineBreakPropertyShortNames[] = {"AI", "AL", "B2", "BA", "BB", "BK", "CB", "CL", "CM", "CR", "EX",
+ "GL", "H2", "H3", "HY", "ID", "IN", "IS", "JL", "JT", "JV", "LF", "NL", "NS", "NU", "OP", "PO", "PR", "QU", "SA", "SG", "SP",
"SY", "WJ", "XX", "ZW"};
private static String lineBreakPropertyLongNames[] = {"Ambiguous","Alphabetic","Break_Both","Break_After","Break_Before",
@@ -691,7 +691,7 @@ public final class LineBreakUtils {
"Surrogate","Space","Break_Symbols","Word_Joiner","Unknown","ZWSpace"};
/**
- * Return the short name for the linebreak property corresponding
+ * Return the short name for the linebreak property corresponding
* to the given symbolic constant.
*
* @param i the numeric value of the linebreak property
@@ -706,7 +706,7 @@ public final class LineBreakUtils {
}
/**
- * Return the long name for the linebreak property corresponding
+ * Return the long name for the linebreak property corresponding
* to the given symbolic constant.
*
* @param i the numeric value of the linebreak property
@@ -731,7 +731,7 @@ public final class LineBreakUtils {
}
/**
- * Return the break class constant for the given pair of linebreak
+ * Return the break class constant for the given pair of linebreak
* property constants.
*
* @param lineBreakPropertyBefore the linebreak property for the first character
diff --git a/src/java/org/apache/fop/tools/TestConverter.java b/src/java/org/apache/fop/tools/TestConverter.java
index 5cbd3c095..0c6e09bd0 100644
--- a/src/java/org/apache/fop/tools/TestConverter.java
+++ b/src/java/org/apache/fop/tools/TestConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools;
import java.io.File;
@@ -48,10 +48,10 @@ import org.apache.commons.logging.impl.SimpleLog;
* pdf rendering.
*/
public class TestConverter {
-
+
// configure fopFactory as desired
private FopFactory fopFactory = FopFactory.newInstance();
-
+
private boolean failOnly = false;
private String outputFormat = MimeConstants.MIME_FOP_AREA_TREE;
private File destdir;
@@ -126,7 +126,7 @@ public class TestConverter {
}
/**
- * Controls whether to process only the tests which are specified as fail
+ * Controls whether to process only the tests which are specified as fail
* in the test results.
* @param fail True if only fail tests should be processed
*/
@@ -262,7 +262,7 @@ public class TestConverter {
if (xslNode != null) {
xsl = xslNode.getNodeValue();
}
- logger.debug("converting xml:" + xml + " and xsl:"
+ logger.debug("converting xml:" + xml + " and xsl:"
+ xsl + " to area tree");
String res = xml;
@@ -299,7 +299,7 @@ public class TestConverter {
if (outname.endsWith(".xml") || outname.endsWith(".pdf")) {
outname = outname.substring(0, outname.length() - 4);
}
- File outputFile = new File(destdir,
+ File outputFile = new File(destdir,
outname + makeResultExtension());
outputFile.getParentFile().mkdirs();
diff --git a/src/java/org/apache/fop/tools/anttasks/FileCompare.java b/src/java/org/apache/fop/tools/anttasks/FileCompare.java
index 5deaa7da2..d9b64226a 100644
--- a/src/java/org/apache/fop/tools/anttasks/FileCompare.java
+++ b/src/java/org/apache/fop/tools/anttasks/FileCompare.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
import java.util.Date;
@@ -37,7 +37,7 @@ import java.text.DateFormat;
*/
public class FileCompare {
-
+
private String referenceDirectory, testDirectory;
private String[] filenameList;
private String filenames;
diff --git a/src/java/org/apache/fop/tools/anttasks/RunTest.java b/src/java/org/apache/fop/tools/anttasks/RunTest.java
index 2bc13e8b2..1e1a959ed 100644
--- a/src/java/org/apache/fop/tools/anttasks/RunTest.java
+++ b/src/java/org/apache/fop/tools/anttasks/RunTest.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
// Ant
@@ -42,7 +42,7 @@ import java.util.Map;
* to run the tests and check the results.
*/
public class RunTest extends Task {
-
+
private String basedir;
private String testsuite = "";
private String referenceJar = "";
@@ -218,7 +218,7 @@ public class RunTest extends Task {
}
/**
- * Return a list of URL's with the specified URL first and followed
+ * Return a list of URL's with the specified URL first and followed
* by all the jar files from lib/.
* @return a list of urls to the runtime jar files.
*/
diff --git a/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java b/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
index 0aefb8422..778c39f9a 100644
--- a/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
+++ b/src/java/org/apache/fop/tools/anttasks/SerializeHyphPattern.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.tools.anttasks;
// Java
diff --git a/src/java/org/apache/fop/traits/BlockProps.java b/src/java/org/apache/fop/traits/BlockProps.java
index 27417d897..370a97982 100644
--- a/src/java/org/apache/fop/traits/BlockProps.java
+++ b/src/java/org/apache/fop/traits/BlockProps.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.Length;
@@ -26,7 +26,7 @@ import org.apache.fop.datatypes.Length;
* Public "structure" allows direct member access.
*/
public class BlockProps {
-
+
public Length firstIndent; // text-indent
public int lastIndent; // last-line-indent
public int textAlign;
diff --git a/src/java/org/apache/fop/traits/BorderProps.java b/src/java/org/apache/fop/traits/BorderProps.java
index d00bdb09d..20e362674 100644
--- a/src/java/org/apache/fop/traits/BorderProps.java
+++ b/src/java/org/apache/fop/traits/BorderProps.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import java.awt.Color;
@@ -33,14 +33,14 @@ import org.apache.fop.util.ColorUtil;
* Class to store border trait propties for the area tree.
*/
public class BorderProps implements Serializable {
-
+
/** Separate border model */
public static final int SEPARATE = 0;
/** Collapsing border model, for borders inside a table */
public static final int COLLAPSE_INNER = 1;
/** Collapsing border model, for borders at the table's outer border */
public static final int COLLAPSE_OUTER = 2;
-
+
/** Border style (one of EN_*) */
public int style; // Enum for border style
/** Border color */
@@ -86,7 +86,7 @@ public class BorderProps implements Serializable {
return 0;
}
}
-
+
private String getStyleString() {
switch (style) {
case Constants.EN_NONE: return "none";
@@ -102,7 +102,7 @@ public class BorderProps implements Serializable {
default: throw new IllegalStateException("Illegal border style: " + style);
}
}
-
+
private static int getConstantForStyle(String style) {
if ("none".equalsIgnoreCase(style)) {
return Constants.EN_NONE;
@@ -128,7 +128,7 @@ public class BorderProps implements Serializable {
throw new IllegalStateException("Illegal border style: " + style);
}
}
-
+
/** {@inheritDoc} */
public int hashCode() {
return toString().hashCode();
@@ -144,7 +144,7 @@ public class BorderProps implements Serializable {
if (obj instanceof BorderProps) {
BorderProps other = (BorderProps)obj;
return (style == other.style)
- && color.equals(other.color)
+ && color.equals(other.color)
&& width == other.width
&& mode == other.mode;
}
@@ -153,7 +153,7 @@ public class BorderProps implements Serializable {
}
/**
- * Returns a BorderProps represtation of a string of the format as written by
+ * Returns a BorderProps represtation of a string of the format as written by
* BorderProps.toString().
* @param foUserAgent FOP user agent caching ICC profiles
* @param s the string
@@ -180,8 +180,8 @@ public class BorderProps implements Serializable {
c = ColorUtil.parseColorString(foUserAgent, color);
} catch (PropertyException e) {
throw new IllegalArgumentException(e.getMessage());
- }
-
+ }
+
return new BorderProps(style, width, c, mode);
} else {
throw new IllegalArgumentException("BorderProps must be surrounded by parentheses");
diff --git a/src/java/org/apache/fop/traits/InlineProps.java b/src/java/org/apache/fop/traits/InlineProps.java
index 735ebc0ca..06ca2553d 100644
--- a/src/java/org/apache/fop/traits/InlineProps.java
+++ b/src/java/org/apache/fop/traits/InlineProps.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
/**
diff --git a/src/java/org/apache/fop/traits/LayoutProps.java b/src/java/org/apache/fop/traits/LayoutProps.java
index f93470720..eff218b37 100644
--- a/src/java/org/apache/fop/traits/LayoutProps.java
+++ b/src/java/org/apache/fop/traits/LayoutProps.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.KeepValue;
diff --git a/src/java/org/apache/fop/traits/MinOptMax.java b/src/java/org/apache/fop/traits/MinOptMax.java
index 33d10a8a5..a4719f896 100644
--- a/src/java/org/apache/fop/traits/MinOptMax.java
+++ b/src/java/org/apache/fop/traits/MinOptMax.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
/**
@@ -163,7 +163,7 @@ public class MinOptMax implements java.io.Serializable, Cloneable {
opt -= op.opt;
max -= op.min;
}
-
+
/** @return true if this instance represents a zero-width length (min=opt=max=0) */
public boolean isNonZero() {
return (min != 0 || max != 0);
@@ -173,7 +173,7 @@ public class MinOptMax implements java.io.Serializable, Cloneable {
public boolean isElastic() {
return (min != opt || opt != max);
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
diff --git a/src/java/org/apache/fop/traits/SpaceVal.java b/src/java/org/apache/fop/traits/SpaceVal.java
index 0dae92193..e2ac6fb1c 100644
--- a/src/java/org/apache/fop/traits/SpaceVal.java
+++ b/src/java/org/apache/fop/traits/SpaceVal.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.traits;
import org.apache.fop.datatypes.PercentBaseContext;
@@ -30,7 +30,7 @@ import org.apache.fop.fonts.Font;
* Length values resolved. See section 4.3 in the specs.
*/
public class SpaceVal {
-
+
private final MinOptMax space;
private final boolean bConditional;
private final boolean bForcing;
@@ -45,7 +45,7 @@ public class SpaceVal {
space = new MinOptMax(spaceprop.getMinimum(context).getLength().getValue(context),
spaceprop.getOptimum(context).getLength().getValue(context),
spaceprop.getMaximum(context).getLength().getValue(context));
- bConditional =
+ bConditional =
(spaceprop.getConditionality().getEnum() == Constants.EN_DISCARD);
Property precProp = spaceprop.getPrecedence();
if (precProp.getNumber() != null) {
@@ -72,8 +72,8 @@ public class SpaceVal {
this.iPrecedence = iPrecedence;
}
- static public SpaceVal makeWordSpacing(Property wordSpacing,
- SpaceVal letterSpacing,
+ static public SpaceVal makeWordSpacing(Property wordSpacing,
+ SpaceVal letterSpacing,
Font fs) {
if (wordSpacing.getEnum() == Constants.EN_NORMAL) {
// give word spaces the possibility to shrink by a third,
@@ -87,7 +87,7 @@ public class SpaceVal {
true, true, 0);
} else {
return new SpaceVal(wordSpacing.getSpace(), null);
- }
+ }
}
static public SpaceVal makeLetterSpacing(Property letterSpacing) {
diff --git a/src/java/org/apache/fop/util/BreakUtil.java b/src/java/org/apache/fop/util/BreakUtil.java
index c0528464d..0e419016e 100644
--- a/src/java/org/apache/fop/util/BreakUtil.java
+++ b/src/java/org/apache/fop/util/BreakUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,7 +44,7 @@ public final class BreakUtil {
* Compares the given break classes and return the one that wins. even-page and
* odd-page win over page, which wins over column, which wins over auto. If even-page
* and odd-page are compared to each other, which one will be returned is undefined.
- *
+ *
* @param break1 a break class, one of {@link Constants#EN_AUTO},
* {@link Constants#EN_COLUMN}, {@link Constants#EN_PAGE},
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE}
diff --git a/src/java/org/apache/fop/util/CMYKColorSpace.java b/src/java/org/apache/fop/util/CMYKColorSpace.java
index 26de8aa97..593c65cea 100644
--- a/src/java/org/apache/fop/util/CMYKColorSpace.java
+++ b/src/java/org/apache/fop/util/CMYKColorSpace.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.util;
import java.awt.color.ColorSpace;
diff --git a/src/java/org/apache/fop/util/CharUtilities.java b/src/java/org/apache/fop/util/CharUtilities.java
index eb56cd331..7786552ff 100644
--- a/src/java/org/apache/fop/util/CharUtilities.java
+++ b/src/java/org/apache/fop/util/CharUtilities.java
@@ -5,9 +5,9 @@
* 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.
@@ -89,7 +89,7 @@ public class CharUtilities {
/** Unicode value indicating the the character is "not a character". */
public static final char NOT_A_CHARACTER = '\uFFFF';
-
+
/**
* Utility class: Constructor prevents instantiating when subclassed.
*/
@@ -147,7 +147,7 @@ public class CharUtilities {
* @return true if the character has a fixed-width
*/
public static boolean isFixedWidthSpace(char c) {
- return (c >= '\u2000' && c <= '\u200B')
+ return (c >= '\u2000' && c <= '\u200B')
|| c == '\u3000';
// c == '\u2000' // en quad
// c == '\u2001' // em quad
@@ -191,7 +191,7 @@ public class CharUtilities {
(c == '\u0020' // normal space
|| c == NBSPACE); // no-break space
}
-
+
/**
* Determines if the character represents any kind of space.
* @param c character to check
@@ -200,7 +200,7 @@ public class CharUtilities {
public static boolean isAnySpace(char c) {
return (isBreakableSpace(c) || isNonBreakableSpace(c));
}
-
+
/**
* Indicates whether a character is classified as "Alphabetic" by the Unicode standard.
* @param ch the character
diff --git a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
index c0db8c8b7..eae1cc09d 100644
--- a/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
+++ b/src/java/org/apache/fop/util/CloseBlockerOutputStream.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.util;
import java.io.IOException;
diff --git a/src/java/org/apache/fop/util/ColorExt.java b/src/java/org/apache/fop/util/ColorExt.java
index bd2c95a33..d2e73d227 100644
--- a/src/java/org/apache/fop/util/ColorExt.java
+++ b/src/java/org/apache/fop/util/ColorExt.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,11 +36,11 @@ public final class ColorExt extends Color {
private float rgbReplacementRed;
private float rgbReplacementGreen;
private float rgbReplacementBlue;
-
+
private String iccProfileName;
private String iccProfileSrc;
private ColorSpace colorSpace;
-
+
private float[] colorValues;
/*
@@ -59,7 +59,7 @@ public final class ColorExt extends Color {
/**
* Create ColorExt object backup up FO's rgb-icc color function
- *
+ *
* @param redReplacement
* Red part of RGB replacement color that will be used when ICC
* profile can not be loaded
@@ -95,7 +95,7 @@ public final class ColorExt extends Color {
/**
* Create ColorExt object backing up SVG's icc-color function.
- *
+ *
* @param red
* Red value resulting from the conversion from the user provided
* (icc) color values to the batik (rgb) color space
@@ -134,7 +134,7 @@ public final class ColorExt extends Color {
/**
* Get ICC profile name
- *
+ *
* @return ICC profile name
*/
public String getIccProfileName() {
@@ -143,7 +143,7 @@ public final class ColorExt extends Color {
/**
* Get ICC profile source
- *
+ *
* @return ICC profile source
*/
public String getIccProfileSrc() {
diff --git a/src/java/org/apache/fop/util/ColorProfileUtil.java b/src/java/org/apache/fop/util/ColorProfileUtil.java
index 6a849a031..f234dde66 100644
--- a/src/java/org/apache/fop/util/ColorProfileUtil.java
+++ b/src/java/org/apache/fop/util/ColorProfileUtil.java
@@ -49,7 +49,7 @@ public class ColorProfileUtil {
}
}
}
-
+
/**
* Indicates whether a given color profile is identical to the default sRGB profile
* provided by the Java class library.
@@ -64,5 +64,5 @@ public class ColorProfileUtil {
}
return profile == sRGBProfile;
}
-
+
}
diff --git a/src/java/org/apache/fop/util/ColorSpaceCache.java b/src/java/org/apache/fop/util/ColorSpaceCache.java
index 92dcf8d55..7b3f409e0 100644
--- a/src/java/org/apache/fop/util/ColorSpaceCache.java
+++ b/src/java/org/apache/fop/util/ColorSpaceCache.java
@@ -5,9 +5,9 @@
* 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.
@@ -49,19 +49,19 @@ public class ColorSpaceCache {
public ColorSpaceCache(URIResolver resolver) {
this.resolver = resolver;
}
-
+
/**
* Create (if needed) and return an ICC ColorSpace instance.
- *
+ *
* The ICC profile source is taken from the src attribute of the color-profile FO element.
* If the ICC ColorSpace is not yet in the cache a new one is created and stored in the cache.
- *
- * The FOP URI resolver is used to try and locate the ICC file.
+ *
+ * The FOP URI resolver is used to try and locate the ICC file.
* If that fails null is returned.
- *
+ *
* @param base a base URI to resolve relative URIs
* @param iccProfileSrc ICC Profile source to return a ColorSpace for
- * @return ICC ColorSpace object or null if ColorSpace could not be created
+ * @return ICC ColorSpace object or null if ColorSpace could not be created
*/
public ColorSpace get(String base, String iccProfileSrc) {
ColorSpace colorSpace = null;
@@ -80,7 +80,7 @@ public class ColorSpaceCache {
// TODO - Would it make sense to fall back on VM ICC
// resolution
// Problem is the cache might be more difficult to maintain
- //
+ //
// FOP URI resolver did not find ICC profile - perhaps the
// Java VM can find it?
// iccProfile = ICC_Profile.getInstance(iccProfileSrc);
@@ -106,5 +106,5 @@ public class ColorSpaceCache {
+ iccProfileSrc);
}
return colorSpace;
- }
+ }
}
diff --git a/src/java/org/apache/fop/util/ColorUtil.java b/src/java/org/apache/fop/util/ColorUtil.java
index fbfc68c36..b85b0c017 100644
--- a/src/java/org/apache/fop/util/ColorUtil.java
+++ b/src/java/org/apache/fop/util/ColorUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -39,21 +39,21 @@ import org.apache.fop.fo.expr.PropertyException;
public final class ColorUtil {
/**
- *
+ *
* keeps all the predefined and parsed colors.
*
* This map is used to predefine given colors, as well as speeding up
* parsing of already parsed colors.
*/
private static Map colorMap = null;
-
+
/** Logger instance */
protected static Log log = LogFactory.getLog(ColorUtil.class);
-
+
static {
initializeColorMap();
}
-
+
/**
* Private constructor since this is an utility class.
*/
@@ -77,8 +77,8 @@ public final class ColorUtil {
*
* First, the color will be converted into the sRGB colorspace. It will then
* be printed as #rrggbb, or as #rrrggbbaa if an alpha value is present.
- *
+ *
* @param color
* the color to represent.
* @return a re-parsable string representadion.
diff --git a/src/java/org/apache/fop/util/CommandLineLogger.java b/src/java/org/apache/fop/util/CommandLineLogger.java
index beb82ab03..0da112e5c 100644
--- a/src/java/org/apache/fop/util/CommandLineLogger.java
+++ b/src/java/org/apache/fop/util/CommandLineLogger.java
@@ -4,9 +4,9 @@
/* 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.
@@ -40,17 +40,17 @@ public class CommandLineLogger implements Log {
private int logLevel;
private String logName;
-
+
/**
- * Construct the logger with a default log level taken from the LogFactory
- * attribute "level".
+ * Construct the logger with a default log level taken from the LogFactory
+ * attribute "level".
* @param logName the logger name.
*/
public CommandLineLogger(String logName) {
this.logName = logName;
setLogLevel((String) LogFactory.getFactory().getAttribute("level"));
}
-
+
/**
* Set a log level for the logger.
* @param level the log level
@@ -72,7 +72,7 @@ public class CommandLineLogger implements Log {
logLevel = LOG_LEVEL_INFO;
}
}
-
+
/**
* {@inheritDoc}
*/
@@ -93,7 +93,7 @@ public class CommandLineLogger implements Log {
public final boolean isInfoEnabled() {
return logLevel <= LOG_LEVEL_INFO;
}
-
+
/**
* {@inheritDoc}
*/
@@ -114,7 +114,7 @@ public class CommandLineLogger implements Log {
public final boolean isFatalEnabled() {
return logLevel <= LOG_LEVEL_FATAL;
}
-
+
/**
* {@inheritDoc}
*/
@@ -222,7 +222,7 @@ public class CommandLineLogger implements Log {
log(LOG_LEVEL_FATAL, message, t);
}
}
-
+
/**
* Do the actual logging.
* This method assembles the message and prints it to
diff --git a/src/java/org/apache/fop/util/ContentHandlerFactory.java b/src/java/org/apache/fop/util/ContentHandlerFactory.java
index 30ab2374a..7eca0bf95 100644
--- a/src/java/org/apache/fop/util/ContentHandlerFactory.java
+++ b/src/java/org/apache/fop/util/ContentHandlerFactory.java
@@ -34,43 +34,43 @@ public interface ContentHandlerFactory {
* @return an array of supported namespaces.
*/
String[] getSupportedNamespaces();
-
+
/**
* @return a new ContentHandler to handle a SAX stream
* @throws SAXException if there's an error while preparing the ContentHandler
*/
ContentHandler createContentHandler() throws SAXException;
-
+
/**
* Interface that ContentHandler implementations that parse Java objects from XML can implement
* to return these objects.
*/
public interface ObjectSource {
-
+
/**
* @return the object parsed from the SAX stream (call valid after parsing)
*/
Object getObject();
-
+
/**
* Set a listener which gets notified when the object is fully built.
* @param listener the listener which gets notified
*/
void setObjectBuiltListener(ObjectBuiltListener listener);
}
-
+
/**
* EventListener interface for objects which want to get notified when ContentHandler
* implementing the ObjectSource interface has finished parsing.
*/
public interface ObjectBuiltListener extends EventListener {
-
+
/**
* Notifies the listener when the object is fully built.
* @param obj the newly built object
*/
void notifyObjectBuilt(Object obj);
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java b/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
index 3d8ef8296..ceedf9f12 100644
--- a/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
+++ b/src/java/org/apache/fop/util/ContentHandlerFactoryRegistry.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,24 +36,24 @@ public class ContentHandlerFactoryRegistry {
/** the logger */
private static Log log = LogFactory.getLog(ContentHandlerFactoryRegistry.class);
-
+
/** Map from namespace URIs to ContentHandlerFactories */
private Map factories = new java.util.HashMap();
-
+
/**
* Default constructor.
*/
public ContentHandlerFactoryRegistry() {
discover();
}
-
+
/**
* Add an XML handler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
*/
public void addContentHandlerFactory(String classname) {
try {
- ContentHandlerFactory factory
+ ContentHandlerFactory factory
= (ContentHandlerFactory)Class.forName(classname).newInstance();
addContentHandlerFactory(factory);
} catch (ClassNotFoundException e) {
@@ -67,11 +67,11 @@ public class ContentHandlerFactoryRegistry {
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ ContentHandlerFactory.class.getName());
}
}
-
+
/**
* Add an ContentHandlerFactory. The instance is inspected to find out what it supports.
* @param factory the ContentHandlerFactory instance
@@ -82,7 +82,7 @@ public class ContentHandlerFactoryRegistry {
factories.put(ns[i], factory);
}
}
-
+
/**
* Retrieves a ContentHandlerFactory instance of a given namespace URI.
* @param namespaceURI the namespace to be handled.
@@ -92,7 +92,7 @@ public class ContentHandlerFactoryRegistry {
ContentHandlerFactory factory = (ContentHandlerFactory)factories.get(namespaceURI);
return factory;
}
-
+
/**
* Discovers ContentHandlerFactory implementations through the classpath and dynamically
* registers them.
@@ -105,7 +105,7 @@ public class ContentHandlerFactoryRegistry {
ContentHandlerFactory factory = (ContentHandlerFactory)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding ContentHandlerFactory: "
+ log.debug("Dynamically adding ContentHandlerFactory: "
+ factory.getClass().getName());
}
addContentHandlerFactory(factory);
diff --git a/src/java/org/apache/fop/util/ConversionUtils.java b/src/java/org/apache/fop/util/ConversionUtils.java
index e2d93fbd3..82d06ba32 100644
--- a/src/java/org/apache/fop/util/ConversionUtils.java
+++ b/src/java/org/apache/fop/util/ConversionUtils.java
@@ -5,7 +5,7 @@
* 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
@@ -27,84 +27,84 @@ public final class ConversionUtils {
* Converts the given base
- * Part of the code here copied and adapted from Apache Xalan-J,
+ * Part of the code here copied and adapted from Apache Xalan-J,
* src/org/apache/xalan/xsltc/trax/DOM2SAX.java
*/
public class DOM2SAX {
@@ -45,9 +45,9 @@ public class DOM2SAX {
private ContentHandler contentHandler;
private LexicalHandler lexicalHandler;
-
+
private Map prefixes = new java.util.HashMap();
-
+
/**
* Main constructor
* @param handler the ContentHandler to send SAX events to
@@ -58,7 +58,7 @@ public class DOM2SAX {
this.lexicalHandler = (LexicalHandler)handler;
}
}
-
+
/**
* Writes the given document using the given ContentHandler.
* @param doc DOM document
@@ -143,7 +143,7 @@ public class DOM2SAX {
* @param node node to serialize
* @throws SAXException In case of a problem while writing XML
*/
- private void writeNode(Node node)
+ private void writeNode(Node node)
throws SAXException {
if (node == null) {
return;
@@ -284,5 +284,5 @@ public class DOM2SAX {
}
}
-
+
}
diff --git a/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java b/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
index 5ad127021..6117c436d 100644
--- a/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
+++ b/src/java/org/apache/fop/util/DOMBuilderContentHandlerFactory.java
@@ -35,23 +35,23 @@ import org.xml.sax.SAXException;
*/
public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
- private static SAXTransformerFactory tFactory
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
private String namespaceURI;
private DOMImplementation domImplementation;
-
+
/**
* Main Constructor
- * @param namespaceURI the main namespace URI for the DOM to be parsed
+ * @param namespaceURI the main namespace URI for the DOM to be parsed
* @param domImplementation the DOMImplementation to use for build the DOM
*/
- public DOMBuilderContentHandlerFactory(String namespaceURI,
+ public DOMBuilderContentHandlerFactory(String namespaceURI,
DOMImplementation domImplementation) {
this.namespaceURI = namespaceURI;
this.domImplementation = domImplementation;
}
-
+
/** {@inheritDoc} */
public String[] getSupportedNamespaces() {
return new String[] {namespaceURI};
@@ -61,13 +61,13 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public ContentHandler createContentHandler() throws SAXException {
return new Handler();
}
-
+
private class Handler extends DelegatingContentHandler
implements ContentHandlerFactory.ObjectSource {
-
+
private Document doc;
private ObjectBuiltListener obListener;
-
+
public Handler() throws SAXException {
super();
}
@@ -75,7 +75,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public Document getDocument() {
return this.doc;
}
-
+
/**
* {@inheritDoc}
*/
@@ -89,7 +89,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
public void setObjectBuiltListener(ObjectBuiltListener listener) {
this.obListener = listener;
}
-
+
/**
* {@inheritDoc}
*/
@@ -103,7 +103,7 @@ public class DOMBuilderContentHandlerFactory implements ContentHandlerFactory {
/**
* {@inheritDoc}
*/
- public void startElement(String uri, String localName, String qName, Attributes atts)
+ public void startElement(String uri, String localName, String qName, Attributes atts)
throws SAXException {
if (doc == null) {
TransformerHandler handler;
diff --git a/src/java/org/apache/fop/util/DataURIResolver.java b/src/java/org/apache/fop/util/DataURIResolver.java
index 699659f7e..89db6dc9d 100644
--- a/src/java/org/apache/fop/util/DataURIResolver.java
+++ b/src/java/org/apache/fop/util/DataURIResolver.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.xmlgraphics.util.io.Base64DecodeStream;
/**
* Resolves data URLs (described in RFC 2397) returning its data as a StreamSource.
- *
+ *
* @see javax.xml.transform.URIResolver
* @see RFC 2397
*/
@@ -51,7 +51,7 @@ public class DataURIResolver implements URIResolver {
/**
* Parses inline data URIs as generated by MS Word's XML export and FO
* stylesheet.
- *
+ *
* @see RFC 2397
*/
private Source parseDataURI(String href) {
diff --git a/src/java/org/apache/fop/util/DataURLUtil.java b/src/java/org/apache/fop/util/DataURLUtil.java
index 03236dd45..d8f7f17bf 100644
--- a/src/java/org/apache/fop/util/DataURLUtil.java
+++ b/src/java/org/apache/fop/util/DataURLUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,7 +44,7 @@ public class DataURLUtil {
writeDataURL(in, mediatype, writer);
return writer.toString();
}
-
+
/**
* Generates a data URL and writes it to a Writer.
* @param in the InputStream to read the data from
diff --git a/src/java/org/apache/fop/util/DefaultErrorListener.java b/src/java/org/apache/fop/util/DefaultErrorListener.java
index 3717d3192..1d17b86fd 100644
--- a/src/java/org/apache/fop/util/DefaultErrorListener.java
+++ b/src/java/org/apache/fop/util/DefaultErrorListener.java
@@ -31,7 +31,7 @@ import org.apache.commons.logging.Log;
public class DefaultErrorListener implements ErrorListener {
private Log log;
-
+
/**
* Main constructor
* @param log the log instance to send log events to
@@ -39,7 +39,7 @@ public class DefaultErrorListener implements ErrorListener {
public DefaultErrorListener(Log log) {
this.log = log;
}
-
+
/**
* {@inheritDoc}
*/
diff --git a/src/java/org/apache/fop/util/DelegatingContentHandler.java b/src/java/org/apache/fop/util/DelegatingContentHandler.java
index 0b371483f..0db1105ce 100644
--- a/src/java/org/apache/fop/util/DelegatingContentHandler.java
+++ b/src/java/org/apache/fop/util/DelegatingContentHandler.java
@@ -38,9 +38,9 @@ import org.xml.sax.ext.LexicalHandler;
*
* The ContentHandler is the only instance that is required. All others (DTDHandler,
* EntityResolver, LexicalHandler and ErrorHandler) may be ignored.
- *
+ *
*/
-public class DelegatingContentHandler
+public class DelegatingContentHandler
implements EntityResolver, DTDHandler, ContentHandler, LexicalHandler, ErrorHandler {
private ContentHandler delegate;
@@ -48,7 +48,7 @@ public class DelegatingContentHandler
private DTDHandler dtdHandler;
private LexicalHandler lexicalHandler;
private ErrorHandler errorHandler;
-
+
/**
* Main constructor.
*/
@@ -62,7 +62,7 @@ public class DelegatingContentHandler
public ContentHandler getDelegateContentHandler() {
return this.delegate;
}
-
+
/**
* Sets the delegate ContentHandler that all events are forwarded to.
* @param handler the delegate instance
@@ -70,7 +70,7 @@ public class DelegatingContentHandler
public void setDelegateContentHandler(ContentHandler handler) {
this.delegate = handler;
}
-
+
/**
* Sets the delegate EntityResolver.
* @param resolver the delegate instance
@@ -78,7 +78,7 @@ public class DelegatingContentHandler
public void setDelegateEntityResolver(EntityResolver resolver) {
this.entityResolver = resolver;
}
-
+
/**
* Sets the delegate DTDHandler.
* @param handler the delegate instance
@@ -86,7 +86,7 @@ public class DelegatingContentHandler
public void setDelegateDTDHandler(DTDHandler handler) {
this.dtdHandler = handler;
}
-
+
/**
* Sets the delegate LexicalHandler.
* @param handler the delegate instance
@@ -94,7 +94,7 @@ public class DelegatingContentHandler
public void setDelegateLexicalHandler(LexicalHandler handler) {
this.lexicalHandler = handler;
}
-
+
/**
* Sets the delegate ErrorHandler.
* @param handler the delegate instance
@@ -102,9 +102,9 @@ public class DelegatingContentHandler
public void setDelegateErrorHandler(ErrorHandler handler) {
this.errorHandler = handler;
}
-
+
// ==== EntityResolver
-
+
/**
* {@inheritDoc}
*/
@@ -130,7 +130,7 @@ public class DelegatingContentHandler
/**
* {@inheritDoc}
*/
- public void unparsedEntityDecl(String name, String publicId, String systemId,
+ public void unparsedEntityDecl(String name, String publicId, String systemId,
String notationName) throws SAXException {
if (dtdHandler != null) {
dtdHandler.unparsedEntityDecl(name, publicId, systemId, notationName);
@@ -138,7 +138,7 @@ public class DelegatingContentHandler
}
// ==== ContentHandler
-
+
/**
* {@inheritDoc}
*/
@@ -177,7 +177,7 @@ public class DelegatingContentHandler
/**
* {@inheritDoc}
*/
- public void startElement(String uri, String localName, String qName,
+ public void startElement(String uri, String localName, String qName,
Attributes atts) throws SAXException {
delegate.startElement(uri, localName, qName, atts);
}
@@ -218,7 +218,7 @@ public class DelegatingContentHandler
}
// ==== LexicalHandler
-
+
/**
* {@inheritDoc}
*/
@@ -226,7 +226,7 @@ public class DelegatingContentHandler
if (lexicalHandler != null) {
lexicalHandler.startDTD(name, publicId, systemId);
}
-
+
}
/**
@@ -275,14 +275,14 @@ public class DelegatingContentHandler
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void comment(char[] ch, int start, int length) throws SAXException {
if (lexicalHandler != null) {
lexicalHandler.comment(ch, start, length);
}
}
-
+
// ==== ErrorHandler
/**
diff --git a/src/java/org/apache/fop/util/ListUtil.java b/src/java/org/apache/fop/util/ListUtil.java
index a6b8d490c..d97457510 100644
--- a/src/java/org/apache/fop/util/ListUtil.java
+++ b/src/java/org/apache/fop/util/ListUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,7 +23,7 @@ import java.util.List;
/**
* Provides helper functions for {@link java.util.List}.
- *
+ *
*/
public final class ListUtil {
@@ -33,7 +33,7 @@ public final class ListUtil {
/**
* Retrieve the last element from a list.
- *
+ *
* @param list
* The list to work on
* @return last element
@@ -44,7 +44,7 @@ public final class ListUtil {
/**
* Retrieve and remove the last element from a list.
- *
+ *
* @param list
* The list to work on
* @return previous last element
diff --git a/src/java/org/apache/fop/util/LogUtil.java b/src/java/org/apache/fop/util/LogUtil.java
index e33397fcb..23f275644 100644
--- a/src/java/org/apache/fop/util/LogUtil.java
+++ b/src/java/org/apache/fop/util/LogUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -23,7 +23,7 @@ import org.apache.commons.logging.Log;
import org.apache.fop.apps.FOPException;
/**
- * Convenience Logging utility methods used in FOP
+ * Convenience Logging utility methods used in FOP
*/
public class LogUtil {
diff --git a/src/java/org/apache/fop/util/QName.java b/src/java/org/apache/fop/util/QName.java
index 132f5b4dc..1b0708a89 100644
--- a/src/java/org/apache/fop/util/QName.java
+++ b/src/java/org/apache/fop/util/QName.java
@@ -22,14 +22,14 @@ package org.apache.fop.util;
/**
* Represents a qualified name of an XML element or an XML attribute.
*
- * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
+ * Note: This class allows to carry a namespace prefix but it is not used in the equals() and
* hashCode() methods.
* @deprecated Use the XML Graphics Commons variant instead!
*/
public class QName extends org.apache.xmlgraphics.util.QName {
private static final long serialVersionUID = -5225376740044770690L;
-
+
/**
* Main constructor.
* @param namespaceURI the namespace URI
@@ -39,7 +39,7 @@ public class QName extends org.apache.xmlgraphics.util.QName {
public QName(String namespaceURI, String prefix, String localName) {
super(namespaceURI, prefix, localName);
}
-
+
/**
* Main constructor.
* @param namespaceURI the namespace URI
@@ -48,5 +48,5 @@ public class QName extends org.apache.xmlgraphics.util.QName {
public QName(String namespaceURI, String qName) {
super(namespaceURI, qName);
}
-
+
}
diff --git a/src/java/org/apache/fop/util/UnclosableInputStream.java b/src/java/org/apache/fop/util/UnclosableInputStream.java
index 0384a62ff..7d06a5ac7 100644
--- a/src/java/org/apache/fop/util/UnclosableInputStream.java
+++ b/src/java/org/apache/fop/util/UnclosableInputStream.java
@@ -5,9 +5,9 @@
* 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.
@@ -29,7 +29,7 @@ public class UnclosableInputStream extends FilterInputStream {
/**
* Default constructor.
- *
+ *
* @param in the Stream to filter.
*/
public UnclosableInputStream(InputStream in) {
diff --git a/src/java/org/apache/fop/util/UnitConv.java b/src/java/org/apache/fop/util/UnitConv.java
index cd3276b9f..8bf7274eb 100644
--- a/src/java/org/apache/fop/util/UnitConv.java
+++ b/src/java/org/apache/fop/util/UnitConv.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,13 +26,13 @@ public final class UnitConv {
/** conversion factory from millimeters to inches. */
public static final float IN2MM = 25.4f;
-
+
/** conversion factory from centimeters to inches. */
public static final float IN2CM = 2.54f;
-
+
/** conversion factory from inches to points. */
public static final int IN2PT = 72;
-
+
/**
* Converts millimeters (mm) to points (pt)
* @param mm the value in mm
@@ -59,7 +59,7 @@ public final class UnitConv {
public static double pt2mm(double pt) {
return pt * IN2MM / IN2PT;
}
-
+
/**
* Converts millimeters (mm) to inches (in)
* @param mm the value in mm
@@ -68,7 +68,7 @@ public final class UnitConv {
public static double mm2in(double mm) {
return mm / IN2MM;
}
-
+
/**
* Converts inches (in) to millimeters (mm)
* @param in the value in inches
@@ -77,7 +77,7 @@ public final class UnitConv {
public static double in2mm(double in) {
return in * IN2MM;
}
-
+
/**
* Converts inches (in) to millipoints (mpt)
* @param in the value in inches
@@ -86,7 +86,7 @@ public final class UnitConv {
public static double in2mpt(double in) {
return in * IN2PT * 1000;
}
-
+
/**
* Converts inches (in) to points (pt)
* @param in the value in inches
@@ -95,16 +95,16 @@ public final class UnitConv {
public static double in2pt(double in) {
return in * IN2PT;
}
-
+
/**
- * Converts millipoints (mpt) to inches (in)
+ * Converts millipoints (mpt) to inches (in)
* @param mpt the value in mpt
* @return the value in inches
*/
public static double mpt2in(double mpt) {
return mpt / IN2PT / 1000;
}
-
+
/**
* Converts millimeters (mm) to pixels (px)
* @param mm the value in mm
diff --git a/src/java/org/apache/fop/util/WriterOutputStream.java b/src/java/org/apache/fop/util/WriterOutputStream.java
index d399b60dc..fb6875498 100644
--- a/src/java/org/apache/fop/util/WriterOutputStream.java
+++ b/src/java/org/apache/fop/util/WriterOutputStream.java
@@ -5,9 +5,9 @@
* 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.
@@ -24,7 +24,7 @@ import java.io.OutputStream;
import java.io.Writer;
/**
- * An OutputStream wrapper for a Writer.
+ * An OutputStream wrapper for a Writer.
*/
public class WriterOutputStream extends OutputStream {
diff --git a/src/java/org/apache/fop/util/XMLResourceBundle.java b/src/java/org/apache/fop/util/XMLResourceBundle.java
index 1b320816b..268ce1eed 100644
--- a/src/java/org/apache/fop/util/XMLResourceBundle.java
+++ b/src/java/org/apache/fop/util/XMLResourceBundle.java
@@ -1,4 +1,4 @@
-/*
+/*
* 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.
@@ -61,12 +61,12 @@ import org.apache.xmlgraphics.util.QName;
public class XMLResourceBundle extends ResourceBundle {
//Note: Some code here has been copied and adapted from Apache Harmony!
-
+
private Properties resources = new Properties();
private Locale locale;
-
- private static SAXTransformerFactory tFactory
+
+ private static SAXTransformerFactory tFactory
= (SAXTransformerFactory)SAXTransformerFactory.newInstance();
/**
@@ -84,7 +84,7 @@ public class XMLResourceBundle extends ResourceBundle {
throw new IOException("Error while parsing XML resource bundle: " + e.getMessage());
}
}
-
+
/**
* Gets a resource bundle using the specified base name, default locale, and class loader.
* @param baseName the base name of the resource bundle, a fully qualified class name
@@ -98,7 +98,7 @@ public class XMLResourceBundle extends ResourceBundle {
throws MissingResourceException {
return getXMLBundle(baseName, Locale.getDefault(), loader);
}
-
+
/**
* Gets a resource bundle using the specified base name, locale, and class loader.
* @param baseName the base name of the resource bundle, a fully qualified class name
@@ -117,7 +117,7 @@ public class XMLResourceBundle extends ResourceBundle {
if (baseName == null) {
throw new NullPointerException("baseName must not be null");
}
-
+
ResourceBundle bundle;
if (!locale.equals(Locale.getDefault())) {
bundle = handleGetXMLBundle(baseName, "_" + locale, false, loader);
@@ -145,10 +145,10 @@ public class XMLResourceBundle extends ResourceBundle {
private static final ResourceBundle MISSING = new MissingBundle();
private static final ResourceBundle MISSINGBASE = new MissingBundle();
-
+
private static Map cache = new java.util.WeakHashMap();
//
- * org.apache.fop.area.CTM ctm =
+ * org.apache.fop.area.CTM ctm =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* String pdfMatrix = org.apache.fop.render.pdf.CTMHelper.toPDFString(ctm);
*
@@ -58,7 +58,7 @@ public final class CTMHelper {
}
/**
- *
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
- * org.apache.fop.area.CTM outCTM =
+ * org.apache.fop.area.CTM outCTM =
* org.apache.fop.render.pdf.CTMHelper.toPDFCTM(ctm);
*
* will return a new CTM where a == 1.0, b == 0.0, c == 0.0, d == 1.0, e == 1.0 and f == 1.0.
@@ -121,7 +121,7 @@ public final class CTMHelper {
*
- * org.apache.fop.area.CTM inCTM =
+ * org.apache.fop.area.CTM inCTM =
* new org.apache.fop.area.CTM(1.0, 0.0, 0.0, 1.0, 1000.0, 1000.0);
* double matrix[] = org.apache.fop.render.pdf.CTMHelper.toPDFArray(ctm);
*
diff --git a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
index b80e2c03e..f158f6a14 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRawCCITTFaxAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -55,7 +55,7 @@ public class ImageRawCCITTFaxAdapter extends AbstractImageAdapter {
public ImageRawCCITTFax getImage() {
return ((ImageRawCCITTFax)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new CCFFilter();
@@ -95,7 +95,7 @@ public class ImageRawCCITTFaxAdapter extends AbstractImageAdapter {
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
getImage().writeTo(out);
diff --git a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
index 1e505daed..a60c9e92c 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRawJPEGAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -64,7 +64,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
public ImageRawJPEG getImage() {
return ((ImageRawJPEG)this.image);
}
-
+
/** {@inheritDoc} */
public void setup(PDFDocument doc) {
pdfFilter = new DCTFilter();
@@ -88,12 +88,12 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
public boolean isInverted() {
return getImage().isInverted();
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
InputStream in = getImage().createInputStream();
@@ -101,7 +101,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
try {
JPEGFile jpeg = new JPEGFile(in);
DataInput din = jpeg.getDataInput();
-
+
//Copy the whole JPEG file except:
// - the ICC profile
//TODO Thumbnails could safely be skipped, too.
@@ -149,7 +149,7 @@ public class ImageRawJPEGAdapter extends AbstractImageAdapter {
default:
out.write(0xFF);
out.write(segID);
-
+
reclen = jpeg.readSegmentLength();
//write short
out.write((reclen >>> 8) & 0xFF);
diff --git a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
index 62e83da81..e8988244f 100644
--- a/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/ImageRenderedAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -52,7 +52,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
private static Log log = LogFactory.getLog(ImageRenderedAdapter.class);
private ImageEncodingHelper encodingHelper;
-
+
private PDFFilter pdfFilter = null;
private String maskRef;
private PDFReference softMask;
@@ -74,11 +74,11 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
public ImageRendered getImage() {
return ((ImageRendered)this.image);
}
-
+
private ColorModel getEffectiveColorModel() {
return encodingHelper.getEncodedColorModel();
}
-
+
/** {@inheritDoc} */
protected ColorSpace getImageColorSpace() {
return getEffectiveColorModel().getColorSpace();
@@ -90,14 +90,14 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
ColorModel cm = getEffectiveColorModel();
super.setup(doc);
-
+
//Handle transparency mask if applicable
- ColorModel orgcm = ri.getColorModel();
+ ColorModel orgcm = ri.getColorModel();
if (orgcm.hasAlpha() && orgcm.getTransparency() == ColorModel.TRANSLUCENT) {
doc.getProfile().verifyTransparencyAllowed(image.getInfo().getOriginalURI());
//TODO Implement code to combine image with background color if transparency is not
//allowed (need BufferedImage support for that)
-
+
AlphaRasterImage alphaImage = new AlphaRasterImage("Mask:" + getKey(), ri);
this.softMask = doc.addImage(null, alphaImage).makeReference();
}
@@ -130,7 +130,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
}
return (getImage().getTransparentColor() != null);
}
-
+
private static Integer getIndexOfFirstTransparentColorInPalette(RenderedImage image) {
ColorModel cm = image.getColorModel();
if (cm instanceof IndexColorModel) {
@@ -180,19 +180,19 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
public PDFReference getSoftMaskReference() {
return softMask;
}
-
+
/** {@inheritDoc} */
public PDFFilter getPDFFilter() {
return pdfFilter;
}
-
+
/** {@inheritDoc} */
public void outputContents(OutputStream out) throws IOException {
encodingHelper.encode(out);
}
private static final int MAX_HIVAL = 255;
-
+
/** {@inheritDoc} */
public void populateXObjectDictionary(PDFDictionary dict) {
ColorModel cm = getEffectiveColorModel();
@@ -200,11 +200,11 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
IndexColorModel icm = (IndexColorModel)cm;
PDFArray indexed = new PDFArray(dict);
indexed.add(new PDFName("Indexed"));
-
+
if (icm.getColorSpace().getType() != ColorSpace.TYPE_RGB) {
log.warn("Indexed color space is not using RGB as base color space."
+ " The image may not be handled correctly."
- + " Base color space: " + icm.getColorSpace()
+ + " Base color space: " + icm.getColorSpace()
+ " Image: " + image.getInfo());
}
indexed.add(new PDFName(toPDFColorSpace(icm.getColorSpace()).getName()));
@@ -229,7 +229,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
dict.put("ColorSpace", indexed);
dict.put("BitsPerComponent", icm.getPixelSize());
-
+
Integer index = getIndexOfFirstTransparentColorInPalette(getImage().getRenderedImage());
if (index != null) {
PDFArray mask = new PDFArray(dict);
@@ -239,7 +239,7 @@ public class ImageRenderedAdapter extends AbstractImageAdapter {
}
}
}
-
+
/** {@inheritDoc} */
public String getFilterHint() {
return PDFFilterList.IMAGE_FILTER;
diff --git a/src/java/org/apache/fop/render/pdf/PDFEventProducer.java b/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
index f8b1bbb33..2c3be9736 100644
--- a/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFEventProducer.java
@@ -31,7 +31,7 @@ public interface PDFEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PDFEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* Some link targets haven't been fully resolved.
* @param source the event source
@@ -60,5 +60,5 @@ public interface PDFEventProducer extends EventProducer {
* @event.severity WARN
*/
void nonFullyResolvedLinkTargets(Object source, int count);
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
index c47b944d0..b61ebc346 100644
--- a/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/pdf/PDFGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.pdf;
import java.awt.Color;
@@ -49,18 +49,18 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
public PDFGraphics2DAdapter(PDFRenderer renderer) {
this.renderer = renderer;
}
-
+
/** {@inheritDoc} */
public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
-
+
PDFSVGHandler.PDFInfo pdfInfo = PDFSVGHandler.getPDFInfo(context);
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -72,7 +72,7 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
renderer.saveGraphicsState();
renderer.setColor(Color.black, false, null);
renderer.setColor(Color.black, true, null);
-
+
//TODO Clip to the image area.
// transform so that the coordinates (0,0) is from the top left
@@ -86,13 +86,13 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
+ PDFGraphics2D graphics = new PDFGraphics2D(textAsShapes,
pdfInfo.fi, pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName,
pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
-
+
AffineTransform transform = new AffineTransform();
transform.translate(fx, fy);
pdfInfo.pdfState.concatenate(transform);
@@ -105,7 +105,7 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
RendererContextWrapper ctx = RendererContext.wrapRendererContext(context);
BufferedImage bi = paintToBufferedImage(painter, ctx, resolution, false, false);
- float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
+ float scale = PDFRenderer.NORMAL_PDF_RESOLUTION
/ context.getUserAgent().getTargetResolution();
graphics.drawImage(bi, new AffineTransform(scale, 0, 0, scale, 0, 0), null);
} else {
@@ -121,9 +121,9 @@ public class PDFGraphics2DAdapter extends AbstractGraphics2DAdapter {
/** {@inheritDoc} */
protected void setRenderingHintsForBufferedImage(Graphics2D g2d) {
super.setRenderingHintsForBufferedImage(g2d);
- g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_ANTIALIASING,
RenderingHints.VALUE_ANTIALIAS_ON);
- g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
+ g2d.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING,
RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandler.java b/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
index d62dcbc5b..f93ee5a97 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -41,19 +41,19 @@ public interface PDFImageHandler {
* @return a positive integer (>0) indicating the priority
*/
int getPriority();
-
+
/**
* Returns the {@link ImageFlavor}s supported by this instance
* @return the supported image flavors
*/
ImageFlavor[] getSupportedImageFlavors();
-
+
/**
* Returns the {@link Image} subclass supported by this instance.
* @return the Image type
*/
Class getSupportedImageClass();
-
+
/**
* Generates the PDF objects for the given {@link Image} instance. If the handler generates
* an XObject, it shall return it or otherwise return null. A generated XObject shall be
@@ -66,7 +66,7 @@ public interface PDFImageHandler {
* @return the generated XObject or null if no XObject was generated
* @throws IOException if an I/O error occurs
*/
- PDFXObject generateImage(RendererContext context, Image image,
+ PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos) throws IOException;
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
index f1825297e..a58fe5922 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerGraphics2D.java
@@ -38,9 +38,9 @@ public class PDFImageHandlerGraphics2D implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.GRAPHICS2D,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
index 65142878a..9f56ebfea 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawCCITTFax.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_CCITTFAX,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawCCITTFaxAdapter(ccitt, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@ public class PDFImageHandlerRawCCITTFax implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
index 58c9f1f53..f971a49ae 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRawJPEG.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.RAW_JPEG,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -52,7 +52,7 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRawJPEGAdapter(jpeg, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -61,7 +61,7 @@ public class PDFImageHandlerRawJPEG implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
index 536fc19b0..b664a0a24 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRegistry.java
@@ -5,9 +5,9 @@
* 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.
@@ -41,7 +41,7 @@ public class PDFImageHandlerRegistry {
/** the logger */
private static Log log = LogFactory.getLog(PDFImageHandlerRegistry.class);
-
+
private static final Comparator HANDLER_COMPARATOR = new Comparator() {
public int compare(Object o1, Object o2) {
PDFImageHandler h1 = (PDFImageHandler)o1;
@@ -54,19 +54,19 @@ public class PDFImageHandlerRegistry {
private Map handlers = new java.util.HashMap();
/** List containing the same handlers as above but ordered by priority */
private List handlerList = new java.util.LinkedList();
-
+
/** Sorted Set of registered handlers */
private ImageFlavor[] supportedFlavors = new ImageFlavor[0];
private int handlerRegistrations;
private int lastSync;
-
+
/**
* Default constructor.
*/
public PDFImageHandlerRegistry() {
discoverHandlers();
}
-
+
/**
* Add an PDFImageHandler. The handler itself is inspected to find out what it supports.
* @param classname the fully qualified class name
@@ -87,11 +87,11 @@ public class PDFImageHandlerRegistry {
+ classname);
} catch (ClassCastException e) {
throw new IllegalArgumentException(classname
- + " is not an "
+ + " is not an "
+ PDFImageHandler.class.getName());
}
}
-
+
/**
* Add an image handler. The handler itself is inspected to find out what it supports.
* @param handler the PDFImageHandler instance
@@ -99,7 +99,7 @@ public class PDFImageHandlerRegistry {
public synchronized void addHandler(PDFImageHandler handler) {
Class imageClass = handler.getSupportedImageClass();
this.handlers.put(imageClass, handler);
-
+
//Sorted insert
ListIterator iter = this.handlerList.listIterator();
while (iter.hasNext()) {
@@ -112,7 +112,7 @@ public class PDFImageHandlerRegistry {
iter.add(handler);
this.handlerRegistrations++;
}
-
+
/**
* Returns an PDFImageHandler which handles an specific image type given the MIME type
* of the image.
@@ -143,7 +143,7 @@ public class PDFImageHandlerRegistry {
}
/**
- * Returns the ordered array of supported image flavors.
+ * Returns the ordered array of supported image flavors.
* @return the array of image flavors
*/
public synchronized ImageFlavor[] getSupportedFlavors() {
@@ -162,7 +162,7 @@ public class PDFImageHandlerRegistry {
}
return this.supportedFlavors;
}
-
+
/**
* Discovers PDFImageHandler implementations through the classpath and dynamically
* registers them.
@@ -175,7 +175,7 @@ public class PDFImageHandlerRegistry {
PDFImageHandler handler = (PDFImageHandler)providers.next();
try {
if (log.isDebugEnabled()) {
- log.debug("Dynamically adding PDFImageHandler: "
+ log.debug("Dynamically adding PDFImageHandler: "
+ handler.getClass().getName());
}
addHandler(handler);
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
index 628883b9f..783cb225c 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerRenderedImage.java
@@ -40,11 +40,11 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.BUFFERED_IMAGE,
- ImageFlavor.RENDERED_IMAGE
+ ImageFlavor.RENDERED_IMAGE
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
@@ -53,7 +53,7 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
PDFRendererContextConstants.PDF_DOCUMENT);
PDFResourceContext resContext = (PDFResourceContext)context.getProperty(
PDFRendererContextConstants.PDF_CONTEXT);
-
+
PDFImage pdfimage = new ImageRenderedAdapter(imageRend, image.getInfo().getOriginalURI());
PDFXObject xobj = pdfDoc.addImage(resContext, pdfimage);
@@ -62,7 +62,7 @@ public class PDFImageHandlerRenderedImage implements PDFImageHandler {
float w = (float)pos.getWidth() / 1000f;
float h = (float)pos.getHeight() / 1000f;
renderer.placeImage(x, y, w, h, xobj);
-
+
return xobj;
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java b/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
index ba47cce69..d111e733f 100644
--- a/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
+++ b/src/java/org/apache/fop/render/pdf/PDFImageHandlerXML.java
@@ -41,9 +41,9 @@ public class PDFImageHandlerXML implements PDFImageHandler {
private static final ImageFlavor[] FLAVORS = new ImageFlavor[] {
ImageFlavor.XML_DOM,
};
-
+
/** {@inheritDoc} */
- public PDFXObject generateImage(RendererContext context, Image image,
+ public PDFXObject generateImage(RendererContext context, Image image,
Point origin, Rectangle pos)
throws IOException {
PDFRenderer renderer = (PDFRenderer)context.getRenderer();
diff --git a/src/java/org/apache/fop/render/pdf/PDFRenderer.java b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
index 154365209..e3aef5e7f 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRenderer.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRenderer.java
@@ -121,7 +121,7 @@ import org.apache.fop.util.ColorProfileUtil;
* Renderer that renders areas to PDF.
*/
public class PDFRenderer extends AbstractPathOrientedRenderer {
-
+
/**
* The mime type for pdf
*/
@@ -129,7 +129,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Normal PDF resolution (72dpi) */
public static final int NORMAL_PDF_RESOLUTION = 72;
-
+
/** PDF encryption parameter: all parameters as object, datatype: PDFEncryptionParams */
public static final String ENCRYPTION_PARAMS = "encryption-params";
/** PDF encryption parameter: user password, datatype: String */
@@ -158,7 +158,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Controls whether comments are written to the PDF stream. */
protected static final boolean WRITE_COMMENTS = true;
-
+
/**
* the PDF Document being created
*/
@@ -166,10 +166,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** the PDF/A mode (Default: disabled) */
protected PDFAMode pdfAMode = PDFAMode.DISABLED;
-
+
/** the PDF/X mode (Default: disabled) */
protected PDFXMode pdfXMode = PDFXMode.DISABLED;
-
+
/**
* Map of pages using the PageViewport as the key
* this is used for prepared pages that cannot be immediately
@@ -245,10 +245,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected PDFICCBasedColorSpace sRGBColorSpace;
/** controls whether the sRGB color space should be installed */
protected boolean disableSRGBColorSpace = false;
-
+
/** Optional URI to an output profile to be used. */
- protected String outputProfileURI;
-
+ protected String outputProfileURI;
+
/** drawing state */
protected PDFState currentState = null;
@@ -262,7 +262,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/** Image handler registry */
private PDFImageHandlerRegistry imageHandlerRegistry = new PDFImageHandlerRegistry();
-
+
/**
* create the PDF renderer
*/
@@ -278,13 +278,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
}
}
-
+
/**
* {@inheritDoc}
*/
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
- PDFEncryptionParams params
+ PDFEncryptionParams params
= (PDFEncryptionParams)agent.getRendererOptions().get(ENCRYPTION_PARAMS);
if (params != null) {
this.encryptionParams = params; //overwrite if available
@@ -380,7 +380,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
if (pdfXMode != PDFXMode.DISABLED) {
log.debug(pdfXMode + " is active.");
- log.warn("Note: " + pdfXMode
+ log.warn("Note: " + pdfXMode
+ " support is work-in-progress and not fully implemented, yet!");
addPDFXOutputIntent();
}
@@ -388,7 +388,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
log.debug("PDF/A is active. Conformance Level: " + pdfAMode);
addPDFA1OutputIntent();
}
-
+
}
private void addsRGBColorSpace() throws IOException {
@@ -408,7 +408,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
this.sRGBColorSpace = PDFICCBasedColorSpace.setupsRGBAsDefaultRGBColorSpace(pdfDoc);
}
}
-
+
private void addDefaultOutputProfile() throws IOException {
if (this.outputProfile != null) {
return;
@@ -437,7 +437,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
outputProfile = sRGBColorSpace.getICCStream();
}
}
-
+
/**
* Adds an OutputIntent to the PDF as mandated by PDF/A-1 when uncalibrated color spaces
* are used (which is true if we use DeviceRGB to represent sRGB colors).
@@ -445,7 +445,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
private void addPDFA1OutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
PDFOutputIntent outputIntent = pdfDoc.getFactory().makeOutputIntent();
outputIntent.setSubtype(PDFOutputIntent.GTS_PDFA1);
@@ -462,7 +462,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
*/
private void addPDFXOutputIntent() throws IOException {
addDefaultOutputProfile();
-
+
String desc = ColorProfileUtil.getICCProfileDescription(this.outputProfile.getICCProfile());
int deviceClass = this.outputProfile.getICCProfile().getProfileClass();
if (deviceClass != ICC_Profile.CLASS_OUTPUT) {
@@ -626,7 +626,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
return new PDFGraphics2DAdapter(this);
}
- /**
+ /**
* writes out a comment.
* @param text text for the comment
*/
@@ -737,7 +737,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
page.getPageIndex());
pageReferences.put(page.getKey(), currentPage.referencePDF());
pvReferences.put(page.getKey(), page);
-
+
//Produce page labels
PDFPageLabels pageLabels = this.pdfDoc.getRoot().getPageLabels();
if (pageLabels == null) {
@@ -745,14 +745,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
pageLabels = this.pdfDoc.getFactory().makePageLabels();
this.pdfDoc.getRoot().setPageLabels(pageLabels);
}
- PDFNumsArray nums = pageLabels.getNums();
+ PDFNumsArray nums = pageLabels.getNums();
PDFDictionary dict = new PDFDictionary(nums);
dict.put("P", page.getPageNumberString());
//TODO If the sequence of generated page numbers were inspected, this could be
//expressed in a more space-efficient way
nums.put(page.getPageIndex(), dict);
}
-
+
/**
* This method creates a pdf stream for the current page
* uses it as the contents of a new page. The page is written
@@ -788,7 +788,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
pageHeight / 1000f);
currentState.concatenate(basicPageTransform);
currentStream.add(CTMHelper.toPDFString(basicPageTransform, false) + " cm\n");
-
+
super.renderPage(page);
this.pdfDoc.registerObject(currentStream);
@@ -810,9 +810,9 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
new AffineTransform(CTMHelper.toPDFArray(ctm)));
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
// multiply with current CTM
@@ -831,7 +831,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(CTMHelper.toPDFString(at, false) + " cm\n");
}
}
-
+
/**
* Formats a float value (normally coordinates) as Strings.
* @param value the value
@@ -840,9 +840,9 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected static String format(float value) {
return PDFNumber.doubleOut(value);
}
-
+
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
float w = x2 - x1;
float h = y2 - y1;
@@ -852,7 +852,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
setColor(col, false, null);
if (horz) {
float unit = Math.abs(2 * h);
@@ -864,7 +864,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -876,7 +876,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[" + format(unit) + "] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -893,7 +893,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[0 " + format(unit) + "] 0 d ");
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
float unit = Math.abs(2 * w);
@@ -905,7 +905,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add("[0 " + format(unit) + " ] 0 d ");
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
break;
@@ -917,18 +917,18 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
float ym2 = ym1 + h3 + h3;
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
- currentStream.add(format(x1) + " " + format(ym2) + " m "
+ currentStream.add(format(x1) + " " + format(ym2) + " m "
+ format(x2) + " " + format(ym2) + " l S\n");
} else {
float w3 = w / 3;
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
float xm2 = xm1 + w3 + w3;
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
- currentStream.add(format(xm2) + " " + format(y1) + " m "
+ currentStream.add(format(xm2) + " " + format(y1) + " m "
+ format(xm2) + " " + format(y2) + " l S\n");
}
break;
@@ -944,13 +944,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h3) + " w\n");
float ym1 = y1 + (h3 / 2);
setColor(uppercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3) + " l S\n");
setColor(lowercol, false, null);
- currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ currentStream.add(format(x1) + " " + format(ym1 + h3 + h3) + " m "
+ format(x2) + " " + format(ym1 + h3 + h3) + " l S\n");
} else {
Color leftcol = lightenColor(col, -colFactor);
@@ -959,13 +959,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(w3) + " w\n");
float xm1 = x1 + (w3 / 2);
setColor(leftcol, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
setColor(col, false, null);
- currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3) + " " + format(y2) + " l S\n");
setColor(rightcol, false, null);
- currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ currentStream.add(format(xm1 + w3 + w3) + " " + format(y1) + " m "
+ format(xm1 + w3 + w3) + " " + format(y2) + " l S\n");
}
break;
@@ -981,14 +981,14 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(h) + " w\n");
float ym1 = y1 + (h / 2);
setColor(c, false, null);
- currentStream.add(format(x1) + " " + format(ym1) + " m "
+ currentStream.add(format(x1) + " " + format(ym1) + " m "
+ format(x2) + " " + format(ym1) + " l S\n");
} else {
c = lightenColor(c, (startOrBefore ? 1 : -1) * colFactor);
currentStream.add(format(w) + " w\n");
float xm1 = x1 + (w / 2);
setColor(c, false, null);
- currentStream.add(format(xm1) + " " + format(y1) + " m "
+ currentStream.add(format(xm1) + " " + format(y1) + " m "
+ format(xm1) + " " + format(y2) + " l S\n");
}
break;
@@ -1001,17 +1001,17 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
if (horz) {
currentStream.add(format(h) + " w\n");
float ym = y1 + (h / 2);
- currentStream.add(format(x1) + " " + format(ym) + " m "
+ currentStream.add(format(x1) + " " + format(ym) + " m "
+ format(x2) + " " + format(ym) + " l S\n");
} else {
currentStream.add(format(w) + " w\n");
float xm = x1 + (w / 2);
- currentStream.add(format(xm) + " " + format(y1) + " m "
+ currentStream.add(format(xm) + " " + format(y1) + " m "
+ format(xm) + " " + format(y2) + " l S\n");
}
}
}
-
+
/**
* Sets the current line width in points.
* @param width line width in points
@@ -1022,10 +1022,10 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(width) + " w\n");
}
}
-
+
/** {@inheritDoc} */
protected void clipRect(float x, float y, float width, float height) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(width) + " " + format(height) + " re ");
clip();
}
@@ -1039,42 +1039,42 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Moves the current point to (x, y), omitting any connecting line segment.
+ * Moves the current point to (x, y), omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected void moveTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " m ");
}
-
+
/**
- * Appends a straight line segment from the current point to (x, y). The
- * new current point is (x, y).
+ * Appends a straight line segment from the current point to (x, y). The
+ * new current point is (x, y).
* @param x x coordinate
* @param y y coordinate
*/
protected void lineTo(float x, float y) {
currentStream.add(format(x) + " " + format(y) + " l ");
}
-
+
/**
- * Closes the current subpath by appending a straight line segment from
+ * Closes the current subpath by appending a straight line segment from
* the current point to the starting point of the subpath.
*/
protected void closePath() {
currentStream.add("h ");
}
- /**
- * {@inheritDoc}
+ /**
+ * {@inheritDoc}
*/
protected void fillRect(float x, float y, float w, float h) {
if (w != 0 && h != 0) {
- currentStream.add(format(x) + " " + format(y) + " "
+ currentStream.add(format(x) + " " + format(y) + " "
+ format(w) + " " + format(h) + " re f\n");
}
}
-
+
/**
* Draw a line.
*
@@ -1130,7 +1130,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Returns area's id if it is the first area in the document with that id
+ * Returns area's id if it is the first area in the document with that id
* (i.e. if the area qualifies as a link target).
* Otherwise, or if the area has no id, null is returned.
*
@@ -1215,7 +1215,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param pdfPageRef the PDF page reference string
* @param relativeIPP the *relative* IP position in millipoints
* @param relativeBPP the *relative* BP position in millipoints
- * @param tf the transformation to apply once the relative positions have been
+ * @param tf the transformation to apply once the relative positions have been
* converted to points
*/
protected void saveAbsolutePosition(String id, String pdfPageRef,
@@ -1257,13 +1257,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param relativeBPP the *relative* BP position in millipoints
*/
protected void saveAbsolutePosition(String id, int relativeIPP, int relativeBPP) {
- saveAbsolutePosition(id, currentPageRef,
+ saveAbsolutePosition(id, currentPageRef,
relativeIPP, relativeBPP, currentState.getTransform());
}
/**
- * If the given block area is a possible link target, its id + absolute position will
- * be saved. The saved position is only correct if this function is called at the very
+ * If the given block area is a possible link target, its id + absolute position will
+ * be saved. The saved position is only correct if this function is called at the very
* start of renderBlock!
*
* @param block the block area in question
@@ -1391,7 +1391,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
// warn if link trait found but not allowed, else create link
if (linkTraitFound) {
if (!annotsAllowed) {
- log.warn("Skipping annotation for a link due to PDF profile: "
+ log.warn("Skipping annotation for a link due to PDF profile: "
+ pdfDoc.getProfile());
} else if (action != null) {
PDFLink pdfLink = factory.makeLink(ipRect, action);
@@ -1407,23 +1407,23 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
return tf;
}
-
+
/** {@inheritDoc} */
public void renderText(TextArea text) {
renderInlineAreaBackAndBorders(text);
Color ct = (Color) text.getTrait(Trait.COLOR);
updateColor(ct, true);
-
+
beginTextObject();
String fontName = getInternalFontNameForArea(text);
int size = ((Integer) text.getTrait(Trait.FONT_SIZE)).intValue();
-
+
// This assumes that *all* CIDFonts use a /ToUnicode mapping
Typeface tf = getTypeface(fontName);
-
+
textutil.updateTf(fontName, size / 1000f, tf.isMultiByte());
-
+
// word.getOffset() = only height of text itself
// currentBlockIPPosition: 0 for beginning of line; nonzero
@@ -1436,7 +1436,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
super.renderText(text);
textutil.writeTJ();
-
+
renderTextDecoration(tf, size, text, bl, rx);
}
@@ -1445,7 +1445,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
Font font = getFontFromArea(word.getParentArea());
String s = word.getWord();
- escapeText(s, word.getLetterAdjustArray(),
+ escapeText(s, word.getLetterAdjustArray(),
font, (AbstractTextArea)word.getParentArea());
super.renderWord(word);
@@ -1455,7 +1455,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
public void renderSpace(SpaceArea space) {
Font font = getFontFromArea(space.getParentArea());
String s = space.getSpace();
-
+
AbstractTextArea textArea = (AbstractTextArea)space.getParentArea();
escapeText(s, null, font, textArea);
@@ -1484,7 +1484,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
Font font, AbstractTextArea parentArea) {
escapeText(s, 0, s.length(), letterAdjust, font, parentArea);
}
-
+
/**
* Escapes text according to PDF rules.
* @param s Text to escape
@@ -1506,7 +1506,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
}
int l = s.length();
-
+
for (int i = start; i < end; i++) {
char orgChar = s.charAt(i);
char ch;
@@ -1552,7 +1552,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/**
* Establishes a new foreground or fill color. In contrast to updateColor
* this method does not check the PDFState for optimization possibilities.
- * @param col the color to apply
+ * @param col the color to apply
* @param fill true to set the fill color, false for the foreground color
* @param pdf StringBuffer to write the PDF code to, if null, the code is
* written to the current stream.
@@ -1566,7 +1566,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(color.getColorSpaceOut(fill));
}
}
-
+
/**
* Establishes a new foreground or fill color.
* @param col the color to apply (null skips this operation)
@@ -1594,7 +1594,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected void updateColor(Color col, boolean fill) {
updateColor(col, fill, null);
}
-
+
/** {@inheritDoc} */
public void renderImage(Image image, Rectangle2D pos) {
endTextObject();
@@ -1607,7 +1607,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
endTextObject();
putImage(url, pos, foreignAttributes);
}
-
+
/**
* Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
* @param uri URL of the bitmap
@@ -1617,7 +1617,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
protected void putImage(String uri, Rectangle2D pos) {
putImage(uri, pos, null);
}
-
+
/**
* Adds a PDF XObject (a bitmap or form) to the PDF that will later be referenced.
* @param uri URL of the bitmap
@@ -1649,11 +1649,11 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
try {
ImageSessionContext sessionContext = getUserAgent().getImageSessionContext();
info = manager.getImageInfo(uri, sessionContext);
-
+
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, imageHandlerRegistry.getSupportedFlavors(), hints, sessionContext);
-
+
//First check for a dynamically registered handler
PDFImageHandler handler = imageHandlerRegistry.getHandler(img.getClass());
if (handler != null) {
@@ -1710,13 +1710,13 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
currentStream.add(format(w) + " 0 0 "
+ format(-h) + " "
+ format(currentIPPosition / 1000f + x) + " "
- + format(currentBPPosition / 1000f + h + y)
+ + format(currentBPPosition / 1000f + h + y)
+ " cm\n" + xobj.getName() + " Do\n");
restoreGraphicsState();
}
/** {@inheritDoc} */
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
@@ -1747,7 +1747,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
int style = area.getRuleStyle();
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = (currentBPPosition + area.getOffset()) / 1000f;
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
float ruleThickness = area.getRuleThickness() / 1000f;
Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1756,7 +1756,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -1764,7 +1764,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
//This displaces the dots to the right by half a dot's width
//TODO There's room for improvement here
currentStream.add("1 0 0 1 " + format(ruleThickness / 2) + " 0 cm\n");
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_GROOVE:
@@ -1809,7 +1809,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
public String getMimeType() {
return MIME_TYPE;
}
-
+
/**
* Sets the PDF/A mode for the PDF renderer.
* @param mode the PDF/A mode
@@ -1823,7 +1823,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
* @param mode the PDF/X mode
*/
public void setXMode(PDFXMode mode) {
- this.pdfXMode = mode;
+ this.pdfXMode = mode;
}
/**
@@ -1844,7 +1844,7 @@ public class PDFRenderer extends AbstractPathOrientedRenderer {
/**
* Sets the encryption parameters used by the PDF renderer.
- * @param encryptionParams the encryption parameters
+ * @param encryptionParams the encryption parameters
*/
public void setEncryptionParams(PDFEncryptionParams encryptionParams) {
this.encryptionParams = encryptionParams;
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java b/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
index 51e13dde1..4ac16d725 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ import org.apache.fop.render.Renderer;
import org.apache.fop.util.LogUtil;
/**
- * PDF renderer configurator
+ * PDF renderer configurator
*/
public class PDFRendererConfigurator extends PrintRendererConfigurator {
@@ -68,9 +68,9 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
} catch (ConfigurationException e) {
LogUtil.handleException(log, e, false);
}
-
+
super.configure(renderer);
-
+
String s = cfg.getChild(PDFRenderer.PDF_A_MODE, true).getValue(null);
if (s != null) {
pdfRenderer.setAMode(PDFAMode.valueOf(s));
@@ -137,7 +137,7 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
* @return Map the newly built filter map
* @throws ConfigurationException if a filter list is defined twice
*/
- public static Map buildFilterMapFromConfiguration(Configuration cfg)
+ public static Map buildFilterMapFromConfiguration(Configuration cfg)
throws ConfigurationException {
Map filterMap = new java.util.HashMap();
Configuration[] filterLists = cfg.getChildren("filterList");
@@ -150,11 +150,11 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
String name = filt[j].getValue();
filterList.add(name);
}
-
+
if (type == null) {
type = PDFFilterList.DEFAULT_FILTER;
}
-
+
if (!filterList.isEmpty() && log.isDebugEnabled()) {
StringBuffer debug = new StringBuffer("Adding PDF filter");
if (filterList.size() != 1) {
@@ -169,13 +169,13 @@ public class PDFRendererConfigurator extends PrintRendererConfigurator {
}
log.debug(debug.toString());
}
-
+
if (filterMap.get(type) != null) {
- throw new ConfigurationException("A filterList of type '"
+ throw new ConfigurationException("A filterList of type '"
+ type + "' has already been defined");
}
filterMap.put(type, filterList);
}
- return filterMap;
+ return filterMap;
}
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java b/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
index d3efa9667..de51aabc7 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererContextConstants.java
@@ -49,5 +49,5 @@ public interface PDFRendererContextConstants extends RendererContextConstants {
/** The current pdf font size. */
String PDF_FONT_SIZE = "fontSize";
-
+
}
diff --git a/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java b/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
index 98fd7b5db..fb65c9d74 100644
--- a/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
+++ b/src/java/org/apache/fop/render/pdf/PDFRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PDFRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PDF};
-
+
/** {@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PDFRenderer();
@@ -41,7 +41,7 @@ public class PDFRendererMaker extends AbstractRendererMaker {
public RendererConfigurator getConfigurator(FOUserAgent userAgent) {
return new PDFRendererConfigurator(userAgent);
}
-
+
/** {@inheritDoc} */
public boolean needsOutputStream() {
return true;
diff --git a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
index cb7c7cf89..864a82517 100644
--- a/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
+++ b/src/java/org/apache/fop/render/pdf/PDFSVGHandler.java
@@ -5,9 +5,9 @@
* 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.
@@ -62,7 +62,7 @@ import org.apache.fop.svg.SVGUserAgent;
* It renders SVG to the PDF document using the PDFGraphics2D.
* The properties from the PDF renderer are subject to change.
*/
-public class PDFSVGHandler extends AbstractGenericSVGHandler
+public class PDFSVGHandler extends AbstractGenericSVGHandler
implements PDFRendererContextConstants {
/** logging instance */
@@ -92,7 +92,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
pdfi.cfg = (Configuration)context.getProperty(HANDLER_CONFIGURATION);
Map foreign = (Map)context.getProperty(RendererContextConstants.FOREIGN_ATTRIBUTES);
QName qName = new QName(ExtensionElementMapping.URI, null, "conversion-mode");
- if (foreign != null
+ if (foreign != null
&& "bitmap".equalsIgnoreCase((String)foreign.get(qName))) {
pdfi.paintAsBitmap = true;
}
@@ -155,12 +155,12 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
int xOffset = pdfInfo.currentXPosition;
int yOffset = pdfInfo.currentYPosition;
- FOUserAgent userAgent = context.getUserAgent();
+ FOUserAgent userAgent = context.getUserAgent();
final float deviceResolution = userAgent.getTargetResolution();
if (log.isDebugEnabled()) {
log.debug("Generating SVG at " + deviceResolution + "dpi.");
}
-
+
final float uaResolution = userAgent.getSourceResolution();
SVGUserAgent ua = new SVGUserAgent(userAgent, new AffineTransform());
@@ -168,22 +168,22 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
double s = uaResolution / deviceResolution;
AffineTransform resolutionScaling = new AffineTransform();
resolutionScaling.scale(s, s);
-
+
GVTBuilder builder = new GVTBuilder();
-
+
//Controls whether text painted by Batik is generated using text or path operations
boolean strokeText = false;
Configuration cfg = pdfInfo.cfg;
if (cfg != null) {
strokeText = cfg.getChild("stroke-text", true).getValueAsBoolean(strokeText);
}
-
- BridgeContext ctx = new PDFBridgeContext(ua,
+
+ BridgeContext ctx = new PDFBridgeContext(ua,
(strokeText ? null : pdfInfo.fi),
userAgent.getFactory().getImageManager(),
userAgent.getImageSessionContext(),
new AffineTransform());
-
+
GraphicsNode root;
try {
root = builder.build(ctx, doc);
@@ -210,7 +210,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
AffineTransform imageTransform = new AffineTransform();
imageTransform.concatenate(scaling);
imageTransform.concatenate(resolutionScaling);
-
+
/*
* Clip to the svg area.
* Note: To have the svg overlay (under) a text area then use
@@ -231,27 +231,27 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
if (pdfInfo.pdfContext == null) {
pdfInfo.pdfContext = pdfInfo.pdfPage;
}
- PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
+ PDFGraphics2D graphics = new PDFGraphics2D(true, pdfInfo.fi,
pdfInfo.pdfDoc,
pdfInfo.pdfContext, pdfInfo.pdfPage.referencePDF(),
pdfInfo.currentFontName, pdfInfo.currentFontSize);
graphics.setGraphicContext(new org.apache.xmlgraphics.java2d.GraphicContext());
if (!resolutionScaling.isIdentity()) {
- pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ pdfInfo.currentStream.add("%resolution scaling for " + uaResolution
+ " -> " + deviceResolution + "\n");
pdfInfo.currentStream.add(
CTMHelper.toPDFString(resolutionScaling, false) + " cm\n");
graphics.scale(1 / s, 1 / s);
}
-
+
pdfInfo.currentStream.add("%SVG start\n");
//Save state and update coordinate system for the SVG image
pdfInfo.pdfState.push();
pdfInfo.pdfState.concatenate(imageTransform);
- //Now that we have the complete transformation matrix for the image, we can update the
+ //Now that we have the complete transformation matrix for the image, we can update the
//transformation matrix for the AElementBridge.
PDFAElementBridge aBridge = (PDFAElementBridge)ctx.getBridge(
SVGDOMImplementation.SVG_NAMESPACE_URI, SVGConstants.SVG_A_TAG);
@@ -271,7 +271,7 @@ public class PDFSVGHandler extends AbstractGenericSVGHandler
renderer.restoreGraphicsState();
pdfInfo.currentStream.add("%SVG end\n");
}
-
+
/** {@inheritDoc} */
public boolean supportsRenderer(Renderer renderer) {
return (renderer instanceof PDFRenderer);
diff --git a/src/java/org/apache/fop/render/print/PageableRenderer.java b/src/java/org/apache/fop/render/print/PageableRenderer.java
index 947708cef..01a60646b 100644
--- a/src/java/org/apache/fop/render/print/PageableRenderer.java
+++ b/src/java/org/apache/fop/render/print/PageableRenderer.java
@@ -57,8 +57,8 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
* datatype: a positive Integer
*/
public static final String END_PAGE = "end-page";
-
-
+
+
/** first valid page number (1-based) */
protected int startNumber = 0;
/** last valid page number (1-based) */
@@ -68,17 +68,17 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
protected PagesMode mode = PagesMode.ALL;
private PageFilter pageFilter;
-
+
/**
* Creates a new PageableRenderer.
*/
public PageableRenderer() {
}
-
+
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
-
+
Map rendererOptions = agent.getRendererOptions();
processOptions(rendererOptions);
this.pageFilter = new DefaultPageFilter();
@@ -97,7 +97,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
+ " must be an 'all', 'even', 'odd' or a PagesMode instance.");
}
}
-
+
o = rendererOptions.get(PageableRenderer.START_PAGE);
if (o != null) {
this.startNumber = getPositiveInteger(o);
@@ -132,7 +132,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
"Value must be a positive integer");
}
}
-
+
/** {@inheritDoc} */
public void stopRenderer() throws IOException {
super.stopRenderer();
@@ -149,13 +149,13 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
super.rememberPage(pageViewport);
}
}
-
+
private interface PageFilter {
boolean isValid(PageViewport page);
}
private class DefaultPageFilter implements PageFilter {
-
+
public boolean isValid(PageViewport page) {
int pageNum = page.getPageIndex() + 1;
assert pageNum >= 0;
@@ -171,7 +171,7 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
return true;
}
}
-
+
/** {@inheritDoc} */
public PageFormat getPageFormat(int pageIndex)
throws IndexOutOfBoundsException {
@@ -179,15 +179,15 @@ public class PageableRenderer extends Java2DRenderer implements Pageable {
if (pageIndex >= getNumberOfPages()) {
return null;
}
-
+
PageFormat pageFormat = new PageFormat();
-
+
Paper paper = new Paper();
-
+
Rectangle2D dim = getPageViewport(pageIndex).getViewArea();
double width = dim.getWidth();
double height = dim.getHeight();
-
+
// if the width is greater than the height assume landscape mode
// and swap the width and height values in the paper format
if (width > height) {
diff --git a/src/java/org/apache/fop/render/print/PagesMode.java b/src/java/org/apache/fop/render/print/PagesMode.java
index 6879aa68d..cf8bade1d 100644
--- a/src/java/org/apache/fop/render/print/PagesMode.java
+++ b/src/java/org/apache/fop/render/print/PagesMode.java
@@ -28,7 +28,7 @@ public final class PagesMode {
public static final PagesMode EVEN = new PagesMode("even");
/** the odd pages mode */
public static final PagesMode ODD = new PagesMode("odd");
-
+
private String name;
/**
@@ -43,7 +43,7 @@ public final class PagesMode {
public String getName() {
return this.name;
}
-
+
/**
* Returns a PagesMode instance by name.
* @param name the name of the pages mode
@@ -60,10 +60,10 @@ public final class PagesMode {
throw new IllegalArgumentException("Invalid value for PagesMode: " + name);
}
}
-
+
/** {@inheritDoc} */
public String toString() {
return "PagesMode:" + name;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/print/PrintRenderer.java b/src/java/org/apache/fop/render/print/PrintRenderer.java
index 888776ecb..2eb2b07a2 100644
--- a/src/java/org/apache/fop/render/print/PrintRenderer.java
+++ b/src/java/org/apache/fop/render/print/PrintRenderer.java
@@ -39,14 +39,14 @@ public class PrintRenderer extends PageableRenderer {
* datatype: java.awt.print.PrinterJob
*/
public static final String PRINTER_JOB = "printerjob";
-
+
/**
* Printing parameter: the number of copies of the document to be printed,
* datatype: a positive Integer
*/
public static final String COPIES = "copies";
-
-
+
+
private int copies = 1;
private PrinterJob printerJob;
@@ -57,7 +57,7 @@ public class PrintRenderer extends PageableRenderer {
*/
public PrintRenderer() {
}
-
+
/**
* Creates a new PrintRenderer and allows you to pass in a specific PrinterJob instance
* that this renderer should work with.
@@ -69,7 +69,7 @@ public class PrintRenderer extends PageableRenderer {
this.printerJob = printerJob;
printerJob.setPageable(this);
}
-
+
private void initializePrinterJob() {
if (this.printerJob == null) {
printerJob = PrinterJob.getPrinterJob();
@@ -88,9 +88,9 @@ public class PrintRenderer extends PageableRenderer {
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
-
+
Map rendererOptions = agent.getRendererOptions();
-
+
Object printerJobO = rendererOptions.get(PrintRenderer.PRINTER_JOB);
if (printerJobO != null) {
if (!(printerJobO instanceof PrinterJob)) {
@@ -118,7 +118,7 @@ public class PrintRenderer extends PageableRenderer {
public int getEndNumber() {
return endNumber;
}
-
+
/**
* Sets the number of the last page to be printed.
* @param end The ending page number
@@ -126,12 +126,12 @@ public class PrintRenderer extends PageableRenderer {
public void setEndPage(int end) {
this.endNumber = end;
}
-
+
/** @return the starting page number */
public int getStartPage() {
return startNumber;
}
-
+
/**
* Sets the number of the first page to be printed.
* @param start The starting page number
@@ -139,7 +139,7 @@ public class PrintRenderer extends PageableRenderer {
public void setStartPage(int start) {
this.startNumber = start;
}
-
+
/** {@inheritDoc} */
public void stopRenderer() throws IOException {
super.stopRenderer();
diff --git a/src/java/org/apache/fop/render/print/PrintRendererMaker.java b/src/java/org/apache/fop/render/print/PrintRendererMaker.java
index 2390567ef..21eb4717a 100644
--- a/src/java/org/apache/fop/render/print/PrintRendererMaker.java
+++ b/src/java/org/apache/fop/render/print/PrintRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.render.RendererConfigurator;
public class PrintRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_PRINT};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new PrintRenderer();
diff --git a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
index aa0fc88b9..b8ff8ef3f 100644
--- a/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/AbstractPSTranscoder.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/ps/EPSTranscoder.java b/src/java/org/apache/fop/render/ps/EPSTranscoder.java
index c34772196..38e700a57 100644
--- a/src/java/org/apache/fop/render/ps/EPSTranscoder.java
+++ b/src/java/org/apache/fop/render/ps/EPSTranscoder.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import org.apache.xmlgraphics.java2d.ps.AbstractPSDocumentGraphics2D;
diff --git a/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java b/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
index d5b2d2a23..e315b1433 100644
--- a/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
+++ b/src/java/org/apache/fop/render/ps/ImageEncoderCCITTFax.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.xmlgraphics.ps.PSDictionary;
* ImageEncoder implementation for CCITT encoded images.
*/
public class ImageEncoderCCITTFax implements ImageEncoder {
-
+
private final ImageRawCCITTFax ccitt;
/**
@@ -66,7 +66,7 @@ public class ImageEncoderCCITTFax implements ImageEncoder {
throw new IllegalStateException(
"Invalid compression scheme: " + compression);
}
-
+
return dict.toString() + " /CCITTFaxDecode";
}
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java b/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
index ef4b9f16c..9baed2a8e 100644
--- a/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
+++ b/src/java/org/apache/fop/render/ps/ImageEncoderJPEG.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/ps/PSEventProducer.java b/src/java/org/apache/fop/render/ps/PSEventProducer.java
index 451ed1cea..c7c621e78 100644
--- a/src/java/org/apache/fop/render/ps/PSEventProducer.java
+++ b/src/java/org/apache/fop/render/ps/PSEventProducer.java
@@ -31,7 +31,7 @@ public interface PSEventProducer extends EventProducer {
/** Provider class for the event producer. */
class Provider {
-
+
/**
* Returns an event producer.
* @param broadcaster the event broadcaster to use
@@ -50,9 +50,9 @@ public interface PSEventProducer extends EventProducer {
public EventModel createEventModel() {
return loadModel(getClass(), "event-model.xml");
}
-
+
}
-
+
/**
* A PostScript dictionary could not be parsed.
* @param source the event source
@@ -61,5 +61,5 @@ public interface PSEventProducer extends EventProducer {
* @event.severity ERROR
*/
void postscriptDictionaryParseError(Object source, String content, Exception e);
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSFontUtils.java b/src/java/org/apache/fop/render/ps/PSFontUtils.java
index 63b12c5c8..6bb1f294b 100644
--- a/src/java/org/apache/fop/render/ps/PSFontUtils.java
+++ b/src/java/org/apache/fop/render/ps/PSFontUtils.java
@@ -55,7 +55,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
/** logging instance */
protected static Log log = LogFactory.getLog(PSFontUtils.class);
-
+
/**
* Generates the PostScript code for the font dictionary.
* @param gen PostScript generator to use for output
@@ -63,11 +63,11 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @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)
+ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo)
throws IOException {
return writeFontDict(gen, fontInfo, fontInfo.getFonts());
}
-
+
/**
* Generates the PostScript code for the font dictionary.
* @param gen PostScript generator to use for output
@@ -76,7 +76,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @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)
+ public static Map writeFontDict(PSGenerator gen, FontInfo fontInfo, Map fonts)
throws IOException {
gen.commentln("%FOPBeginFontDict");
@@ -88,7 +88,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
PSResource fontRes = new PSResource(PSResource.TYPE_FONT, tf.getFontName());
fontResources.put(key, fontRes);
embedFont(gen, tf, fontRes);
-
+
if (tf instanceof SingleByteFont) {
SingleByteFont sbf = (SingleByteFont)tf;
for (int i = 0, c = sbf.getAdditionalEncodingCount(); i < c; i++) {
@@ -108,12 +108,12 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
private static void reencodeFonts(PSGenerator gen, Map fonts) throws IOException {
ResourceTracker tracker = gen.getResourceTracker();
-
+
if (!tracker.isResourceSupplied(WINANSI_ENCODING_RESOURCE)) {
defineWinAnsiEncoding(gen);
}
gen.commentln("%FOPBeginFontReencode");
-
+
//Rewrite font encodings
Iterator iter = fonts.keySet().iterator();
while (iter.hasNext()) {
@@ -133,7 +133,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
//ignore (no encoding redefinition)
} else {
if (tf instanceof Base14Font) {
- //Our Base 14 fonts don't use the default encoding
+ //Our Base 14 fonts don't use the default encoding
redefineFontEncoding(gen, tf.getFontName(), tf.getEncodingName());
}
}
@@ -149,7 +149,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
if (tf == null) {
//This is to avoid an NPE if a malconfigured font is in the configuration but not
//used in the document. If it were used, we wouldn't get this far.
- String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT);
+ String fallbackKey = fontInfo.getInternalFontKey(Font.DEFAULT_FONT);
tf = (Typeface)fonts.get(fallbackKey);
}
return tf;
@@ -162,7 +162,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @param fontRes the PSResource associated with the font
* @throws IOException In case of an I/O error
*/
- public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
+ public static void embedFont(PSGenerator gen, Typeface tf, PSResource fontRes)
throws IOException {
boolean embeddedFont = false;
if (FontType.TYPE1 == tf.getFontType()) {
@@ -171,7 +171,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
if (isEmbeddable(cf)) {
InputStream in = getInputStreamOnFont(gen, cf);
if (in != null) {
- gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
+ gen.writeDSCComment(DSCConstants.BEGIN_RESOURCE,
fontRes);
embedType1Font(gen, in);
gen.writeDSCComment(DSCConstants.END_RESOURCE);
@@ -193,8 +193,8 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
private static boolean isEmbeddable(CustomFont font) {
return font.isEmbeddable();
}
-
- private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font)
+
+ private static InputStream getInputStreamOnFont(PSGenerator gen, CustomFont font)
throws IOException {
if (isEmbeddable(font)) {
Source source = font.getEmbedFileSource();
@@ -239,7 +239,7 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
* @param fonts the set of fonts to work with
* @return a Map of PSResource instances representing all defined fonts (key: font key)
*/
- public static Map determineSuppliedFonts(ResourceTracker resTracker,
+ public static Map determineSuppliedFonts(ResourceTracker resTracker,
FontInfo fontInfo, Map fonts) {
Map fontResources = new java.util.HashMap();
Iterator iter = fonts.keySet().iterator();
@@ -337,5 +337,5 @@ public class PSFontUtils extends org.apache.xmlgraphics.ps.PSFontUtils {
gen.getResourceTracker().registerSuppliedResource(res);
return res;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
index 994481d59..5f204ad70 100644
--- a/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
+++ b/src/java/org/apache/fop/render/ps/PSGraphics2DAdapter.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
import java.awt.Dimension;
@@ -46,7 +46,7 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
public PSGraphics2DAdapter(PSRenderer renderer) {
this(renderer.gen, true);
}
-
+
/**
* Constructor for use without a PSRenderer instance.
* @param gen the PostScript generator
@@ -56,16 +56,16 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
this.gen = gen;
this.clip = clip;
}
-
+
/** {@inheritDoc} */
- public void paintImage(Graphics2DImagePainter painter,
+ public void paintImage(Graphics2DImagePainter painter,
RendererContext context,
int x, int y, int width, int height) throws IOException {
float fwidth = width / 1000f;
float fheight = height / 1000f;
float fx = x / 1000f;
float fy = y / 1000f;
-
+
// get the 'width' and 'height' attributes of the SVG document
Dimension dim = painter.getImageSize();
float imw = (float)dim.getWidth() / 1000f;
@@ -82,7 +82,7 @@ public class PSGraphics2DAdapter extends AbstractGraphics2DAdapter {
gen.defineRect(fx, fy, fwidth, fheight);
gen.writeln("clip");
}
-
+
// transform so that the coordinates (0,0) is from the top left
// and positive is down and to the right. (0,0) is where the
// viewBox puts it.
diff --git a/src/java/org/apache/fop/render/ps/PSImageFormResource.java b/src/java/org/apache/fop/render/ps/PSImageFormResource.java
index b00e2201d..11c3205e6 100644
--- a/src/java/org/apache/fop/render/ps/PSImageFormResource.java
+++ b/src/java/org/apache/fop/render/ps/PSImageFormResource.java
@@ -5,9 +5,9 @@
* 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.
@@ -28,7 +28,7 @@ import org.apache.xmlgraphics.ps.PSResource;
public class PSImageFormResource extends PSResource {
private String uri;
-
+
/**
* Create a new Form Resource.
* @param id An ID for the form
@@ -37,7 +37,7 @@ public class PSImageFormResource extends PSResource {
public PSImageFormResource(int id, String uri) {
this("FOPForm:" + Integer.toString(id), uri);
}
-
+
/**
/**
* Create a new Form Resource.
@@ -48,7 +48,7 @@ public class PSImageFormResource extends PSResource {
super(PSResource.TYPE_FORM, name);
this.uri = uri;
}
-
+
/**
* Returns the image URI.
* @return the image URI
@@ -56,5 +56,5 @@ public class PSImageFormResource extends PSResource {
public String getImageURI() {
return this.uri;
}
-
+
}
diff --git a/src/java/org/apache/fop/render/ps/PSImageUtils.java b/src/java/org/apache/fop/render/ps/PSImageUtils.java
index 27eb736d8..7a011fbec 100644
--- a/src/java/org/apache/fop/render/ps/PSImageUtils.java
+++ b/src/java/org/apache/fop/render/ps/PSImageUtils.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.ps;
/**
diff --git a/src/java/org/apache/fop/render/ps/PSRenderer.java b/src/java/org/apache/fop/render/ps/PSRenderer.java
index f84f46bf9..9f8cdc771 100644
--- a/src/java/org/apache/fop/render/ps/PSRenderer.java
+++ b/src/java/org/apache/fop/render/ps/PSRenderer.java
@@ -5,9 +5,9 @@
* 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.
@@ -121,7 +121,7 @@ import org.apache.fop.util.CharUtilities;
*
* This renderer inserts FOP-specific comments into the PostScript stream which
* may help certain users to do certain types of post-processing of the output.
- * These comments all start with "%FOP".
+ * These comments all start with "%FOP".
*
* @author Apache FOP Development Team
* @version $Id$
@@ -150,7 +150,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
private OutputStream outputStream;
/** the temporary file in case of two-pass processing */
private File tempFile;
-
+
/** The PostScript generator used to output the PostScript */
protected PSGenerator gen;
/** Determines whether the PS file is generated in two passes to minimize file size */
@@ -181,13 +181,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/** Is used to determine the document's bounding box */
private Rectangle2D documentBoundingBox;
-
+
/** This is a collection holding all document header comments */
private Collection headerComments;
/** This is a collection holding all document footer comments */
private Collection footerComments;
-
+
/** {@inheritDoc} */
public void setUserAgent(FOUserAgent agent) {
super.setUserAgent(agent);
@@ -215,7 +215,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Boolean or \"true\" or \"false\" expected.");
}
}
-
+
private int intValueOf(Object obj) {
if (obj instanceof Integer) {
return ((Integer)obj).intValue();
@@ -225,11 +225,11 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Integer or String with a number expected.");
}
}
-
+
/**
* Sets the landscape mode for this renderer.
* @param value false will normally generate a "pseudo-portrait" page, true will rotate
- * a "wider-than-long" page by 90 degrees.
+ * a "wider-than-long" page by 90 degrees.
*/
public void setAutoRotateLandscape(boolean value) {
this.autoRotateLandscape = value;
@@ -251,7 +251,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
throw new IllegalArgumentException("Only language levels 2 or 3 are allowed/supported");
}
}
-
+
/**
* Return the PostScript language level that the renderer produces.
* @return the language level
@@ -259,12 +259,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
public int getLanguageLevel() {
return this.languageLevel;
}
-
+
/**
* Sets the resource optimization mode. If set to true, the renderer does two passes to
* only embed the necessary resources in the PostScript file. This is slower, but produces
* smaller files.
- * @param value true to enable the resource optimization
+ * @param value true to enable the resource optimization
*/
public void setOptimizeResources(boolean value) {
this.twoPassGeneration = value;
@@ -335,7 +335,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected void clip() {
writeln("clip newpath");
}
-
+
/** {@inheritDoc} */
protected void clipRect(float x, float y, float width, float height) {
try {
@@ -350,27 +350,27 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected void moveTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " M");
}
-
+
/**
- * Moves the current point by (x, y) relative to the current position,
- * omitting any connecting line segment.
+ * Moves the current point by (x, y) relative to the current position,
+ * omitting any connecting line segment.
* @param x x coordinate
* @param y y coordinate
*/
protected void rmoveTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " RM");
}
-
+
/** {@inheritDoc} */
protected void lineTo(float x, float y) {
writeln(gen.formatDouble(x) + " " + gen.formatDouble(y) + " lineto");
}
-
+
/** {@inheritDoc} */
protected void closePath() {
writeln("cp");
}
-
+
/** {@inheritDoc} */
protected void fillRect(float x, float y, float width, float height) {
if (width != 0 && height != 0) {
@@ -400,7 +400,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
protected boolean isImageInlined(String uri) {
return !isOptimizeResources() || uri == null || "".equals(uri);
}
-
+
/**
* Indicates whether an image should be inlined or added as a PostScript form.
* @param info the ImageInfo object of the image
@@ -410,7 +410,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (isImageInlined(info.getOriginalURI())) {
return true;
}
-
+
if (!isOptimizeResources()) {
throw new IllegalStateException("Must not get here if form support is enabled");
}
@@ -423,7 +423,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info, inlineFlavors);
ImageProviderPipeline inlineChoice = manager.choosePipeline(inlineCandidates);
ImageFlavor inlineFlavor = (inlineChoice != null ? inlineChoice.getTargetFlavor() : null);
-
+
//Investigate choice for form mode
ImageFlavor[] formFlavors = getFormFlavors();
ImageProviderPipeline[] formCandidates
@@ -431,11 +431,11 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info, formFlavors);
ImageProviderPipeline formChoice = manager.choosePipeline(formCandidates);
ImageFlavor formFlavor = (formChoice != null ? formChoice.getTargetFlavor() : null);
-
+
//Inline if form is not supported or if a better choice is available with inline mode
return formFlavor == null || !formFlavor.equals(inlineFlavor);
}
-
+
/** {@inheritDoc} */
protected void drawImage(String uri, Rectangle2D pos, Map foreignAttributes) {
endTextObject();
@@ -445,7 +445,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (log.isDebugEnabled()) {
log.debug("Handling image: " + uri);
}
-
+
ImageManager manager = getUserAgent().getFactory().getImageManager();
ImageInfo info = null;
try {
@@ -453,7 +453,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
info = manager.getImageInfo(uri, sessionContext);
int width = (int)pos.getWidth();
int height = (int)pos.getHeight();
-
+
//millipoints --> points for PostScript
float ptx = x / 1000f;
float pty = y / 1000f;
@@ -468,7 +468,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
Map hints = ImageUtil.getDefaultHints(sessionContext);
org.apache.xmlgraphics.image.loader.Image img = manager.getImage(
info, getInlineFlavors(), hints, sessionContext);
-
+
//...and embed as inline image
if (img instanceof ImageGraphics2D) {
ImageGraphics2D imageG2D = (ImageGraphics2D)img;
@@ -488,7 +488,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
final ImageRawStream raw = (ImageRawStream)img;
if (raw instanceof ImageRawEPS) {
ImageRawEPS eps = (ImageRawEPS)raw;
- Rectangle2D bbox = eps.getBoundingBox();
+ Rectangle2D bbox = eps.getBoundingBox();
InputStream in = raw.createInputStream();
try {
PSImageUtils.renderEPS(in, uri,
@@ -525,9 +525,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
log.debug("Image " + info + " is embedded as a form later");
}
//Don't load image at this time, just put a form placeholder in the stream
- PSResource form = getFormForImage(uri);
+ PSResource form = getFormForImage(uri);
Rectangle2D targetRect = new Rectangle2D.Double(ptx, pty, ptw, pth);
- PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);
+ PSImageUtils.paintForm(form, info.getSize().getDimensionPt(), targetRect, gen);
}
} catch (ImageException ie) {
@@ -586,7 +586,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
/** {@inheritDoc} */
- public void paintImage(RenderedImage image, RendererContext context,
+ public void paintImage(RenderedImage image, RendererContext context,
int x, int y, int width, int height) throws IOException {
float fx = (float)x / 1000f;
x += currentIPPosition / 1000f;
@@ -606,12 +606,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
* @param endy the y end position
*/
private void drawLine(float startx, float starty, float endx, float endy) {
- writeln(gen.formatDouble(startx) + " "
- + gen.formatDouble(starty) + " M "
- + gen.formatDouble(endx) + " "
+ writeln(gen.formatDouble(startx) + " "
+ + gen.formatDouble(starty) + " M "
+ + gen.formatDouble(endx) + " "
+ gen.formatDouble(endy) + " lineto stroke newpath");
}
-
+
/** Saves the graphics state of the rendering engine. */
public void saveGraphicsState() {
endTextObject();
@@ -673,7 +673,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
private String getPostScriptNameForFontKey(String key) {
int pos = key.indexOf('_');
String postFix = null;
@@ -695,7 +695,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return tf.getFontName() + postFix;
}
}
-
+
/**
* Returns the PSResource for the given font key.
* @param key the font key ("F*")
@@ -706,7 +706,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (this.fontResources != null) {
res = (PSResource)this.fontResources.get(key);
} else {
- this.fontResources = new java.util.HashMap();
+ this.fontResources = new java.util.HashMap();
}
if (res == null) {
res = new PSResource(PSResource.TYPE_FONT, getPostScriptNameForFontKey(key));
@@ -714,7 +714,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
return res;
}
-
+
/**
* Changes the currently used font.
* @param key key of the font ("F*")
@@ -742,15 +742,15 @@ public class PSRenderer extends AbstractPathOrientedRenderer
|| area.hasTrait(Trait.BORDER_AFTER)
|| area.hasTrait(Trait.BORDER_START)
|| area.hasTrait(Trait.BORDER_END)) {
- comment("%FOPBeginBackgroundAndBorder: "
+ comment("%FOPBeginBackgroundAndBorder: "
+ startx + " " + starty + " " + width + " " + height);
super.drawBackAndBorders(area, startx, starty, width, height);
- comment("%FOPEndBackgroundAndBorder");
+ comment("%FOPEndBackgroundAndBorder");
}
}
-
+
/** {@inheritDoc} */
- protected void drawBorderLine(float x1, float y1, float x2, float y2,
+ protected void drawBorderLine(float x1, float y1, float x2, float y2,
boolean horz, boolean startOrBefore, int style, Color col) {
try {
float w = x2 - x1;
@@ -760,7 +760,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return;
}
switch (style) {
- case Constants.EN_DASHED:
+ case Constants.EN_DASHED:
useColor(col);
if (horz) {
float unit = Math.abs(2 * h);
@@ -902,14 +902,14 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
/** {@inheritDoc} */
public void startRenderer(OutputStream outputStream)
throws IOException {
log.debug("Rendering areas to PostScript...");
this.outputStream = outputStream;
- OutputStream out;
+ OutputStream out;
if (isOptimizeResources()) {
this.tempFile = File.createTempFile("fop", null);
out = new java.io.FileOutputStream(this.tempFile);
@@ -917,7 +917,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
} else {
out = this.outputStream;
}
-
+
//Setup for PostScript generation
this.gen = new PSGenerator(out) {
/** Need to subclass PSGenerator to have better URI resolution */
@@ -944,7 +944,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
gen.writeDSCComment(DSCConstants.BBOX, DSCConstants.ATEND);
gen.writeDSCComment(DSCConstants.HIRES_BBOX, DSCConstants.ATEND);
this.documentBoundingBox = new Rectangle2D.Double();
- gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
+ gen.writeDSCComment(DSCConstants.DOCUMENT_SUPPLIED_RESOURCES,
new Object[] {DSCConstants.ATEND});
if (headerComments != null) {
for (Iterator iter = headerComments.iterator(); iter.hasNext();) {
@@ -988,7 +988,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
PSResource res = (PSResource)this.fontResources.get(key);
gen.notifyResourceUsage(res);
}*/
-
+
//Write trailer
gen.writeDSCComment(DSCConstants.TRAILER);
if (footerComments != null) {
@@ -1016,7 +1016,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
pageDeviceDictionary.clear();
}
}
-
+
/**
* Used for two-pass production. This will rewrite the PostScript file from the temporary
* file while adding all needed resources.
@@ -1030,7 +1030,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
in = new java.io.BufferedInputStream(in);
try {
try {
- ResourceHandler.process(this.userAgent, in, this.outputStream,
+ ResourceHandler.process(this.userAgent, in, this.outputStream,
this.fontInfo, resTracker, this.formResources,
this.currentPageNumber, this.documentBoundingBox);
this.outputStream.flush();
@@ -1100,7 +1100,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
super.processOffDocumentItem(oDI);
}
-
+
/**
* Formats and writes a List of PSSetupCode instances to the output stream.
* @param setupCodeList a List of PSSetupCode instances
@@ -1111,8 +1111,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
Iterator i = setupCodeList.iterator();
while (i.hasNext()) {
PSSetupCode setupCode = (PSSetupCode)i.next();
- gen.commentln("%FOPBegin" + type + ": ("
- + (setupCode.getName() != null ? setupCode.getName() : "")
+ gen.commentln("%FOPBegin" + type + ": ("
+ + (setupCode.getName() != null ? setupCode.getName() : "")
+ ")");
LineNumberReader reader = new LineNumberReader(
new java.io.StringReader(setupCode.getContent()));
@@ -1137,9 +1137,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (this.currentPageNumber == 0) {
writeHeader();
}
-
+
this.currentPageNumber++;
-
+
gen.getResourceTracker().notifyStartNewPage();
gen.getResourceTracker().notifyResourceUsageOnPage(PSProcSets.STD_PROCSET);
gen.writeDSCComment(DSCConstants.PAGE, new Object[]
@@ -1159,7 +1159,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
pageSizes.add(new Long(Math.round(pageHeight)));
}
pageDeviceDictionary.put("/PageSize", pageSizes);
-
+
if (page.hasExtensionAttachments()) {
for (Iterator iter = page.getExtensionAttachments().iterator();
iter.hasNext();) {
@@ -1245,7 +1245,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
if (safeSetPageDevice) {
content += " SSPD";
} else {
- content += " setpagedevice";
+ content += " setpagedevice";
}
writeEnclosedExtensionAttachment(new PSSetPageDevice(content));
}
@@ -1256,8 +1256,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
concatMatrix(1, 0, 0, -1, 0, pageHeight);
- gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
-
+ gen.writeDSCComment(DSCConstants.END_PAGE_SETUP);
+
//Process page
super.renderPage(page);
@@ -1287,7 +1287,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
comment("%FOPEndRegionViewport");
}
}
-
+
/** Indicates the beginning of a text object. */
protected void beginTextObject() {
if (!inTextMode) {
@@ -1327,16 +1327,16 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
beginTextObject();
- writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f)
+ writeln("1 0 0 -1 " + gen.formatDouble(rx / 1000f)
+ " " + gen.formatDouble(bl / 1000f) + " Tm");
-
+
super.renderText(area); //Updates IPD
renderTextDecoration(tf, fontsize, area, bl, rx);
}
-
+
/** {@inheritDoc} */
protected void renderWord(WordArea word) {
renderText((TextArea)word.getParentArea(), word.getWord(), word.getLetterAdjustArray());
@@ -1349,9 +1349,9 @@ public class PSRenderer extends AbstractPathOrientedRenderer
String s = space.getSpace();
char sp = s.charAt(0);
Font font = getFontFromArea(textArea);
-
- int tws = (space.isAdjustable()
- ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
+
+ int tws = (space.isAdjustable()
+ ? ((TextArea) space.getParentArea()).getTextWordSpaceAdjust()
+ 2 * textArea.getTextLetterSpaceAdjust()
: 0);
@@ -1366,7 +1366,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
return tf;
}
-
+
private void renderText(AbstractTextArea area, String text, int[] letterAdjust) {
String fontkey = getInternalFontNameForArea(area);
int fontSize = area.getTraitAsInteger(Trait.FONT_SIZE);
@@ -1411,8 +1411,8 @@ public class PSRenderer extends AbstractPathOrientedRenderer
int initialSize = text.length();
initialSize += initialSize / 2;
StringBuffer sb = new StringBuffer(initialSize);
- if (letterAdjust == null
- && area.getTextLetterSpaceAdjust() == 0
+ if (letterAdjust == null
+ && area.getTextLetterSpaceAdjust() == 0
&& area.getTextWordSpaceAdjust() == 0) {
sb.append("(");
for (int i = start; i < end; i++) {
@@ -1437,7 +1437,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
int cw = tf.getWidth(mapped, fontsize) / 1000;
int ladj = (letterAdjust != null && i < end - 1 ? letterAdjust[i + 1] : 0);
- int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0);
+ int tls = (i < end - 1 ? area.getTextLetterSpaceAdjust() : 0);
offsets[i - start] = cw + ladj + tls + wordSpace;
PSGenerator.escapeChar(codepoint, sb);
}
@@ -1479,7 +1479,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
return null;
}
}
-
+
/** {@inheritDoc} */
protected void restoreStateStackAfterBreakOut(List breakOutList) {
try {
@@ -1496,16 +1496,16 @@ public class PSRenderer extends AbstractPathOrientedRenderer
handleIOTrouble(ioe);
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void startVParea(CTM ctm, Rectangle2D clippingRect) {
saveGraphicsState();
if (clippingRect != null) {
- clipRect((float)clippingRect.getX() / 1000f,
- (float)clippingRect.getY() / 1000f,
- (float)clippingRect.getWidth() / 1000f,
+ clipRect((float)clippingRect.getX() / 1000f,
+ (float)clippingRect.getY() / 1000f,
+ (float)clippingRect.getWidth() / 1000f,
(float)clippingRect.getHeight() / 1000f);
}
// multiply with current CTM
@@ -1528,12 +1528,12 @@ public class PSRenderer extends AbstractPathOrientedRenderer
super.renderBlockViewport(bv, children);
comment("%FOPEndBlockViewport");
}
-
+
/** {@inheritDoc} */
protected void renderInlineParent(InlineParent ip) {
super.renderInlineParent(ip);
}
-
+
/**
* {@inheritDoc}
*/
@@ -1545,7 +1545,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
int style = area.getRuleStyle();
float startx = (currentIPPosition + area.getBorderAndPaddingWidthStart()) / 1000f;
float starty = (currentBPPosition + area.getOffset()) / 1000f;
- float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ float endx = (currentIPPosition + area.getBorderAndPaddingWidthStart()
+ area.getIPD()) / 1000f;
float ruleThickness = area.getRuleThickness() / 1000f;
Color col = (Color)area.getTrait(Trait.COLOR);
@@ -1555,7 +1555,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
case EN_SOLID:
case EN_DASHED:
case EN_DOUBLE:
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_DOTTED:
@@ -1563,13 +1563,13 @@ public class PSRenderer extends AbstractPathOrientedRenderer
//This displaces the dots to the right by half a dot's width
//TODO There's room for improvement here
gen.concatMatrix(1, 0, 0, 1, ruleThickness / 2, 0);
- drawBorderLine(startx, starty, endx, starty + ruleThickness,
+ drawBorderLine(startx, starty, endx, starty + ruleThickness,
true, true, style, col);
break;
case EN_GROOVE:
case EN_RIDGE:
float half = area.getRuleThickness() / 2000f;
-
+
gen.useColor(lightenColor(col, 0.6f));
moveTo(startx, starty);
lineTo(endx, starty);
@@ -1606,7 +1606,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void renderImage(Image image, Rectangle2D pos) {
drawImage(image.getURL(), pos);
@@ -1615,7 +1615,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* {@inheritDoc}
*/
- protected RendererContext createRendererContext(int x, int y, int width, int height,
+ protected RendererContext createRendererContext(int x, int y, int width, int height,
Map foreignAttributes) {
RendererContext context = super.createRendererContext(
x, y, width, height, foreignAttributes);
@@ -1631,7 +1631,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* Formats and writes a PSExtensionAttachment to the output stream.
- *
+ *
* @param attachment an PSExtensionAttachment instance
*/
private void writeEnclosedExtensionAttachment(PSExtensionAttachment attachment)
@@ -1661,7 +1661,7 @@ public class PSRenderer extends AbstractPathOrientedRenderer
/**
* Formats and writes a Collection of PSExtensionAttachment instances to
* the output stream.
- *
+ *
* @param attachmentCollection
* a Collection of PSExtensionAttachment instances
*/
@@ -1677,15 +1677,15 @@ public class PSRenderer extends AbstractPathOrientedRenderer
iter.remove();
}
}
-
+
/**
* Sets whether or not the safe set page device macro should be used
* (as opposed to directly invoking setpagedevice) when setting the
* postscript page device.
- *
+ *
* This option is a useful option when you want to guard against the possibility
- * of invalid/unsupported postscript key/values being placed in the page device.
- *
+ * of invalid/unsupported postscript key/values being placed in the page device.
+ *
* @param safeSetPageDevice setting to false and the renderer will make a
* standard "setpagedevice" call, setting to true will make a safe set page
* device macro call (default is false).
@@ -1701,14 +1701,14 @@ public class PSRenderer extends AbstractPathOrientedRenderer
* It can cause problems (unwanted PostScript subsystem initgraphics/erasepage calls)
* on some printers when the pagedevice is set. If this causes problems on a
* particular implementation then use this setting with a 'false' value to try and
- * minimize the number of setpagedevice calls in the postscript document output.
+ * minimize the number of setpagedevice calls in the postscript document output.
* bpb
to rtrAttr
. */
@@ -313,7 +313,7 @@ final class TextAttributesConverter {
* @param bl the Block object the properties are read from
* @param rtfAttr the RtfAttributes object the attributes are written to
*/
- private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
+ private static void attrBackgroundColor(CommonBorderPaddingBackground bpb,
RtfAttributes rtfAttr) {
Color fopValue = bpb.backgroundColor;
int rtfColor = 0;
@@ -334,11 +334,11 @@ final class TextAttributesConverter {
rtfAttr.set(RtfText.ATTR_BACKGROUND_COLOR, rtfColor);
}
-
+
private static void attrBaseLineShift(Length baselineShift, RtfAttributes rtfAttr) {
-
+
int s = baselineShift.getEnum();
-
+
if (s == Constants.EN_SUPER) {
rtfAttr.set(RtfText.ATTR_SUPERSCRIPT);
} else if (s == Constants.EN_SUB) {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
index d1fd0192e..71bc9ed88 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfException.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
index f3502b4aa..7b8a22df2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/exceptions/RtfStructureException.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
index 0e9820994..5b3153b15 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IBorderAttributes.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
index 6afba3ba1..2fff24afa 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfAfterContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
index 7966010b6..87beb24d8 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBeforeContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
index afbbba04b..957ce62f6 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfBookmarkContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
index 568c33996..14486d8d1 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfExternalGraphicContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
index 9bc096e7a..194d25653 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfHyperLinkContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
index d341f80fe..743b10e85 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfJforCmdContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
index 7e2936ea8..890e00760 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfListContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
index e620ff996..2083f9b6e 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfOptions.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
index 6c49e7c08..d30bbb173 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageBreakContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
index a7cca6dcf..299ff2169 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
index 16f4a4af3..dba341700 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberCitationContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
index 1aa5820fb..77832cac2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfPageNumberContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
index f2c9b0aa6..f940d9dec 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
index 74a50b8b5..c2b78e8a8 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfParagraphKeepTogetherContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
index a61edf803..afa62807f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTableContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
index 1545df320..0522cdf10 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
index 58ca07196..528c05e70 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IRtfTextrunContainer.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfTextrun;
*/
public interface IRtfTextrunContainer {
-
+
/**
* Returns the current RtfTextrun object.
* Opens a new one if necessary.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
index e96fbbe30..87f7fe520 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableAttributes.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,13 +45,13 @@ public interface ITableAttributes {
/** half the space between the cells of a table row in twips */
String ATTR_RTF_15_TRGAPH = "trgaph";
-
+
/**
* Position of the leftmost edge of the table with respect to the
* left edge of its column
*/
String ATTR_ROW_LEFT_INDENT = "trleft";
-
+
/** table row header */
String ATTR_HEADER = "trhdr";
@@ -140,7 +140,7 @@ public interface ITableAttributes {
//Table row attributes
/** row attribute, keep-together */
String ROW_KEEP_TOGETHER = "trkeep";
-
+
/** Height of a table row in twips */
String ROW_HEIGHT = "trrh";
@@ -206,5 +206,5 @@ public interface ITableAttributes {
*/
String[] CELL_VERT_ALIGN = {
ATTR_CELL_VERT_ALIGN_TOP, ATTR_CELL_VERT_ALIGN_CENTER, ATTR_CELL_VERT_ALIGN_BOTTOM};
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
index d94563c69..dc0e559cc 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ITableColumnsInfo.java
@@ -5,9 +5,9 @@
* 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.
@@ -50,9 +50,9 @@ public interface ITableColumnsInfo {
/** @return number of columns */
int getNumberOfColumns();
-
+
/**
- *
+ *
* @return true, if it's the first of multiple spanning columns
*/
boolean getFirstSpanningCol();
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
index 5a8b6a5b9..a02825b3c 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/IrtfTemplateContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
index 79171cb47..aec0237e5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/ParagraphKeeptogetherContext.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
index 75abb5fbb..078439306 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfter.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
index f71075d96..5fbde8d3e 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAfterBeforeBase.java
@@ -5,9 +5,9 @@
* 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.
@@ -123,7 +123,7 @@ implements IRtfParagraphContainer, IRtfExternalGraphicContainer, IRtfTableContai
table = new RtfTable(this, writer, tc);
return table;
}
-
+
public RtfTextrun getTextrun()
throws IOException {
return RtfTextrun.getTextrun(this, writer, null);
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
index 92d6a5655..2eb95b587 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfAttributes.java
@@ -5,9 +5,9 @@
* 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.
@@ -215,17 +215,17 @@ implements java.lang.Cloneable {
xslAttributes = new org.xml.sax.helpers.AttributesImpl(pAttribs);
}
}
-
+
/**
* Add integer value addValue
to attribute with name name
.
- * If there is no such setted attribute, then value of this attribure is equal to
+ * If there is no such setted attribute, then value of this attribure is equal to
* addValue
.
* @param addValue the increment of value
* @param name the name of attribute
*/
public void addIntegerValue(int addValue, String name) {
Integer value = (Integer) getValue(name);
- int v = (value != null) ? value.intValue() : 0;
+ int v = (value != null) ? value.intValue() : 0;
set(name, v + addValue);
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
index c48d50ec9..0828be238 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBefore.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
index 23883f672..f691c211c 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmark.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
index 986e79c0c..3eee4cd71 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfBookmarkContainerImpl.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
index 641202c99..8df7bd7b2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfColorTable.java
@@ -5,9 +5,9 @@
* 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.
@@ -158,7 +158,7 @@ public final class RtfColorTable {
//The color currently does not exist, so add it to the table.
//First add it, then read the size as index (to return it).
//So the first added color gets index 1. That is OK, because
- //index 0 is reserved for auto-colored.
+ //index 0 is reserved for auto-colored.
addColor (identifier);
retVal = colorTable.size ();
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
index a3db213c4..5a6b1d6ed 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfContainer.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
index 3e37ec9d7..6204e2ac2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfDocumentArea.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
index 3e64a0f7d..3f1e2f7e1 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfElement.java
@@ -5,9 +5,9 @@
* 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.
@@ -97,7 +97,7 @@ public abstract class RtfElement {
public void newLine() throws IOException {
writer.write("\n");
}
-
+
/**
* Write an RTF control word to our Writer
* @param word RTF control word to write
@@ -224,7 +224,7 @@ public abstract class RtfElement {
writeControlWord(cw);
writeAttributes((RtfAttributes) value, null);
return;
- }
+ }
writeControlWord(cw);
}
@@ -246,7 +246,7 @@ public abstract class RtfElement {
writeControlWord(cw);
writeAttributes((RtfAttributes) value, null);
return;
- }
+ }
writeControlWordNS(cw);
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
index 932198676..182894ea5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfExternalGraphic.java
@@ -5,9 +5,9 @@
* 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.
@@ -65,7 +65,7 @@ public class RtfExternalGraphic extends RtfElement {
super(reason);
}
}
-
+
//////////////////////////////////////////////////
// Supported Formats
//////////////////////////////////////////////////
@@ -83,7 +83,7 @@ public class RtfExternalGraphic extends RtfElement {
public static boolean isFormat(byte[] data) {
return false;
}
-
+
/**
* Convert image data if necessary - for example when format is not supported by rtf.
*
@@ -93,7 +93,7 @@ public class RtfExternalGraphic extends RtfElement {
public FormatBase convert(FormatBase format, byte[] data) {
return format;
}
-
+
/**
* Determine image file format.
*
@@ -118,7 +118,7 @@ public class RtfExternalGraphic extends RtfElement {
return null;
}
}
-
+
/**
* Get image type.
*
@@ -127,7 +127,7 @@ public class RtfExternalGraphic extends RtfElement {
public int getType() {
return ImageConstants.I_NOT_SUPPORTED;
}
-
+
/**
* Get rtf tag.
*
@@ -137,7 +137,7 @@ public class RtfExternalGraphic extends RtfElement {
return "";
}
}
-
+
private static class FormatGIF extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "GIF8" on position 0
@@ -145,12 +145,12 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_GIF;
}
}
-
+
private static class FormatEMF extends FormatBase {
public static boolean isFormat(byte[] data) {
// No offical Indentifier known
@@ -158,28 +158,28 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_EMF;
}
-
+
public String getRtfTag() {
return "emfblip";
}
}
-
+
private static class FormatBMP extends FormatBase {
public static boolean isFormat(byte[] data) {
byte [] pattern = new byte [] {(byte) 0x42, (byte) 0x4D};
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_BMP;
}
}
-
+
private static class FormatJPG extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "0xFFD8" on position 0
@@ -187,16 +187,16 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 0, true);
}
-
+
public int getType() {
return ImageConstants.I_JPG;
}
-
+
public String getRtfTag() {
return "jpegblip";
}
}
-
+
private static class FormatPNG extends FormatBase {
public static boolean isFormat(byte[] data) {
// Indentifier "PNG" on position 1
@@ -204,16 +204,16 @@ public class RtfExternalGraphic extends RtfElement {
return ImageUtil.compareHexValues(pattern, data, 1, true);
}
-
+
public int getType() {
return ImageConstants.I_PNG;
}
-
+
public String getRtfTag() {
return "pngblip";
}
}
-
+
//////////////////////////////////////////////////
// @@ Members
//////////////////////////////////////////////////
@@ -370,7 +370,7 @@ public class RtfExternalGraphic extends RtfElement {
throw new ExternalGraphicException("The attribute 'src' of "
+ "RtfSpaceManager
object.
*/
@@ -49,8 +49,8 @@ public class RtfSpaceManager {
}
/**
- * Iterates block-level stack (i.e. all open blocks) and stops updating
- * candidate for adding space-before/space-after attribute in case of
+ * Iterates block-level stack (i.e. all open blocks) and stops updating
+ * candidate for adding space-before/space-after attribute in case of
* candidate presence.
*/
public void stopUpdatingSpaceBefore() {
@@ -61,10 +61,10 @@ public class RtfSpaceManager {
}
}
}
-
+
/**
* Set attributes as candidate for space attributes inheritance.
- *
+ *
* @param attrs attributes to set
*/
public void setCandidate(RtfAttributes attrs) {
@@ -74,24 +74,24 @@ public class RtfSpaceManager {
splitter.setSpaceAfterCandidate(attrs);
}
}
-
+
/**
- * Builds RtfSpaceSplitter on attrs
and adds it to the
+ * Builds RtfSpaceSplitter on attrs
and adds it to the
* block-level stack.
- *
+ *
* @param attrs RtfAttribute to add
* @return instance of RtfSpaceSplitter
*/
public RtfSpaceSplitter pushRtfSpaceSplitter(RtfAttributes attrs) {
RtfSpaceSplitter splitter;
splitter = new RtfSpaceSplitter(attrs, accumulatedSpace);
- // set accumulatedSpace to 0, because now accumulatedSpace used
+ // set accumulatedSpace to 0, because now accumulatedSpace used
// in splitter
accumulatedSpace = 0;
blockAttributes.addLast(splitter);
return splitter;
}
-
+
/**
* Removes RtfSpaceSplitter from top of block-level stack.
*/
@@ -105,7 +105,7 @@ public class RtfSpaceManager {
/**
* Pushes inline attributes to inline-level stack.
- *
+ *
* @param attrs attributes to add
*/
public void pushInlineAttributes(RtfAttributes attrs) {
@@ -123,7 +123,7 @@ public class RtfSpaceManager {
/**
* Peeks at inline-level attribute stack.
- *
+ *
* @return RtfAttributes from top of inline-level stack
*/
public RtfAttributes getLastInlineAttribute() {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
index 19db4dc6a..689a2753f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfSpaceSplitter.java
@@ -45,7 +45,7 @@ public class RtfSpaceSplitter {
/**
* Create RtfSpaceSplitter with given RtfAttributes.
- *
+ *
* @param attrs RtfAttributes for splitting
* @param previousSpace integer, representing accumulated spacing
*/
@@ -62,7 +62,7 @@ public class RtfSpaceSplitter {
/**
* Remove attributes with name key
from
* commonAttributes
and return it as int.
- *
+ *
* @param key attributes name to extract
* @return integer, representing value of extracted attributes
*/
@@ -86,10 +86,10 @@ public class RtfSpaceSplitter {
return spaceBefore;
}
- /**
+ /**
* Sets a candidate for space-before property.
- *
- * @param candidate instance of RtfAttributes
, considered as
+ *
+ * @param candidate instance of RtfAttributes
, considered as
* a candidate for space-before adding
*/
public void setSpaceBeforeCandidate(RtfAttributes candidate) {
@@ -98,10 +98,10 @@ public class RtfSpaceSplitter {
}
}
- /**
+ /**
* Sets a candidate for space-after property.
- *
- * @param candidate instance of RtfAttributes
, considered as
+ *
+ * @param candidate instance of RtfAttributes
, considered as
* a candidate for space-after adding
*/
public void setSpaceAfterCandidate(RtfAttributes candidate) {
@@ -117,19 +117,19 @@ public class RtfSpaceSplitter {
public boolean isAfterCadidateSet() {
return spaceAfterCandidate != null;
}
-
+
/**
* Stops updating candidates for space-before attribute.
*/
public void stopUpdatingSpaceBefore() {
updatingSpaceBefore = false;
- }
+ }
/**
* Adds corresponding attributes to their candidates.
- *
- * @return integer, representing value of space-before/space-after
- * attributes, that can't be added anywhere (i.e. these attributes
+ *
+ * @return integer, representing value of space-before/space-after
+ * attributes, that can't be added anywhere (i.e. these attributes
* hasn't their candidates)
*/
public int flush() {
@@ -144,7 +144,7 @@ public class RtfSpaceSplitter {
if (!isAfterCadidateSet()) {
accumulatingSpace += spaceAfter;
} else {
- spaceAfterCandidate.addIntegerValue(spaceAfter,
+ spaceAfterCandidate.addIntegerValue(spaceAfter,
RtfText.SPACE_AFTER);
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
index a9b531ca3..c7cc6d36f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfString.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,21 +36,21 @@ import java.io.Writer;
public class RtfString extends RtfElement {
private String text = "";
-
+
RtfString(RtfContainer parent, Writer w, String s)
throws IOException {
super(parent, w);
-
+
text = s;
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return text.trim().equals("");
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -58,11 +58,11 @@ public class RtfString extends RtfElement {
protected void writeRtfContent() throws IOException {
RtfStringConverter.getInstance().writeRtfString(writer, text);
}
-
+
public String getText() {
return text;
}
-
+
public void setText(String s) {
text = s;
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
index 04275fd72..40460bb4d 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStringConverter.java
@@ -5,9 +5,9 @@
* 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.
@@ -132,5 +132,5 @@ public class RtfStringConverter {
}
return sb.toString();
}
-
+
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
index fdbe94cfc..b838fb8a4 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfStyleSheetTable.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
index b8bb4b032..eda5644a2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTable.java
@@ -5,9 +5,9 @@
* 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.
@@ -110,16 +110,16 @@ public class RtfTable extends RtfContainer {
writeControlWordNS("pard");
}
- writeGroupMark(true);
+ writeGroupMark(true);
}
-
+
/**
* Overridden to write RTF suffix code, what comes after our children
* @throws IOException for I/O problems
*/
protected void writeRtfSuffix() throws IOException {
writeGroupMark(false);
-
+
if (isNestedTable()) {
getRow().writeRowAndCellsDefintions();
}
@@ -154,7 +154,7 @@ public class RtfTable extends RtfContainer {
}
/**
- *
+ *
* @return RtfAttributes of Header
*/
public RtfAttributes getHeaderAttribs() {
@@ -173,7 +173,7 @@ public class RtfTable extends RtfContainer {
return super.getRtfAttributes();
}
-
+
/** @return true if the the table is a nested table */
public boolean isNestedTable() {
if (isNestedTable == null) {
@@ -194,9 +194,9 @@ public class RtfTable extends RtfContainer {
return false;
}
-
+
/**
- *
+ *
* @return Parent row table (for nested tables only)
*/
public RtfTableRow getRow() {
@@ -209,7 +209,7 @@ public class RtfTable extends RtfContainer {
e = e.parent;
}
- return null;
+ return null;
}
/**
@@ -219,7 +219,7 @@ public class RtfTable extends RtfContainer {
public void setBorderAttributes(RtfAttributes attributes) {
borderAttributes = attributes;
}
-
+
/**
* Returns the RtfAttributes for the borders of the table.
* @return Border attributes of the table.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
index 1ba590f22..740ea36e5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableCell.java
@@ -5,9 +5,9 @@
* 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.
@@ -100,7 +100,7 @@ public class RtfTableCell
if (attrs == null) {
attrs = new RtfAttributes();
}
-
+
attrs.set("intbl");
paragraph = new RtfParagraph(this, writer, attrs);
@@ -192,13 +192,13 @@ public class RtfTableCell
* table (Word2000 seems to do the same).
* Cause of this, dont't write horizontally merged cells.
* They just exist as placeholders in TableContext class,
- * and are never written to RTF file.
+ * and are never written to RTF file.
*/
// horizontal cell merge codes
if (hMerge == MERGE_WITH_PREVIOUS) {
return offset;
}
-
+
newLine();
this.widthOffset = offset;
@@ -225,13 +225,13 @@ public class RtfTableCell
if (attrib.getValue("number-columns-spanned") != null) {
// Get the number of columns spanned
int nbMergedCells = ((Integer)attrib.getValue("number-columns-spanned")).intValue();
-
+
RtfTable tab = getRow().getTable();
-
+
// Get the context of the current table in order to get the width of each column
ITableColumnsInfo tableColumnsInfo
= tab.getITableColumnsInfo();
-
+
tableColumnsInfo.selectFirstColumn();
// Reach the column index in table context corresponding to the current column cell
@@ -273,7 +273,7 @@ public class RtfTableCell
return xPos;
}
-
+
/**
* Overriden to avoid writing any it's a merged cell.
* @throws IOException for I/O problems
@@ -283,7 +283,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
super.writeRtfContent();
}
@@ -297,7 +297,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
super.writeRtfPrefix();
}
@@ -310,7 +310,7 @@ public class RtfTableCell
if (hMerge == MERGE_WITH_PREVIOUS) {
return;
}
-
+
if (getRow().getTable().isNestedTable()) {
//nested table
writeControlWordNS("nestcell");
@@ -330,19 +330,19 @@ public class RtfTableCell
writeControlWord("qr");
} else {
RtfElement lastChild = null;
-
+
if (getChildren().size() > 0) {
lastChild = (RtfElement) getChildren().get(getChildren().size() - 1);
}
-
-
+
+
if (lastChild != null
&& lastChild instanceof RtfTextrun) {
- //Don't write \ql in order to allow for example a right aligned paragraph
+ //Don't write \ql in order to allow for example a right aligned paragraph
//in a not right aligned table-cell to write its \qr.
} else {
writeControlWord("ql");
- }
+ }
}
if (!containsText()) {
@@ -497,7 +497,7 @@ public class RtfTableCell
}
return result;
}
-
+
/**
* Returns the current RtfTextrun object.
* Opens a new one if necessary.
@@ -506,20 +506,20 @@ public class RtfTableCell
*/
public RtfTextrun getTextrun() throws IOException {
RtfAttributes attrs = new RtfAttributes();
-
+
if (!getRow().getTable().isNestedTable()) {
attrs.set("intbl");
}
-
+
RtfTextrun textrun = RtfTextrun.getTextrun(this, writer, attrs);
//Suppress the very last \par, because the closing \cell applies the
- //paragraph attributes.
- textrun.setSuppressLastPar(true);
-
+ //paragraph attributes.
+ textrun.setSuppressLastPar(true);
+
return textrun;
}
-
+
/**
* Get the parent row.
* @return The parent row.
@@ -534,6 +534,6 @@ public class RtfTableCell
e = e.parent;
}
- return null;
+ return null;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
index 2182f94ec..fe936e3f5 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTableRow.java
@@ -5,9 +5,9 @@
* 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.
@@ -145,15 +145,15 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
// now children can write themselves, we have the correct RTF prefix code
super.writeRtfContent();
}
-
+
/**
- *
+ *
* @throws IOException In case of a IO-problem
*/
public void writeRowAndCellsDefintions() throws IOException {
// render the row and cells definitions
writeControlWord("trowd");
-
+
if (!getTable().isNestedTable()) {
writeControlWord("itap0");
}
@@ -181,24 +181,24 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
// write X positions of our cells
int xPos = 0;
-
+
final Object leftIndent = attrib.getValue(ITableAttributes.ATTR_ROW_LEFT_INDENT);
if (leftIndent != null) {
xPos = ((Integer)leftIndent).intValue();
}
-
+
RtfAttributes tableBorderAttributes = getTable().getBorderAttributes();
-
+
int index = 0;
for (Iterator it = getChildren().iterator(); it.hasNext();) {
final RtfElement e = (RtfElement)it.next();
if (e instanceof RtfTableCell) {
-
+
RtfTableCell rtfcell = (RtfTableCell)e;
-
+
// Adjust the cell's display attributes so the table's/row's borders
// are drawn properly.
-
+
if (tableBorderAttributes != null) {
// get border attributes from table
if (index == 0) {
@@ -233,7 +233,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
}
}
}
-
+
// get border attributes from row
if (index == 0) {
if (!rtfcell.getRtfAttributes().isSet(ITableAttributes.CELL_BORDER_LEFT)) {
@@ -268,7 +268,7 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
}
index++; // Added by Boris POUDEROUS on 2002/07/02
}
-
+
newLine();
}
@@ -366,9 +366,9 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
public boolean isHighestCell(int cellId) {
return (highestCell == cellId) ? true : false;
}
-
+
/**
- *
+ *
* @return Parent table of the row.
*/
public RtfTable getTable() {
@@ -381,6 +381,6 @@ public class RtfTableRow extends RtfContainer implements ITableAttributes {
e = e.parent;
}
- return null;
+ return null;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
index fa4cf3978..a02d6db8f 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTemplate.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
index 3dc2e59e0..b176e1ee2 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfText.java
@@ -5,9 +5,9 @@
* 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.
@@ -79,7 +79,7 @@ public class RtfText extends RtfElement {
/** RtfText attributes: paragraph shading attributes */
/** Constant for the shading of the paragraph */
public static final String SHADING = "shading";
- /** Constant for the document's color tableshading of the paragraph */
+ /** Constant for the document's color tableshading of the paragraph */
public static final String SHADING_FRONT_COLOR = "cfpat";
/** Constant for the 100% shading of the paragraph */
public static final int FULL_SHADING = 10000;
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
index 05a97ffd4..e0703d7ba 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/RtfTextrun.java
@@ -5,9 +5,9 @@
* 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.
@@ -29,33 +29,33 @@ import java.util.ListIterator;
// FOP
import org.apache.fop.render.rtf.rtflib.rtfdoc.RtfExternalGraphic;
-/**
- * Class which contains a linear text run. It has methods to add attributes,
+/**
+ * Class which contains a linear text run. It has methods to add attributes,
* text, paragraph breaks....
* @author Peter Herweg, pherweg@web.de
*/
public class RtfTextrun extends RtfContainer {
private boolean bSuppressLastPar = false;
private RtfListItem rtfListItem;
-
+
/** Manager for handling space-* property. */
private RtfSpaceManager rtfSpaceManager = new RtfSpaceManager();
-
+
/** Class which represents the opening of a RTF group mark.*/
private class RtfOpenGroupMark extends RtfElement {
-
+
RtfOpenGroupMark(RtfContainer parent, Writer w, RtfAttributes attr)
throws IOException {
super(parent, w, attr);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -65,22 +65,22 @@ public class RtfTextrun extends RtfContainer {
writeAttributes(getRtfAttributes(), null);
}
}
-
+
/** Class which represents the closing of a RTF group mark.*/
private class RtfCloseGroupMark extends RtfElement {
-
+
RtfCloseGroupMark(RtfContainer parent, Writer w)
throws IOException {
super(parent, w);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -92,19 +92,19 @@ public class RtfTextrun extends RtfContainer {
/** Class which represents a paragraph break.*/
private class RtfParagraphBreak extends RtfElement {
-
+
RtfParagraphBreak(RtfContainer parent, Writer w)
throws IOException {
super(parent, w);
}
-
+
/**
* @return true if this element would generate no "useful" RTF content
*/
public boolean isEmpty() {
return false;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -113,16 +113,16 @@ public class RtfTextrun extends RtfContainer {
writeControlWord("par");
}
}
-
+
/** Create an RTF container as a child of given container */
RtfTextrun(RtfContainer parent, Writer w, RtfAttributes attrs) throws IOException {
super(parent, w, attrs);
}
-
-
+
+
/**
* Adds instance of OpenGroupMark
as a child with attributes.
- *
+ *
* @param attrs attributes to add
* @throws IOException for I/O problems
*/
@@ -132,17 +132,17 @@ public class RtfTextrun extends RtfContainer {
/**
* Adds instance of CloseGroupMark
as a child.
- *
+ *
* @throws IOException for I/O problems
*/
private void addCloseGroupMark() throws IOException {
RtfCloseGroupMark r = new RtfCloseGroupMark(this, writer);
}
-
+
/**
- * Pushes block attributes, notifies all opened blocks about pushing block
+ * Pushes block attributes, notifies all opened blocks about pushing block
* attributes, adds OpenGroupMark
as a child.
- *
+ *
* @param attrs the block attributes to push
* @throws IOException for I/O problems
*/
@@ -151,11 +151,11 @@ public class RtfTextrun extends RtfContainer {
RtfSpaceSplitter splitter = rtfSpaceManager.pushRtfSpaceSplitter(attrs);
addOpenGroupMark(splitter.getCommonAttributes());
}
-
+
/**
- * Pops block attributes, notifies all opened blocks about pushing block
+ * Pops block attributes, notifies all opened blocks about pushing block
* attributes, adds CloseGroupMark
as a child.
- *
+ *
* @throws IOException for I/O problems
*/
public void popBlockAttributes() throws IOException {
@@ -166,7 +166,7 @@ public class RtfTextrun extends RtfContainer {
/**
* Pushes inline attributes.
- *
+ *
* @param attrs the inline attributes to push
* @throws IOException for I/O problems
*/
@@ -177,17 +177,17 @@ public class RtfTextrun extends RtfContainer {
/**
* Pop inline attributes.
- *
+ *
* @throws IOException for I/O problems
*/
public void popInlineAttributes() throws IOException {
rtfSpaceManager.popInlineAttributes();
addCloseGroupMark();
}
-
+
/**
* Add string to children list.
- *
+ *
* @param s string to add
* @throws IOException for I/O problems
*/
@@ -202,20 +202,20 @@ public class RtfTextrun extends RtfContainer {
RtfString r = new RtfString(this, writer, s);
rtfSpaceManager.popRtfSpaceSplitter();
}
-
+
/**
* Inserts a footnote.
- *
+ *
* @return inserted footnote
* @throws IOException for I/O problems
*/
public RtfFootnote addFootnote() throws IOException {
return new RtfFootnote(this, writer);
}
-
+
/**
* Inserts paragraph break before all close group marks.
- *
+ *
* @throws IOException for I/O problems
*/
public void addParagraphBreak() throws IOException {
@@ -241,7 +241,7 @@ public class RtfTextrun extends RtfContainer {
}
}
}
-
+
/**
* Inserts a page number.
* @param attr Attributes for the page number to insert.
@@ -250,7 +250,7 @@ public class RtfTextrun extends RtfContainer {
public void addPageNumber(RtfAttributes attr) throws IOException {
RtfPageNumber r = new RtfPageNumber(this, writer, attr);
}
-
+
/**
* Inserts a hyperlink.
* @param attr Attributes for the hyperlink to insert.
@@ -260,7 +260,7 @@ public class RtfTextrun extends RtfContainer {
public RtfHyperLink addHyperlink(RtfAttributes attr) throws IOException {
return new RtfHyperLink(this, writer, attr);
}
-
+
/**
* Inserts a bookmark.
* @param id Id for the inserted bookmark
@@ -294,7 +294,7 @@ public class RtfTextrun extends RtfContainer {
throws IOException {
List list = container.getChildren();
-
+
if (list.size() == 0) {
//add a new RtfTextrun
RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
@@ -302,7 +302,7 @@ public class RtfTextrun extends RtfContainer {
return textrun;
}
-
+
Object obj = list.get(list.size() - 1);
if (obj instanceof RtfTextrun) {
@@ -313,18 +313,18 @@ public class RtfTextrun extends RtfContainer {
//add a new RtfTextrun as the last child
RtfTextrun textrun = new RtfTextrun(container, writer, attrs);
list.add(textrun);
-
+
return textrun;
}
-
+
/**
* specify, if the last paragraph control word (\par) should be suppressed.
* @param bSuppress true, if the last \par should be suppressed
- */
+ */
public void setSuppressLastPar(boolean bSuppress) {
bSuppressLastPar = bSuppress;
}
-
+
/**
* write RTF code of all our children
* @throws IOException for I/O problems
@@ -336,7 +336,7 @@ public class RtfTextrun extends RtfContainer {
* 2. To write the children
* Maybe this can be done more efficient.
*/
-
+
boolean bHasTableCellParent =
this.getParentOfClass(RtfTableCell.class) != null;
RtfAttributes attrBlockLevel = new RtfAttributes();
@@ -349,7 +349,7 @@ public class RtfTextrun extends RtfContainer {
break;
}
}
-
+
//get last RtfParagraphBreak, which is not followed by any visible child
RtfParagraphBreak lastParagraphBreak = null;
if (bLast) {
@@ -366,10 +366,10 @@ public class RtfTextrun extends RtfContainer {
}
}
}
-
+
//may contain for example \intbl
writeAttributes(attrib, null);
-
+
if (rtfListItem != null) {
rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
}
@@ -384,8 +384,8 @@ public class RtfTextrun extends RtfContainer {
if (bHasTableCellParent) {
attrBlockLevel.set(e.getRtfAttributes());
}
-
-
+
+
/**
* -Write RtfParagraphBreak only, if the previous visible child
* was't also a RtfParagraphBreak.
@@ -396,21 +396,21 @@ public class RtfTextrun extends RtfContainer {
*/
boolean bHide = false;
bHide = bRtfParagraphBreak;
- bHide = bHide
- && (bPrevPar
- || bFirst
- || (bSuppressLastPar && bLast && lastParagraphBreak != null
+ bHide = bHide
+ && (bPrevPar
+ || bFirst
+ || (bSuppressLastPar && bLast && lastParagraphBreak != null
&& e == lastParagraphBreak));
-
+
if (!bHide) {
newLine();
- e.writeRtf();
-
+ e.writeRtf();
+
if (rtfListItem != null && e instanceof RtfParagraphBreak) {
rtfListItem.getRtfListStyle().writeParagraphPrefix(this);
}
}
-
+
if (e instanceof RtfParagraphBreak) {
bPrevPar = true;
} else if (e instanceof RtfCloseGroupMark) {
@@ -422,26 +422,26 @@ public class RtfTextrun extends RtfContainer {
bFirst = bFirst && e.isEmpty();
}
} //for (Iterator it = ...)
-
+
//
if (bHasTableCellParent) {
writeAttributes(attrBlockLevel, null);
}
-
+
}
-
+
/**
* Set the parent list-item of the textrun.
- *
+ *
* @param listItem parent list-item of the textrun
*/
public void setRtfListItem(RtfListItem listItem) {
rtfListItem = listItem;
}
-
+
/**
- * Gets the parent list-item of the textrun.
- *
+ * Gets the parent list-item of the textrun.
+ *
* @return parent list-item of the textrun
*/
public RtfListItem getRtfListItem() {
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
index c690a287b..339434b69 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/rtfdoc/WhitespaceCollapser.java
@@ -5,9 +5,9 @@
* 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.
@@ -63,7 +63,7 @@ class WhitespaceCollapser {
txt.setText(newString);
}
}
-
+
/** process one RtfString from our container */
private void processString(RtfString txt) {
final String newString = processString(txt.getText());
@@ -71,7 +71,7 @@ class WhitespaceCollapser {
txt.setText(newString);
}
}
-
+
/** process one String */
private String processString(String txt) {
final String orig = txt;
@@ -80,7 +80,7 @@ class WhitespaceCollapser {
// to collapse multiple spaces into one
if (orig == null) {
return null;
- } else if (orig.length() > 0) {
+ } else if (orig.length() > 0) {
final boolean allSpaces = orig.trim().length() == 0;
final boolean endSpace = allSpaces
|| Character.isWhitespace(orig.charAt(orig.length() - 1));
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
index 7e9b59c20..430231792 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/BuilderContext.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
index 274ad53f5..859472709 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageConstants.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
index 93bb991e8..c5e3cb191 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/ImageUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -67,7 +67,7 @@ public class ImageUtil {
} else {
//for example "600.0pt" has to be exited,
//when the dot is reached.
- break;
+ break;
}
}
diff --git a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
index 826be58e7..96d65ad12 100644
--- a/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
+++ b/src/java/org/apache/fop/render/rtf/rtflib/tools/TableContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -60,7 +60,7 @@ public class TableContext implements ITableColumnsInfo {
* as a number-rows-spanned attribute has been found.
*/
private final List colRowSpanningAttrs = new java.util.ArrayList();
-
+
/**
* This ArrayList contains one element for each column in the table.
* value == true means, it's the first of multiple spanned columns
@@ -71,7 +71,7 @@ public class TableContext implements ITableColumnsInfo {
private boolean bNextRowBelongsToHeader = false;
/**
- *
+ *
* @param value Specifies, if next row belongs to header
*/
public void setNextRowBelongsToHeader(boolean value) {
@@ -79,7 +79,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return true, if next row belongs to header
*/
public boolean getNextRowBelongsToHeader() {
@@ -87,7 +87,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param ctx BuilderContext
*/
public TableContext(BuilderContext ctx) {
@@ -95,7 +95,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- * Adds a column and sets its width.
+ * Adds a column and sets its width.
* @param width Width of next column
*/
public void setNextColumnWidth(Float width) {
@@ -103,7 +103,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return RtfAttributes of current row-spanning cell
*/
public RtfAttributes getColumnRowSpanningAttrs() {
@@ -111,15 +111,15 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @return Number of currently spanned rows
*/
public Integer getColumnRowSpanningNumber() {
return (Integer)colRowSpanningNumber.get(colIndex);
}
-
+
/**
- *
+ *
* @return true, if it's the first of multiple spanning columns
*/
public boolean getFirstSpanningCol() {
@@ -128,7 +128,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param iRowSpanning number of rows to span
* @param attrs RtfAttributes of row-spanning cell
*/
@@ -145,7 +145,7 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
+ *
* @param iRowSpanning number of rows to span in next column
* @param attrs RtfAttributes of row-spanning cell
*/
@@ -154,10 +154,10 @@ public class TableContext implements ITableColumnsInfo {
colRowSpanningNumber.add(iRowSpanning);
colRowSpanningAttrs.add(colIndex, attrs);
}
-
+
/**
- *
- * @param bFirstSpanningCol specifies, if it's the first of
+ *
+ * @param bFirstSpanningCol specifies, if it's the first of
* multiple spanned columns
*/
public void setCurrentFirstSpanningCol(
@@ -174,8 +174,8 @@ public class TableContext implements ITableColumnsInfo {
}
/**
- *
- * @param bFirstSpanningCol specifies, if it's the first of
+ *
+ * @param bFirstSpanningCol specifies, if it's the first of
* multiple spanned columns
*/
public void setNextFirstSpanningCol(
@@ -234,7 +234,7 @@ public class TableContext implements ITableColumnsInfo {
if (colIndex < 0) {
throw new IllegalStateException("colIndex must not be negative!");
} else if (colIndex >= getNumberOfColumns()) {
- log.warn("Column width for column " + (colIndex + 1) + " is not defined, using "
+ log.warn("Column width for column " + (colIndex + 1) + " is not defined, using "
+ INVALID_COLUMN_WIDTH);
while (colIndex >= getNumberOfColumns()) {
setNextColumnWidth(new Float(INVALID_COLUMN_WIDTH));
@@ -250,9 +250,9 @@ public class TableContext implements ITableColumnsInfo {
public void setColumnIndex(int index) {
colIndex = index;
}
-
+
/**
- * @return Index of current column
+ * @return Index of current column
*/
public int getColumnIndex() {
return colIndex;
diff --git a/src/java/org/apache/fop/render/txt/Helper.java b/src/java/org/apache/fop/render/txt/Helper.java
index f2bd14914..1bdf86f0f 100644
--- a/src/java/org/apache/fop/render/txt/Helper.java
+++ b/src/java/org/apache/fop/render/txt/Helper.java
@@ -30,9 +30,9 @@ public final class Helper {
private Helper() { }
/**
- * Returns nearest integer to x
, divisible by
- * quantum
.
- *
+ * Returns nearest integer to x
, divisible by
+ * quantum
.
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -44,9 +44,9 @@ public final class Helper {
}
/**
- * Returns minimal possible integer, greater or equal than
+ * Returns minimal possible integer, greater or equal than
* x
, divisible by quantum
.
- *
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -59,7 +59,7 @@ public final class Helper {
/**
* Returns maximum possible integer, less or equal than
* oldValue
, divisible by quantum
.
- *
+ *
* @param x integer for quantization
* @param quantum integer, representing quantization
* @return computed nearest integer
@@ -71,9 +71,9 @@ public final class Helper {
/**
* Returns the closest integer to x/y
fraction.
- * It's possible to consider this methos as a analog of Math.round(x/y),
+ * It's possible to consider this methos as a analog of Math.round(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
* @return the value of the fraction rounded to the nearest
@@ -84,31 +84,31 @@ public final class Helper {
}
/**
- * Returns the smallest integer that is greater than or equal to the
+ * Returns the smallest integer that is greater than or equal to the
* x/y
fraction.
- * It's possible to consider this function as a analog of Math.ceil(x/y),
+ * It's possible to consider this function as a analog of Math.ceil(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
- * @return the smallest integer that is greater than or equal to
+ * @return the smallest integer that is greater than or equal to
* x/y
fraction
* @see java.lang.Math#ceil(double)
*/
public static int ceilPosition(int x, int y) {
return ceil(x, y) / y;
}
-
-
+
+
/**
* Returns the largest integer that is less than or equal to the
* argument and is equal to x/y
fraction.
- * It's possible to consider this function as a analog of Math.floor(x/y),
+ * It's possible to consider this function as a analog of Math.floor(x/y),
* without having deal with non-integer.
- *
+ *
* @param x integer, fraction numerator
* @param y integer, fraction denominator
- * @return the largest integer that is less than or equal to
+ * @return the largest integer that is less than or equal to
* the argument and is equal to x/y
fraction
* @see java.lang.Math#floor(double)
*/
diff --git a/src/java/org/apache/fop/render/txt/TXTRenderer.java b/src/java/org/apache/fop/render/txt/TXTRenderer.java
index b6d09d769..52c6912d4 100644
--- a/src/java/org/apache/fop/render/txt/TXTRenderer.java
+++ b/src/java/org/apache/fop/render/txt/TXTRenderer.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.txt;
import java.awt.Color;
@@ -40,17 +40,17 @@ import org.apache.fop.render.txt.border.BorderManager;
/**
* Renderer that renders areas to plain text.
- *
+ *
* @author Art Welch
* @author Mark Lillywhite (to use
* the new Renderer interface)
*/
public class TXTRenderer extends AbstractPathOrientedRenderer {
-
+
private static final char LIGHT_SHADE = '\u2591';
-
+
private static final char MEDIUM_SHADE = '\u2592';
-
+
private static final char DARK_SHADE = '\u2593';
private static final char FULL_BLOCK = '\u2588';
@@ -95,7 +95,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/** Manager for storing border's information. */
private BorderManager bm;
-
+
/** Char for current filling. */
private char fillChar;
@@ -103,7 +103,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
private TXTState currentState = new TXTState();
private String encoding;
-
+
/**
* Constructs a newly allocated TXTRenderer
object.
*/
@@ -114,7 +114,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
public String getMimeType() {
return "text/plain";
}
-
+
/**
* Sets the encoding of the target file.
* @param encoding the encoding, null to select the default encoding (UTF-8)
@@ -125,7 +125,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Indicates if point (x, y) lay inside currentPage.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @return true if point lay inside page
@@ -136,7 +136,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Add char to text buffer.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @param ch char to add
@@ -149,7 +149,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Add char to text or background buffer.
- *
+ *
* @param x x coordinate
* @param y x coordinate
* @param ch char to add
@@ -168,7 +168,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Adds string to text buffer (charData
). bm
) to buffer for
- * background and images (i.e.decoData
).
+ * Projects current page borders (i.e.bm
) to buffer for
+ * background and images (i.e.decoData
).
*/
private void flushBorderToBuffer() {
for (int x = 0; x < pageWidth; x++) {
@@ -363,14 +363,14 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Does nothing.
+ * Does nothing.
* {@inheritDoc}
*/
protected void moveTo(float x, float y) {
}
/**
- * Does nothing.
+ * Does nothing.
* {@inheritDoc}
*/
protected void lineTo(float x, float y) {
@@ -384,16 +384,16 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * Fills rectangle startX, startY, width, height with char
+ * Fills rectangle startX, startY, width, height with char
* charToFill
.
- *
+ *
* @param startX x-coordinate of upper left point
* @param startY y-coordinate of upper left point
* @param width width of rectangle
* @param height height of rectangle
- * @param charToFill filling char
+ * @param charToFill filling char
*/
- private void fillRect(int startX, int startY, int width, int height,
+ private void fillRect(int startX, int startY, int width, int height,
char charToFill) {
for (int x = startX; x < startX + width; x++) {
for (int y = startY; y < startY + height; y++) {
@@ -401,7 +401,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
}
}
-
+
/**
* Fills a rectangular area with the current filling char.
* {@inheritDoc}
@@ -410,7 +410,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
fillRect(bm.getStartX(), bm.getStartY(), bm.getWidth(), bm.getHeight(),
fillChar);
}
-
+
/**
* Changes current filling char.
* {@inheritDoc}
@@ -423,11 +423,11 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
// TODO: This fillShase is catually the luminance component of the color
// transformed to the YUV (YPrBb) Colorspace. It should use standard
// Java methods for its conversion instead of the formula given here.
- double fillShade = 0.30f / 255f * col.getRed()
- + 0.59f / 255f * col.getGreen()
+ double fillShade = 0.30f / 255f * col.getRed()
+ + 0.59f / 255f * col.getGreen()
+ 0.11f / 255f * col.getBlue();
fillShade = 1 - fillShade;
-
+
if (fillShade > 0.8f) {
fillChar = FULL_BLOCK;
} else if (fillShade > 0.6f) {
@@ -445,10 +445,10 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
protected void drawImage(String url, Rectangle2D pos, Map foreignAttributes) {
//No images are painted here
}
-
+
/**
* Fills image rectangle with a IMAGE_CHAR
.
- *
+ *
* @param image the base image
* @param pos the position of the image
*/
@@ -457,17 +457,17 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
int y1 = Helper.ceilPosition(currentBPPosition, CHAR_HEIGHT);
int width = Helper.ceilPosition((int) pos.getWidth(), CHAR_WIDTH);
int height = Helper.ceilPosition((int) pos.getHeight(), CHAR_HEIGHT);
-
+
fillRect(x1, y1, width, height, IMAGE_CHAR);
}
-
+
/**
* Returns the closest integer to the multiplication of a number and 1000.
- *
- * @param x the value of the argument, multiplied by
+ *
+ * @param x the value of the argument, multiplied by
* 1000 and rounded
- * @return the value of the argument multiplied by
+ * @return the value of the argument multiplied by
* 1000 and rounded to the nearest integer
*/
protected int toMilli(float x) {
@@ -476,11 +476,11 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
/**
* Adds one element of border.
- *
+ *
* @param x x coordinate
* @param y y coordinate
* @param style integer, representing border style
- * @param type integer, representing border element type
+ * @param type integer, representing border element type
*/
private void addBitOfBorder(int x, int y, int style, int type) {
Point point = currentState.transformPoint(x, y);
@@ -542,7 +542,7 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void drawBackAndBorders(Area area, float startx, float starty,
float width, float height) {
@@ -567,10 +567,10 @@ public class TXTRenderer extends AbstractPathOrientedRenderer {
protected void endVParea() {
currentState.pop();
}
-
+
/** {@inheritDoc} */
protected void concatenateTransformationMatrix(AffineTransform at) {
currentState.push(new CTM(ptToMpt(at)));
}
-
+
}
diff --git a/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java b/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
index 0ca509b66..f2c47735f 100644
--- a/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
+++ b/src/java/org/apache/fop/render/txt/TXTRendererConfigurator.java
@@ -5,9 +5,9 @@
* 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.
@@ -26,7 +26,7 @@ import org.apache.fop.render.PrintRendererConfigurator;
import org.apache.fop.render.Renderer;
/**
- * TXT Renderer configurator
+ * TXT Renderer configurator
*/
public class TXTRendererConfigurator extends PrintRendererConfigurator {
diff --git a/src/java/org/apache/fop/render/txt/TXTRendererMaker.java b/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
index 24e24ea87..0db369ef2 100644
--- a/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
+++ b/src/java/org/apache/fop/render/txt/TXTRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -31,7 +31,7 @@ import org.apache.fop.render.RendererConfigurator;
public class TXTRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_PLAIN_TEXT};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new TXTRenderer();
diff --git a/src/java/org/apache/fop/render/txt/TXTState.java b/src/java/org/apache/fop/render/txt/TXTState.java
index 172b5eb9c..09abc2515 100644
--- a/src/java/org/apache/fop/render/txt/TXTState.java
+++ b/src/java/org/apache/fop/render/txt/TXTState.java
@@ -27,7 +27,7 @@ import java.util.LinkedList;
import org.apache.fop.area.CTM;
/**
- * This keeps information about the current state when writing to txt, i.e.
+ * This keeps information about the current state when writing to txt, i.e.
* manages coordinate transformation matrices for getting absolute coordinates.
*/
public class TXTState {
@@ -36,7 +36,7 @@ public class TXTState {
private LinkedList stackCTM = new LinkedList();
/**
- * Current result coordinate transformation matrix. It's product of
+ * Current result coordinate transformation matrix. It's product of
* all matrices in order, saved in stackCTM
.
*/
private CTM resultCTM = new CTM();
@@ -48,9 +48,9 @@ public class TXTState {
}
/**
- * Updates result coordinate transformation matrix
+ * Updates result coordinate transformation matrix
* (i.e. resultCTM
), multipliing it by given matrix.
- *
+ *
* @param ctm CTM
*/
private void updateResultCTM(CTM ctm) {
@@ -68,9 +68,9 @@ public class TXTState {
}
/**
- * Push the current coordinate transformation matrix onto the stack and
+ * Push the current coordinate transformation matrix onto the stack and
* reevaluate resultCTM
.
- *
+ *
* @param ctm instance of CTM
*/
public void push(CTM ctm) {
@@ -86,11 +86,11 @@ public class TXTState {
stackCTM.removeLast();
calcResultCTM();
}
-
+
/**
- * Modifies coordinate transformation matrix in such a way, so
+ * Modifies coordinate transformation matrix in such a way, so
* x-shift and y-shift will be transformed in text positions.
- *
+ *
* @param ctm CTM to modify
* @return instance of CTM
*/
@@ -100,13 +100,13 @@ public class TXTState {
da[4] = Helper.roundPosition((int) da[4], TXTRenderer.CHAR_WIDTH);
// refine y-shift
da[5] = Helper.roundPosition((int) da[5], TXTRenderer.CHAR_HEIGHT);
-
+
return new CTM(da[0], da[1], da[2], da[3], da[4], da[5]);
}
/**
* Transforms point
using ctm
.
- *
+ *
* @param p Point
* @param ctm CTM
* @return transformed Point
@@ -120,7 +120,7 @@ public class TXTState {
/**
* Transforms point (x, y) using resultCTM
.
- *
+ *
* @param x x-coordinate
* @param y y-coordinate
* @return transformed Point
diff --git a/src/java/org/apache/fop/render/txt/TXTStream.java b/src/java/org/apache/fop/render/txt/TXTStream.java
index 57797eb86..49e36be3a 100644
--- a/src/java/org/apache/fop/render/txt/TXTStream.java
+++ b/src/java/org/apache/fop/render/txt/TXTStream.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.render.txt;
import java.io.IOException;
@@ -26,9 +26,9 @@ import java.io.OutputStream;
* Helper class for text streams.
*/
public class TXTStream {
-
+
private static final String DEFAULT_ENCODING = "UTF-8";
-
+
private OutputStream out = null;
private boolean doOutput = true;
private String encoding = DEFAULT_ENCODING;
@@ -65,7 +65,7 @@ public class TXTStream {
public void setDoOutput(boolean doout) {
doOutput = doout;
}
-
+
/**
* Set the encoding for the text stream.
* @param encoding the encoding, if null, "UTF-8" is chosen as default
diff --git a/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java b/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
index 80f8dc01c..cd79594c1 100644
--- a/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/AbstractBorderElement.java
@@ -33,25 +33,25 @@ import org.apache.fop.render.txt.TXTState;
public abstract class AbstractBorderElement implements Constants {
/**
- * Constant for a line segment, directing from a center of symbol up
+ * Constant for a line segment, directing from a center of symbol up
* the the symbol boundary.
*/
public static final int UP = 0;
/**
- * Constant for a line segment, directing from a center of symbol right
+ * Constant for a line segment, directing from a center of symbol right
* the the symbol boundary.
*/
public static final int RIGHT = 1;
/**
- * Constant for a line segment, directing from a center of symbol down
+ * Constant for a line segment, directing from a center of symbol down
* the the symbol boundary.
*/
public static final int DOWN = 2;
/**
- * Constant for a line segment, directing from a center of symbol left
+ * Constant for a line segment, directing from a center of symbol left
* the the symbol boundary.
*/
public static final int LEFT = 3;
@@ -63,7 +63,7 @@ public abstract class AbstractBorderElement implements Constants {
protected int[] data = {0, 0, 0, 0};
/**
- * Initializes a newly created AbstractBorderElement
object
+ * Initializes a newly created AbstractBorderElement
object
* so that it represents an empty border element.
*/
public AbstractBorderElement() {
@@ -71,9 +71,9 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Constructs a newly allocated AbstractBorderElement
object.
- * Fills array data
using binary representation of
+ * Fills array data
using binary representation of
* type
.
- *
+ *
* @param type binary representation of type gives data
*/
public AbstractBorderElement(int type) {
@@ -84,7 +84,7 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Returns value of side's element of data
.
- *
+ *
* @param side integer, representing side
* @return value of side's element
*/
@@ -94,7 +94,7 @@ public abstract class AbstractBorderElement implements Constants {
/**
* Sets a value for data[side]
.
- *
+ *
* @param side integer, representing side
* @param value a new value for data[side]
*/
diff --git a/src/java/org/apache/fop/render/txt/border/BorderManager.java b/src/java/org/apache/fop/render/txt/border/BorderManager.java
index 4a470a37f..0af243ec6 100644
--- a/src/java/org/apache/fop/render/txt/border/BorderManager.java
+++ b/src/java/org/apache/fop/render/txt/border/BorderManager.java
@@ -32,7 +32,7 @@ public class BorderManager {
/** Width of current processed border. */
private int width;
-
+
/** Height of current processed border. */
private int height;
@@ -46,9 +46,9 @@ public class BorderManager {
private TXTState state;
/**
- * Constructs BorderManger, using pageWidth
and
+ * Constructs BorderManger, using pageWidth
and
* pageHeight
for creating borderInfo
.
- *
+ *
* @param pageWidth page width
* @param pageHeight page height
* @param state TXTState
@@ -60,12 +60,12 @@ public class BorderManager {
/**
* Adds border element to borderInfo
.
- *
+ *
* @param x x-coordinate
* @param y y-coordinate
* @param style border-style
- * @param type border element type, binary representation of wich gives
- * information about availability or absence of corresponding side.
+ * @param type border element type, binary representation of wich gives
+ * information about availability or absence of corresponding side.
*/
public void addBorderElement(int x, int y, int style, int type) {
AbstractBorderElement be = null;
@@ -91,9 +91,9 @@ public class BorderManager {
/**
* @param x x-coordinate
* @param y y-coordinate
- * @return if border element at point (x,y) is available, returns instance
- * of Character, created on char, given by corresponding border element,
- * otherwise returns null.
+ * @return if border element at point (x,y) is available, returns instance
+ * of Character, created on char, given by corresponding border element,
+ * otherwise returns null.
*/
public Character getCharacter(int x, int y) {
Character c = null;
@@ -109,7 +109,7 @@ public class BorderManager {
public int getWidth() {
return width;
}
-
+
/**
* Sets width of current processed border.
* @param width width of border
@@ -117,7 +117,7 @@ public class BorderManager {
public void setWidth(int width) {
this.width = width;
}
-
+
/**
* @return height of current processed border.
*/
diff --git a/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java b/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
index d91179845..7c806e6ce 100644
--- a/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/DashedBorderElement.java
@@ -25,39 +25,39 @@ import java.util.Arrays;
* This class is responsible for managing of dashed border elements.
*/
public class DashedBorderElement extends AbstractBorderElement {
-
+
private static final char DASH_HORIZONTAL = '-';
private static final char DASH_VERTICAL = '|';
-
+
private static final char UNDEFINED = '?';
-
+
private static final int UP2 = 1;
-
+
private static final int RIGHT2 = 2;
-
+
private static final int DOWN2 = 4;
-
+
private static final int LEFT2 = 8;
-
+
private static char[] map = new char[20];
-
+
static {
Arrays.fill(map, UNDEFINED);
map[0] = ' ';
map[UP2] = DASH_VERTICAL;
map[DOWN2] = DASH_VERTICAL;
map[UP2 + DOWN2] = DASH_VERTICAL;
-
+
map[LEFT2] = DASH_HORIZONTAL;
map[RIGHT2] = DASH_HORIZONTAL;
map[LEFT2 + RIGHT2] = DASH_HORIZONTAL;
}
-
+
/**
* Constructs a newly allocated DashedBorderElement
object.
* Fills data
using superclass constructor.
- *
+ *
* @param type binary representation of type gives data
*/
public DashedBorderElement(int type) {
@@ -66,8 +66,8 @@ public class DashedBorderElement extends AbstractBorderElement {
/**
* Merges dashed border element with instance of solid and double border
- * element, returns instance of SolidAndDoubleBorderElement
.
- *
+ * element, returns instance of SolidAndDoubleBorderElement
.
+ *
* @param sdb instance of SolidAndDoubleBorderElement
to merge
* @return merged border element
*/
@@ -76,13 +76,13 @@ public class DashedBorderElement extends AbstractBorderElement {
for (int i = 0; i < 4; i++) {
e.setData(i, Math.max(data[i], sdb.getData(i)));
}
- return e;
+ return e;
}
/**
- * Merges dashed border element with dashed border element and returns
- * instance of DashedBorderElement
.
- *
+ * Merges dashed border element with dashed border element and returns
+ * instance of DashedBorderElement
.
+ *
* @param dbe instance of DashedBorderElement
to merge
* @return merged border element
*/
@@ -92,11 +92,11 @@ public class DashedBorderElement extends AbstractBorderElement {
}
return this;
}
-
+
/**
- * Converts dashed border element to
+ * Converts dashed border element to
* SolidAndDoubleBorderElement
.
- *
+ *
* @return converted instance of SolidAndDoubleBorderElement
*/
private AbstractBorderElement toSolidAndDouble() {
@@ -104,7 +104,7 @@ public class DashedBorderElement extends AbstractBorderElement {
for (int i = 0; i < 4; i++) {
e.setData(i, data[i]);
}
- return e;
+ return e;
}
/**
@@ -124,7 +124,7 @@ public class DashedBorderElement extends AbstractBorderElement {
return abe;
}
- /**
+ /**
* {@inheritDoc}
*/
public char convert2Char() {
diff --git a/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java b/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
index e5930fcb3..3e1700f1a 100644
--- a/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/DottedBorderElement.java
@@ -23,13 +23,13 @@ package org.apache.fop.render.txt.border;
* This class is responsible for managing of dotted border elements.
*/
public class DottedBorderElement extends AbstractBorderElement {
-
+
private static final char MIDDLE_DOT = '\u00B7';
/**
* Merges dotted border element with another border element. Here merging
* is quite simple: returning this
without any comparing.
- *
+ *
* @param e instance of AbstractBorderElement
* @return instance of DottedBorderElement
*/
diff --git a/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java b/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
index b14ecabe7..7defc64c6 100644
--- a/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
+++ b/src/java/org/apache/fop/render/txt/border/SolidAndDoubleBorderElement.java
@@ -47,67 +47,67 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
private static final char LIGHT_UP_AND_HORIZONTAL = '\u2534';
private static final char LIGHT_VERTICAL_AND_HORIZONTAL = '\u253C';
-
+
private static final char DOUBLE_HORIZONTAL = '\u2550';
private static final char DOUBLE_VERTICAL = '\u2551';
-
- private static final char DOUBLE_DOWN_AND_RIGHT = '\u2554';
+
+ private static final char DOUBLE_DOWN_AND_RIGHT = '\u2554';
private static final char DOUBLE_DOWN_AND_LEFT = '\u2557';
private static final char DOUBLE_UP_AND_RIGHT = '\u255A';
private static final char DOUBLE_UP_AND_LEFT = '\u255D';
-
+
private static final char DOUBLE_VERTICAL_AND_RIGHT = '\u2560';
-
+
private static final char DOUBLE_VERTICAL_AND_LEFT = '\u2563';
-
+
private static final char DOUBLE_DOWN_AND_HORIZONTAL = '\u2566';
-
+
private static final char DOUBLE_UP_AND_HORIZONTAL = '\u2569';
-
+
private static final char DOUBLE_VERTICAL_AND_HORIZONTAL = '\u256C';
-
+
private static final char DOWN_SINGLE_AND_RIGHT_DOUBLE = '\u2552';
-
+
private static final char DOWN_DOUBLE_AND_RIGHT_SINGLE = '\u2553';
private static final char DOWN_SINGLE_AND_LEFT_DOUBLE = '\u2555';
private static final char DOWN_DOUBLE_AND_LEFT_SINGLE = '\u2556';
-
+
private static final char UP_SINGLE_AND_RIGHT_DOUBLE = '\u2558';
-
+
private static final char UP_DOUBLE_AND_RIGHT_SINGLE = '\u2559';
-
+
private static final char UP_SINGLE_AND_LEFT_DOUBLE = '\u255B';
-
+
private static final char UP_DOUBLE_AND_LEFT_SINGLE = '\u255C';
-
+
private static final char VERTICAL_SINGLE_AND_RIGHT_DOUBLE = '\u255E';
-
+
private static final char VERTICAL_DOUBLE_AND_RIGHT_SINGLE = '\u255F';
-
+
private static final char VERTICAL_SINGLE_AND_LEFT_DOUBLE = '\u2561';
-
+
private static final char VERTICAL_DOUBLE_AND_LEFT_SINGLE = '\u2562';
-
+
private static final char DOWN_SINGLE_AND_HORIZONTAL_DOUBLE = '\u2564';
-
+
private static final char DOWN_DOUBLE_AND_HORIZONTAL_SINGLE = '\u2565';
-
+
private static final char UP_SINGLE_AND_HORIZONTAL_DOUBLE = '\u2567';
-
+
private static final char UP_DOUBLE_AND_HORIZONTAL_SINGLE = '\u2568';
-
+
private static final char VERTICAL_SINGLE_AND_HORIZONTAL_DOUBLE = '\u256A';
-
+
private static final char VERTICAL_DOUBLE_AND_HORIZONTAL_SINGLE = '\u256B';
-
+
private static final char UNDEFINED = '?';
-
+
private static final int UP3 = 1;
private static final int DOWN3 = 3;
@@ -174,19 +174,19 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
/**
- * Initializes a newly created SolidAndDoubleBorderElement
+ * Initializes a newly created SolidAndDoubleBorderElement
* object so that it represents an empty border element.
*/
public SolidAndDoubleBorderElement() {
}
/**
- * Constructs a newly allocated SolidAndDoubleBorderElement
- * object. Fills data
using binary representation of
- * type
. If border style is EN_DOUBLE, multiplies
- * data[side]
by 2 for every side to distinguish EN_SOLID and
+ * Constructs a newly allocated SolidAndDoubleBorderElement
+ * object. Fills data
using binary representation of
+ * type
. If border style is EN_DOUBLE, multiplies
+ * data[side]
by 2 for every side to distinguish EN_SOLID and
* EN_DOUBLE.
- *
+ *
* @param style integer, representing border style.
* @param type binary representation of type gives data
*/
@@ -198,7 +198,7 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
}
}
-
+
/**
* Merges with sde
.
* @param sde instance of SolidAndDoubleBorderElement
@@ -232,10 +232,10 @@ public class SolidAndDoubleBorderElement extends AbstractBorderElement {
}
return abe;
}
-
+
/**
* Maps to char.
- * @return resulting mapping char
+ * @return resulting mapping char
*/
private char map2Char() {
int key = 0;
diff --git a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
index 7aa22e080..4f62155a3 100644
--- a/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/AbstractXMLRenderer.java
@@ -5,9 +5,9 @@
* 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.
@@ -88,7 +88,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param comment the comment
*/
protected void comment(String comment) {
- if (handler instanceof LexicalHandler) {
+ if (handler instanceof LexicalHandler) {
try {
((LexicalHandler) handler).comment(comment.toCharArray(), 0, comment.length());
} catch (SAXException saxe) {
@@ -96,7 +96,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
}
}
}
-
+
/**
* Starts a new element (without attributes).
* @param tagName tag name of the element
@@ -158,7 +158,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param value value of the attribute
*/
protected void addAttribute(QName name, String value) {
- atts.addAttribute(name.getNamespaceURI(), name.getLocalName(), name.getQName(),
+ atts.addAttribute(name.getNamespaceURI(), name.getLocalName(), name.getQName(),
CDATA, value);
}
@@ -175,7 +175,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
return "" + (int) rect.getX() + " " + (int) rect.getY() + " "
+ (int) rect.getWidth() + " " + (int) rect.getHeight();
}
-
+
/**
* Adds a new attribute to the protected member variable "atts".
* @param name name of the attribute
@@ -259,7 +259,7 @@ public abstract class AbstractXMLRenderer extends PrintRenderer {
* @param attachments a list of extension attachments
*/
protected abstract void handleExtensionAttachments(List attachments);
-
+
/**
* Renders a bookmark tree
* @param odi the bookmark data
diff --git a/src/java/org/apache/fop/render/xml/XMLRenderer.java b/src/java/org/apache/fop/render/xml/XMLRenderer.java
index aec067b91..38db7abdf 100644
--- a/src/java/org/apache/fop/render/xml/XMLRenderer.java
+++ b/src/java/org/apache/fop/render/xml/XMLRenderer.java
@@ -92,7 +92,7 @@ import org.apache.fop.util.ColorUtil;
* Renderer that renders areas to XML for debugging purposes.
* This creates an xml that contains the information of the area
* tree. It does not output any state or derived information.
- * The output can be used to build a new area tree which can be
+ * The output can be used to build a new area tree which can be
* rendered to any renderer.
*/
public class XMLRenderer extends AbstractXMLRenderer {
@@ -148,7 +148,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
public void setCompactFormat(boolean compact) {
this.compactFormat = compact;
}
-
+
private boolean isDetailedFormat() {
return !this.compactFormat;
}
@@ -243,7 +243,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
}
}
}
-
+
transferForeignObjects(area);
}
@@ -261,7 +261,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
while (iter.hasNext()) {
Map.Entry entry = (Map.Entry)iter.next();
String qn = "xmlns:" + (String)entry.getKey();
- atts.addAttribute("", (String)entry.getKey(), qn,
+ atts.addAttribute("", (String)entry.getKey(), qn,
CDATA, (String)entry.getValue());
}
}
@@ -606,7 +606,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
renderBlocks(block, children);
}
}
-
+
/** {@inheritDoc} */
protected void renderBlock(Block block) {
atts.clear();
@@ -779,7 +779,7 @@ public class XMLRenderer extends AbstractXMLRenderer {
protected void renderWord(WordArea word) {
atts.clear();
addAttribute("offset", word.getOffset());
- int[] letterAdjust = word.getLetterAdjustArray();
+ int[] letterAdjust = word.getLetterAdjustArray();
if (letterAdjust != null) {
StringBuffer sb = new StringBuffer(64);
boolean nonZeroFound = false;
diff --git a/src/java/org/apache/fop/render/xml/XMLRendererMaker.java b/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
index 5aa0deb2b..8526daa2a 100644
--- a/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
+++ b/src/java/org/apache/fop/render/xml/XMLRendererMaker.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.render.RendererConfigurator;
public class XMLRendererMaker extends AbstractRendererMaker {
private static final String[] MIMES = new String[] {MimeConstants.MIME_FOP_AREA_TREE};
-
+
/**{@inheritDoc} */
public Renderer makeRenderer(FOUserAgent userAgent) {
return new XMLRenderer();
diff --git a/src/java/org/apache/fop/servlet/FopPrintServlet.java b/src/java/org/apache/fop/servlet/FopPrintServlet.java
index f99468743..d446dff54 100644
--- a/src/java/org/apache/fop/servlet/FopPrintServlet.java
+++ b/src/java/org/apache/fop/servlet/FopPrintServlet.java
@@ -5,9 +5,9 @@
* 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.
@@ -53,31 +53,31 @@ import org.apache.fop.apps.MimeConstants;
*
* Example URL: http://servername/fop/servlet/FopPrintServlet?xml=data.xml&xsl=format.xsl
*
- * Note: This servlet is derived from FopServlet. Most methods are inherited from the
+ * Note: This servlet is derived from FopServlet. Most methods are inherited from the
* superclass. Only the differences to the base class are necessary.
- *
+ *
* @author Apache FOP Development Team
* @version $Id$
*/
public class FopPrintServlet extends FopServlet {
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
protected void render(Source src, Transformer transformer, HttpServletResponse response)
throws FOPException, TransformerException, IOException {
FOUserAgent foUserAgent = getFOUserAgent();
-
+
//Setup FOP
Fop fop = fopFactory.newFop(MimeConstants.MIME_FOP_PRINT, foUserAgent);
-
+
//Make sure the XSL transformation's result is piped through to FOP
Result res = new SAXResult(fop.getDefaultHandler());
-
+
//Start the transformation and rendering process
transformer.transform(src, res);
-
+
//Return the result
reportOK(response);
}
diff --git a/src/java/org/apache/fop/servlet/FopServlet.java b/src/java/org/apache/fop/servlet/FopServlet.java
index 173e622dd..9b2326032 100644
--- a/src/java/org/apache/fop/servlet/FopServlet.java
+++ b/src/java/org/apache/fop/servlet/FopServlet.java
@@ -5,9 +5,9 @@
* 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.
@@ -85,7 +85,7 @@ public class FopServlet extends HttpServlet {
/** The FopFactory used to create Fop instances */
protected FopFactory fopFactory = null;
/** URIResolver for use by this servlet */
- protected URIResolver uriResolver;
+ protected URIResolver uriResolver;
/**
* {@inheritDoc}
@@ -101,7 +101,7 @@ public class FopServlet extends HttpServlet {
this.fopFactory.setURIResolver(this.uriResolver);
configureFopFactory();
}
-
+
/**
* This method is called right after the FopFactory is instantiated and can be overridden
* by subclasses to perform additional configuration.
@@ -111,7 +111,7 @@ public class FopServlet extends HttpServlet {
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void doGet(HttpServletRequest request,
HttpServletResponse response) throws ServletException {
@@ -163,7 +163,7 @@ public class FopServlet extends HttpServlet {
response.getOutputStream().write(content);
response.getOutputStream().flush();
}
-
+
/**
* Renders an XSL-FO file into a PDF file. The PDF is written to a byte
* array that is returned as the method's result.
@@ -252,7 +252,7 @@ public class FopServlet extends HttpServlet {
//Return the result
sendPDF(out.toByteArray(), response);
}
-
+
/** @return a new FOUserAgent for FOP */
protected FOUserAgent getFOUserAgent() {
FOUserAgent userAgent = fopFactory.newFOUserAgent();
diff --git a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
index 48bd2d6cb..413dac76d 100644
--- a/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
+++ b/src/java/org/apache/fop/servlet/ServletContextURIResolver.java
@@ -37,9 +37,9 @@ public class ServletContextURIResolver implements URIResolver {
/** The protocol name for the servlet context URIs. */
public static final String SERVLET_CONTEXT_PROTOCOL = "servlet-context:";
-
+
private ServletContext servletContext;
-
+
/**
* Main constructor
* @param servletContext the servlet context to access the resources through
@@ -47,14 +47,14 @@ public class ServletContextURIResolver implements URIResolver {
public ServletContextURIResolver(ServletContext servletContext) {
this.servletContext = servletContext;
}
-
+
/** {@inheritDoc} */
public Source resolve(String href, String base) throws TransformerException {
if (href.startsWith(SERVLET_CONTEXT_PROTOCOL)) {
return resolveServletContextURI(href.substring(SERVLET_CONTEXT_PROTOCOL.length()));
} else {
- if (base != null
- && base.startsWith(SERVLET_CONTEXT_PROTOCOL)
+ if (base != null
+ && base.startsWith(SERVLET_CONTEXT_PROTOCOL)
&& (href.indexOf(':') < 0)) {
String abs = base + href;
return resolveServletContextURI(
diff --git a/src/java/org/apache/fop/svg/ACIUtils.java b/src/java/org/apache/fop/svg/ACIUtils.java
index 984b63f25..91dfb85ca 100644
--- a/src/java/org/apache/fop/svg/ACIUtils.java
+++ b/src/java/org/apache/fop/svg/ACIUtils.java
@@ -5,9 +5,9 @@
* 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.
@@ -44,7 +44,7 @@ public final class ACIUtils {
Map.Entry entry = (Map.Entry)i.next();
if (entry.getValue() != null) {
System.out.println(entry.getKey() + ": " + entry.getValue());
- }
+ }
}
int start = aci.getBeginIndex();
System.out.print("AttrRuns: ");
@@ -54,7 +54,7 @@ public final class ACIUtils {
aci.setIndex(end);
if (start == end) {
break;
- }
+ }
start = end;
}
System.out.println("");
diff --git a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
index b7cee29ef..83cfa8021 100644
--- a/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
+++ b/src/java/org/apache/fop/svg/AbstractFOPTranscoder.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import org.apache.batik.bridge.UserAgent;
@@ -40,7 +40,7 @@ import org.xml.sax.EntityResolver;
public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
/**
- * The key to specify whether to stroke text instead of using text
+ * The key to specify whether to stroke text instead of using text
* operations.
*/
public static final TranscodingHints.Key KEY_STROKE_TEXT = new BooleanKey();
@@ -69,7 +69,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
hints.put(KEY_DOM_IMPLEMENTATION,
SVGDOMImplementation.getDOMImplementation());
}
-
+
/**
* Creates and returns the default user agent for this transcoder. Override
* this method if you need non-default behaviour.
@@ -78,7 +78,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
protected UserAgent createUserAgent() {
return new FOPTranscoderUserAgent();
}
-
+
/**
* @param logger
*/
@@ -93,9 +93,9 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
public void setEntityResolver(EntityResolver resolver) {
this.resolver = resolver;
}
-
+
/**
- * Returns the logger associated with this transcoder. It returns a
+ * Returns the logger associated with this transcoder. It returns a
* SimpleLog if no logger has been explicitly set.
* @return Logger the logger for the transcoder.
*/
@@ -106,7 +106,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
return this.logger;
}
-
+
/**
* Creates a DocumentFactory that is used to create an SVG DOM
* tree. The specified DOM Implementation is ignored and the Batik
@@ -118,7 +118,7 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
*/
protected DocumentFactory createDocumentFactory(DOMImplementation domImpl,
String parserClassname) {
- final FOPSAXSVGDocumentFactory factory
+ final FOPSAXSVGDocumentFactory factory
= new FOPSAXSVGDocumentFactory(parserClassname);
if (this.resolver != null) {
factory.setAdditionalEntityResolver(this.resolver);
@@ -141,18 +141,18 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
return stroke;
}
-
+
// --------------------------------------------------------------------
// FOP's default error handler (for transcoders)
// --------------------------------------------------------------------
/**
* This is the default transcoder error handler for FOP. It logs error
- * to an Commons Logger instead of to System.out. The remaining behaviour
+ * to an Commons Logger instead of to System.out. The remaining behaviour
* is the same as Batik's DefaultErrorHandler.
- */
+ */
protected class FOPErrorHandler implements ErrorHandler {
-
+
/**
* {@inheritDoc}
*/
@@ -244,5 +244,5 @@ public abstract class AbstractFOPTranscoder extends SVGAbstractTranscoder {
}
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java b/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
index e265613fa..720795cb2 100644
--- a/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
+++ b/src/java/org/apache/fop/svg/FOPSAXSVGDocumentFactory.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.io.IOException;
@@ -41,7 +41,7 @@ public class FOPSAXSVGDocumentFactory extends SAXSVGDocumentFactory {
public FOPSAXSVGDocumentFactory(String parser) {
super(parser);
}
-
+
/**
* Sets an additional entity resolver. It will be used before the default
* entity resolving.
@@ -50,9 +50,9 @@ public class FOPSAXSVGDocumentFactory extends SAXSVGDocumentFactory {
public void setAdditionalEntityResolver(EntityResolver resolver) {
this.additionalResolver = resolver;
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public InputSource resolveEntity(String publicId, String systemId)
throws SAXException {
diff --git a/src/java/org/apache/fop/svg/GraphicsConfiguration.java b/src/java/org/apache/fop/svg/GraphicsConfiguration.java
index a92baed27..ca3b3363c 100644
--- a/src/java/org/apache/fop/svg/GraphicsConfiguration.java
+++ b/src/java/org/apache/fop/svg/GraphicsConfiguration.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
@@ -27,8 +27,8 @@ import java.awt.image.VolatileImage;
* compilation errors.
* The version for JDK 1.4 needs to add an override for the abstract
* createCompatibleVolatileImage() method. It can't be overidden
- * for JDK 1.3 because there is no VolatileImage there.
- *
+ * for JDK 1.3 because there is no VolatileImage there.
+ *
*/
abstract public class GraphicsConfiguration extends java.awt.GraphicsConfiguration {
diff --git a/src/java/org/apache/fop/svg/PDFAElementBridge.java b/src/java/org/apache/fop/svg/PDFAElementBridge.java
index e9bb8a955..9ab360f39 100644
--- a/src/java/org/apache/fop/svg/PDFAElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFAElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.geom.AffineTransform;
@@ -55,7 +55,7 @@ public class PDFAElementBridge extends AbstractGraphicsNodeBridge {
public AffineTransform getCurrentTransform() {
return this.transform;
}
-
+
/**
* Returns 'a'.
* @return the name of this node
diff --git a/src/java/org/apache/fop/svg/PDFANode.java b/src/java/org/apache/fop/svg/PDFANode.java
index 84c8b9e42..a2d1d354c 100644
--- a/src/java/org/apache/fop/svg/PDFANode.java
+++ b/src/java/org/apache/fop/svg/PDFANode.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import org.apache.batik.gvt.CompositeGraphicsNode;
@@ -102,7 +102,7 @@ public class PDFANode extends CompositeGraphicsNode {
}
}
} catch (Exception e) {
- //TODO Move this to setDestination() and throw an IllegalArgumentException
+ //TODO Move this to setDestination() and throw an IllegalArgumentException
e.printStackTrace();
}
Rectangle2D destRect = new Rectangle2D.Float(x, y, width, height);
diff --git a/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java b/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
index 748e216a7..d167f5de4 100644
--- a/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFBatikFlowTextElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.fonts.FontInfo;
public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
private PDFTextPainter textPainter;
-
+
/**
* Main Constructor.
* @param fontInfo the font directory
@@ -40,7 +40,7 @@ public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
public PDFBatikFlowTextElementBridge(FontInfo fontInfo) {
this.textPainter = new PDFFlowExtTextPainter(fontInfo);
}
-
+
/** {@inheritDoc} */
protected GraphicsNode instantiateGraphicsNode() {
GraphicsNode node = super.instantiateGraphicsNode();
@@ -58,5 +58,5 @@ public class PDFBatikFlowTextElementBridge extends BatikFlowTextElementBridge {
public TextPainter getTextPainter() {
return this.textPainter;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFBridgeContext.java b/src/java/org/apache/fop/svg/PDFBridgeContext.java
index 9f235b6a9..fdf83784f 100644
--- a/src/java/org/apache/fop/svg/PDFBridgeContext.java
+++ b/src/java/org/apache/fop/svg/PDFBridgeContext.java
@@ -5,9 +5,9 @@
* 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.
@@ -36,7 +36,7 @@ import org.apache.fop.fonts.FontInfo;
* BridgeContext which registers the custom bridges for PDF output.
*/
public class PDFBridgeContext extends BridgeContext {
-
+
/** The font list. */
private final FontInfo fontInfo;
@@ -44,7 +44,7 @@ public class PDFBridgeContext extends BridgeContext {
private final ImageSessionContext imageSessionContext;
private AffineTransform linkTransform;
-
+
/**
* Constructs a new bridge context.
* @param userAgent the user agent
@@ -75,8 +75,8 @@ public class PDFBridgeContext extends BridgeContext {
* @param linkTransform AffineTransform to properly place links,
* may be null
*/
- public PDFBridgeContext(UserAgent userAgent,
- FontInfo fontInfo,
+ public PDFBridgeContext(UserAgent userAgent,
+ FontInfo fontInfo,
ImageManager imageManager,
ImageSessionContext imageSessionContext,
AffineTransform linkTransform) {
@@ -115,12 +115,12 @@ public class PDFBridgeContext extends BridgeContext {
public ImageSessionContext getImageSessionContext() {
return this.imageSessionContext;
}
-
+
private void putPDFElementBridgeConditional(String className, String testFor) {
try {
Class.forName(testFor);
//if we get here the test class is available
-
+
Class clazz = Class.forName(className);
Constructor constructor = clazz.getConstructor(new Class[] {FontInfo.class});
putBridge((Bridge)constructor.newInstance(new Object[] {fontInfo}));
@@ -128,7 +128,7 @@ public class PDFBridgeContext extends BridgeContext {
//simply ignore (bridges instantiated over this method are optional)
}
}
-
+
/** {@inheritDoc} */
public void registerSVGBridges() {
super.registerSVGBridges();
@@ -136,7 +136,7 @@ public class PDFBridgeContext extends BridgeContext {
if (fontInfo != null) {
PDFTextElementBridge textElementBridge = new PDFTextElementBridge(fontInfo);
putBridge(textElementBridge);
-
+
//Batik flow text extension (may not always be available)
//putBridge(new PDFBatikFlowTextElementBridge(fontInfo);
putPDFElementBridgeConditional(
@@ -148,7 +148,7 @@ public class PDFBridgeContext extends BridgeContext {
putPDFElementBridgeConditional(
"org.apache.fop.svg.PDFSVG12TextElementBridge",
"org.apache.batik.bridge.svg12.SVG12TextElementBridge");
-
+
//putBridge(new PDFSVGFlowRootElementBridge(fontInfo));
putPDFElementBridgeConditional(
"org.apache.fop.svg.PDFSVGFlowRootElementBridge",
diff --git a/src/java/org/apache/fop/svg/PDFContext.java b/src/java/org/apache/fop/svg/PDFContext.java
index 494d47636..b7eec7b73 100644
--- a/src/java/org/apache/fop/svg/PDFContext.java
+++ b/src/java/org/apache/fop/svg/PDFContext.java
@@ -31,7 +31,7 @@ public class PDFContext {
/** number of pages generated */
private int pagecount;
-
+
/** @return true if a page is set up for painting. */
public boolean isPagePending() {
return this.currentPage != null;
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
index 5bdfe8c8d..dd13df1c4 100644
--- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2D.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
index cda1478bb..2d1c9279c 100644
--- a/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
+++ b/src/java/org/apache/fop/svg/PDFDocumentGraphics2DConfigurator.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java b/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
index 0e8f47cfe..1c85a2899 100644
--- a/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFFlowExtTextPainter.java
@@ -5,9 +5,9 @@
* 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.
@@ -45,5 +45,5 @@ public class PDFFlowExtTextPainter extends PDFTextPainter {
FlowExtTextPainter delegate = (FlowExtTextPainter)FlowExtTextPainter.getInstance();
return delegate.getTextRuns(node, aci);
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFFlowTextPainter.java b/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
index eeef40da1..5b307ce83 100644
--- a/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFFlowTextPainter.java
@@ -5,9 +5,9 @@
* 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.
@@ -30,7 +30,7 @@ import org.apache.fop.fonts.FontInfo;
* Text Painter for SVG 1.2 (flow) text.
*/
public class PDFFlowTextPainter extends PDFTextPainter {
-
+
/**
* Main constructor
* @param fontInfo the font directory
@@ -45,5 +45,5 @@ public class PDFFlowTextPainter extends PDFTextPainter {
FlowTextPainter delegate = (FlowTextPainter)FlowTextPainter.getInstance();
return delegate.getTextRuns(node, aci);
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFGraphics2D.java b/src/java/org/apache/fop/svg/PDFGraphics2D.java
index 4d1ee6a6d..ca2245a12 100644
--- a/src/java/org/apache/fop/svg/PDFGraphics2D.java
+++ b/src/java/org/apache/fop/svg/PDFGraphics2D.java
@@ -5,9 +5,9 @@
* 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.
diff --git a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
index 20c2c5c89..83a431d5e 100644
--- a/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
+++ b/src/java/org/apache/fop/svg/PDFGraphicsConfiguration.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Rectangle;
diff --git a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
index 763bc7bb4..5da2d50ee 100644
--- a/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
+++ b/src/java/org/apache/fop/svg/PDFGraphicsDevice.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.GraphicsDevice;
diff --git a/src/java/org/apache/fop/svg/PDFImageElementBridge.java b/src/java/org/apache/fop/svg/PDFImageElementBridge.java
index 0513c78bb..7eb89d2b1 100644
--- a/src/java/org/apache/fop/svg/PDFImageElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFImageElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.svg;
import java.awt.Graphics2D;
@@ -72,13 +72,13 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
protected GraphicsNode createImageGraphicsNode
(BridgeContext ctx, Element imageElement, ParsedURL purl) {
PDFBridgeContext pdfCtx = (PDFBridgeContext)ctx;
-
+
ImageManager manager = pdfCtx.getImageManager();
ImageSessionContext sessionContext = pdfCtx.getImageSessionContext();
try {
ImageInfo info = manager.getImageInfo(purl.toString(), sessionContext);
Image image = manager.getImage(info, supportedFlavors, sessionContext);
-
+
//TODO color profile overrides aren't handled, yet!
//ICCColorSpaceExt colorspaceOverride = extractColorSpace(e, ctx);
AbstractGraphicsNode specializedNode = null;
@@ -104,7 +104,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
ctx.getUserAgent().displayError(
new ImageException("Cannot convert an image to a usable format: " + purl));
}
-
+
Rectangle2D imgBounds = getImageBounds(ctx, imageElement);
Rectangle2D bounds = specializedNode.getPrimitiveBounds();
float [] vb = new float[4];
@@ -113,14 +113,14 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
vb[2] = (float) bounds.getWidth(); // width
vb[3] = (float) bounds.getHeight(); // height
- // handles the 'preserveAspectRatio', 'overflow' and 'clip'
+ // handles the 'preserveAspectRatio', 'overflow' and 'clip'
// and sets the appropriate AffineTransform to the image node
initializeViewport(ctx, imageElement, specializedNode, vb, imgBounds);
return specializedNode;
} catch (Exception e) {
ctx.getUserAgent().displayError(e);
}
-
+
return superCreateGraphicsNode(ctx, imageElement, purl);
}
@@ -144,13 +144,13 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* the PDFGraphics2D.
*/
public class LoaderImageNode extends AbstractGraphicsNode {
-
+
private Image image;
private BridgeContext ctx;
private Element imageElement;
private ParsedURL purl;
private GraphicsNode origGraphicsNode = null;
-
+
/**
* Create a new image node for drawing natively handled images
* into PDF graphics.
@@ -159,7 +159,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* @param imageElement the SVG image element
* @param purl the URL to the image
*/
- public LoaderImageNode(Image image, BridgeContext ctx,
+ public LoaderImageNode(Image image, BridgeContext ctx,
Element imageElement, ParsedURL purl) {
this.image = image;
this.ctx = ctx;
@@ -191,7 +191,7 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
if (origGraphicsNode == null) {
// Haven't constructed baseclass Graphics Node,
// so do so now.
- origGraphicsNode
+ origGraphicsNode
= PDFImageElementBridge.this.superCreateGraphicsNode
(ctx, imageElement, purl);
}
@@ -223,9 +223,9 @@ public class PDFImageElementBridge extends SVGImageElementBridge {
* A node that holds a Graphics2D image.
*/
public class Graphics2DNode extends AbstractGraphicsNode {
-
+
private ImageGraphics2D image;
-
+
/**
* Create a new Graphics2D node.
* @param g2d the Graphics2D image
diff --git a/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java b/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
index ec6996389..d313e6cc4 100644
--- a/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFSVGFlowRootElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ import org.apache.fop.fonts.FontInfo;
public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
private PDFTextPainter textPainter;
-
+
/**
* Main Constructor.
* @param fontInfo the font directory
@@ -40,7 +40,7 @@ public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
public PDFSVGFlowRootElementBridge(FontInfo fontInfo) {
this.textPainter = new PDFFlowTextPainter(fontInfo);
}
-
+
/** {@inheritDoc} */
protected GraphicsNode instantiateGraphicsNode() {
GraphicsNode node = super.instantiateGraphicsNode();
@@ -58,5 +58,5 @@ public class PDFSVGFlowRootElementBridge extends SVGFlowRootElementBridge {
public TextPainter getTextPainter() {
return this.textPainter;
}
-
+
}
diff --git a/src/java/org/apache/fop/svg/PDFTextElementBridge.java b/src/java/org/apache/fop/svg/PDFTextElementBridge.java
index 47e794dda..4c11aa97e 100644
--- a/src/java/org/apache/fop/svg/PDFTextElementBridge.java
+++ b/src/java/org/apache/fop/svg/PDFTextElementBridge.java
@@ -5,9 +5,9 @@
* 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.
@@ -35,7 +35,7 @@ import org.w3c.dom.Element;
* @author Keiron Liddle
*/
public class PDFTextElementBridge extends SVGTextElementBridge {
-
+
private PDFTextPainter pdfTextPainter;
/**
diff --git a/src/java/org/apache/fop/svg/PDFTextPainter.java b/src/java/org/apache/fop/svg/PDFTextPainter.java
index 754b0794b..d8123c4fb 100644
--- a/src/java/org/apache/fop/svg/PDFTextPainter.java
+++ b/src/java/org/apache/fop/svg/PDFTextPainter.java
@@ -5,9 +5,9 @@
* 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.
@@ -62,7 +62,7 @@ import org.apache.fop.util.CharUtilities;
public class PDFTextPainter extends StrokingTextPainter {
private static final boolean DEBUG = false;
-
+
private boolean strokeText = false;
private FontInfo fontInfo;
@@ -102,7 +102,7 @@ public class PDFTextPainter extends StrokingTextPainter {
if ((tpi != null) && (tpi.composite != null)) {
g2d.setComposite(tpi.composite);
}
-
+
//------------------------------------
TextSpanLayout layout = textRun.getLayout();
if (DEBUG) {
@@ -110,7 +110,7 @@ public class PDFTextPainter extends StrokingTextPainter {
System.out.println("================================================");
System.out.println("New text run:");
System.out.println("char count: " + charCount);
- System.out.println("range: "
+ System.out.println("range: "
+ runaci.getBeginIndex() + " - " + runaci.getEndIndex());
System.out.println("glyph count: " + layout.getGlyphCount()); //=getNumGlyphs()
}
@@ -125,26 +125,26 @@ public class PDFTextPainter extends StrokingTextPainter {
System.out.println("Text: " + chars);
pdf.currentStream.write("%Text: " + chars + "\n");
}
-
+
GeneralPath debugShapes = null;
if (DEBUG) {
debugShapes = new GeneralPath();
}
-
+
Font[] fonts = findFonts(runaci);
if (fonts == null || fonts.length == 0) {
//Draw using Java2D
textRun.getLayout().draw(g2d);
continue;
}
-
+
textUtil.saveGraphicsState();
textUtil.concatMatrix(g2d.getTransform());
Shape imclip = g2d.getClip();
pdf.writeClip(imclip);
-
+
applyColorAndPaint(tpi, pdf);
-
+
textUtil.beginTextObject();
textUtil.setFonts(fonts);
textUtil.setTextRenderingMode(tpi.fillPaint != null, tpi.strokePaint != null, false);
@@ -158,7 +158,7 @@ public class PDFTextPainter extends StrokingTextPainter {
boolean visibleChar = gv.isGlyphVisible(index)
|| (CharUtilities.isAnySpace(ch) && !CharUtilities.isZeroWidthSpace(ch));
if (DEBUG) {
- System.out.println("glyph " + index
+ System.out.println("glyph " + index
+ " -> " + layout.getGlyphIndex(index) + " => " + ch);
if (CharUtilities.isAnySpace(ch) && ch != 32) {
System.out.println("Space found: " + Integer.toHexString(ch));
@@ -198,9 +198,9 @@ public class PDFTextPainter extends StrokingTextPainter {
localTransform.concatenate(glyphTransform);
}
localTransform.scale(1, -1);
-
- boolean yPosChanged = (prevPos == null
- || prevPos.getY() != p.getY()
+
+ boolean yPosChanged = (prevPos == null
+ || prevPos.getY() != p.getY()
|| glyphTransform != null);
if (yPosChanged) {
if (index > 0) {
@@ -218,7 +218,7 @@ public class PDFTextPainter extends StrokingTextPainter {
textUtil.adjustGlyphTJ(adjust * 1000);
}
if (DEBUG) {
- System.out.println("==> x diff: " + xdiff + ", " + effxdiff
+ System.out.println("==> x diff: " + xdiff + ", " + effxdiff
+ ", charWidth: " + cw);
}
}
@@ -231,7 +231,7 @@ public class PDFTextPainter extends StrokingTextPainter {
}
char paintChar = (CharUtilities.isAnySpace(ch) ? ' ' : ch);
textUtil.writeTJChar(paintChar);
-
+
//Update last position
prevPos = p;
prevVisibleCharWidth = textUtil.getCurrentFont().getCharWidth(chars.charAt(index));
@@ -268,7 +268,7 @@ public class PDFTextPainter extends StrokingTextPainter {
}
pdf.applyAlpha(fillAlpha, PDFGraphics2D.OPAQUE);
}
-
+
private Font[] findFonts(AttributedCharacterIterator aci) {
List fonts = new java.util.ArrayList();
List gvtFonts = (List) aci.getAttribute(
@@ -343,5 +343,5 @@ public class PDFTextPainter extends StrokingTextPainter {
}
return (Font[])fonts.toArray(new Font[fonts.size()]);
}
-
+
}
\ No newline at end of file
diff --git a/src/java/org/apache/fop/svg/PDFTextUtil.java b/src/java/org/apache/fop/svg/PDFTextUtil.java
index f3c7f31a2..9ba7cd049 100644
--- a/src/java/org/apache/fop/svg/PDFTextUtil.java
+++ b/src/java/org/apache/fop/svg/PDFTextUtil.java
@@ -5,9 +5,9 @@
* 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.
@@ -32,7 +32,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
private FontInfo fontInfo;
private Font[] fonts;
private Font font;
-
+
/**
* Main constructor.
* @param fontInfo the font catalog
@@ -41,13 +41,13 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
super();
this.fontInfo = fontInfo;
}
-
+
/** {@inheritDoc} */
protected void initValues() {
super.initValues();
this.font = null;
}
-
+
/**
* Sets the current fonts for the text object. For every character, the suitable font will
* be selected.
@@ -56,7 +56,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setFonts(Font[] fonts) {
this.fonts = fonts;
}
-
+
/**
* Sets the current font for the text object.
* @param font the new font
@@ -64,7 +64,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setFont(Font font) {
setFonts(new Font[] {font});
}
-
+
/**
* Returns the current font in use.
* @return the current font or null if no font is currently active.
@@ -72,7 +72,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public Font getCurrentFont() {
return this.font;
}
-
+
/**
* Sets the current font.
* @param f the new font to use
@@ -80,7 +80,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
public void setCurrentFont(Font f) {
this.font = f;
}
-
+
/**
* Determines whether the font with the given name is a multi-byte font.
* @param name the name of the font
@@ -114,7 +114,7 @@ public abstract class PDFTextUtil extends org.apache.fop.pdf.PDFTextUtil {
}
return fonts[0]; //TODO Maybe fall back to painting with shapes
}
-
+
/**
* Writes a char to the "TJ-Buffer".
* @param ch the unmapped character
diff --git a/src/java/org/apache/fop/svg/PDFTranscoder.java b/src/java/org/apache/fop/svg/PDFTranscoder.java
index 281df1b1d..333cd5e4c 100644
--- a/src/java/org/apache/fop/svg/PDFTranscoder.java
+++ b/src/java/org/apache/fop/svg/PDFTranscoder.java
@@ -5,9 +5,9 @@
* 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.
@@ -78,7 +78,7 @@ import org.apache.fop.fonts.FontInfo;
* KEY_USER_STYLESHEET_URI to fix the URI of a user
* stylesheet, and KEY_PIXEL_TO_MM to specify the pixel to
* millimeter conversion factor.
- *
+ *
* String
into
* an array of int
, splitting the base along the
* given separator pattern.
- * Note: this method assumes the input is a string containing
+ * Note: this method assumes the input is a string containing
* only decimal integers, signed or unsigned, that are parsable
* by java.lang.Integer.parseInt(String)
. If this
* is not the case, the resulting NumberFormatException
* will have to be handled by the caller.
- *
+ *
* @param baseString the base string
* @param separatorPattern the pattern separating the integer values
* (if this is null
, the baseString is parsed as one
- * integer value)
+ * integer value)
* @return an array of int
whose size is equal to the number
* values in the input string; null
if this number
* is equal to zero.
*/
public static int[] toIntArray(String baseString, String separatorPattern) {
-
+
if (baseString == null || "".equals(baseString)) {
return null;
}
-
+
if (separatorPattern == null || "".equals(separatorPattern)) {
return new int[] { Integer.parseInt(baseString) };
}
-
+
String[] values = baseString.split(separatorPattern);
int numValues = values.length;
if (numValues == 0) {
return null;
}
-
+
int[] returnArray = new int[numValues];
for (int i = 0; i < numValues; ++i) {
returnArray[i] = Integer.parseInt(values[i]);
}
return returnArray;
-
+
}
/**
* Converts the given base String
into
* an array of double
, splitting the base along the
* given separator pattern.
- * Note: this method assumes the input is a string containing
+ * Note: this method assumes the input is a string containing
* only decimal doubles, signed or unsigned, that are parsable
* by java.lang.Double.parseDouble(String)
. If this
* is not the case, the resulting NumberFormatException
* will have to be handled by the caller.
- *
+ *
* @param baseString the base string
* @param separatorPattern the pattern separating the integer values
* (if this is null
, the baseString is parsed as one
- * double value)
+ * double value)
* @return an array of double
whose size is equal to the number
* values in the input string; null
if this number
* is equal to zero.
*/
public static double[] toDoubleArray(String baseString, String separatorPattern) {
-
+
if (baseString == null || "".equals(baseString)) {
return null;
}
-
+
if (separatorPattern == null || "".equals(separatorPattern)) {
return new double[] { Double.parseDouble(baseString) };
}
-
+
String[] values = baseString.split(separatorPattern);
int numValues = values.length;
if (numValues == 0) {
return null;
}
-
+
double[] returnArray = new double[numValues];
for (int i = 0; i < numValues; ++i) {
returnArray[i] = Double.parseDouble(values[i]);
}
return returnArray;
-
+
}
-
+
}
diff --git a/src/java/org/apache/fop/util/DOM2SAX.java b/src/java/org/apache/fop/util/DOM2SAX.java
index 15f371b45..04096e053 100644
--- a/src/java/org/apache/fop/util/DOM2SAX.java
+++ b/src/java/org/apache/fop/util/DOM2SAX.java
@@ -35,7 +35,7 @@ import org.xml.sax.helpers.AttributesImpl;
/**
* Helper class that produces a SAX stream from a DOM Document.
*