diff options
author | Finn Bock <bckfnn@apache.org> | 2004-10-19 08:53:51 +0000 |
---|---|---|
committer | Finn Bock <bckfnn@apache.org> | 2004-10-19 08:53:51 +0000 |
commit | b0839fa1f93f128c6dd271930209e59228bb0472 (patch) | |
tree | f3ed77c6f9d3f58314beb64e7557eaf117f2d6aa /src/java/org/apache/fop/fo/flow | |
parent | 85506764aad78e6aa4b675838aaed1f6fd23883a (diff) | |
download | xmlgraphics-fop-b0839fa1f93f128c6dd271930209e59228bb0472.tar.gz xmlgraphics-fop-b0839fa1f93f128c6dd271930209e59228bb0472.zip |
First phase of performance improvement. Added bind() and startOfNode()
methods to the FO nodes, unused for now.
PR: 31699
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198054 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow')
35 files changed, 2732 insertions, 253 deletions
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java index 101d0ccfa..3b9424b99 100644 --- a/src/java/org/apache/fop/fo/flow/BasicLink.java +++ b/src/java/org/apache/fop/fo/flow/BasicLink.java @@ -28,6 +28,7 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; import org.apache.fop.layoutmgr.BasicLinkLayoutManager; /** @@ -38,6 +39,17 @@ import org.apache.fop.layoutmgr.BasicLinkLayoutManager; * reference). */ public class BasicLink extends Inline { + // The value of properties relevant for fo:basic-link. + // private ToBeImplementedProperty destinationPlacementOffset; + // private ToBeImplementedProperty dominantBaseline; + private String externalDestination; + // private ToBeImplementedProperty indicateDestination; + private String internalDestination; + // private ToBeImplementedProperty showDestination; + // private ToBeImplementedProperty targetProcessingContext; + // private ToBeImplementedProperty targetPresentationContext; + // private ToBeImplementedProperty targetStylesheet; + // End of property values // link represented by this FO private String link = null; @@ -56,6 +68,47 @@ public class BasicLink extends Inline { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) throws SAXParseException { + super.bind(pList); + // destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString(); + // indicateDestination = pList.get(PR_INDICATE_DESTINATION); + internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString(); + // showDestination = pList.get(PR_SHOW_DESTINATION); + // targetProcessingContext = pList.get(PR_TARGET_PROCESSING_CONTEXT); + // targetPresentationContext = pList.get(PR_TARGET_PRESENTATION_CONTEXT); + // targetStylesheet = pList.get(PR_TARGET_STYLESHEET); + + // per spec, internal takes precedence if both specified + if (internalDestination.length() > 0) { + externalDestination = null; + } else if (externalDestination.length() == 0) { + // slightly stronger than spec "should be specified" + attributeError("Missing attribute: Either external-destination or " + + "internal-destination must be specified."); + } + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + super.startOfNode(); + getFOEventHandler().startLink(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + super.endOfNode(); + getFOEventHandler().endLink(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -98,14 +151,6 @@ public class BasicLink extends Inline { } /** - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - super.endOfNode(); - getFOEventHandler().endLink(); - } - - /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { @@ -128,6 +173,20 @@ public class BasicLink extends Inline { } /** + * Return the "internal-destination" property. + */ + public String getInternalDestination() { + return internalDestination; + } + + /** + * Return the "external-destination" property. + */ + public String getExternalDestination() { + return externalDestination; + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/BidiOverride.java b/src/java/org/apache/fop/fo/flow/BidiOverride.java index 73f8118e7..6d15a8ebc 100644 --- a/src/java/org/apache/fop/fo/flow/BidiOverride.java +++ b/src/java/org/apache/fop/fo/flow/BidiOverride.java @@ -28,8 +28,15 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.ColorTypeProperty; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonFont; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.layoutmgr.BidiLayoutManager; import org.apache.fop.layoutmgr.InlineStackingLayoutManager; import org.apache.fop.layoutmgr.LayoutManager; @@ -43,6 +50,19 @@ public class BidiOverride extends FObjMixed { private boolean blockOrInlineItemFound = false; private boolean canHaveBlockLevelChildren = true; + // The value of properties relevant for fo:bidi-override. + private CommonAural commonAural; + private CommonFont commonFont; + private CommonRelativePosition commonRelativePosition; + private ColorTypeProperty prColor; + // private ToBeImplementedProperty prDirection; + // private ToBeImplementedProperty prLetterSpacing; + private Length prLineHeight; + // private ToBeImplementedProperty prScoreSpaces; + // private ToBeImplementedProperty prUnicodeBidi; + private SpaceProperty prWordSpacing; + // End of property values + /** * @param parent FONode that is the parent of this object */ @@ -72,6 +92,22 @@ public class BidiOverride extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAural = pList.getAuralProps(); + commonFont = pList.getFontProps(); + commonRelativePosition = pList.getRelativePositionProps(); + prColor = pList.get(PR_COLOR).getColorType(); + // prDirection = pList.get(PR_DIRECTION); + // prLetterSpacing = pList.get(PR_LETTER_SPACING); + prLineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + // prScoreSpaces = pList.get(PR_SCORE_SPACES); + // prUnicodeBidi = pList.get(PR_UNICODE_BIDI); + prWordSpacing = pList.get(PR_WORD_SPACING).getSpace(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties * @todo see if can use a BitSet to determine if an FO should * have its ID setup; then move setupID() instances to FObj. diff --git a/src/java/org/apache/fop/fo/flow/Block.java b/src/java/org/apache/fop/fo/flow/Block.java index c328e7758..9ae7963ea 100644 --- a/src/java/org/apache/fop/fo/flow/Block.java +++ b/src/java/org/apache/fop/fo/flow/Block.java @@ -28,12 +28,24 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.CharIterator; -import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; +import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; import org.apache.fop.fo.PropertySets; import org.apache.fop.fo.RecursiveCharIterator; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +import org.apache.fop.fo.properties.CommonHyphenation; +import org.apache.fop.fo.properties.CommonMarginBlock; +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.layoutmgr.BlockLayoutManager; import org.apache.fop.fo.Constants; import org.apache.fop.util.CharUtilities; @@ -61,22 +73,56 @@ public class Block extends FObjMixed { private boolean blockOrInlineItemFound = false; private boolean initialPropertySetFound = false; + // The value of properties relevant for fo:block. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonHyphenation commonHyphenation; + private CommonMarginBlock commonMarginBlock; + private CommonRelativePosition commonRelativePosition; + private int breakAfter; + private int breakBefore; + private ColorType color; + // private ToBeImplementedProperty textDepth; + // private ToBeImplementedProperty textAltitude; + // private ToBeImplementedProperty hyphenationKeep; + // private ToBeImplementedProperty hyphenationLadderCount; + private String id; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + // private ToBeImplementedProperty lastLineEndIndent; + private int linefeedTreatment; + private SpaceProperty lineHeight; + // private ToBeImplementedProperty lineHeightShiftAdjustment; + // private ToBeImplementedProperty lineStackingStrategy; + private Numeric orphans; + private int whiteSpaceTreatment; + private int span; + private int textAlign; + private int textAlignLast; + private Length textIndent; + // private ToBeImplementedProperty visibility; + private int whiteSpaceCollapse; + private Numeric widows; + private int wrapOption; + // End of property values + private int align; private int alignLast; - private int breakAfter; - private int lineHeight; + private int _lineHeight; private int startIndent; private int endIndent; private int spaceBefore; private int spaceAfter; - private int textIndent; - private int keepWithNext; + private int _textIndent; + private int _keepWithNext; private ColorType backgroundColor; private int blockWidows; private int blockOrphans; - private String id; - private int span; private int wsTreatment; //ENUMERATION private int lfTreatment; //ENUMERATION private boolean bWScollapse; //true if white-space-collapse=true @@ -99,6 +145,154 @@ public class Block extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) throws SAXParseException { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonHyphenation = pList.getHyphenationProps(); + commonMarginBlock = pList.getMarginBlockProps(); + commonRelativePosition = pList.getRelativePositionProps(); + + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + color = pList.get(PR_COLOR).getColorType(); + // textDepth = pList.get(PR_TEXT_DEPTH); + // textAltitude = pList.get(PR_TEXT_ALTITUDE); + // hyphenationKeep = pList.get(PR_HYPHENATION_KEEP); + // hyphenationLadderCount = pList.get(PR_HYPHENATION_LADDER_COUNT); + id = pList.get(PR_ID).getString(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + // lastLineEndIndent = pList.get(PR_LAST_LINE_END_INDENT); + linefeedTreatment = pList.get(PR_LINEFEED_TREATMENT).getEnum(); + lineHeight = pList.get(PR_LINE_HEIGHT).getSpace(); + // lineHeightShiftAdjustment = pList.get(PR_LINE_HEIGHT_SHIFT_ADJUSTMENT); + // lineStackingStrategy = pList.get(PR_LINE_STACKING_STRATEGY); + orphans = pList.get(PR_ORPHANS).getNumeric(); + whiteSpaceTreatment = pList.get(PR_WHITE_SPACE_TREATMENT).getEnum(); + span = pList.get(PR_SPAN).getEnum(); + textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); + textAlignLast = pList.get(PR_TEXT_ALIGN_LAST).getEnum(); + textIndent = pList.get(PR_TEXT_INDENT).getLength(); + // visibility = pList.get(PR_VISIBILITY); + whiteSpaceCollapse = pList.get(PR_WHITE_SPACE_COLLAPSE).getEnum(); + widows = pList.get(PR_WIDOWS).getNumeric(); + wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startBlock(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + handleWhiteSpace(); + getFOEventHandler().endBlock(this); + } + + /** + * Return the Common Margin Properties-Block. + */ + public CommonMarginBlock getCommonMarginBlock() { + return commonMarginBlock; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the Common Hyphenation Properties. + */ + public CommonHyphenation getCommonHyphenation() { + return commonHyphenation; + } + + /** + * Return the "break-after" property. + */ + public int getBreakAfter() { + return breakAfter; + } + + /** + * Return the "break-before" property. + */ + public int getBreakBefore() { + return breakBefore; + } + + /** + * Return the "color" property. + */ + public ColorType getColor() { + return color; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "line-height" property. + */ + public SpaceProperty getLineHeight() { + return lineHeight; + } + + /** + * Return the "span" property. + */ + public int getSpan() { + return this.span; + } + + /** + * Return the "text-align" property. + */ + public int getTextAlign() { + return textAlign; + } + + /** + * Return the "text-align-last" property. + */ + public int getTextAlignLast() { + return textAlignLast; + } + + /** + * Return the "text-indent" property. + */ + public Length getTextIndent() { + return textIndent; + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -110,13 +304,13 @@ public class Block extends FObjMixed { this.align = getPropEnum(PR_TEXT_ALIGN); this.alignLast = getPropEnum(PR_TEXT_ALIGN_LAST); this.breakAfter = getPropEnum(PR_BREAK_AFTER); - this.lineHeight = getPropLength(PR_LINE_HEIGHT); + this._lineHeight = getPropLength(PR_LINE_HEIGHT); this.startIndent = getPropLength(PR_START_INDENT); this.endIndent = getPropLength(PR_END_INDENT); this.spaceBefore = getPropLength(PR_SPACE_BEFORE | CP_OPTIMUM); this.spaceAfter = getPropLength(PR_SPACE_AFTER | CP_OPTIMUM); - this.textIndent = getPropLength(PR_TEXT_INDENT); - this.keepWithNext = getPropEnum(PR_KEEP_WITH_NEXT); + this._textIndent = getPropLength(PR_TEXT_INDENT); + this._keepWithNext = getPropEnum(PR_KEEP_WITH_NEXT); this.blockWidows = this.propertyList.get(PR_WIDOWS).getNumber().intValue(); this.blockOrphans = @@ -157,13 +351,6 @@ public class Block extends FObjMixed { } /** - * @return span for this Block, in millipoints (??) - */ - public int getSpan() { - return this.span; - } - - /** * @see org.apache.fop.fo.FONode#addChildNode(FONode) */ public void addChildNode(FONode child) throws SAXParseException { @@ -183,14 +370,6 @@ public class Block extends FObjMixed { super.addChildNode(child); } - /** - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - handleWhiteSpace(); - getFOEventHandler().endBlock(this); - } - private void handleWhiteSpace() { //getLogger().debug("fo:block: handleWhiteSpace"); if (firstInlineChild != null) { diff --git a/src/java/org/apache/fop/fo/flow/BlockContainer.java b/src/java/org/apache/fop/fo/flow/BlockContainer.java index af9079c23..df1a8e884 100644 --- a/src/java/org/apache/fop/fo/flow/BlockContainer.java +++ b/src/java/org/apache/fop/fo/flow/BlockContainer.java @@ -23,8 +23,16 @@ import java.util.List; // FOP import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAbsolutePosition; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.KeepProperty; +import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.BlockContainerLayoutManager; import org.xml.sax.Attributes; @@ -35,6 +43,29 @@ import org.xml.sax.SAXParseException; * @todo implement validateChildNode() */ public class BlockContainer extends FObj { + // The value of properties relevant for fo:block-container. + private CommonAbsolutePosition commonAbsolutePosition ; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginBlock commonMarginBlock; + private LengthRangeProperty blockProgressionDimension; + private int breakAfter; + private int breakBefore; + // private ToBeImplementedProperty clip; + private int displayAlign; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private int overflow; + private Numeric referenceOrientation; + private int span; + private Length width; + private int writingMode; + // private ToBeImplementedProperty zIndex; + // End of property values private ColorType backgroundColor; private int position; @@ -43,10 +74,9 @@ public class BlockContainer extends FObj { private int bottom; private int left; private int right; - private int width; - private int height; + private int _width; + private int _height; - private int span; /** * @param parent FONode that is the parent of this object @@ -56,6 +86,41 @@ public class BlockContainer extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAbsolutePosition = pList.getAbsolutePositionProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginBlock = pList.getMarginBlockProps(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + // clip = pList.get(PR_CLIP); + displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + overflow = pList.get(PR_OVERFLOW).getEnum(); + referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric(); + span = pList.get(PR_SPAN).getEnum(); + width = pList.get(PR_WIDTH).getLength(); + writingMode = pList.get(PR_WRITING_MODE).getEnum(); + // zIndex = pList.get(PR_Z_INDEX); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startBlockContainer(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -64,8 +129,8 @@ public class BlockContainer extends FObj { this.backgroundColor = this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); - this.width = getPropLength(PR_WIDTH); - this.height = getPropLength(PR_HEIGHT); + this._width = getPropLength(PR_WIDTH); + this._height = getPropLength(PR_HEIGHT); getFOEventHandler().startBlockContainer(this); } @@ -84,13 +149,76 @@ public class BlockContainer extends FObj { } /** - * @return the span for this object + * Return the Common Absolute Position Properties. + */ + public CommonAbsolutePosition getCommonAbsolutePosition() { + return commonAbsolutePosition; + } + + /** + * Return the Common Margin Properties-Block. + */ + public CommonMarginBlock getCommonMarginBlock() { + return commonMarginBlock; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the "block-progression-dimension" property. + */ + public LengthRangeProperty getBlockProgressionDimension() { + return blockProgressionDimension; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "inline-progression-dimension" property. + */ + public LengthRangeProperty getInlineProgressionDimension() { + return inlineProgressionDimension; + } + + /** + * Return the "overflow" property. + */ + public int getOverflow() { + return overflow; + } + + /** + * Return the "reference-orientation" property. + */ + public int getReferenceOrientation() { + return referenceOrientation.getValue(); + } + + /** + * Return the "span" property. */ public int getSpan() { return this.span; } /** + * Return the "writing-mode" property. + */ + public int getWritingMode() { + return writingMode; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/Character.java b/src/java/org/apache/fop/fo/flow/Character.java index f1b185826..2a84a6dcf 100644 --- a/src/java/org/apache/fop/fo/flow/Character.java +++ b/src/java/org/apache/fop/fo/flow/Character.java @@ -27,9 +27,20 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.CharIterator; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +import org.apache.fop.fo.properties.CommonHyphenation; +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.Property; import org.apache.fop.fo.OneCharIterator; import org.apache.fop.layoutmgr.CharacterLayoutManager; @@ -47,6 +58,37 @@ import org.apache.fop.layoutmgr.CharacterLayoutManager; * */ public class Character extends FObj { + // The value of properties relevant for fo:character. + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonHyphenation commonHyphenation; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty treatAsWordSpace; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private char character; + private ColorType color; + // private ToBeImplementedProperty dominantBaseline; + // private ToBeImplementedProperty textDepth; + // private ToBeImplementedProperty textAltitude; + // private ToBeImplementedProperty glyphOrientationHorizontal; + // private ToBeImplementedProperty glyphOrientationVertical; + private String id; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Property letterSpacing; + private Length lineHeight; + // private ToBeImplementedProperty scoreSpaces; + // private ToBeImplementedProperty suppressAtLineBreak; + private int textDecoration; + // private ToBeImplementedProperty textShadow; + private int textTransform; + // private ToBeImplementedProperty visibility; + private Property wordSpacing; + // End of property values /** constant indicating that the character is OK */ public static final int OK = 0; @@ -63,6 +105,50 @@ public class Character extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonHyphenation = pList.getHyphenationProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // treatAsWordSpace = pList.get(PR_TREAT_AS_WORD_SPACE); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + character = pList.get(PR_CHARACTER).getCharacter(); + color = pList.get(PR_COLOR).getColorType(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + // textDepth = pList.get(PR_TEXT_DEPTH); + // textAltitude = pList.get(PR_TEXT_ALTITUDE); + // glyphOrientationHorizontal = pList.get(PR_GLYPH_ORIENTATION_HORIZONTAL); + // glyphOrientationVertical = pList.get(PR_GLYPH_ORIENTATION_VERTICAL); + id = pList.get(PR_ID).getString(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + letterSpacing = pList.get(PR_LETTER_SPACING); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + // scoreSpaces = pList.get(PR_SCORE_SPACES); + // suppressAtLineBreak = pList.get(PR_SUPPRESS_AT_LINE_BREAK); + textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); + // textShadow = pList.get(PR_TEXT_SHADOW); + textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); + // visibility = pList.get(PR_VISIBILITY); + wordSpacing = pList.get(PR_WORD_SPACING); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().character(this); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ @@ -71,6 +157,7 @@ public class Character extends FObj { invalidChildError(loc, nsURI, localName); } + /** * @see org.apache.fop.fo.FObj#addProperties */ @@ -89,6 +176,69 @@ public class Character extends FObj { } /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the Common Hyphenation Properties. + */ + public CommonHyphenation getCommonHyphenation() { + return commonHyphenation; + } + + /** + * Return the "character" property. + */ + public char getCharacter() { + return character; + } + + /** + * Return the "color" property. + */ + public ColorType getColor() { + return color; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "letter-spacing" property. + */ + public Property getLetterSpacing() { + return letterSpacing; + } + + /** + * Return the "text-decoration" property. + */ + public int getTextDecoration() { + return textDecoration; + } + + /** + * Return the "word-spacing" property. + */ + public Property getWordSpacing() { + return wordSpacing; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java index 241d5ebae..290183b51 100644 --- a/src/java/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/java/org/apache/fop/fo/flow/ExternalGraphic.java @@ -27,8 +27,17 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +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.LengthRangeProperty; import org.apache.fop.layoutmgr.ExternalGraphicLayoutManager; /** @@ -37,6 +46,36 @@ import org.apache.fop.layoutmgr.ExternalGraphicLayoutManager; * inline area that can be added to the area tree. */ public class ExternalGraphic extends FObj { + // The value of properties relevant for fo:external-graphic. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private LengthRangeProperty blockProgressionDimension; + // private ToBeImplementedProperty clip; + private Length contentHeight; + // private ToBeImplementedProperty contentType; + private Length contentWidth; + private int displayAlign; + // private ToBeImplementedProperty dominantBaseline; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Length lineHeight; + private int overflow; + private int scaling; + // private ToBeImplementedProperty scalingMethod; + private String src; + private int textAlign; + private int verticalAlign; //Extra + private Length width; + // End of property values /** * Create a new External graphic node. @@ -48,6 +87,48 @@ public class ExternalGraphic extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + // clip = pList.get(PR_CLIP); + contentHeight = pList.get(PR_CONTENT_HEIGHT).getLength(); + // contentType = pList.get(PR_CONTENT_TYPE); + contentWidth = pList.get(PR_CONTENT_WIDTH).getLength(); + displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + overflow = pList.get(PR_OVERFLOW).getEnum(); + scaling = pList.get(PR_SCALING).getEnum(); + // scalingMethod = pList.get(PR_SCALING_METHOD); + src = pList.get(PR_SRC).getString(); + textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); + verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum(); + width = pList.get(PR_WIDTH).getLength(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().image(this); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ @@ -66,6 +147,111 @@ public class ExternalGraphic extends FObj { } /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the Common Margin Properties-Inline. + */ + public CommonMarginInline getCommonMarginInline() { + return commonMarginInline; + } + + /** + * Return the "block-progression-dimension" property. + */ + public LengthRangeProperty getBlockProgressionDimension() { + return blockProgressionDimension; + } + + /** + * Return the "content-height" property. + */ + public Length getContentHeight() { + return contentHeight; + } + + /** + * Return the "content-width" property. + */ + public Length getContentWidth() { + return contentWidth; + } + + /** + * Return the "display-align" property. + */ + public int getDisplayAlign() { + return displayAlign; + } + + /** + * Return the "height" property. + */ + public Length getHeight() { + return height; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "inline-progression-dimension" property. + */ + public LengthRangeProperty getInlineProgressionDimension() { + return inlineProgressionDimension; + } + + /** + * Return the "overflow" property. + */ + public int getOverflow() { + return overflow; + } + + /** + * Return the "scaling" property. + */ + public int getScaling() { + return scaling; + } + + /** + * Return the "src" property. + */ + public String getSrc() { + return src; + } + + /** + * Return the "text-align" property. + */ + public int getTextAlign() { + return textAlign; + } + + /** + * Return the "width" property. + */ + public Length getWidth() { + return width; + } + + /** + * Return the "vertical-align" property. + */ + public int getVerticalAlign() { + return verticalAlign; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/Float.java b/src/java/org/apache/fop/fo/flow/Float.java index c6062092c..b846260c4 100644 --- a/src/java/org/apache/fop/fo/flow/Float.java +++ b/src/java/org/apache/fop/fo/flow/Float.java @@ -25,11 +25,16 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; /** * fo:float element. */ public class Float extends FObj { + // The value of properties relevant for fo:float. + // private ToBeImplementedProperty float; + // private ToBeImplementedProperty clear; + // End of property values static boolean notImplementedWarningGiven = false; @@ -46,6 +51,14 @@ public class Float extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + // float = pList.get(PR_FLOAT); + // clear = pList.get(PR_CLEAR); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: (%block;)+ */ diff --git a/src/java/org/apache/fop/fo/flow/Footnote.java b/src/java/org/apache/fop/fo/flow/Footnote.java index f44c2950a..1b5506e2d 100644 --- a/src/java/org/apache/fop/fo/flow/Footnote.java +++ b/src/java/org/apache/fop/fo/flow/Footnote.java @@ -29,11 +29,16 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:footnote object. */ public class Footnote extends FObj { + // The value of properties relevant for fo:footnote. + private CommonAccessibility commonAccessibility; + // End of property values private Inline inlineFO = null; private FootnoteBody footnoteBody; @@ -46,6 +51,13 @@ public class Footnote extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -54,6 +66,26 @@ public class Footnote extends FObj { } /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + getFOEventHandler().startFootnote(this); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + super.endOfNode(); + if (inlineFO == null || footnoteBody == null) { + missingChildElementError("(inline,footnote-body)"); + } + getFOEventHandler().endFootnote(this); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: (inline,footnote-body) * @todo: implement additional constraint: An fo:footnote is not permitted @@ -80,19 +112,6 @@ public class Footnote extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - super.endOfNode(); - if (inlineFO == null || footnoteBody == null) { - missingChildElementError("(inline,footnote-body)"); - } - getFOEventHandler().endFootnote(this); - } - - /** * @see org.apache.fop.fo.FONode#addChildNode(FONode) */ public void addChildNode(FONode child) { diff --git a/src/java/org/apache/fop/fo/flow/FootnoteBody.java b/src/java/org/apache/fop/fo/flow/FootnoteBody.java index c6de42c1f..d582d9e1b 100644 --- a/src/java/org/apache/fop/fo/flow/FootnoteBody.java +++ b/src/java/org/apache/fop/fo/flow/FootnoteBody.java @@ -26,11 +26,16 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:footnote-body object. */ public class FootnoteBody extends FObj { + // The value of properties relevant for fo:footnote-body. + private CommonAccessibility commonAccessibility; + // End of property values /** * @param parent FONode that is the parent of this object @@ -40,6 +45,32 @@ public class FootnoteBody extends FObj { } /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (childNodes == null) { + missingChildElementError("(%block;)+"); + } + getFOEventHandler().endFootnoteBody(this); + } + + /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + getFOEventHandler().startFootnoteBody(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -59,18 +90,6 @@ public class FootnoteBody extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - if (childNodes == null) { - missingChildElementError("(%block;)+"); - } - getFOEventHandler().endFootnoteBody(this); - } - - /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java index 89a7ac766..27c83b368 100644 --- a/src/java/org/apache/fop/fo/flow/InitialPropertySet.java +++ b/src/java/org/apache/fop/fo/flow/InitialPropertySet.java @@ -23,6 +23,15 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.ColorTypeProperty; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.SpaceProperty; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; @@ -30,6 +39,22 @@ import org.apache.fop.fo.FObj; * Class modelling the fo:initial-property-set object. */ public class InitialPropertySet extends FObj { + // The value of properties relevant for fo:initial-property-set. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonRelativePosition commonRelativePosition; + private ColorTypeProperty color; + private String id; + // private ToBeImplementedProperty letterSpacing; + private Length lineHeight; + // private ToBeImplementedProperty scoreSpaces; + private int textDecoration; + // private ToBeImplementedProperty textShadow; + private int textTransform; + private SpaceProperty wordSpacing; + // End of property values /** * @param parent FONode that is the parent of this object @@ -39,6 +64,33 @@ public class InitialPropertySet extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonRelativePosition = pList.getRelativePositionProps(); + color = pList.get(PR_COLOR).getColorType(); + id = pList.get(PR_ID).getString(); + // letterSpacing = pList.get(PR_LETTER_SPACING); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + // scoreSpaces = pList.get(PR_SCORE_SPACES); + textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); + // textShadow = pList.get(PR_TEXT_SHADOW); + textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); + wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ diff --git a/src/java/org/apache/fop/fo/flow/Inline.java b/src/java/org/apache/fop/fo/flow/Inline.java index a611c07d0..a1ae50300 100644 --- a/src/java/org/apache/fop/fo/flow/Inline.java +++ b/src/java/org/apache/fop/fo/flow/Inline.java @@ -24,15 +24,51 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.CharIterator; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; import org.apache.fop.fo.InlineCharIterator; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +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.LengthRangeProperty; /** * Class modelling the fo:inline formatting object. */ public class Inline extends FObjMixed { + // The value of properties relevant for fo:inline. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private LengthRangeProperty blockProgressionDimension; + private ColorType color; + // private ToBeImplementedProperty dominantBaseline; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Length lineHeight; + private int textDecoration; + // private ToBeImplementedProperty visibility; + private Length width; + private int wrapOption; + // End of property values // used for FO validation private boolean blockOrInlineItemFound = false; @@ -46,6 +82,68 @@ public class Inline extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) throws SAXParseException { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + color = pList.get(PR_COLOR).getColorType(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); + // visibility = pList.get(PR_VISIBILITY); + width = pList.get(PR_WIDTH).getLength(); + wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + /* Check to see if this node can have block-level children. + * See validateChildNode() below. + */ + int lvlLeader = findAncestor(FO_LEADER); + int lvlFootnote = findAncestor(FO_FOOTNOTE); + int lvlInCntr = findAncestor(FO_INLINE_CONTAINER); + + if (lvlLeader > 0) { + if (lvlInCntr < 0 || + (lvlInCntr > 0 && lvlInCntr > lvlLeader)) { + canHaveBlockLevelChildren = false; + } + } else if (lvlFootnote > 0) { + if (lvlInCntr < 0 || lvlInCntr > lvlFootnote) { + canHaveBlockLevelChildren = false; + } + } + + checkId(id); + getFOEventHandler().startInline(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endInline(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -100,12 +198,46 @@ public class Inline extends FObjMixed { } } + /** + * Return the Common Margin Properties-Inline. + */ + public CommonMarginInline getCommonMarginInline() { + return commonMarginInline; + } /** - * @see org.apache.fop.fo.FONode#endOfNode + * Return the Common Border, Padding, and Background Properties. */ - protected void endOfNode() throws SAXParseException { - getFOEventHandler().endInline(this); + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the "color" property. + */ + public ColorType getColor() { + return color; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "text-decoration" property. + */ + public int getTextDecoration() { + return textDecoration; } /** diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java index 4d375827a..5f7d22e5d 100644 --- a/src/java/org/apache/fop/fo/flow/InlineContainer.java +++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java @@ -27,16 +27,47 @@ import org.xml.sax.Attributes; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.ICLayoutManager; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +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.LengthRangeProperty; /** * Class modelling the fo:inline-container object. * @todo implement validateChildNode() */ public class InlineContainer extends FObj { + // The value of properties relevant for fo:inline-container. + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private LengthRangeProperty blockProgressionDimension; + // private ToBeImplementedProperty clip; + private int displayAlign; + // private ToBeImplementedProperty dominantBaseline; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Length lineHeight; + private int overflow; + private Numeric referenceOrientation; + private Length width; + private int writingMode; + // End of property values /** * @param parent FONode that is the parent of this object @@ -46,6 +77,40 @@ public class InlineContainer extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + // clip = pList.get(PR_CLIP); + displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + overflow = pList.get(PR_OVERFLOW).getEnum(); + referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric(); + width = pList.get(PR_WIDTH).getLength(); + writingMode = pList.get(PR_WRITING_MODE).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -53,6 +118,13 @@ public class InlineContainer extends FObj { } /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java index 952afe133..debf9b9a5 100644 --- a/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java +++ b/src/java/org/apache/fop/fo/flow/InstreamForeignObject.java @@ -26,9 +26,18 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; +import org.apache.fop.fo.FObj; import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +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.LengthRangeProperty; import org.apache.fop.layoutmgr.InstreamForeignObjectLM; -import org.apache.fop.fo.FObj; /** * The instream-foreign-object flow formatting object. @@ -36,6 +45,35 @@ import org.apache.fop.fo.FObj; * xml data. */ public class InstreamForeignObject extends FObj { + // The value of properties relevant for fo:instream-foreign-object. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private LengthRangeProperty blockProgressionDimension; + // private ToBeImplementedProperty clip; + private Length contentHeight; + // private ToBeImplementedProperty contentType; + private Length contentWidth; + private int displayAlign; + // private ToBeImplementedProperty dominantBaseline; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Length lineHeight; + private int overflow; + private int scaling; + // private ToBeImplementedProperty scalingMethod; + private int textAlign; + private int verticalAlign; // shorthand!!! + private Length width; + // End of property values /** * constructs an instream-foreign-object object (called by Maker). @@ -47,16 +85,43 @@ public class InstreamForeignObject extends FObj { } /** - * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) - * XSL Content Model: one (1) non-XSL namespace child + * @see org.apache.fop.fo.FObj#bind(PropertyList) */ - protected void validateChildNode(Locator loc, String nsURI, String localName) - throws SAXParseException { - if (nsURI == FO_URI) { - invalidChildError(loc, nsURI, localName); - } else if (childNodes != null) { - tooManyNodesError(loc, "child element"); - } + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + // clip = pList.get(PR_CLIP); + contentHeight = pList.get(PR_CONTENT_HEIGHT).getLength(); + // contentType = pList.get(PR_CONTENT_TYPE); + contentWidth = pList.get(PR_CONTENT_WIDTH).getLength(); + displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + overflow = pList.get(PR_OVERFLOW).getEnum(); + scaling = pList.get(PR_SCALING).getEnum(); + // scalingMethod = pList.get(PR_SCALING_METHOD); + textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); + verticalAlign = pList.get(PR_VERTICAL_ALIGN).getEnum(); + width = pList.get(PR_WIDTH).getLength(); + } + + /** + * @see org.apache.fop.fo.FONode#start + */ + protected void startOfNode() throws SAXParseException { + checkId(id); } /** @@ -70,6 +135,19 @@ public class InstreamForeignObject extends FObj { } } + /** + * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) + * XSL Content Model: one (1) non-XSL namespace child + */ + protected void validateChildNode(Locator loc, String nsURI, String localName) + throws SAXParseException { + if (nsURI == FO_URI) { + invalidChildError(loc, nsURI, localName); + } else if (childNodes != null) { + tooManyNodesError(loc, "child element"); + } + } + public int computeXOffset (int ipd, int cwidth) { int xoffset = 0; int ta = getPropEnum(PR_TEXT_ALIGN); @@ -109,6 +187,83 @@ public class InstreamForeignObject extends FObj { } /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "line-height" property. + */ + public Length getLineHeight() { + return lineHeight; + } + + /** + * Return the "inline-progression-dimension" property. + */ + public LengthRangeProperty getInlineProgressionDimension() { + return inlineProgressionDimension; + } + + /** + * Return the "block-progression-dimension" property. + */ + public LengthRangeProperty getBlockProgressionDimension() { + return blockProgressionDimension; + } + + /** + * Return the "height" property. + */ + public Length getHeight() { + return height; + } + + /** + * Return the "width" property. + */ + public Length getWidth() { + return width; + } + + /** + * Return the "content-height" property. + */ + public Length getContentHeight() { + return contentHeight; + } + + /** + * Return the "content-width" property. + */ + public Length getContentWidth() { + return contentWidth; + } + + /** + * Return the "scaling" property. + */ + public int getScaling() { + return scaling; + } + + /** + * Return the "vertical-align" property. + */ + public int getVerticalAlign() { + return verticalAlign; + } + + /** + * Return the "overflow" property. + */ + public int getOverflow() { + return overflow; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/Leader.java b/src/java/org/apache/fop/fo/flow/Leader.java index b18d2e17d..d5752907a 100644 --- a/src/java/org/apache/fop/fo/flow/Leader.java +++ b/src/java/org/apache/fop/fo/flow/Leader.java @@ -21,11 +21,24 @@ package org.apache.fop.fo.flow; // Java import java.util.List; +// XML +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +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.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; @@ -37,10 +50,37 @@ import org.apache.fop.layoutmgr.LeaderLayoutManager; * @todo implement validateChildNode() */ public class Leader extends FObjMixed { - - private int ruleStyle; - private int ruleThickness; + // The value of properties relevant for fo:leader. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + private ColorType color; + // private ToBeImplementedProperty dominantBaseline; + // private ToBeImplementedProperty textDepth; + // private ToBeImplementedProperty textAltitude; + private String id; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private int leaderAlignment; + private LengthRangeProperty leaderLength; private int leaderPattern; + private Length leaderPatternWidth; + private int ruleStyle; + private Length ruleThickness; + // private ToBeImplementedProperty letterSpacing; + private Length lineHeight; + // private ToBeImplementedProperty textShadow; + // private ToBeImplementedProperty visibility; + private SpaceProperty wordSpacing; + // End of property values + + private int _ruleThickness; private int patternWidth; /** FontState for this object */ protected Font fontState; @@ -53,6 +93,61 @@ public class Leader extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + color = pList.get(PR_COLOR).getColorType(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + // textDepth = pList.get(PR_TEXT_DEPTH); + // textAltitude = pList.get(PR_TEXT_ALTITUDE); + id = pList.get(PR_ID).getString(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + leaderAlignment = pList.get(PR_LEADER_ALIGNMENT).getEnum(); + leaderLength = pList.get(PR_LEADER_LENGTH).getLengthRange(); + leaderPattern = pList.get(PR_LEADER_PATTERN).getEnum(); + leaderPatternWidth = pList.get(PR_LEADER_PATTERN_WIDTH).getLength(); + switch(leaderPattern) { + case LeaderPattern.SPACE: + // use Space + break; + case LeaderPattern.RULE: + // the following properties only apply + // for leader-pattern = "rule" + ruleStyle = pList.get(PR_RULE_STYLE).getEnum(); + ruleThickness = pList.get(PR_RULE_THICKNESS).getLength(); + break; + case LeaderPattern.DOTS: + break; + case LeaderPattern.USECONTENT: + // use inline layout manager to create inline areas + // add the inline parent multiple times until leader full + break; + } + // letterSpacing = pList.get(PR_LETTER_SPACING); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + // textShadow = pList.get(PR_TEXT_SHADOW); + // visibility = pList.get(PR_VISIBILITY); + wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** * @todo convert to addProperties() */ private void setup() { @@ -75,7 +170,7 @@ public class Leader extends FObjMixed { case LeaderPattern.RULE: // the following properties only apply // for leader-pattern = "rule" - ruleThickness = getPropLength(PR_RULE_THICKNESS); + _ruleThickness = getPropLength(PR_RULE_THICKNESS); ruleStyle = getPropEnum(PR_RULE_STYLE); break; case LeaderPattern.DOTS: @@ -104,24 +199,73 @@ public class Leader extends FObjMixed { return length; } + public int getRuleThickness() { + return _ruleThickness; + } + + public Font getFontState() { + return fontState; + } + + public int getPatternWidth() { + return patternWidth; + } + + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "rule-style" property. + */ public int getRuleStyle() { return ruleStyle; } - public int getRuleThickness() { + /** + * Return the "rule-thickness" property. + * TODO: 31699 + */ + public Length ___getRuleThickness() { return ruleThickness; } - public int getLeaderPattern() { - return leaderPattern; + /** + * Return the "leader-alignment" property. + */ + public int getLeaderAlignment() { + return leaderAlignment; } - public Font getFontState() { - return fontState; + /** + * Return the "leader-length" property. + */ + public LengthRangeProperty getLeaderLength() { + return leaderLength; } - public int getPatternWidth() { - return patternWidth; + /** + * Return the "leader-pattern" property. + */ + public int getLeaderPattern() { + return leaderPattern; + } + + /** + * Return the "leader-pattern-width" property. + */ + public Length getLeaderPatternWidth() { + return leaderPatternWidth; } /** diff --git a/src/java/org/apache/fop/fo/flow/ListBlock.java b/src/java/org/apache/fop/fo/flow/ListBlock.java index 952e9d044..6c99580aa 100644 --- a/src/java/org/apache/fop/fo/flow/ListBlock.java +++ b/src/java/org/apache/fop/fo/flow/ListBlock.java @@ -27,14 +27,38 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.layoutmgr.list.ListBlockLayoutManager; /** * Class modelling the fo:list-block object. */ public class ListBlock extends FObj { + // The value of properties relevant for fo:list-block. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginBlock commonMarginBlock; + private CommonRelativePosition commonRelativePosition; + private int breakAfter; + private int breakBefore; + private String id; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private Length provisionalDistanceBetweenStarts; + private Length provisionalLabelSeparation; + // End of property values // used for child node validation private boolean hasListItem = false; @@ -47,6 +71,46 @@ public class ListBlock extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginBlock = pList.getMarginBlockProps(); + commonRelativePosition = pList.getRelativePositionProps(); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + id = pList.get(PR_ID).getString(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + provisionalDistanceBetweenStarts = pList.get(PR_PROVISIONAL_DISTANCE_BETWEEN_STARTS).getLength(); + provisionalLabelSeparation = pList.get(PR_PROVISIONAL_LABEL_SEPARATION).getLength(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startList(this); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (!hasListItem) { + missingChildElementError("marker* (list-item)+"); + } + getFOEventHandler().endList(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -60,27 +124,36 @@ public class ListBlock extends FObj { */ protected void validateChildNode(Locator loc, String nsURI, String localName) throws SAXParseException { - if (nsURI == FO_URI && localName.equals("marker")) { - if (hasListItem) { - nodesOutOfOrderError(loc, "fo:marker", "fo:list-item"); - } - } else if (nsURI == FO_URI && localName.equals("list-item")) { - hasListItem = true; - } else { - invalidChildError(loc, nsURI, localName); + if (nsURI == FO_URI && localName.equals("marker")) { + if (hasListItem) { + nodesOutOfOrderError(loc, "fo:marker", "fo:list-item"); } + } else if (nsURI == FO_URI && localName.equals("list-item")) { + hasListItem = true; + } else { + invalidChildError(loc, nsURI, localName); + } } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode + * Return the Common Margin Properties-Block. */ - protected void endOfNode() throws SAXParseException { - if (!hasListItem) { - missingChildElementError("marker* (list-item)+"); - } - getFOEventHandler().endList(this); + public CommonMarginBlock getCommonMarginBlock() { + return commonMarginBlock; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; } /** diff --git a/src/java/org/apache/fop/fo/flow/ListItem.java b/src/java/org/apache/fop/fo/flow/ListItem.java index 3a46abe35..6b04f22e1 100644 --- a/src/java/org/apache/fop/fo/flow/ListItem.java +++ b/src/java/org/apache/fop/fo/flow/ListItem.java @@ -29,12 +29,34 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; import org.apache.fop.layoutmgr.list.ListItemLayoutManager; /** * Class modelling the fo:list-item object. */ public class ListItem extends FObj { + // The value of properties relevant for fo:list-item. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginBlock commonMarginBlock; + private CommonRelativePosition commonRelativePosition; + private int breakAfter; + private int breakBefore; + private String id; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private int relativeAlign; + // End of property values private ListItemLabel label = null; private ListItemBody body = null; @@ -47,6 +69,45 @@ public class ListItem extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginBlock = pList.getMarginBlockProps(); + commonRelativePosition = pList.getRelativePositionProps(); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + id = pList.get(PR_ID).getString(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + relativeAlign = pList.get(PR_RELATIVE_ALIGN).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startListItem(this); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (label == null || body == null) { + missingChildElementError("marker* (list-item-label,list-item-body)"); + } + getFOEventHandler().endListItem(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -60,23 +121,23 @@ public class ListItem extends FObj { */ protected void validateChildNode(Locator loc, String nsURI, String localName) throws SAXParseException { - if (nsURI == FO_URI && localName.equals("marker")) { - if (label != null) { - nodesOutOfOrderError(loc, "fo:marker", "fo:list-item-label"); - } - } else if (nsURI == FO_URI && localName.equals("list-item-label")) { - if (label != null) { - tooManyNodesError(loc, "fo:list-item-label"); - } - } else if (nsURI == FO_URI && localName.equals("list-item-body")) { - if (label == null) { - nodesOutOfOrderError(loc, "fo:list-item-label", "fo:list-item-body"); - } else if (body != null) { - tooManyNodesError(loc, "fo:list-item-body"); - } - } else { - invalidChildError(loc, nsURI, localName); + if (nsURI == FO_URI && localName.equals("marker")) { + if (label != null) { + nodesOutOfOrderError(loc, "fo:marker", "fo:list-item-label"); + } + } else if (nsURI == FO_URI && localName.equals("list-item-label")) { + if (label != null) { + tooManyNodesError(loc, "fo:list-item-label"); } + } else if (nsURI == FO_URI && localName.equals("list-item-body")) { + if (label == null) { + nodesOutOfOrderError(loc, "fo:list-item-label", "fo:list-item-body"); + } else if (body != null) { + tooManyNodesError(loc, "fo:list-item-body"); + } + } else { + invalidChildError(loc, nsURI, localName); + } } /** @@ -97,15 +158,10 @@ public class ListItem extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode + * Return the "id" property. */ - protected void endOfNode() throws SAXParseException { - if (label == null || body == null) { - missingChildElementError("marker* (list-item-label,list-item-body)"); - } - getFOEventHandler().endListItem(this); + public String getId() { + return id; } /** diff --git a/src/java/org/apache/fop/fo/flow/ListItemBody.java b/src/java/org/apache/fop/fo/flow/ListItemBody.java index 73a7f47a3..2b936f68a 100644 --- a/src/java/org/apache/fop/fo/flow/ListItemBody.java +++ b/src/java/org/apache/fop/fo/flow/ListItemBody.java @@ -18,15 +18,26 @@ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.KeepProperty; /** * Class modelling the fo:list-item-body object. * @todo implement validateChildNode() */ public class ListItemBody extends FObj { + // The value of properties relevant for fo:list-item-body. + private CommonAccessibility commonAccessibility; + private String id; + private KeepProperty keepTogether; + // End of property values /** * @param parent FONode that is the parent of this object @@ -36,6 +47,30 @@ public class ListItemBody extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + id = pList.get(PR_ID).getString(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startListBody(); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endListBody(); + } + + /** * @todo convert to addProperties() */ private void setup() { @@ -47,6 +82,16 @@ public class ListItemBody extends FObj { */ } + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * @see org.apache.fop.fo.FObj#getName() + */ public String getName() { return "fo:list-item-body"; } diff --git a/src/java/org/apache/fop/fo/flow/ListItemLabel.java b/src/java/org/apache/fop/fo/flow/ListItemLabel.java index 9f57ac212..f7e3ec063 100644 --- a/src/java/org/apache/fop/fo/flow/ListItemLabel.java +++ b/src/java/org/apache/fop/fo/flow/ListItemLabel.java @@ -25,12 +25,20 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.KeepProperty; /** * Class modelling the fo:list-item-label object. * @todo implement validateChildNode() */ public class ListItemLabel extends FObj { + // The value of properties relevant for fo:list-item-label. + private CommonAccessibility commonAccessibility; + private String id; + private KeepProperty keepTogether; + // End of property values /** * @param parent FONode that is the parent of this object @@ -40,6 +48,30 @@ public class ListItemLabel extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + id = pList.get(PR_ID).getString(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startListLabel(); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endListLabel(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -53,11 +85,16 @@ public class ListItemLabel extends FObj { */ } - protected void endOfNode() throws SAXParseException { - super.endOfNode(); - getFOEventHandler().endListLabel(); + /** + * Return the "id" property. + */ + public String getId() { + return id; } - + + /** + * @see org.apache.fop.fo.FObj#getName() + */ public String getName() { return "fo:list-item-label"; } diff --git a/src/java/org/apache/fop/fo/flow/Marker.java b/src/java/org/apache/fop/fo/flow/Marker.java index 347b480af..066d40189 100644 --- a/src/java/org/apache/fop/fo/flow/Marker.java +++ b/src/java/org/apache/fop/fo/flow/Marker.java @@ -26,11 +26,15 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; /** * Marker formatting object. */ public class Marker extends FObjMixed { + // The value of properties relevant for fo:marker. + private String markerClassName; + // End of property values /** * Create a marker fo. @@ -41,6 +45,13 @@ public class Marker extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) throws SAXParseException { + markerClassName = pList.get(PR_MARKER_CLASS_NAME).getString(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -63,6 +74,13 @@ public class Marker extends FObjMixed { } /** + * Return the "marker-class-name" property. + */ + public String getMarkerClassName() { + return markerClassName; + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/MultiCase.java b/src/java/org/apache/fop/fo/flow/MultiCase.java index 4ec5ea6c1..5ad05fd0a 100644 --- a/src/java/org/apache/fop/fo/flow/MultiCase.java +++ b/src/java/org/apache/fop/fo/flow/MultiCase.java @@ -18,15 +18,27 @@ package org.apache.fop.fo.flow; +// XML +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:multi-case object. * @todo implement validateChildNode() */ public class MultiCase extends FObj { + // The value of properties relevant for fo:multi-case. + private CommonAccessibility commonAccessibility; + private String id; + // private ToBeImplementedProperty startingState; + // private ToBeImplementedProperty caseName; + // private ToBeImplementedProperty caseTitle; + // End of property values static boolean notImplementedWarningGiven = false; @@ -43,6 +55,24 @@ public class MultiCase extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + id = pList.get(PR_ID).getString(); + // startingState = pList.get(PR_STARTING_STATE); + // caseName = pList.get(PR_CASE_NAME); + // caseTitle = pList.get(PR_CASE_TITLE); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/MultiProperties.java b/src/java/org/apache/fop/fo/flow/MultiProperties.java index 7668ee648..9400df421 100644 --- a/src/java/org/apache/fop/fo/flow/MultiProperties.java +++ b/src/java/org/apache/fop/fo/flow/MultiProperties.java @@ -25,11 +25,17 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:multi-properties object. */ public class MultiProperties extends FObj { + // The value of properties relevant for fo:multi-properties. + private CommonAccessibility commonAccessibility; + private String id; + // End of property values static boolean notImplementedWarningGiven = false; @@ -50,6 +56,32 @@ public class MultiProperties extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + id = pList.get(PR_ID).getString(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (!hasMultiPropertySet || !hasWrapper) { + missingChildElementError("(multi-property-set+, wrapper)"); + } + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: (multi-property-set+, wrapper) */ @@ -73,16 +105,12 @@ public class MultiProperties extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode + * Return the "id" property. */ - protected void endOfNode() throws SAXParseException { - if (!hasMultiPropertySet || !hasWrapper) { - missingChildElementError("(multi-property-set+, wrapper)"); - } + public String getId() { + return id; } - + /** * @see org.apache.fop.fo.FObj#getName() */ diff --git a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java index 09a99fb10..f476d187d 100644 --- a/src/java/org/apache/fop/fo/flow/MultiPropertySet.java +++ b/src/java/org/apache/fop/fo/flow/MultiPropertySet.java @@ -25,11 +25,16 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; /** * Class modelling the fo:multi-property-set object. */ public class MultiPropertySet extends FObj { + // The value of properties relevant for fo:multi-property-set. + private String id; + // private ToBeImplementedProperty activeState; + // End of property values static boolean notImplementedWarningGiven = false; @@ -46,6 +51,21 @@ public class MultiPropertySet extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + id = pList.get(PR_ID).getString(); + // activeState = pList.get(PR_ACTIVE_STATE); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ @@ -55,6 +75,13 @@ public class MultiPropertySet extends FObj { } /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/MultiSwitch.java b/src/java/org/apache/fop/fo/flow/MultiSwitch.java index 77f859215..f0a72a0ad 100644 --- a/src/java/org/apache/fop/fo/flow/MultiSwitch.java +++ b/src/java/org/apache/fop/fo/flow/MultiSwitch.java @@ -25,12 +25,19 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:multi-switch object. * @todo needs implementation */ public class MultiSwitch extends FObj { + // The value of properties relevant for fo:multi-switch. + private CommonAccessibility commonAccessibility; + // private ToBeImplementedProperty autoRestore; + private String id; + // End of property values static boolean notImplementedWarningGiven = false; @@ -47,6 +54,32 @@ public class MultiSwitch extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + // autoRestore = pList.get(PR_AUTO_RESTORE); + id = pList.get(PR_ID).getString(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** + * Make sure content model satisfied. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (childNodes == null) { + missingChildElementError("(multi-case+)"); + } + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: (multi-case+) */ @@ -58,13 +91,10 @@ public class MultiSwitch extends FObj { } /** - * Make sure content model satisfied. - * @see org.apache.fop.fo.FONode#endOfNode + * Return the "id" property. */ - protected void endOfNode() throws SAXParseException { - if (childNodes == null) { - missingChildElementError("(multi-case+)"); - } + public String getId() { + return id; } /** diff --git a/src/java/org/apache/fop/fo/flow/MultiToggle.java b/src/java/org/apache/fop/fo/flow/MultiToggle.java index 3d78a7476..d4bc23628 100644 --- a/src/java/org/apache/fop/fo/flow/MultiToggle.java +++ b/src/java/org/apache/fop/fo/flow/MultiToggle.java @@ -21,13 +21,19 @@ package org.apache.fop.fo.flow; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; /** * Class modelling the fo:multi-toggle property. * @todo implement validateChildNode() */ public class MultiToggle extends FObj { - + // The value of properties relevant for fo:multi-toggle. + private CommonAccessibility commonAccessibility; + // public ToBeImplementedProperty prSwitchTo; + // End of property values + static boolean notImplementedWarningGiven = false; /** @@ -43,6 +49,19 @@ public class MultiToggle extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + // prSwitchTo = pList.get(PR_SWITCH_TO); + + if (!notImplementedWarningGiven) { + getLogger().warn("fo:multi-toggle is not yet implemented."); + notImplementedWarningGiven = true; + } + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/PageNumber.java b/src/java/org/apache/fop/fo/flow/PageNumber.java index 022d8dcf2..5671cddb2 100644 --- a/src/java/org/apache/fop/fo/flow/PageNumber.java +++ b/src/java/org/apache/fop/fo/flow/PageNumber.java @@ -28,8 +28,18 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +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; @@ -37,13 +47,39 @@ import org.apache.fop.layoutmgr.PageNumberLayoutManager; * Class modelling the fo:page-number object. */ public class PageNumber extends FObj { + // The value of properties relevant for fo:page-number. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + // private ToBeImplementedProperty dominantBaseline; + private String id; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + // private ToBeImplementedProperty letterSpacing; + private Length lineHeight; + // private ToBeImplementedProperty scoreSpaces; + // private ToBeImplementedProperty textAltitude; + private int textDecoration; + // private ToBeImplementedProperty textDepth; + // private ToBeImplementedProperty textShadow; + private int textTransform; + // private ToBeImplementedProperty visibility; + private SpaceProperty wordSpacing; + private int wrapOption; + // End of property values + /** FontState for this object */ protected Font fontState; private float red; private float green; private float blue; - private int wrapOption; /** * @param parent FONode that is the parent of this object @@ -53,6 +89,51 @@ public class PageNumber extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + id = pList.get(PR_ID).getString(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + // letterSpacing = pList.get(PR_LETTER_SPACING); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + // scoreSpaces = pList.get(PR_SCORE_SPACES); + // textAltitude = pList.get(PR_TEXT_ALTITUDE); + textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); + // textDepth = pList.get(PR_TEXT_DEPTH); + // textShadow = pList.get(PR_TEXT_SHADOW); + textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); + // visibility = pList.get(PR_VISIBILITY); + wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); + wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startPageNumber(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endPageNumber(this); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ @@ -86,10 +167,34 @@ public class PageNumber extends FObj { return fontState; } - protected void endOfNode() throws SAXParseException { - getFOEventHandler().endPageNumber(this); + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; } - + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "text-decoration" property. + */ + public int getTextDecoration() { + return textDecoration; + } + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ @@ -104,7 +209,10 @@ public class PageNumber extends FObj { public String getName() { return "fo:page-number"; } - + + /** + * @see org.apache.fop.fo.FObj#getNameId() + */ public int getNameId() { return FO_PAGE_NUMBER; } diff --git a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java index c256cec75..89e2b6127 100644 --- a/src/java/org/apache/fop/fo/flow/PageNumberCitation.java +++ b/src/java/org/apache/fop/fo/flow/PageNumberCitation.java @@ -27,8 +27,18 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonFont; +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.layoutmgr.PageNumberCitationLayoutManager; /** @@ -38,6 +48,33 @@ import org.apache.fop.layoutmgr.PageNumberCitationLayoutManager; * block referenced with the ref-id attribute. */ public class PageNumberCitation extends FObj { + // The value of properties relevant for fo:page-number-citation. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonFont commonFont; + private CommonMarginInline commonMarginInline; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty alignmentAdjust; + // private ToBeImplementedProperty alignmentBaseline; + private Length baselineShift; + // private ToBeImplementedProperty dominantBaseline; + private String id; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + // private ToBeImplementedProperty letterSpacing; + private Length lineHeight; + private String refId; + // private ToBeImplementedProperty scoreSpaces; + // private ToBeImplementedProperty textAltitude; + private int textDecoration; + // private ToBeImplementedProperty textDepth; + // private ToBeImplementedProperty textShadow; + private int textTransform; + // private ToBeImplementedProperty visibility; + private SpaceProperty wordSpacing; + private int wrapOption; + // End of property values /** * @param parent FONode that is the parent of this object @@ -47,12 +84,42 @@ public class PageNumberCitation extends FObj { } /** - * @see org.apache.fop.fo.FObj#addProperties + * @see org.apache.fop.fo.FObj#bind(PropertyList) */ - protected void addProperties(Attributes attlist) throws SAXParseException { - super.addProperties(attlist); + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonFont = pList.getFontProps(); + commonMarginInline = pList.getMarginInlineProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // alignmentAdjust = pList.get(PR_ALIGNMENT_ADJUST); + // alignmentBaseline = pList.get(PR_ALIGNMENT_BASELINE); + baselineShift = pList.get(PR_BASELINE_SHIFT).getLength(); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + id = pList.get(PR_ID).getString(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + // letterSpacing = pList.get(PR_LETTER_SPACING); + lineHeight = pList.get(PR_LINE_HEIGHT).getLength(); + refId = pList.get(PR_REF_ID).getString(); + // scoreSpaces = pList.get(PR_SCORE_SPACES); + // textAltitude = pList.get(PR_TEXT_ALTITUDE); + textDecoration = pList.get(PR_TEXT_DECORATION).getEnum(); + // textDepth = pList.get(PR_TEXT_DEPTH); + // textShadow = pList.get(PR_TEXT_SHADOW); + textTransform = pList.get(PR_TEXT_TRANSFORM).getEnum(); + // visibility = pList.get(PR_VISIBILITY); + wordSpacing = pList.get(PR_WORD_SPACING).getSpace(); + wrapOption = pList.get(PR_WRAP_OPTION).getEnum(); + } - if (getPropString(PR_REF_ID) == null || getPropString(PR_REF_ID).equals("")) { + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + if (refId.equals("")) { missingPropertyError("ref-id"); } } @@ -67,6 +134,38 @@ public class PageNumberCitation extends FObj { } /** + * @see org.apache.fop.fo.FObj#addProperties + */ + protected void addProperties(Attributes attlist) throws SAXParseException { + super.addProperties(attlist); + + if (getPropString(PR_REF_ID) == null || getPropString(PR_REF_ID).equals("")) { + missingPropertyError("ref-id"); + } + } + + /** + * Return the Common Font Properties. + */ + public CommonFont getCommonFont() { + return commonFont; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "ref-id" property. + */ + public String getRefId() { + return refId; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java index c983f6b5b..a944b69bd 100644 --- a/src/java/org/apache/fop/fo/flow/RetrieveMarker.java +++ b/src/java/org/apache/fop/fo/flow/RetrieveMarker.java @@ -29,6 +29,7 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager; @@ -38,10 +39,11 @@ import org.apache.fop.layoutmgr.RetrieveMarkerLayoutManager; * a marker based on the information. */ public class RetrieveMarker extends FObjMixed { - + // The value of properties relevant for fo:retrieve-marker. private String retrieveClassName; private int retrievePosition; private int retrieveBoundary; + // End of property values /** * Create a retrieve marker object. @@ -53,6 +55,15 @@ public class RetrieveMarker extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + retrieveClassName = pList.get(PR_RETRIEVE_CLASS_NAME).getString(); + retrievePosition = pList.get(PR_RETRIEVE_POSITION).getEnum(); + retrieveBoundary = pList.get(PR_RETRIEVE_BOUNDARY).getEnum(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -71,18 +82,28 @@ public class RetrieveMarker extends FObjMixed { invalidChildError(loc, nsURI, localName); } + /** + * Return the "retrieve-class-name" property. + */ public String getRetrieveClassName() { return retrieveClassName; } + /** + * Return the "retrieve-position" property. + */ public int getRetrievePosition() { return retrievePosition; } + /** + * Return the "retrieve-boundry" property. + */ public int getRetrieveBoundary() { return retrieveBoundary; } + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ diff --git a/src/java/org/apache/fop/fo/flow/Table.java b/src/java/org/apache/fop/fo/flow/Table.java index 2ccc2c00c..b9457a2e4 100644 --- a/src/java/org/apache/fop/fo/flow/Table.java +++ b/src/java/org/apache/fop/fo/flow/Table.java @@ -29,17 +29,55 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; +import org.apache.fop.fo.properties.LengthPairProperty; +import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.table.TableLayoutManager; import org.apache.fop.layoutmgr.table.Body; import org.apache.fop.layoutmgr.table.Column; -import org.apache.fop.fo.properties.LengthRangeProperty; /** * Class modelling the fo:table object. */ public class Table extends FObj { + // The value of properties relevant for fo:table. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginBlock commonMarginBlock; + private CommonRelativePosition commonRelativePosition; + private LengthRangeProperty blockProgressionDimension; + // private ToBeImplementedProperty borderAfterPrecedence; + // private ToBeImplementedProperty borderBeforePrecedence; + private int borderCollapse; + // private ToBeImplementedProperty borderEndPrecedence; + private LengthPairProperty borderSeparation; + // private ToBeImplementedProperty borderStartPrecedence; + private int breakAfter; + private int breakBefore; + private String id; + private LengthRangeProperty inlineProgressionDimension; + // private ToBeImplementedProperty intrusionDisplace; + private Length height; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private int tableLayout; + private int tableOmitFooterAtBreak; + private int tableOmitHeaderAtBreak; + private Length width; + private int writingMode; + // End of property values + private static final int MINCOLWIDTH = 10000; // 10pt /** collection of columns in this table */ @@ -49,13 +87,11 @@ public class Table extends FObj { private boolean omitHeaderAtBreak = false; private boolean omitFooterAtBreak = false; - private int breakBefore; - private int breakAfter; private int spaceBefore; private int spaceAfter; private ColorType backgroundColor; private LengthRangeProperty ipd; - private int height; + private int _height; private boolean bAutoLayout = false; private int contentWidth = 0; // Sum of column widths @@ -74,6 +110,53 @@ public class Table extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginBlock = pList.getMarginBlockProps(); + commonRelativePosition = pList.getRelativePositionProps(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE); + // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE); + borderCollapse = pList.get(PR_BORDER_COLLAPSE).getEnum(); + // borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE); + borderSeparation = pList.get(PR_BORDER_SEPARATION).getLengthPair(); + // borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + height = pList.get(PR_HEIGHT).getLength(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + tableLayout = pList.get(PR_TABLE_LAYOUT).getEnum(); + tableOmitFooterAtBreak = pList.get(PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum(); + tableOmitHeaderAtBreak = pList.get(PR_TABLE_OMIT_HEADER_AT_BREAK).getEnum(); + width = pList.get(PR_WIDTH).getLength(); + writingMode = pList.get(PR_WRITING_MODE).getEnum(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startTable(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endTable(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -86,7 +169,7 @@ public class Table extends FObj { this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); this.ipd = this.propertyList.get( PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); - this.height = getPropLength(PR_HEIGHT); + this._height = getPropLength(PR_HEIGHT); this.bAutoLayout = (getPropEnum(PR_TABLE_LAYOUT) == TableLayout.AUTO); this.omitHeaderAtBreak = getPropEnum(PR_TABLE_OMIT_HEADER_AT_BREAK) @@ -96,10 +179,6 @@ public class Table extends FObj { getFOEventHandler().startTable(this); } - protected void endOfNode() throws SAXParseException { - getFOEventHandler().endTable(this); - } - /** * @see org.apache.fop.fo.FONode#addChildNode(FONode) */ @@ -132,6 +211,27 @@ public class Table extends FObj { } /** + * Return the Common Margin Properties-Block. + */ + public CommonMarginBlock getCommonMarginBlock() { + return commonMarginBlock; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) * @todo see if can/should move much of this logic into TableLayoutManager * and/or TableBody and TableColumn FO subclasses. diff --git a/src/java/org/apache/fop/fo/flow/TableAndCaption.java b/src/java/org/apache/fop/fo/flow/TableAndCaption.java index 45b15b1f8..beadf6279 100644 --- a/src/java/org/apache/fop/fo/flow/TableAndCaption.java +++ b/src/java/org/apache/fop/fo/flow/TableAndCaption.java @@ -25,13 +25,36 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonMarginBlock; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; /** * Class modelling the fo:table-and-caption property. * @todo needs implementation */ public class TableAndCaption extends FObj { - + // The value of properties relevant for fo:table-and-caption. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonMarginBlock commonMarginBlock; + private CommonRelativePosition commonRelativePosition; + private int breakAfter; + private int breakBefore; + private int captionSide; + private String id; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + private int textAlign; + // End of property values + static boolean notImplementedWarningGiven = false; /** used for FO validation */ @@ -51,35 +74,30 @@ public class TableAndCaption extends FObj { } /** - * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) - * XSL Content Model: marker* table-caption? table + * @see org.apache.fop.fo.FObj#bind(PropertyList) */ - protected void validateChildNode(Locator loc, String nsURI, String localName) - throws SAXParseException { + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonMarginBlock = pList.getMarginBlockProps(); + commonRelativePosition = pList.getRelativePositionProps(); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + captionSide = pList.get(PR_CAPTION_SIDE).getEnum(); + id = pList.get(PR_ID).getString(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + textAlign = pList.get(PR_TEXT_ALIGN).getEnum(); + } - if (nsURI == FO_URI && localName.equals("marker")) { - if (tableCaptionFound) { - nodesOutOfOrderError(loc, "fo:marker", "fo:table-caption"); - } else if (tableFound) { - nodesOutOfOrderError(loc, "fo:marker", "fo:table"); - } - } else if (nsURI == FO_URI && localName.equals("table-caption")) { - if (tableCaptionFound) { - tooManyNodesError(loc, "fo:table-caption"); - } else if (tableFound) { - nodesOutOfOrderError(loc, "fo:table-caption", "fo:table"); - } else { - tableCaptionFound = true; - } - } else if (nsURI == FO_URI && localName.equals("table")) { - if (tableFound) { - tooManyNodesError(loc, "fo:table"); - } else { - tableFound = true; - } - } else { - invalidChildError(loc, nsURI, localName); - } + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); } /** @@ -94,6 +112,45 @@ public class TableAndCaption extends FObj { } /** + * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) + * XSL Content Model: marker* table-caption? table + */ + protected void validateChildNode(Locator loc, String nsURI, String localName) + throws SAXParseException { + + if (nsURI == FO_URI && localName.equals("marker")) { + if (tableCaptionFound) { + nodesOutOfOrderError(loc, "fo:marker", "fo:table-caption"); + } else if (tableFound) { + nodesOutOfOrderError(loc, "fo:marker", "fo:table"); + } + } else if (nsURI == FO_URI && localName.equals("table-caption")) { + if (tableCaptionFound) { + tooManyNodesError(loc, "fo:table-caption"); + } else if (tableFound) { + nodesOutOfOrderError(loc, "fo:table-caption", "fo:table"); + } else { + tableCaptionFound = true; + } + } else if (nsURI == FO_URI && localName.equals("table")) { + if (tableFound) { + tooManyNodesError(loc, "fo:table"); + } else { + tableFound = true; + } + } else { + invalidChildError(loc, nsURI, localName); + } + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { diff --git a/src/java/org/apache/fop/fo/flow/TableBody.java b/src/java/org/apache/fop/fo/flow/TableBody.java index fedd50321..80cc2e51d 100644 --- a/src/java/org/apache/fop/fo/flow/TableBody.java +++ b/src/java/org/apache/fop/fo/flow/TableBody.java @@ -29,6 +29,11 @@ import org.xml.sax.SAXParseException; import org.apache.fop.datatypes.ColorType; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonRelativePosition; import org.apache.fop.layoutmgr.table.Body; /** @@ -36,7 +41,18 @@ import org.apache.fop.layoutmgr.table.Body; * @todo implement validateChildNode() */ public class TableBody extends FObj { - + // The value of properties relevant for fo:table-body. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty borderAfterPrecedence; + // private ToBeImplementedProperty borderBeforePrecedence; + // private ToBeImplementedProperty borderEndPrecedence; + // private ToBeImplementedProperty borderStartPrecedence; + // private ToBeImplementedProperty visibility; + // End of property values + private int spaceBefore; private int spaceAfter; private ColorType backgroundColor; @@ -49,6 +65,35 @@ public class TableBody extends FObj { } /** + * @see FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE); + // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE); + // borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE); + // borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE); + // visibility = pList.get(PR_VISIBILITY); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + getFOEventHandler().startBody(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endBody(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -60,8 +105,11 @@ public class TableBody extends FObj { getFOEventHandler().startBody(this); } - protected void endOfNode() throws SAXParseException { - getFOEventHandler().endBody(this); + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; } /** diff --git a/src/java/org/apache/fop/fo/flow/TableCaption.java b/src/java/org/apache/fop/fo/flow/TableCaption.java index 2681ef3d1..f73a8d936 100644 --- a/src/java/org/apache/fop/fo/flow/TableCaption.java +++ b/src/java/org/apache/fop/fo/flow/TableCaption.java @@ -23,14 +23,36 @@ import org.xml.sax.Locator; import org.xml.sax.SAXParseException; // FOP +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; +import org.apache.fop.fo.properties.LengthRangeProperty; + /** * Class modelling the fo:table-caption object. * @todo needs implementation */ public class TableCaption extends FObj { + // The value of properties relevant for fo:table-caption. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonRelativePosition commonRelativePosition; + private LengthRangeProperty blockProgressionDimension; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + // private ToBeImplementedProperty intrusionDisplace; + private KeepProperty keepTogether; + private Length width; + // End of property values /** used for FO validation */ private boolean blockItemFound = false; @@ -50,6 +72,41 @@ public class TableCaption extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonRelativePosition = pList.getRelativePositionProps(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + // intrusionDisplace = pList.get(PR_INTRUSION_DISPLACE); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + width = pList.get(PR_WIDTH).getLength(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (childNodes == null) { + missingChildElementError("marker* (%block;)"); + } + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: marker* (%block;) */ @@ -67,14 +124,10 @@ public class TableCaption extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode + * Return the "id" property. */ - protected void endOfNode() throws SAXParseException { - if (childNodes == null) { - missingChildElementError("marker* (%block;)"); - } + public String getId() { + return id; } /** diff --git a/src/java/org/apache/fop/fo/flow/TableCell.java b/src/java/org/apache/fop/fo/flow/TableCell.java index 84e226f79..d0917e36b 100644 --- a/src/java/org/apache/fop/fo/flow/TableCell.java +++ b/src/java/org/apache/fop/fo/flow/TableCell.java @@ -28,8 +28,17 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; +import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.LengthPairProperty; +import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.table.Cell; import org.apache.fop.fo.properties.CommonBorderAndPadding; @@ -38,6 +47,31 @@ import org.apache.fop.fo.properties.CommonBorderAndPadding; * @todo check need for all instance variables stored here */ public class TableCell extends FObj { + // The value of properties relevant for fo:table-cell. + private CommonAccessibility commonAccessibility; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty borderAfterPrecedence; + // private ToBeImplementedProperty borderBeforePrecedence; + // private ToBeImplementedProperty borderEndPrecedence; + // private ToBeImplementedProperty borderStartPrecedence; + private LengthRangeProperty blockProgressionDimension; + private int borderCollapse; + private LengthPairProperty borderSeparation; + private Numeric columnNumber; + private int displayAlign; + private int relativeAlign; + // private ToBeImplementedProperty emptyCells; + // private ToBeImplementedProperty endsRow; + private Length height; + private String id; + private LengthRangeProperty inlineProgressionDimension; + private Numeric numberColumnsSpanned; + private Numeric numberRowsSpanned; + // private ToBeImplementedProperty startsRow; + private Length width; + // End of property values // private int spaceBefore; // private int spaceAfter; @@ -60,7 +94,7 @@ public class TableCell extends FObj { * Dimension of allocation rectangle in inline-progression-direction, * determined by the width of the column(s) occupied by the cell */ - protected int width; + protected int _width; /** * Offset of content rectangle, in block-progression-direction, @@ -87,7 +121,7 @@ public class TableCell extends FObj { protected int minCellHeight = 0; /** Height of cell */ - protected int height = 0; + protected int _height = 0; /** Ypos of cell ??? */ protected int top; @@ -110,7 +144,7 @@ public class TableCell extends FObj { * Border separation value in the block-progression dimension. * Used in calculating cells height. */ - private int borderSeparation = 0; + private int _borderSeparation = 0; /** * @param parent FONode that is the parent of this object @@ -120,6 +154,55 @@ public class TableCell extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE); + // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE); + // borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE); + // borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + borderCollapse = pList.get(PR_BORDER_COLLAPSE).getEnum(); + borderSeparation = pList.get(PR_BORDER_SEPARATION).getLengthPair(); + columnNumber = pList.get(PR_COLUMN_NUMBER).getNumeric(); + displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); + relativeAlign = pList.get(PR_RELATIVE_ALIGN).getEnum(); + // emptyCells = pList.get(PR_EMPTY_CELLS); + // endsRow = pList.get(PR_ENDS_ROW); + height = pList.get(PR_HEIGHT).getLength(); + id = pList.get(PR_ID).getString(); + inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); + numberColumnsSpanned = pList.get(PR_NUMBER_COLUMNS_SPANNED).getNumeric(); + numberRowsSpanned = pList.get(PR_NUMBER_ROWS_SPANNED).getNumeric(); + // startsRow = pList.get(PR_STARTS_ROW); + width = pList.get(PR_WIDTH).getLength(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startCell(this); + } + + /** + * Make sure content model satisfied, if so then tell the + * FOEventHandler that we are at the end of the flow. + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (!blockItemFound) { + missingChildElementError("marker* (%block;)+"); + } + getFOEventHandler().endCell(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -179,18 +262,6 @@ public class TableCell extends FObj { } /** - * Make sure content model satisfied, if so then tell the - * FOEventHandler that we are at the end of the flow. - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - if (!blockItemFound) { - missingChildElementError("marker* (%block;)+"); - } - getFOEventHandler().endCell(this); - } - - /** * Set position relative to table (set by body?) */ public void setStartOffset(int offset) { @@ -204,7 +275,7 @@ public class TableCell extends FObj { * @param width the width of the cell (in millipoints ??) */ public void setWidth(int width) { - this.width = width; + this._width = width; } /** @@ -252,9 +323,9 @@ public class TableCell extends FObj { + bp.getPaddingEnd(false); // Offset of content rectangle in the block-progression direction - borderSeparation = getPropLength(PR_BORDER_SEPARATION | + _borderSeparation = getPropLength(PR_BORDER_SEPARATION | CP_BLOCK_PROGRESSION_DIRECTION); - this.beforeOffset = borderSeparation / 2 + this.beforeOffset = _borderSeparation / 2 + bp.getBorderBeforeWidth(false) + bp.getPaddingBefore(false); @@ -325,6 +396,42 @@ public class TableCell extends FObj { } /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** + * @return number of the column containing this cell + * TODO 31699 + */ + public int ___getColumnNumber() { + return columnNumber.getValue(); + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * @return the number of columns spanned by this cell + */ + public int getNumberColumnsSpanned() { + return numberColumnsSpanned.getValue(); + } + + /** + * @return the number of rows spanned by this cell + */ + public int getNumberRowsSpanned() { + return numberRowsSpanned.getValue(); + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/TableColumn.java b/src/java/org/apache/fop/fo/flow/TableColumn.java index a6e30f2dc..ad242ede0 100644 --- a/src/java/org/apache/fop/fo/flow/TableColumn.java +++ b/src/java/org/apache/fop/fo/flow/TableColumn.java @@ -26,16 +26,30 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.Length; +import org.apache.fop.datatypes.Numeric; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; /** * Class modelling the fo:table-column object. */ public class TableColumn extends FObj { - - private ColorType backgroundColor; + // The value of properties relevant for fo:table-column. + private CommonBorderPaddingBackground commonBorderPaddingBackground; + // private ToBeImplementedProperty borderAfterPrecedence; + // private ToBeImplementedProperty borderBeforePrecedence; + // private ToBeImplementedProperty borderEndPrecedence; + // private ToBeImplementedProperty borderStartPrecedence; + private Numeric columnNumber; private Length columnWidth; + private Numeric numberColumnsRepeated; + private Numeric numberColumnsSpanned; + // private ToBeImplementedProperty visibility; + // End of property values + + private ColorType backgroundColor; private int columnOffset; private int numColumnsRepeated; private int iColumnNumber; @@ -48,6 +62,36 @@ public class TableColumn extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE); + // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE); + // borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE); + // borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE); + columnNumber = pList.get(PR_COLUMN_NUMBER).getNumeric(); + columnWidth = pList.get(PR_COLUMN_WIDTH).getLength(); + numberColumnsRepeated = pList.get(PR_NUMBER_COLUMNS_REPEATED).getNumeric(); + numberColumnsSpanned = pList.get(PR_NUMBER_COLUMNS_SPANNED).getNumeric(); + // visibility = pList.get(PR_VISIBILITY); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode() + */ + protected void startOfNode() throws SAXParseException { + getFOEventHandler().startColumn(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + getFOEventHandler().endColumn(this); + } + + /** * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String) * XSL Content Model: empty */ @@ -73,33 +117,40 @@ public class TableColumn extends FObj { } /** - * @see org.apache.fop.fo.FONode#endOfNode + * @return value for number of columns repeated */ - protected void endOfNode() throws SAXParseException { - getFOEventHandler().endColumn(this); + public int getNumColumnsRepeated() { + return numColumnsRepeated; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; } /** - * @return Length object containing column width + * Return the "column-width" property. */ public Length getColumnWidth() { return columnWidth; } /** - * @return column number + * Return the "column-number" property. */ public int getColumnNumber() { - return iColumnNumber; + return columnNumber.getValue(); } /** * @return value for number of columns repeated */ - public int getNumColumnsRepeated() { - return numColumnsRepeated; + public int getNumberColumnsRepeated() { + return numberColumnsRepeated.getValue(); } - + public String getName() { return "fo:table-column"; } diff --git a/src/java/org/apache/fop/fo/flow/TableRow.java b/src/java/org/apache/fop/fo/flow/TableRow.java index ecae89376..e1c5774d3 100644 --- a/src/java/org/apache/fop/fo/flow/TableRow.java +++ b/src/java/org/apache/fop/fo/flow/TableRow.java @@ -29,8 +29,16 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.datatypes.ColorType; import org.apache.fop.datatypes.KeepValue; +import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObj; +import org.apache.fop.fo.PropertyList; +import org.apache.fop.fo.properties.CommonAccessibility; +import org.apache.fop.fo.properties.CommonAural; +import org.apache.fop.fo.properties.CommonBorderPaddingBackground; +import org.apache.fop.fo.properties.CommonRelativePosition; +import org.apache.fop.fo.properties.KeepProperty; +import org.apache.fop.fo.properties.LengthRangeProperty; import org.apache.fop.layoutmgr.table.Row; import org.apache.fop.fo.Constants; import org.apache.fop.fo.properties.Property; @@ -40,15 +48,33 @@ import org.apache.fop.fo.properties.Property; * Class modelling the fo:table-row object. */ public class TableRow extends FObj { - + // The value of properties relevant for fo:table-row. + private CommonAccessibility commonAccessibility; + private LengthRangeProperty blockProgressionDimension; + private CommonAural commonAural; + private CommonBorderPaddingBackground commonBorderPaddingBackground; + private CommonRelativePosition commonRelativePosition; + // private ToBeImplementedProperty borderAfterPrecedence; + // private ToBeImplementedProperty borderBeforePrecedence; + // private ToBeImplementedProperty borderEndPrecedence; + // private ToBeImplementedProperty borderStartPrecedence; + private int breakAfter; + private int breakBefore; + private Length height; + private String id; + private KeepProperty keepTogether; + private KeepProperty keepWithNext; + private KeepProperty keepWithPrevious; + // private ToBeImplementedProperty visibility; + // End of property values + private boolean setup = false; - private int breakAfter; private ColorType backgroundColor; - private KeepValue keepWithNext; - private KeepValue keepWithPrevious; - private KeepValue keepTogether; + private KeepValue _keepWithNext; + private KeepValue _keepWithPrevious; + private KeepValue _keepTogether; private int minHeight = 0; // force row height @@ -60,6 +86,47 @@ public class TableRow extends FObj { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + commonAccessibility = pList.getAccessibilityProps(); + blockProgressionDimension = pList.get(PR_BLOCK_PROGRESSION_DIMENSION).getLengthRange(); + commonAural = pList.getAuralProps(); + commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); + commonRelativePosition = pList.getRelativePositionProps(); + // borderAfterPrecedence = pList.get(PR_BORDER_AFTER_PRECEDENCE); + // borderBeforePrecedence = pList.get(PR_BORDER_BEFORE_PRECEDENCE); + // borderEndPrecedence = pList.get(PR_BORDER_END_PRECEDENCE); + // borderStartPrecedence = pList.get(PR_BORDER_START_PRECEDENCE); + breakAfter = pList.get(PR_BREAK_AFTER).getEnum(); + breakBefore = pList.get(PR_BREAK_BEFORE).getEnum(); + id = pList.get(PR_ID).getString(); + height = pList.get(PR_HEIGHT).getLength(); + keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); + keepWithNext = pList.get(PR_KEEP_WITH_NEXT).getKeep(); + keepWithPrevious = pList.get(PR_KEEP_WITH_PREVIOUS).getKeep(); + // visibility = pList.get(PR_VISIBILITY); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + getFOEventHandler().startRow(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + if (childNodes == null) { + missingChildElementError("(table-cell+)"); + } + getFOEventHandler().endRow(this); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -79,20 +146,10 @@ public class TableRow extends FObj { } /** - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - if (childNodes == null) { - missingChildElementError("(table-cell+)"); - } - getFOEventHandler().endRow(this); - } - - /** * @return keepWithPrevious */ public KeepValue getKeepWithPrevious() { - return keepWithPrevious; + return _keepWithPrevious; } /** @@ -103,9 +160,9 @@ public class TableRow extends FObj { this.backgroundColor = this.propertyList.get(PR_BACKGROUND_COLOR).getColorType(); - this.keepTogether = getKeepValue(PR_KEEP_TOGETHER | CP_WITHIN_COLUMN); - this.keepWithNext = getKeepValue(PR_KEEP_WITH_NEXT | CP_WITHIN_COLUMN); - this.keepWithPrevious = + this._keepTogether = getKeepValue(PR_KEEP_TOGETHER | CP_WITHIN_COLUMN); + this._keepWithNext = getKeepValue(PR_KEEP_WITH_NEXT | CP_WITHIN_COLUMN); + this._keepWithPrevious = getKeepValue(PR_KEEP_WITH_PREVIOUS | CP_WITHIN_COLUMN); this.minHeight = getPropLength(PR_HEIGHT); @@ -128,6 +185,49 @@ public class TableRow extends FObj { } /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** + * Return the "keep-with-previous" property. + * TODO: 31699 + */ + public KeepProperty ___getKeepWithPrevious() { + return keepWithPrevious; + } + + /** + * Return the "keep-with-next" property. + */ + public KeepProperty getKeepWithNext() { + return keepWithNext; + } + + /** + * Return the "keep-together" property. + */ + public KeepProperty getKeepTogether() { + return keepTogether; + } + + /** + * Return the "height" property. + */ + public Length getHeight() { + return height; + } + + /** + * Return the Common Border, Padding, and Background Properties. + */ + public CommonBorderPaddingBackground getCommonBorderPaddingBackground() { + return commonBorderPaddingBackground; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { diff --git a/src/java/org/apache/fop/fo/flow/Wrapper.java b/src/java/org/apache/fop/fo/flow/Wrapper.java index 589711d07..27cf815be 100644 --- a/src/java/org/apache/fop/fo/flow/Wrapper.java +++ b/src/java/org/apache/fop/fo/flow/Wrapper.java @@ -22,9 +22,13 @@ package org.apache.fop.fo.flow; import java.util.List; import java.util.ListIterator; +// XML +import org.xml.sax.SAXParseException; + // FOP import org.apache.fop.fo.FONode; import org.apache.fop.fo.FObjMixed; +import org.apache.fop.fo.PropertyList; /** * Implementation for fo:wrapper formatting object. @@ -36,7 +40,10 @@ import org.apache.fop.fo.FObjMixed; * @todo implement validateChildNode() */ public class Wrapper extends FObjMixed { - + // The value of properties relevant for fo:wrapper. + private String id; + // End of property values + /** * @param parent FONode that is the parent of this object */ @@ -45,6 +52,27 @@ public class Wrapper extends FObjMixed { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) { + id = pList.get(PR_ID).getString(); + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + checkId(id); + } + + /** + * Return the "id" property. + */ + public String getId() { + return id; + } + + /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) * @todo remove null check when vCN() & endOfNode() implemented */ |