diff options
Diffstat (limited to 'src/java/org')
20 files changed, 36 insertions, 75 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 29299be67..e31c2bdc2 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -98,7 +98,7 @@ abstract public class PropertyList { /* Handle request for one part of a compound property */ Property p = getExplicit(propId); if (p == null) { - p = getShorthand(propId & Constants.PROPERTY_MASK); + p = getShorthand(propId); } return p; } diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index 2650937cf..eb0613a60 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -40,7 +40,6 @@ import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.fo.properties.PercentLength; -import org.apache.fop.fonts.Font; import org.apache.fop.layoutmgr.LeaderLayoutManager; /** @@ -155,10 +154,6 @@ public class Leader extends FObjMixed { return length; } - public Font getFontState() { - return commonFont.getFontState(getFOEventHandler().getFontInfo()); - } - /** * Return the Common Font Properties. */ diff --git a/src/java/org/apache/fop/fo/flow/PageNumber.java b/src/java/org/apache/fop/fo/flow/PageNumber.java index 7b9d86bb5..9e81694b9 100644 --- a/src/java/org/apache/fop/fo/flow/PageNumber.java +++ b/src/java/org/apache/fop/fo/flow/PageNumber.java @@ -38,7 +38,6 @@ import org.apache.fop.fo.properties.CommonMarginInline; import org.apache.fop.fo.properties.CommonRelativePosition; import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.fo.properties.SpaceProperty; -import org.apache.fop.fonts.Font; import org.apache.fop.layoutmgr.PageNumberLayoutManager; /** @@ -134,14 +133,6 @@ public class PageNumber extends FObj { } /** - * @return the FontState object for this PageNumber - */ - public Font getFontState() { - return commonFont.getFontState(getFOEventHandler().getFontInfo()); - - } - - /** * Return the Common Font Properties. */ public CommonFont getCommonFont() { diff --git a/src/java/org/apache/fop/fo/pagination/ColorProfile.java b/src/java/org/apache/fop/fo/pagination/ColorProfile.java index 3ada5b3b4..fc62907ba 100644 --- a/src/java/org/apache/fop/fo/pagination/ColorProfile.java +++ b/src/java/org/apache/fop/fo/pagination/ColorProfile.java @@ -46,8 +46,6 @@ public class ColorProfile extends FObj { private int renderingIntent; // End of property values - private int intent; - private String profileName; private ICC_ColorSpace colorSpace = null; /** @@ -76,10 +74,10 @@ public class ColorProfile extends FObj { } /** - * @return the name of this color profile. + * Return the "color-profile-name" property. */ - public String getProfileName() { - return profileName; + public String getColorProfileName() { + return colorProfileName; } /** diff --git a/src/java/org/apache/fop/fo/pagination/Declarations.java b/src/java/org/apache/fop/fo/pagination/Declarations.java index e859e5053..2556270bb 100644 --- a/src/java/org/apache/fop/fo/pagination/Declarations.java +++ b/src/java/org/apache/fop/fo/pagination/Declarations.java @@ -85,16 +85,16 @@ public class Declarations extends FObj { FONode node = (FONode)iter.next(); if (node.getName().equals("fo:color-profile")) { ColorProfile cp = (ColorProfile)node; - if (!"".equals(cp.getProfileName())) { + if (!"".equals(cp.getColorProfileName())) { if (colorProfiles == null) { colorProfiles = new java.util.HashMap(); } - if (colorProfiles.get(cp.getProfileName()) != null) { + if (colorProfiles.get(cp.getColorProfileName()) != null) { // duplicate names getLogger().warn("Duplicate fo:color-profile profile name : " - + cp.getProfileName()); + + cp.getColorProfileName()); } - colorProfiles.put(cp.getProfileName(), cp); + colorProfiles.put(cp.getColorProfileName(), cp); } else { getLogger().warn("color-profile-name required for color profile"); } diff --git a/src/java/org/apache/fop/fo/pagination/Region.java b/src/java/org/apache/fop/fo/pagination/Region.java index d68961441..35da2f03b 100644 --- a/src/java/org/apache/fop/fo/pagination/Region.java +++ b/src/java/org/apache/fop/fo/pagination/Region.java @@ -69,12 +69,9 @@ public abstract class Region extends FObj { writingMode = pList.getWritingMode(); // regions may have name, or default - if (null == regionName) { - setRegionName(getDefaultRegionName()); - } else if (regionName.equals("")) { - setRegionName(getDefaultRegionName()); + if (regionName.equals("")) { + regionName = getDefaultRegionName(); } else { - setRegionName(regionName); // check that name is OK. Not very pretty. if (isReserved(getRegionName()) && !getRegionName().equals(getDefaultRegionName())) { @@ -103,14 +100,6 @@ public abstract class Region extends FObj { */ protected abstract String getDefaultRegionName(); - /** - * Sets the name of the region. - * @param name the name - */ - private void setRegionName(String name) { - this.regionName = name; - } - /** * Checks to see if a given region name is one of the reserved names * @@ -154,7 +143,7 @@ public abstract class Region extends FObj { * Return the "region-name" property. */ public String getRegionName() { - return this.regionName; + return regionName; } /** diff --git a/src/java/org/apache/fop/fo/pagination/RegionAfter.java b/src/java/org/apache/fop/fo/pagination/RegionAfter.java index 2b47a24f5..6fb6ca623 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionAfter.java +++ b/src/java/org/apache/fop/fo/pagination/RegionAfter.java @@ -43,13 +43,13 @@ public class RegionAfter extends RegionBA { public Rectangle getViewportRectangle (FODimension reldims) { // Depends on extent, precedence ans writing mode Rectangle vpRect; - if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), reldims.ipd, getExtent().getValue()); } else { vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), getExtent().getValue(), reldims.ipd); } if (getPrecedence() == FALSE) { - adjustIPD(vpRect, this.getWritingMode()); + adjustIPD(vpRect, getWritingMode()); } return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionBefore.java b/src/java/org/apache/fop/fo/pagination/RegionBefore.java index c00a40ce0..72de90461 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBefore.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBefore.java @@ -54,13 +54,13 @@ public class RegionBefore extends RegionBA { // Before is always 0, start depends on extent // ipd depends on precedence, bpd=extent Rectangle vpRect; - if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue()); } else { vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.ipd); } if (getPrecedence() == FALSE) { - adjustIPD(vpRect, this.getWritingMode()); + adjustIPD(vpRect, getWritingMode()); } return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionBody.java b/src/java/org/apache/fop/fo/pagination/RegionBody.java index 483c28b0c..3ed0adeb9 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionBody.java +++ b/src/java/org/apache/fop/fo/pagination/RegionBody.java @@ -25,7 +25,6 @@ import java.awt.Rectangle; import org.xml.sax.SAXParseException; // FOP -import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.FODimension; import org.apache.fop.datatypes.Length; import org.apache.fop.datatypes.Numeric; @@ -43,8 +42,6 @@ public class RegionBody extends Region { private Length columnGap; // End of property values - private ColorType backgroundColor; - /** * @see org.apache.fop.fo.FONode#FONode(FONode) */ diff --git a/src/java/org/apache/fop/fo/pagination/RegionEnd.java b/src/java/org/apache/fop/fo/pagination/RegionEnd.java index 0940719bf..4e1e10b3d 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionEnd.java +++ b/src/java/org/apache/fop/fo/pagination/RegionEnd.java @@ -42,7 +42,7 @@ public class RegionEnd extends RegionSE { public Rectangle getViewportRectangle (FODimension reldims) { // Depends on extent, precedence and writing mode Rectangle vpRect; - if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { // Rectangle: x , y (of top left point), width, height vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0, getExtent().getValue(), reldims.bpd); @@ -51,7 +51,7 @@ public class RegionEnd extends RegionSE { vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0, reldims.bpd, getExtent().getValue()); } - adjustIPD(vpRect, this.getWritingMode()); + adjustIPD(vpRect, getWritingMode()); return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RegionStart.java b/src/java/org/apache/fop/fo/pagination/RegionStart.java index ad72e2737..2b97cb7fe 100644 --- a/src/java/org/apache/fop/fo/pagination/RegionStart.java +++ b/src/java/org/apache/fop/fo/pagination/RegionStart.java @@ -44,12 +44,12 @@ public class RegionStart extends RegionSE { // This is the rectangle relative to the page-reference area in // writing-mode relative coordinates Rectangle vpRect; - if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) { + if (getWritingMode() == WritingMode.LR_TB || getWritingMode() == WritingMode.RL_TB) { vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.bpd); } else { vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue()); } - adjustIPD(vpRect, this.getWritingMode()); + adjustIPD(vpRect, getWritingMode()); return vpRect; } diff --git a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java index 541cf8330..654bd733d 100644 --- a/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java +++ b/src/java/org/apache/fop/fo/pagination/RepeatablePageMasterAlternatives.java @@ -45,11 +45,6 @@ public class RepeatablePageMasterAlternatives extends FObj private static final int INFINITE = -1; - /** - * Max times this page master can be repeated. - * INFINITE is used for the unbounded case - */ - private int _maximumRepeats; private int numberConsumed = 0; private ArrayList conditionalPageMasterRefs; @@ -130,8 +125,8 @@ public class RepeatablePageMasterAlternatives extends FObj public String getNextPageMasterName(boolean isOddPage, boolean isFirstPage, boolean isBlankPage) { - if (_maximumRepeats != INFINITE) { - if (numberConsumed < _maximumRepeats) { + if (getMaximumRepeats() != INFINITE) { + if (numberConsumed < getMaximumRepeats()) { numberConsumed++; } else { return null; diff --git a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java index 6bc38585f..96dcbe5e4 100644 --- a/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CorrespondingPropertyMaker.java @@ -29,7 +29,7 @@ public class CorrespondingPropertyMaker { protected int lr_tb; protected int rl_tb; protected int tb_rl; - private boolean useParent; + protected boolean useParent; private boolean relative; public CorrespondingPropertyMaker(PropertyMaker baseMaker) { diff --git a/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java b/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java index a91b82257..0f98bda2e 100644 --- a/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/BasicLinkLayoutManager.java @@ -28,9 +28,7 @@ import org.apache.fop.area.PageViewport; * LayoutManager for the fo:basic-link formatting object */ public class BasicLinkLayoutManager extends InlineStackingLayoutManager { - - private String externalLink; - private String internalLink; + private BasicLink fobj; /** * Create an fo:basic-link layout manager. @@ -39,8 +37,6 @@ public class BasicLinkLayoutManager extends InlineStackingLayoutManager { */ public BasicLinkLayoutManager(BasicLink node) { super(node); - externalLink = node.getExternalDestination(); - internalLink = node.getInternalDestination(); } protected InlineParent createArea() { @@ -51,10 +47,10 @@ public class BasicLinkLayoutManager extends InlineStackingLayoutManager { private void setupBasicLinkArea(LayoutManager parentLM, InlineParent area) { - if (externalLink != null) { - area.addTrait(Trait.EXTERNAL_LINK, externalLink); + if (fobj.getExternalDestination() != null) { + area.addTrait(Trait.EXTERNAL_LINK, fobj.getExternalDestination()); } else { - String link = internalLink; + String link = fobj.getInternalDestination(); PageViewport page = parentLM.resolveRefID(link); if (page != null) { area.addTrait(Trait.INTERNAL_LINK, page.getKey()); diff --git a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java index 15ee8b873..f3f261694 100644 --- a/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java @@ -18,8 +18,8 @@ package org.apache.fop.layoutmgr; -import org.apache.fop.fo.FObj; import org.apache.fop.fo.flow.Marker; +import org.apache.fop.fo.pagination.Flow; import org.apache.fop.area.Area; import org.apache.fop.area.BlockParent; @@ -34,7 +34,8 @@ import org.apache.fop.traits.MinOptMax; * and filling them with block-level areas generated by its children. */ public class FlowLayoutManager extends BlockStackingLayoutManager { - + private Flow fobj; + /** List of break possibilities */ protected List blockBreaks = new ArrayList(); @@ -47,8 +48,9 @@ public class FlowLayoutManager extends BlockStackingLayoutManager { * This is the top level layout manager. * It is created by the PageSequence FO. */ - public FlowLayoutManager(FObj node) { + public FlowLayoutManager(Flow node) { super(node); + fobj = node; } /** diff --git a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java index 7bf1f1263..fb2b6f1b0 100644 --- a/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java @@ -116,7 +116,7 @@ public class InlineStackingLayoutManager extends AbstractLayoutManager { return true; } - private MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) { + protected MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) { return new MinOptMax(0); } diff --git a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java index 554c8877a..f7bc3f393 100644 --- a/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java @@ -47,7 +47,7 @@ public class LeaderLayoutManager extends LeafNodeLayoutManager { public LeaderLayoutManager(Leader node) { super(node); fobj = node; - font = node.getFontState(); + font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo()); setAlignment(node.getLeaderAlignment()); } diff --git a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java index 7e10e14d2..21484b63f 100644 --- a/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java @@ -21,7 +21,6 @@ package org.apache.fop.layoutmgr; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.Constants; import org.apache.fop.fo.flow.Block; -import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.CommonHyphenation; import org.apache.fop.hyphenation.Hyphenation; import org.apache.fop.hyphenation.Hyphenator; @@ -54,7 +53,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager { * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */ protected void initProperties() { - CommonMarginBlock marginProps = fobj.getCommonMarginBlock(); bTextAlignment = fobj.getTextAlign(); bTextAlignmentLast = fobj.getTextAlignLast(); textIndent = fobj.getTextIndent(); diff --git a/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java b/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java index 272d44cb4..4beebb169 100644 --- a/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java @@ -40,7 +40,7 @@ public class PageNumberLayoutManager extends LeafNodeLayoutManager { public PageNumberLayoutManager(PageNumber node) { super(node); fobj = node; - font = node.getFontState(); + font = fobj.getCommonFont().getFontState(fobj.getFOEventHandler().getFontInfo()); } public InlineArea get(LayoutContext context) { diff --git a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java index 352c72d23..38054c235 100644 --- a/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java @@ -21,7 +21,7 @@ package org.apache.fop.layoutmgr; import org.apache.fop.area.RegionReference; import org.apache.fop.area.Area; import org.apache.fop.area.Block; -import org.apache.fop.fo.pagination.Flow; +import org.apache.fop.fo.pagination.StaticContent; import java.util.ArrayList; import java.util.List; @@ -38,7 +38,7 @@ public class StaticContentLayoutManager extends BlockStackingLayoutManager { private RegionReference region; private List blockBreaks = new ArrayList(); - public StaticContentLayoutManager(Flow node) { + public StaticContentLayoutManager(StaticContent node) { super(node); } |