diff options
Diffstat (limited to 'src')
7 files changed, 173 insertions, 186 deletions
diff --git a/src/java/org/apache/fop/area/CTM.java b/src/java/org/apache/fop/area/CTM.java index a4eab7c2e..230f2680b 100644 --- a/src/java/org/apache/fop/area/CTM.java +++ b/src/java/org/apache/fop/area/CTM.java @@ -137,13 +137,13 @@ public class CTM implements Serializable { * @return CTM The result of multiplying premult * this. */ public CTM multiply(CTM premult) { - CTM rslt = new CTM ((premult.a * a) + (premult.b * c), - (premult.a * b) + (premult.b * d), - (premult.c * a) + (premult.d * c), - (premult.c * b) + (premult.d * d), - (premult.e * a) + (premult.f * c) + e, - (premult.e * b) + (premult.f * d) + f); - return rslt; + CTM result = new CTM ((premult.a * a) + (premult.b * c), + (premult.a * b) + (premult.b * d), + (premult.c * a) + (premult.d * c), + (premult.c * b) + (premult.d * d), + (premult.e * a) + (premult.f * c) + e, + (premult.e * b) + (premult.f * d) + f); + return result; } /** diff --git a/src/java/org/apache/fop/fo/PropertyList.java b/src/java/org/apache/fop/fo/PropertyList.java index 09545055a..cdd4a5522 100644 --- a/src/java/org/apache/fop/fo/PropertyList.java +++ b/src/java/org/apache/fop/fo/PropertyList.java @@ -205,18 +205,18 @@ abstract public class PropertyList { */ public void setWritingMode() throws PropertyException { FObj p = fobj.findNearestAncestorFObj(); - // If this is a RA or the root, use the property value. + // If this is a reference area or the root, use the property value. if (fobj.generatesReferenceAreas() || p == null) { writingMode = get(Constants.PR_WRITING_MODE).getEnum(); } else { - // Otherwise steal the wm value from the parent. + // Otherwise get the writing mode value from the parent. writingMode = getParentPropertyList().getWritingMode(); } } /** * Return the "writing-mode" property value. - * @return The "writing-mode" property value. + * @return the "writing-mode" property value. */ public int getWritingMode() { return writingMode; @@ -308,12 +308,12 @@ abstract public class PropertyList { } else { // e.g. "leader-length.maximum" Property baseProperty = findBaseProperty(attributes, parentFO, propId, basePropertyName, propertyMaker); - int subpropId = FOPropertyMapping.getSubPropertyId(subPropertyName); - if (subpropId == -1) { + int subpropertyId = FOPropertyMapping.getSubPropertyId(subPropertyName); + if (subpropertyId == -1) { handleInvalidProperty(attributeName); return; } - prop = propertyMaker.make(baseProperty, subpropId, + prop = propertyMaker.make(baseProperty, subpropertyId, this, attributeValue, parentFO); } if (prop != null) { @@ -328,7 +328,7 @@ abstract public class PropertyList { private Property findBaseProperty(Attributes attributes, FObj parentFO, int propId, - String basePropName, + String basePropertyName, PropertyMaker propertyMaker) throws PropertyException { @@ -345,7 +345,7 @@ abstract public class PropertyList { /* Otherwise If it is specified later in this list of Attributes, create it now * e.g. <fo:leader xxxx.maximum="200pt" xxxx="200pt"... /> */ - String basePropertyValue = attributes.getValue(basePropName); + String basePropertyValue = attributes.getValue(basePropertyName); if (basePropertyValue != null && propertyMaker != null) { baseProperty = propertyMaker.make(this, basePropertyValue, @@ -370,12 +370,12 @@ abstract public class PropertyList { * @return the base portion of the attribute */ private static String findBasePropertyName(String attributeName) { - int sepCharIndex = attributeName.indexOf('.'); - String basePropName = attributeName; - if (sepCharIndex > -1) { - basePropName = attributeName.substring(0, sepCharIndex); + int separatorCharIndex = attributeName.indexOf('.'); + String basePropertyName = attributeName; + if (separatorCharIndex > -1) { + basePropertyName = attributeName.substring(0, separatorCharIndex); } - return basePropName; + return basePropertyName; } /** @@ -386,12 +386,12 @@ abstract public class PropertyList { * @return the sub portion of the attribute */ private static String findSubPropertyName(String attributeName) { - int sepCharIndex = attributeName.indexOf('.'); - String subPropName = null; - if (sepCharIndex > -1) { - subPropName = attributeName.substring(sepCharIndex + 1); + int separatorCharIndex = attributeName.indexOf('.'); + String subpropertyName = null; + if (separatorCharIndex > -1) { + subpropertyName = attributeName.substring(separatorCharIndex + 1); } - return subPropName; + return subpropertyName; } /** @@ -467,8 +467,8 @@ abstract public class PropertyList { } /** - * Constructs a HyphenationProps objects. - * @return a HyphenationProps object + * Constructs a CommonHyphenation object. + * @return the CommonHyphenation object * @throws PropertyException if there's a problem while processing the properties */ public CommonHyphenation getHyphenationProps() throws PropertyException { @@ -476,8 +476,8 @@ abstract public class PropertyList { } /** - * Constructs a MarginProps objects. - * @return a MarginProps object + * Constructs a CommonMarginBlock object. + * @return the CommonMarginBlock object * @throws PropertyException if there's a problem while processing the properties */ public CommonMarginBlock getMarginBlockProps() throws PropertyException { @@ -485,8 +485,8 @@ abstract public class PropertyList { } /** - * Constructs a MarginInlineProps objects. - * @return a MarginInlineProps object + * Constructs a CommonMarginInline object. + * @return the CommonMarginInline object * @throws PropertyException if there's a problem while processing the properties */ public CommonMarginInline getMarginInlineProps() throws PropertyException { @@ -494,8 +494,8 @@ abstract public class PropertyList { } /** - * Constructs a AccessibilityProps objects. - * @return a AccessibilityProps object + * Constructs a CommonAccessibility object. + * @return the CommonAccessibility object * @throws PropertyException if there's a problem while processing the properties */ public CommonAccessibility getAccessibilityProps() throws PropertyException { @@ -503,8 +503,8 @@ abstract public class PropertyList { } /** - * Constructs a AuralProps objects. - * @return a AuralProps object + * Constructs a CommonAural object. + * @return the CommonAural object * @throws PropertyException if there's a problem while processing the properties */ public CommonAural getAuralProps() throws PropertyException { @@ -522,8 +522,8 @@ abstract public class PropertyList { } /** - * Constructs a AbsolutePositionProps objects. - * @return a AbsolutePositionProps object + * Constructs a CommonAbsolutePosition object. + * @return the CommonAbsolutePosition object * @throws PropertyException if there's a problem while processing the properties */ public CommonAbsolutePosition getAbsolutePositionProps() throws PropertyException { diff --git a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java index 7fc2495bf..e40082af4 100644 --- a/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/CompoundPropertyMaker.java @@ -76,7 +76,7 @@ public class CompoundPropertyMaker extends PropertyMaker { public void addSubpropMaker(PropertyMaker subproperty) { // Place the base propId in the propId of the subproperty. subproperty.propId &= Constants.COMPOUND_MASK; - subproperty.propId |= this.propId; + subproperty.propId |= propId; subproperties[getSubpropIndex(subproperty.getPropId())] = subproperty; @@ -93,13 +93,13 @@ public class CompoundPropertyMaker extends PropertyMaker { * of compound property types, such as "space". * Overridden by property maker subclasses which handle * compound properties. - * @param subpropId the id of the component for which a Maker is to + * @param subpropertyId the id of the component for which a Maker is to * returned, for example CP_OPTIMUM, if the FO attribute is * space.optimum='10pt'. * @return the Maker object specified */ - public PropertyMaker getSubpropMaker(int subpropId) { - return subproperties[getSubpropIndex(subpropId)]; + public PropertyMaker getSubpropMaker(int subpropertyId) { + return subproperties[getSubpropIndex(subpropertyId)]; } /** @@ -109,8 +109,8 @@ public class CompoundPropertyMaker extends PropertyMaker { * @param propId the property id of the sub property. * @return the array index. */ - private int getSubpropIndex(int subpropId) { - return ((subpropId & Constants.COMPOUND_MASK) >> + private int getSubpropIndex(int subpropertyId) { + return ((subpropertyId & Constants.COMPOUND_MASK) >> Constants.COMPOUND_SHIFT)-1; } @@ -137,19 +137,19 @@ public class CompoundPropertyMaker extends PropertyMaker { * this will try to compute it based on other properties, or if it is * inheritable, to return the inherited value. If all else fails, it returns * the default value. - * @param subpropId The subproperty id of the property being retrieved. + * @param subpropertyId The subproperty id of the property being retrieved. * Is 0 when retriving a base property. * @param propertyList The PropertyList object being built for this FO. - * @param bTryInherit true if inherited properties should be examined. - * @param bTryDefault true if the default value should be returned. + * @param tryInherit true if inherited properties should be examined. + * @param tryDefault true if the default value should be returned. */ - public Property get(int subpropId, PropertyList propertyList, - boolean bTryInherit, boolean bTryDefault) + public Property get(int subpropertyId, PropertyList propertyList, + boolean tryInherit, boolean tryDefault) throws PropertyException { - Property p = super.get(subpropId, propertyList, bTryInherit, bTryDefault); - if (subpropId != 0 && p != null) { - p = getSubprop(p, subpropId); + Property p = super.get(subpropertyId, propertyList, tryInherit, tryDefault); + if (subpropertyId != 0 && p != null) { + p = getSubprop(p, subpropertyId); } return p; } @@ -168,7 +168,7 @@ public class CompoundPropertyMaker extends PropertyMaker { protected Property convertProperty(Property p, PropertyList propertyList, FObj fo) throws PropertyException { - // delegate to the subprop maker to do conversions + // Delegate to the subproperty maker to do conversions. p = shorthandMaker.convertProperty(p, propertyList, fo); if (p != null) { @@ -217,36 +217,36 @@ public class CompoundPropertyMaker extends PropertyMaker { /** * Return a property value for a compound property. If the property * value is already partially initialized, this method will modify it. - * @param baseProp The Property object representing the compound property, + * @param baseProperty The Property object representing the compound property, * for example: SpaceProperty. - * @param subpropId The Constants ID of the subproperty (component) + * @param subpropertyId The Constants ID of the subproperty (component) * whose value is specified. * @param propertyList The propertyList being built. * @param fo The parent FO for the FO whose property is being made. * @param value the value of the - * @return baseProp (or if null, a new compound property object) with + * @return baseProperty (or if null, a new compound property object) with * the new subproperty added * @throws PropertyException for invalid or inconsistent FO input */ - public Property make(Property baseProp, int subpropId, + public Property make(Property baseProperty, int subpropertyId, PropertyList propertyList, String value, FObj fo) throws PropertyException { - if (baseProp == null) { - baseProp = makeCompound(propertyList, fo); + if (baseProperty == null) { + baseProperty = makeCompound(propertyList, fo); } - PropertyMaker spMaker = getSubpropMaker(subpropId); + PropertyMaker spMaker = getSubpropMaker(subpropertyId); if (spMaker != null) { Property p = spMaker.make(propertyList, value, fo); if (p != null) { - return setSubprop(baseProp, subpropId & Constants.COMPOUND_MASK, p); + return setSubprop(baseProperty, subpropertyId & Constants.COMPOUND_MASK, p); } } else { //getLogger().error("compound property component " // + partName + " unknown."); } - return baseProp; + return baseProperty; } /** @@ -264,10 +264,10 @@ public class CompoundPropertyMaker extends PropertyMaker { Property p = makeNewProperty(); CompoundDatatype data = (CompoundDatatype) p.getObject(); for (int i = 0; i < Constants.COMPOUND_COUNT; i++) { - PropertyMaker submaker = subproperties[i]; - if (submaker != null) { - Property subprop = submaker.make(propertyList); - data.setComponent(submaker.getPropId() & Constants.COMPOUND_MASK, subprop, true); + PropertyMaker subpropertyMaker = subproperties[i]; + if (subpropertyMaker != null) { + Property subproperty = subpropertyMaker.make(propertyList); + data.setComponent(subpropertyMaker.getPropId() & Constants.COMPOUND_MASK, subproperty, true); } } return p; diff --git a/src/java/org/apache/fop/fo/properties/PropertyMaker.java b/src/java/org/apache/fop/fo/properties/PropertyMaker.java index a719d5881..be944163f 100644 --- a/src/java/org/apache/fop/fo/properties/PropertyMaker.java +++ b/src/java/org/apache/fop/fo/properties/PropertyMaker.java @@ -134,11 +134,11 @@ public class PropertyMaker implements Cloneable { } /** - * Return a subproperty maker for the subpropId. - * @param subpropId The subpropId 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 subpropId) { + public PropertyMaker getSubpropMaker(int subpropertyId) { throw new RuntimeException("Unable to add subproperties"); } @@ -234,7 +234,7 @@ public class PropertyMaker implements Cloneable { * happens in computeProperty. */ public Property findProperty(PropertyList propertyList, - boolean bTryInherit) + boolean tryInherit) throws PropertyException { Property p = null; @@ -256,7 +256,7 @@ public class PropertyMaker implements Cloneable { p = getShorthand(propertyList); } } - if (p == null && bTryInherit) { + if (p == null && tryInherit) { // else inherit (if has parent and is inheritable) PropertyList parentPropertyList = propertyList.getParentPropertyList(); if (parentPropertyList != null && isInherited()) { @@ -271,19 +271,19 @@ public class PropertyMaker implements Cloneable { * this will try to compute it based on other properties, or if it is * inheritable, to return the inherited value. If all else fails, it returns * the default value. - * @param subpropId The subproperty id of the property being retrieved. + * @param subpropertyId The subproperty id of the property being retrieved. * Is 0 when retriving a base property. * @param propertyList The PropertyList object being built for this FO. - * @param bTryInherit true if inherited properties should be examined. - * @param bTryDefault true if the default value should be returned. + * @param tryInherit true if inherited properties should be examined. + * @param tryDefault true if the default value should be returned. */ - public Property get(int subpropId, PropertyList propertyList, - boolean bTryInherit, boolean bTryDefault) + public Property get(int subpropertyId, PropertyList propertyList, + boolean tryInherit, boolean tryDefault) throws PropertyException { - Property p = findProperty(propertyList, bTryInherit); + Property p = findProperty(propertyList, tryInherit); - if (p == null && bTryDefault) { // default value for this FO! + if (p == null && tryDefault) { // default value for this FO! p = make(propertyList); } return p; @@ -319,7 +319,7 @@ public class PropertyMaker implements Cloneable { * property. * @param p A property value for a compound property type such as * SpaceProperty. - * @param subpropId the id of the component whose value is to be + * @param subpropertyId the id of the component whose value is to be * returned. * NOTE: this is only to ease porting when calls are made to * PropertyList.get() using a component name of a compound property, @@ -329,9 +329,9 @@ public class PropertyMaker implements Cloneable { * compound properties. * @return the Property containing the subproperty */ - public Property getSubprop(Property p, int subpropId) { + public Property getSubprop(Property p, int subpropertyId) { CompoundDatatype val = (CompoundDatatype) p.getObject(); - return val.getComponent(subpropId); + return val.getComponent(subpropertyId); } /** @@ -341,18 +341,18 @@ public class PropertyMaker implements Cloneable { * without modifying it. * It is overridden by property maker subclasses which handle * compound properties. - * @param baseProp The Property object representing the compound property, + * @param baseProperty The Property object representing the compound property, * such as SpaceProperty. - * @param partId The ID of the component whose value is specified. - * @param subProp A Property object holding the specified value of the + * @param subpropertyId The ID of the component whose value is specified. + * @param subproperty A Property object holding the specified value of the * component to be set. * @return The modified compound property object. */ - protected Property setSubprop(Property baseProp, int partId, - Property subProp) { - CompoundDatatype val = (CompoundDatatype) baseProp.getObject(); - val.setComponent(partId, subProp, false); - return baseProp; + protected Property setSubprop(Property baseProperty, int subpropertyId, + Property subproperty) { + CompoundDatatype val = (CompoundDatatype) baseProperty.getObject(); + val.setComponent(subpropertyId, subproperty, false); + return baseProperty; } /** @@ -427,23 +427,23 @@ public class PropertyMaker implements Cloneable { /** * Make a property value for a compound property. If the property * value is already partially initialized, this method will modify it. - * @param baseProp The Property object representing the compound property, + * @param baseProperty The Property object representing the compound property, * for example: SpaceProperty. - * @param subpropId The Constants ID of the subproperty (component) + * @param subpropertyId The Constants ID of the subproperty (component) * whose value is specified. * @param propertyList The propertyList being built. * @param fo The parent FO for the FO whose property is being made. * @param value the value of the - * @return baseProp (or if null, a new compound property object) with + * @return baseProperty (or if null, a new compound property object) with * the new subproperty added * @throws PropertyException for invalid or inconsistent FO input */ - public Property make(Property baseProp, int subpropId, + public Property make(Property baseProperty, int subpropertyId, PropertyList propertyList, String value, FObj fo) throws PropertyException { //getLogger().error("compound property component " // + partName + " unknown."); - return baseProp; + return baseProperty; } public Property convertShorthandProperty(PropertyList propertyList, diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index 72bab19ff..393633a29 100755 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -53,7 +53,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager private CommonMarginInline inlineProps = null; private CommonBorderPaddingBackground borderProps = null; - private boolean bAreaCreated = false; + private boolean areaCreated = false; private LayoutManager lastChildLM = null; // Set when return last breakposs; /** @@ -77,37 +77,33 @@ public class InlineLayoutManager extends InlineStackingLayoutManager inlineProps = fobj.getCommonMarginInline(); borderProps = fobj.getCommonBorderPaddingBackground(); - int iPad = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false, this); - iPad += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE, + int padding = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false, this); + padding += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE, false); - iPad += borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false, this); - iPad += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false); - extraBPD = new MinOptMax(iPad); + padding += borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false, this); + padding += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false); + extraBPD = new MinOptMax(padding); } - protected MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) { - int iBP = borderProps.getPadding(CommonBorderPaddingBackground.START, - bNotFirst, this); - iBP += borderProps.getBorderWidth(CommonBorderPaddingBackground.START, - bNotFirst); - iBP += borderProps.getPadding(CommonBorderPaddingBackground.END, bNotLast, this); - iBP += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, bNotLast); - return new MinOptMax(iBP); + protected MinOptMax getExtraIPD(boolean isNotFirst, boolean isNotLast) { + int borderAndPadding = borderProps.getPadding(CommonBorderPaddingBackground.START, + isNotFirst, this); + borderAndPadding += borderProps.getBorderWidth(CommonBorderPaddingBackground.START, + isNotFirst); + borderAndPadding += borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this); + borderAndPadding += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast); + return new MinOptMax(borderAndPadding); } - protected boolean hasLeadingFence(boolean bNotFirst) { - int iBP = borderProps.getPadding(CommonBorderPaddingBackground.START, - bNotFirst, this); - iBP += borderProps.getBorderWidth(CommonBorderPaddingBackground.START, - bNotFirst); - return (iBP > 0); + protected boolean hasLeadingFence(boolean isNotFirst) { + return borderProps.getPadding(CommonBorderPaddingBackground.START, isNotFirst, this)>0 + || borderProps.getBorderWidth(CommonBorderPaddingBackground.START, isNotFirst)>0; } - protected boolean hasTrailingFence(boolean bNotLast) { - int iBP = borderProps.getPadding(CommonBorderPaddingBackground.END, bNotLast, this); - iBP += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, bNotLast); - return (iBP > 0); + protected boolean hasTrailingFence(boolean isNotLast) { + return borderProps.getPadding(CommonBorderPaddingBackground.END, isNotLast, this)>0 + || borderProps.getBorderWidth(CommonBorderPaddingBackground.END, isNotLast)>0; } protected SpaceProperty getSpaceStart() { @@ -118,9 +114,9 @@ public class InlineLayoutManager extends InlineStackingLayoutManager } /** @see org.apache.fop.layoutmgr.inline.InlineLayoutManager#createArea(boolean) */ - protected InlineArea createArea(boolean bInlineParent) { + protected InlineArea createArea(boolean hasInlineParent) { InlineArea area; - if (bInlineParent) { + if (hasInlineParent) { area = new InlineParent(); area.setOffset(0); } else { @@ -133,11 +129,11 @@ public class InlineLayoutManager extends InlineStackingLayoutManager /** * @see org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager#setTraits(boolean, boolean) */ - protected void setTraits(boolean bNotFirst, boolean bNotLast) { + protected void setTraits(boolean isNotFirst, boolean isNotLast) { // Add border and padding to current area and set flags (FIRST, LAST ...) TraitSetter.setBorderPaddingTraits(getCurrentArea(), - borderProps, bNotFirst, bNotLast, this); + borderProps, isNotFirst, isNotLast, this); if (borderProps != null) { TraitSetter.addBorders(getCurrentArea(), borderProps, this); @@ -315,29 +311,24 @@ public class InlineLayoutManager extends InlineStackingLayoutManager setChildContext(new LayoutContext(context)); // Store current value - // If has fence, make a new leadingSS - /* How to know if first area created by this LM? Keep a count and - * reset it if getNextBreakPoss() is called again. - */ - if (hasLeadingFence(bAreaCreated)) { + // If this LM has fence, make a new leading space specifier. + if (hasLeadingFence(areaCreated)) { getContext().setLeadingSpace(new SpaceSpecifier(false)); - getContext().setFlags(LayoutContext.RESOLVE_LEADING_SPACE, - true); + getContext().setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true); } else { - getContext().setFlags(LayoutContext.RESOLVE_LEADING_SPACE, - false); + getContext().setFlags(LayoutContext.RESOLVE_LEADING_SPACE, false); } if (getSpaceStart() != null) { context.getLeadingSpace().addSpace(new SpaceVal(getSpaceStart(), this)); } - // "unwrap" the NonLeafPositions stored in parentIter - // and put them in a new list; - // also set lastLM to be the LayoutManager which created - // the last Position: if the LAST_AREA flag is set in context, - // it must be also set in the LayoutContext given to lastLM, - // but unset in the LayoutContext given to the other LMs + // "Unwrap" the NonLeafPositions stored in parentIter and put + // them in a new list. Set lastLM to be the LayoutManager + // which created the last Position: if the LAST_AREA flag is + // set in the layout context, it must be also set in the + // layout context given to lastLM, but must be cleared in the + // layout context given to the other LMs. LinkedList positionList = new LinkedList(); NonLeafPosition pos = null; LayoutManager lastLM = null; // last child LM in this iterator @@ -358,8 +349,7 @@ public class InlineLayoutManager extends InlineStackingLayoutManager LayoutManager prevLM = null; LayoutManager childLM; - while ((childLM = childPosIter.getNextChildLM()) - != null) { + while ((childLM = childPosIter.getNextChildLM()) != null) { getContext().setFlags(LayoutContext.LAST_AREA, context.isLastArea() && childLM == lastLM); childLM.addAreas(childPosIter, getContext()); @@ -368,23 +358,21 @@ public class InlineLayoutManager extends InlineStackingLayoutManager prevLM = childLM; } - /* If has trailing fence, - * resolve trailing space specs from descendants. - * Otherwise, propagate any trailing space specs to parent LM via - * the context object. - * If the last child LM called return ISLAST in the context object - * and it is the last child LM for this LM, then this must be - * the last area for the current LM also. + /* 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 + * the last child LM called returns LAST_AREA in the layout + * context and it is the last child LM for this LM, then this + * must be the last area for the current LM too. */ - boolean bIsLast = - (getContext().isLastArea() && prevLM == lastChildLM); - if (hasTrailingFence(bIsLast)) { + boolean isLast = (getContext().isLastArea() && prevLM == lastChildLM); + if (hasTrailingFence(isLast)) { addSpace(getCurrentArea(), getContext().getTrailingSpace().resolve(false), getContext().getSpaceAdjust()); context.setTrailingSpace(new SpaceSpecifier(false)); } else { - // Propagate trailing space-spec sequence to parent LM in context + // Propagate trailing space-spec sequence to parent LM in context. context.setTrailingSpace(getContext().getTrailingSpace()); } // Add own trailing space to parent context (or set on area?) @@ -393,10 +381,10 @@ public class InlineLayoutManager extends InlineStackingLayoutManager } parentLM.addChildArea(getCurrentArea()); - setTraits(bAreaCreated, !bIsLast); + setTraits(areaCreated, !isLast); - context.setFlags(LayoutContext.LAST_AREA, bIsLast); - bAreaCreated = true; + context.setFlags(LayoutContext.LAST_AREA, isLast); + areaCreated = true; } public void addChildArea(Area childArea) { diff --git a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java index 48aeeae17..a187a0745 100644 --- a/src/java/org/apache/fop/layoutmgr/table/GridUnit.java +++ b/src/java/org/apache/fop/layoutmgr/table/GridUnit.java @@ -65,7 +65,7 @@ public class GridUnit { /** index of grid unit within cell in row direction */ private int rowSpanIndex; /** effective borders for a cell slot */ - private CommonBorderPaddingBackground effBorders; + private CommonBorderPaddingBackground effectiveBorders; /** flags for the grid unit */ private byte flags = 0; @@ -87,16 +87,16 @@ public class GridUnit { } public TableCell getCell() { - return this.cell; + return cell; } public TableColumn getColumn() { - return this.column; + return column; } public TableRow getRow() { - if (this.row != null) { - return this.row; + if (row != null) { + return row; } else if (getCell().getParent() instanceof TableRow) { return (TableRow)getCell().getParent(); } else { @@ -106,10 +106,10 @@ public class GridUnit { /** * Sets the table-row FO, if applicable. - * @param rowFO the table-row FO + * @param row the table-row FO */ - public void setRow(TableRow rowFO) { - this.row = rowFO; + public void setRow(TableRow row) { + this.row = row; } public TableBody getBody() { @@ -135,7 +135,7 @@ public class GridUnit { * @return the primary grid unit if this is a spanned grid unit */ public PrimaryGridUnit getPrimary() { - return (isPrimary() ? (PrimaryGridUnit)this : this.primary); + return (isPrimary() ? (PrimaryGridUnit)this : primary); } public boolean isPrimary() { @@ -143,11 +143,11 @@ public class GridUnit { } public boolean isEmpty() { - return this.cell == null; + return cell == null; } public int getStartCol() { - return this.startCol; + return startCol; } /** @return true if the grid unit is the last in column spanning direction */ @@ -172,14 +172,14 @@ public class GridUnit { * @return the index of the grid unit inside a cell in row direction */ public int getRowSpanIndex() { - return this.rowSpanIndex; + return rowSpanIndex; } /** * @return the index of the grid unit inside a cell in column direction */ public int getColSpanIndex() { - return this.colSpanIndex; + return colSpanIndex; } /** @@ -201,7 +201,7 @@ public class GridUnit { * @return the resolved normal borders for this grid unit */ public CommonBorderPaddingBackground getBorders() { - return this.effBorders; + return effectiveBorders; } /** @@ -217,7 +217,7 @@ public class GridUnit { */ public void assignBorderForSeparateBorderModel() { if (cell != null) { - this.effBorders = cell.getCommonBorderPaddingBackground(); + effectiveBorders = cell.getCommonBorderPaddingBackground(); } } @@ -239,14 +239,13 @@ public class GridUnit { public void resolveBorder(GridUnit other, int side, int resFlags) { CollapsingBorderModel borderModel = CollapsingBorderModel.getBorderModelFor( getTable().getBorderCollapse()); - if (this.effBorders == null) { - this.effBorders = new CommonBorderPaddingBackground(); + if (effectiveBorders == null) { + effectiveBorders = new CommonBorderPaddingBackground(); } - this.effBorders.setBorderInfo( - borderModel.determineWinner(this, other, + effectiveBorders.setBorderInfo(borderModel.determineWinner(this, other, side, resFlags), side); if (cell != null) { - this.effBorders.setPadding(this.cell.getCommonBorderPaddingBackground()); + effectiveBorders.setPadding(cell.getCommonBorderPaddingBackground()); } } @@ -288,22 +287,22 @@ public class GridUnit { /** @see java.lang.Object#toString() */ public String toString() { - StringBuffer sb = new StringBuffer(); + StringBuffer buffer = new StringBuffer(); if (isEmpty()) { - sb.append("EMPTY"); + buffer.append("EMPTY"); } else if (isPrimary()) { - sb.append("Primary"); + buffer.append("Primary"); } - sb.append("GridUnit:"); + buffer.append("GridUnit:"); if (colSpanIndex > 0) { - sb.append(" colSpan=").append(colSpanIndex); + buffer.append(" colSpan=").append(colSpanIndex); } if (rowSpanIndex > 0) { - sb.append(" rowSpan=").append(rowSpanIndex); + buffer.append(" rowSpan=").append(rowSpanIndex); } - sb.append(" startCol=").append(startCol); - sb.append(" flags=").append(Integer.toBinaryString(flags)); - return sb.toString(); + buffer.append(" startCol=").append(startCol); + buffer.append(" flags=").append(Integer.toBinaryString(flags)); + return buffer.toString(); } } diff --git a/src/java/org/apache/fop/render/awt/viewer/GoToPageDialog.java b/src/java/org/apache/fop/render/awt/viewer/GoToPageDialog.java index d3db6979b..809168561 100644 --- a/src/java/org/apache/fop/render/awt/viewer/GoToPageDialog.java +++ b/src/java/org/apache/fop/render/awt/viewer/GoToPageDialog.java @@ -42,7 +42,7 @@ import java.awt.event.ActionListener; */ public class GoToPageDialog extends JDialog { - private JTextField pgNbField; + private JTextField pageNumberField; private int pageNumber = -1; /** @@ -61,7 +61,7 @@ public class GoToPageDialog extends JDialog { JPanel panel1 = new JPanel(); GridBagLayout gridBagLayout1 = new GridBagLayout(); JLabel pgNbLabel = new JLabel(); - pgNbField = new JTextField(); + pageNumberField = new JTextField(); JButton okButton = new JButton(); JButton cancelButton = new JButton(); panel1.setLayout(gridBagLayout1); @@ -85,7 +85,7 @@ public class GoToPageDialog extends JDialog { GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 10, 10, 5), 0, 0)); - panel1.add(pgNbField, + panel1.add(pageNumberField, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.BOTH, @@ -104,10 +104,10 @@ public class GoToPageDialog extends JDialog { private void okButtonActionPerformed(ActionEvent e) { try { - pageNumber = Integer.parseInt(pgNbField.getText()); + pageNumber = Integer.parseInt(pageNumberField.getText()); dispose(); } catch (NumberFormatException nfe) { - pgNbField.setText("???"); + pageNumberField.setText("???"); } } |