diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2008-07-24 09:35:34 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2008-07-24 09:35:34 +0000 |
commit | 92df262a0778ee539c849454be2810621dac1b7e (patch) | |
tree | d5be9359cbacb91dffcab6f1a6ecfe61e9db2c6b /src/java/org/apache/fop/fo/pagination | |
parent | 30e2ce5bee38cbc32758e0b65fa7f98f3db76baa (diff) | |
download | xmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.tar.gz xmlgraphics-fop-92df262a0778ee539c849454be2810621dac1b7e.zip |
Fed up with all those trailing whitespaces. Let's remove them all (once... and for all?)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@679326 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination')
31 files changed, 228 insertions, 228 deletions
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; * <code>fox:external-document</code></a> 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 <code>reference-orientation</code> 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} * <br>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 <a href="http://www.w3.org/TR/xsl/#fo_conditional-page-master-reference"> * <code>fo:conditional-page-master-reference</code></a> 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} * <br>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 <code>page-position</code> 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 { * <br>XSL 1.0: (color-profile)+ (and non-XSL NS nodes) * <br>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} * <br>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} * <br>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; * <code>fo:page-sequence</code></a> 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 <code>master-reference</code> 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 <code>country</code> 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 <code>language</code> 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 { * <br>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} * <br>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) * <br>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} * <br>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} * <br>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 { * <br>XSL 1.0 Spec: (layout-master-set,declarations?,page-sequence+) * <br>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} * <br>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} * <br>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} * <br>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) * <br>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 <a href="http://www.w3.org/TR/xsl/#fo_bookmark"> - * <code>fo:bookmark</code></a> object, first introduced in the + * <code>fo:bookmark</code></a> 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} * <br>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} * <br>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} * <br>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")) { |