import java.util.NoSuchElementException;
// FOP
+import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.flow.Block;
import org.apache.fop.fo.pagination.Root;
+import org.apache.fop.fo.properties.CommonFont;
+import org.apache.fop.fo.properties.CommonHyphenation;
+import org.apache.fop.fo.properties.Property;
+import org.apache.fop.fo.properties.SpaceProperty;
import org.apache.fop.layoutmgr.TextLayoutManager;
/**
*/
public int endIndex = 0;
+ // The value of properties relevant for character.
+ private CommonFont commonFont;
+ private CommonHyphenation commonHyphenation;
+ private ColorType color;
+ private Property letterSpacing;
+ private SpaceProperty lineHeight;
+ private int whiteSpaceCollapse;
+ private int textTransform;
+ private Property wordSpacing;
+ private int wrapOption;
+ // End of property values
+
/**
* The TextInfo object attached to the text
*/
textTransform();
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ commonFont = pList.getFontProps();
+ commonHyphenation = pList.getHyphenationProps();
+
+ color = pList.get(Constants.PR_COLOR).getColorType();
+ lineHeight = pList.get(Constants.PR_LINE_HEIGHT).getSpace();
+ letterSpacing = pList.get(Constants.PR_LETTER_SPACING);
+ whiteSpaceCollapse = pList.get(Constants.PR_WHITE_SPACE_COLLAPSE).getEnum();
+ textTransform = pList.get(Constants.PR_TEXT_TRANSFORM).getEnum();
+ wordSpacing = pList.get(Constants.PR_WORD_SPACING);
+ wrapOption = pList.get(Constants.PR_WRAP_OPTION).getEnum();
+ }
+
/**
* Check if this text node will create an area.
* This means either there is non-whitespace or it is
}
+ /**
+ * Return the Common Font Properties.
+ */
+ public CommonFont getCommonFont() {
+ return commonFont;
+ }
+
+ /**
+ * Return the Common Hyphenation Properties.
+ */
+ public CommonHyphenation getCommonHyphenation() {
+ return commonHyphenation;
+ }
+
+ /**
+ * Return the "color" property.
+ */
+ public ColorType getColor() {
+ return color;
+ }
+
+ /**
+ * Return the "letter-spacing" property.
+ */
+ public Property getLetterSpacing() {
+ return letterSpacing;
+ }
+
+ /**
+ * Return the "line-height" property.
+ */
+ public SpaceProperty getLineHeight() {
+ return lineHeight;
+ }
+
+ /**
+ * Return the "word-spacing" property.
+ */
+ public Property getWordSpacing() {
+ return wordSpacing;
+ }
+
+ /**
+ * Return the "wrap-option" property.
+ */
+ public int getWrapOption() {
+ return wrapOption;
+ }
+
/**
* @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
// FOP
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
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;
super(parent);
}
+ /**
+ * @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
*/
}
}
- /**
- * @see org.apache.fop.fo.FONode#endOfNode
- */
- protected void endOfNode() throws SAXParseException {
- super.endOfNode();
- getFOEventHandler().endLink();
- }
-
/**
* @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
return isExternalLink;
}
+ /**
+ * 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()
*/
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;
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
*/
}
+ /**
+ * @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
// 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;
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
super(parent);
}
+ /**
+ * @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
*/
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 =
}
}
- /**
- * @return span for this Block, in millipoints (??)
- */
- public int getSpan() {
- return this.span;
- }
-
/**
* @see org.apache.fop.fo.FONode#addChildNode(FONode)
*/
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) {
// 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;
* @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;
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
super(parent);
}
+ /**
+ * @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
*/
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);
}
}
/**
- * @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)
*/
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;
*
*/
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;
super(parent);
}
+ /**
+ * @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
invalidChildError(loc, nsURI, localName);
}
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
// But what if the character is ignored due to white space handling?
}
+ /**
+ * 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)
*/
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;
/**
* 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.
super(parent);
}
+ /**
+ * @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
getFOEventHandler().image(this);
}
+ /**
+ * 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)
*/
// 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;
}
}
+ /**
+ * @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;)+
// 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;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ commonAccessibility = pList.getAccessibilityProps();
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
getFOEventHandler().startFootnote(this);
}
+ /**
+ * @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)
}
}
- /**
- * 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)
*/
// 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
super(parent);
}
+ /**
+ * 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
*/
}
}
- /**
- * 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()
*/
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;
* 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
super(parent);
}
+ /**
+ * @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
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;
super(parent);
}
+ /**
+ * @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
*/
}
}
+ /**
+ * 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;
}
/**
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
super(parent);
}
+ /**
+ * @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
*/
super.addProperties(attlist);
}
+ /**
+ * Return the "id" property.
+ */
+ public String getId() {
+ return id;
+ }
+
/**
* @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
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.
* 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).
}
/**
- * @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);
}
/**
}
}
+ /**
+ * @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);
return yoffset;
}
+ /**
+ * 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)
*/
// 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;
* @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;
super(parent);
}
+ /**
+ * @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()
*/
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:
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;
}
/**
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;
super(parent);
}
+ /**
+ * @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 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;
}
/**
// 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;
super(parent);
}
+ /**
+ * @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 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);
+ }
}
/**
}
/**
- * 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;
}
/**
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
super(parent);
}
+ /**
+ * @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()
*/
*/
}
+ /**
+ * Return the "id" property.
+ */
+ public String getId() {
+ return id;
+ }
+
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:list-item-body";
}
// 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
super(parent);
}
+ /**
+ * @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 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";
}
// 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.
super(parent);
}
+ /**
+ * @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
*/
}
}
+ /**
+ * Return the "marker-class-name" property.
+ */
+ public String getMarkerClassName() {
+ return markerClassName;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
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;
}
}
+ /**
+ * @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()
*/
// 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;
}
}
+ /**
+ * @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)
}
/**
- * 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()
*/
// 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;
}
}
+ /**
+ * @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
invalidChildError(loc, nsURI, localName);
}
+ /**
+ * Return the "id" property.
+ */
+ public String getId() {
+ return id;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
// 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;
}
}
+ /**
+ * @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+)
}
/**
- * 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;
}
/**
// 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;
/**
}
}
+ /**
+ * @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()
*/
// 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;
* 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
super(parent);
}
+ /**
+ * @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
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)
*/
public String getName() {
return "fo:page-number";
}
-
+
+ /**
+ * @see org.apache.fop.fo.FObj#getNameId()
+ */
public int getNameId() {
return FO_PAGE_NUMBER;
}
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;
/**
* 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
}
/**
- * @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");
}
}
invalidChildError(loc, nsURI, localName);
}
+ /**
+ * @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)
*/
// 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;
* 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.
super(parent);
}
+ /**
+ * @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
*/
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)
*/
// 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 */
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
super(parent);
}
+ /**
+ * @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
*/
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)
getFOEventHandler().startTable(this);
}
- protected void endOfNode() throws SAXParseException {
- getFOEventHandler().endTable(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#addChildNode(FONode)
*/
return tableFooter;
}
+ /**
+ * 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
// 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 */
}
/**
- * @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);
}
/**
}
}
+ /**
+ * @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()
*/
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;
/**
* @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;
super(parent);
}
+ /**
+ * @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
*/
getFOEventHandler().startBody(this);
}
- protected void endOfNode() throws SAXParseException {
- getFOEventHandler().endBody(this);
+ /**
+ * Return the Common Border, Padding, and Background Properties.
+ */
+ public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
+ return commonBorderPaddingBackground;
}
/**
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;
}
}
+ /**
+ * @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;)
}
/**
- * 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;
}
/**
// 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;
* @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;
* 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,
protected int minCellHeight = 0;
/** Height of cell */
- protected int height = 0;
+ protected int _height = 0;
/** Ypos of cell ??? */
protected int top;
* 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
super(parent);
}
+ /**
+ * @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
*/
}
}
- /**
- * 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?)
*/
* @param width the width of the cell (in millipoints ??)
*/
public void setWidth(int width) {
- this.width = width;
+ this._width = width;
}
/**
+ 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);
}
}
+ /**
+ * 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)
*/
// 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;
super(parent);
}
+ /**
+ * @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
}
/**
- * @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";
}
// 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;
* 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
super(parent);
}
+ /**
+ * @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
*/
}
}
- /**
- * @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;
}
/**
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);
}
}
+ /**
+ * 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)
*/
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.
* @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
*/
super(parent);
}
+ /**
+ * @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
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
/**
* The fo:color-profile formatting object.
* This loads the color profile when needed and resolves a requested color.
*/
public class ColorProfile extends FObj {
- private int intent;
+ // The value of properties relevant for fo:color-profile.
private String src;
+ private String colorProfileName;
+ private int renderingIntent;
+ // End of property values
+
+ private int intent;
private String profileName;
private ICC_ColorSpace colorSpace = null;
}
/**
- * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
- XSL 1.0/FOP: EMPTY (no child nodes permitted)
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws SAXParseException {
- invalidChildError(loc, nsURI, localName);
+ public void bind(PropertyList pList) {
+ src = pList.get(PR_SRC).getString();
+ colorProfileName = pList.get(PR_COLOR_PROFILE_NAME).getString();
+ renderingIntent = pList.get(PR_RENDERING_INTENT).getEnum();
}
/**
this.propertyList = null;
}
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ XSL 1.0/FOP: EMPTY (no child nodes permitted)
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws SAXParseException {
+ invalidChildError(loc, nsURI, localName);
+ }
+
/**
* @return the name of this color profile.
*/
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
/**
* A conditional-page-master-reference formatting object.
* element.
*/
public class ConditionalPageMasterReference extends FObj {
-
- private RepeatablePageMasterAlternatives repeatablePageMasterAlternatives;
-
- private String masterName;
-
+ // The value of properties relevant for fo:conditional-page-master-reference.
+ private String masterReference;
private int pagePosition;
private int oddOrEven;
private int blankOrNotBlank;
+ // End of property values
+
+ private RepeatablePageMasterAlternatives repeatablePageMasterAlternatives;
+
+ private String masterName;
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ masterReference = pList.get(PR_MASTER_REFERENCE).getString();
+ pagePosition = pList.get(PR_PAGE_POSITION).getEnum();
+ oddOrEven = pList.get(PR_ODD_OR_EVEN).getEnum();
+ blankOrNotBlank = pList.get(PR_BLANK_OR_NOT_BLANK).getEnum();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ validateParent(parent);
+ }
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: empty
}
}
+ /**
+ * Returns the "master-reference" property.
+ */
+ public String getMasterReference() {
+ return masterReference;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.XMLObj;
((Root) parent).setDeclarations(this);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ // No properties defined for fo:declarations
+ }
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL 1.0: (color-profile)+ (and non-XSL NS nodes)
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.layoutmgr.FlowLayoutManager;
/**
* @todo check need for markerSnapshot, contentWidth
*/
public class Flow extends FObj {
-
+ // The value of properties relevant for fo:flow.
+ private String flowName;
+ // End of property values
+
/**
* ArrayList to store snapshot
*/
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ flowName = pList.get(PR_FLOW_NAME).getString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ if (!parent.getName().equals("fo:page-sequence")) {
+ throw new SAXParseException("flow must be child of "
+ + "page-sequence, not " + parent.getName(), locator);
+ }
+
+ if (flowName == null || flowName.equals("")) {
+ missingPropertyError("flow-name");
+ }
+
+ // according to communication from Paul Grosso (XSL-List,
+ // 001228, Number 406), confusion in spec section 6.4.5 about
+ // multiplicity of fo:flow in XSL 1.0 is cleared up - one (1)
+ // fo:flow per fo:page-sequence only.
+
+ /* if (pageSequence.isFlowSet()) {
+ if (this.name.equals("fo:flow")) {
+ throw new FOPException("Only a single fo:flow permitted"
+ + " per fo:page-sequence");
+ } else {
+ throw new FOPException(this.name
+ + " not allowed after fo:flow");
+ }
+ }
+ */
+ // Now done in addChild of page-sequence
+ //pageSequence.addFlow(this);
+ getFOEventHandler().startFlow(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().endFlow(this);
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
}
}
- /**
- * 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().endFlow(this);
- }
-
/**
* @param contentWidth content width of this flow, in millipoints (??)
*/
return true;
}
+ /**
+ * @return the name of this flow
+ */
+ public String getFlowName() {
+ return flowName;
+ }
+
/**
* @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
/**
* The layout-master-set formatting object.
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ // No properties in layout-master-set.
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ if (parent.getName().equals("fo:root")) {
+ Root root = (Root)parent;
+ root.setLayoutMasterSet(this);
+ } else {
+ throw new SAXParseException("fo:layout-master-set must be child of fo:root, not "
+ + parent.getName(), locator);
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#endOfNode
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (childNodes == null) {
+ missingChildElementError("(simple-page-master|page-sequence-master)+");
+ }
+ checkRegionNames();
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
}
}
- /**
- * @see org.apache.fop.fo.FONode#endOfNode
- */
- protected void endOfNode() throws SAXParseException {
- if (childNodes == null) {
- missingChildElementError("(simple-page-master|page-sequence-master)+");
- }
- checkRegionNames();
- }
-
/**
* Section 7.25.7: check to see that if a region-name is a
* duplicate, that it maps to the same fo region-class.
// 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.Property;
/**
* The main entry point is the format method.
*/
public class PageSequence extends FObj {
+ // The value of properties relevant for fo:page-sequence.
+ private String country;
+ private String format;
+ private String language;
+ private int letterValue;
+ private char groupingSeparator;
+ private int groupingSize;
+ private String id;
+ private Property initialPageNumber;
+ private int forcePageCount;
+ private String masterReference;
+ // End of property values
+
//
// initial-page-number types
//
public int firstPageNumber = 0; // actual
public PageNumberGenerator pageNumberGenerator;
- public int forcePageCount = 0;
private int pageCount = 0;
private boolean isForcing = false;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ country = pList.get(PR_COUNTRY).getString();
+ format = pList.get(PR_FORMAT).getString();
+ language = pList.get(PR_LANGUAGE).getString();
+ letterValue = pList.get(PR_LETTER_VALUE).getEnum();
+ groupingSeparator = pList.get(PR_GROUPING_SEPARATOR).getCharacter();
+ groupingSize = pList.get(PR_GROUPING_SIZE).getNumber().intValue();
+ id = pList.get(PR_ID).getString();
+ initialPageNumber = pList.get(PR_INITIAL_PAGE_NUMBER);
+ forcePageCount = pList.get(PR_FORCE_PAGE_COUNT).getEnum();
+ masterReference = pList.get(PR_MASTER_REFERENCE).getString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode()
+ */
+ protected void startOfNode() throws SAXParseException {
+ this.root = (Root) parent;
+ layoutMasterSet = root.getLayoutMasterSet();
+ flowMap = new HashMap();
+
+ // we are now on the first page of the page sequence
+ thisIsFirstPage = true;
+
+ if (initialPageNumber.getEnum() != 0) {
+ // auto | auto-odd | auto-even.
+ pageNumberType = initialPageNumber.getEnum();
+ } else {
+ pageNumberType = EXPLICIT;
+ int pageStart = initialPageNumber.getNumber().intValue();
+ this.explicitFirstNumber = (pageStart > 0) ? pageStart : 1;
+ }
+
+ this.simplePageMaster =
+ this.layoutMasterSet.getSimplePageMaster(masterReference);
+ if (this.simplePageMaster == null) {
+ this.pageSequenceMaster =
+ this.layoutMasterSet.getPageSequenceMaster(masterReference);
+ if (this.pageSequenceMaster == null) {
+ throw new SAXParseException("master-reference '" + masterReference
+ + "' for fo:page-sequence matches no"
+ + " simple-page-master or page-sequence-master", locator);
+ }
+ }
+
+ // get the 'format' properties
+ this.pageNumberGenerator =
+ new PageNumberGenerator(format, groupingSeparator, groupingSize, letterValue);
+
+ checkId(id);
+ //call startStructuredPageSequence to ensure, that startPageSequence is called
+ //before startFlow.
+ startStructuredPageSequence();
+ }
+
+ /**
+ * Signal end of this xml element.
+ * This passes the end page sequence to the structure handler
+ * so it can act upon that.
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (mainFlow == null) {
+ missingChildElementError("(title?,static-content*,flow)");
+ }
+
+ getFOEventHandler().endPageSequence(this);
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
}
}
- /**
- * Signal end of this xml element.
- * This passes the end page sequence to the structure handler
- * so it can act upon that.
- */
- protected void endOfNode() throws SAXParseException {
- if (mainFlow == null) {
- missingChildElementError("(title?,static-content*,flow)");
- }
-
- getFOEventHandler().endPageSequence(this);
- }
-
/**
* Add a flow or static content, mapped by its flow-name.
* The flow-name is used to associate the flow with a region on a page,
return root;
}
+ /**
+ * Return the "master-reference" property.
+ */
+ public String getMasterReference() {
+ return masterReference;
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
// FOP
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.apps.FOPException;
/**
* which are simple or complex references to page-masters.
*/
public class PageSequenceMaster extends FObj {
-
+ // The value of properties relevant for fo:page-sequence-master.
+ private String masterName;
+ // End of property values
+
private LayoutMasterSet layoutMasterSet;
private List subSequenceSpecifiers;
private SubSequenceSpecifier currentSubSequence;
private int currentSubSequenceNumber;
- private String masterName;
// The terminology may be confusing. A 'page-sequence-master' consists
// of a sequence of what the XSL spec refers to as
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ masterName = pList.get(PR_MASTER_NAME).getString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode()
+ */
+ protected void startOfNode() throws SAXParseException {
+ subSequenceSpecifiers = new java.util.ArrayList();
+ if (parent.getName().equals("fo:layout-master-set")) {
+ this.layoutMasterSet = (LayoutMasterSet)parent;
+ if (masterName == null) {
+ getLogger().warn("page-sequence-master does not have "
+ + "a master-name and so is being ignored");
+ } else {
+ this.layoutMasterSet.addPageSequenceMaster(masterName, this);
+ }
+ } else {
+ throw new SAXParseException("fo:page-sequence-master must be child "
+ + "of fo:layout-master-set, not "
+ + parent.getName(), locator);
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#endOfNode()
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (childNodes == null) {
+ missingChildElementError("(single-page-master-reference|" +
+ "repeatable-page-master-reference|repeatable-page-master-alternatives)+");
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
}
}
- protected void endOfNode() throws SAXParseException {
- if (childNodes == null) {
- missingChildElementError("(single-page-master-reference|" +
- "repeatable-page-master-reference|repeatable-page-master-alternatives)+");
- }
- }
-
/**
* Adds a new suqsequence specifier to the page sequence master.
* @param pageMasterReference the subsequence to add
// FOP
import org.apache.fop.datatypes.FODimension;
+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;
/**
* This is an abstract base class for pagination regions
*/
public abstract class Region extends FObj {
-
- private SimplePageMaster layoutMaster;
+ // The value of properties relevant for fo:region
+ private CommonBorderPaddingBackground commonBorderPaddingBackground;
+ // private ToBeImplementedProperty clip
+ private int displayAlign;
+ private int overflow;
private String regionName;
+ private Numeric referenceOrientation;
+ private int writingMode;
+ // End of property values
+
+ private SimplePageMaster layoutMaster;
- /** Holds the overflow attribute */
- public int overflow;
/** Holds the writing mode */
protected int wm;
layoutMaster = (SimplePageMaster) parent;
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) throws SAXParseException {
+ commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
+ // clip = pList.get(PR_CLIP);
+ displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum();
+ overflow = pList.get(PR_OVERFLOW).getEnum();
+ regionName = pList.get(PR_REGION_NAME).getString();
+ referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
+ writingMode = pList.getWritingMode();
+
+ // regions may have name, or default
+ if (null == regionName) {
+ setRegionName(getDefaultRegionName());
+ } else if (regionName.equals("")) {
+ setRegionName(getDefaultRegionName());
+ } else {
+ setRegionName(regionName);
+ // check that name is OK. Not very pretty.
+ if (isReserved(getRegionName())
+ && !getRegionName().equals(getDefaultRegionName())) {
+ throw new SAXParseException("region-name '" + regionName
+ + "' for " + this.getName()
+ + " is not permitted.", locator);
+ }
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
*/
protected abstract String getDefaultRegionName();
- /**
- * Returns the name of this region.
- * @return the region name
- */
- public String getRegionName() {
- return this.regionName;
- }
-
- /**
+ /**
* Sets the name of the region.
* @param name the name
*/
// Ask parent for region
return layoutMaster.getRegion(regionId);
}
+
+ /**
+ * Return the Common Border, Padding, and Background Properties.
+ */
+ public CommonBorderPaddingBackground getCommonBorderPaddingBackground() {
+ return commonBorderPaddingBackground;
+ }
+
+ /**
+ * Return the "region-name" property.
+ */
+ public String getRegionName() {
+ return this.regionName;
+ }
+
+ /**
+ * Return the "writing-mode" property.
+ */
+ public int getWritingMode() {
+ return writingMode;
+ }
+
+ /**
+ * Return the "overflow" property.
+ */
+ public int getOverflow() {
+ return overflow;
+ }
+
+ /**
+ * Return the "reference-orientation" property.
+ */
+ public int getReferenceOrientation() {
+ return referenceOrientation.getValue();
+ }
}
import org.xml.sax.SAXParseException;
// FOP
+import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
/**
* Abstract base class for fo:region-before and fo:region-after.
*/
public abstract class RegionBA extends Region {
-
+ // The value of properties relevant for fo:region-[before|after].
+ private Length extent;
+ private int precedence;
+ // End of property values
+
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) throws SAXParseException {
+ super.bind(pList);
+ extent = pList.get(PR_EXTENT).getLength();
+ precedence = pList.get(PR_PRECEDENCE).getEnum();
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
super.addProperties(attlist);
}
+ /**
+ * Return the "extent" property.
+ */
+ public Length getExtent() {
+ return extent;
+ }
+
+ /**
+ * Return the "precedence" property.
+ * TODO: 31699
+ */
+ public int ___getPrecedence() {
+ return precedence;
+ }
+
/**
* Adjust the viewport reference rectangle for a region as a function
* of precedence.
// Java
import java.awt.Rectangle;
+// XML
+import org.xml.sax.SAXParseException;
+
// FOP
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.FODimension;
+import org.apache.fop.datatypes.Length;
+import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.properties.CommonMarginBlock;
/**
* The fo:region-body element.
*/
public class RegionBody extends Region {
+ // The value of properties relevant for fo:region-body.
+ private CommonMarginBlock commonMarginBlock;
+ private Numeric columnCount;
+ private Length columnGap;
+ // End of property values
private ColorType backgroundColor;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) throws SAXParseException {
+ super.bind(pList);
+ commonMarginBlock = pList.getMarginBlockProps();
+ columnCount = pList.get(PR_COLUMN_COUNT).getNumeric();
+ columnGap = pList.get(PR_COLUMN_GAP).getLength();
+ }
+
+ /**
+ * Return the Common Margin Properties-Block.
+ */
+ public CommonMarginBlock getCommonMarginBlock() {
+ return commonMarginBlock;
+ }
+
+ /**
+ * Return the "column-count" property.
+ */
+ public int getColumnCount() {
+ return columnCount.getValue();
+ }
+
+ /**
+ * Return the "column-gap" property.
+ */
+ public int getColumnGap() {
+ return columnGap.getValue();
+ }
+
/**
* @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
*/
import org.xml.sax.SAXParseException;
// FOP
+import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
+import org.apache.fop.fo.PropertyList;
/**
* Abstract base class for fo:region-start and fo:region-end.
*/
public abstract class RegionSE extends Region {
+ // The value of properties relevant for fo:region-[start|end].
+ private Length extent;
+ // End of property values
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) throws SAXParseException {
+ super.bind(pList);
+ extent = pList.get(PR_EXTENT).getLength();
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
super.addProperties(attlist);
}
+ /**
+ * Return the "extent" property.
+ */
+ public Length getExtent() {
+ return extent;
+ }
+
/**
* Adjust the viewport reference rectangle for a region as a function
* of precedence.
// 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.Property;
/**
*/
public class RepeatablePageMasterAlternatives extends FObj
implements SubSequenceSpecifier {
-
+ // The value of properties relevant for fo:repeatable-page-master-alternatives.
+ private Property maximumRepeats;
+ // End of property values
+
private static final int INFINITE = -1;
/**
* Max times this page master can be repeated.
* INFINITE is used for the unbounded case
*/
- private int maximumRepeats;
+ private int _maximumRepeats;
private int numberConsumed = 0;
private ArrayList conditionalPageMasterRefs;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ conditionalPageMasterRefs = new ArrayList();
+
+ if (parent.getName().equals("fo:page-sequence-master")) {
+ PageSequenceMaster pageSequenceMaster = (PageSequenceMaster)parent;
+ pageSequenceMaster.addSubsequenceSpecifier(this);
+ } else {
+ throw new SAXParseException("fo:repeatable-page-master-alternatives "
+ + "must be child of fo:page-sequence-master, not "
+ + parent.getName(), locator);
+ }
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#endOfNode
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (childNodes == null) {
+ missingChildElementError("(conditional-page-master-reference+)");
+ }
+ }
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL/FOP: (conditional-page-master-reference+)
}
/**
- * @see org.apache.fop.fo.FONode#endOfNode
+ * Return the "maximum-repeats" property.
*/
- protected void endOfNode() throws SAXParseException {
- if (childNodes == null) {
- missingChildElementError("(conditional-page-master-reference+)");
+ public int getMaximumRepeats() {
+ if (maximumRepeats.getEnum() == NO_LIMIT) {
+ return INFINITE;
+ } else {
+ int mr = maximumRepeats.getNumeric().getValue();
+ if (mr < 0) {
+ getLogger().debug("negative maximum-repeats: "
+ + this.maximumRepeats);
+ mr = 0;
+ }
+ return mr;
}
}
Property mr = getProperty(PR_MAXIMUM_REPEATS);
if (mr.getEnum() == NO_LIMIT) {
- this.maximumRepeats = INFINITE;
+ this._maximumRepeats = INFINITE;
} else {
- this.maximumRepeats = mr.getNumber().intValue();
- if (this.maximumRepeats < 0) {
+ this._maximumRepeats = mr.getNumber().intValue();
+ if (this._maximumRepeats < 0) {
getLogger().debug("negative maximum-repeats: "
+ this.maximumRepeats);
- this.maximumRepeats = 0;
+ this._maximumRepeats = 0;
}
}
}
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isBlankPage) {
- if (maximumRepeats != INFINITE) {
- if (numberConsumed < maximumRepeats) {
+ if (_maximumRepeats != INFINITE) {
+ if (numberConsumed < _maximumRepeats) {
numberConsumed++;
} else {
return null;
// 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.Property;
/**
public class RepeatablePageMasterReference extends FObj
implements SubSequenceSpecifier {
+ // The value of properties relevant for fo:repeatable-page-master-reference.
+ private String masterReference;
+ private Property maximumRepeats;
+ // End of property values
+
private static final int INFINITE = -1;
private PageSequenceMaster pageSequenceMaster;
- private int maximumRepeats;
+ private int _maximumRepeats;
private int numberConsumed = 0;
/**
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ masterReference = pList.get(PR_MASTER_REFERENCE).getString();
+ maximumRepeats = pList.get(PR_MAXIMUM_REPEATS);
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
+
+ if (masterReference == null) {
+ missingPropertyError("master-reference");
+ } else {
+ pageSequenceMaster.addSubsequenceSpecifier(this);
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
Property mr = getProperty(PR_MAXIMUM_REPEATS);
if (mr.getEnum() == NO_LIMIT) {
- this.maximumRepeats = INFINITE;
+ this._maximumRepeats = INFINITE;
} else {
- this.maximumRepeats = mr.getNumber().intValue();
- if (this.maximumRepeats < 0) {
+ this._maximumRepeats = mr.getNumber().intValue();
+ if (this._maximumRepeats < 0) {
getLogger().debug("negative maximum-repeats: "
+ this.maximumRepeats);
- this.maximumRepeats = 0;
+ this._maximumRepeats = 0;
}
}
}
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isEmptyPage) {
- if (maximumRepeats != INFINITE) {
- if (numberConsumed < maximumRepeats) {
+ if (_maximumRepeats != INFINITE) {
+ if (numberConsumed < _maximumRepeats) {
numberConsumed++;
} else {
return null;
return getPropString(PR_MASTER_REFERENCE);
}
+ /**
+ * Return the "maximum-repeats" property.
+ */
+ public int getMaximumRepeats() {
+ if (maximumRepeats.getEnum() == NO_LIMIT) {
+ return INFINITE;
+ } else {
+ int mr = maximumRepeats.getNumeric().getValue();
+ if (mr < 0) {
+ getLogger().debug("negative maximum-repeats: "
+ + this.maximumRepeats);
+ mr = 0;
+ }
+ return mr;
+ }
+ }
+
/**
* @see org.apache.fop.fo.pagination.SubSequenceSpecifier#reset()
*/
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOEventHandler;
+import org.apache.fop.fo.PropertyList;
import org.apache.fop.fo.extensions.ExtensionElementMapping;
import org.apache.fop.fo.extensions.Bookmarks;
* The fo:root formatting object. Contains page masters, page-sequences.
*/
public class Root extends FObj {
+ // The value of properties relevant for fo:root.
+ // private ToBeImplementedProperty mediaUsage;
+ // End of property values
+
private LayoutMasterSet layoutMasterSet;
private Declarations declarations;
private Bookmarks bookmarks = null;
}
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ // prMediaUsage = pList.get(PR_MEDIA_USAGE);
+ }
+
+ /**
+ * Signal end of this xml element.
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (!pageSequenceFound || layoutMasterSet == null) {
+ missingChildElementError("(layout-master-set, declarations?, " +
+ "fox:bookmarks?, page-sequence+)");
+ }
+ }
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL 1.0 Spec: (layout-master-set,declarations?,page-sequence+)
}
}
- /**
- * Signal end of this xml element.
- */
- protected void endOfNode() throws SAXParseException {
- if (!pageSequenceFound || layoutMasterSet == null) {
- missingChildElementError("(layout-master-set, declarations?, " +
- "fox:bookmarks?, page-sequence+)");
- }
- }
-
/**
* Sets the FOEventHandler object that this Root is attached to
* @param foEventHandler the FOEventHandler object
import org.xml.sax.SAXParseException;
// FOP
+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.CommonMarginBlock;
/**
* A simple-page-master formatting object.
* and attributes.
*/
public class SimplePageMaster extends FObj {
+ // The value of properties relevant for fo:simple-page-master.
+ private CommonMarginBlock commonMarginBlock;
+ private String masterName;
+ private Length pageHeight;
+ private Length pageWidth;
+ private Numeric referenceOrientation;
+ private int writingMode;
+ // End of property values
+
/**
* Page regions (regionClass, Region)
*/
private Map regions;
- private String masterName;
-
- // used for node validation
+ // used for node validation
private boolean hasRegionBody = false;
private boolean hasRegionBefore = false;
private boolean hasRegionAfter = false;
super(parent);
}
+ /**
+ * @see org.apache.fop.fo.FObj#resolve
+ */
+ public void bind(PropertyList pList) {
+ commonMarginBlock = pList.getMarginBlockProps();
+ masterName = pList.get(PR_MASTER_NAME).getString();
+ pageHeight = pList.get(PR_PAGE_HEIGHT).getLength();
+ pageWidth = pList.get(PR_PAGE_WIDTH).getLength();
+ referenceOrientation = pList.get(PR_REFERENCE_ORIENTATION).getNumeric();
+ writingMode = pList.getWritingMode();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ LayoutMasterSet layoutMasterSet = (LayoutMasterSet) parent;
+
+ if (masterName == null) {
+ missingPropertyError("master-name");
+ } else {
+ layoutMasterSet.addSimplePageMaster(this);
+ }
+
+ //Well, there are only 5 regions so we can save a bit of memory here
+ regions = new HashMap(5);
+ }
+
+ /**
+ * Make sure content model satisfied.
+ * @see org.apache.fop.fo.FONode#endOfNode
+ */
+ protected void endOfNode() throws SAXParseException {
+ if (!hasRegionBody) {
+ missingChildElementError("(region-body, region-before?," +
+ " region-after?, region-start?, region-end?)");
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
*/
protected void validateChildNode(Locator loc, String nsURI, String localName)
throws SAXParseException {
- if (nsURI == FO_URI && localName.equals("region-body")) {
- if (hasRegionBody) {
- tooManyNodesError(loc, "fo:region-body");
- } else {
- hasRegionBody = true;
- }
- } else if (nsURI == FO_URI && localName.equals("region-before")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-before");
- } else if (hasRegionBefore) {
- tooManyNodesError(loc, "fo:region-before");
- } else if (hasRegionAfter) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-after");
- } else if (hasRegionStart) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-before", "fo:region-end");
- } else {
- hasRegionBody = true;
- }
- } else if (nsURI == FO_URI && localName.equals("region-after")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-after");
- } else if (hasRegionAfter) {
- tooManyNodesError(loc, "fo:region-after");
- } else if (hasRegionStart) {
- nodesOutOfOrderError(loc, "fo:region-after", "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-after", "fo:region-end");
- } else {
- hasRegionAfter = true;
- }
- } else if (nsURI == FO_URI && localName.equals("region-start")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-start");
- } else if (hasRegionStart) {
- tooManyNodesError(loc, "fo:region-start");
- } else if (hasRegionEnd) {
- nodesOutOfOrderError(loc, "fo:region-start", "fo:region-end");
- } else {
- hasRegionStart = true;
- }
- } else if (nsURI == FO_URI && localName.equals("region-end")) {
- if (!hasRegionBody) {
- nodesOutOfOrderError(loc, "fo:region-body", "fo:region-end");
- } else if (hasRegionEnd) {
- tooManyNodesError(loc, "fo:region-end");
- } else {
- hasRegionEnd = true;
- }
+ if (nsURI == FO_URI && localName.equals("region-body")) {
+ if (hasRegionBody) {
+ tooManyNodesError(loc, "fo:region-body");
} else {
- invalidChildError(loc, nsURI, localName);
+ hasRegionBody = true;
}
- }
-
- /**
- * Make sure content model satisfied.
- * @see org.apache.fop.fo.FONode#endOfNode
- */
- protected void endOfNode() throws SAXParseException {
- if (!hasRegionBody) {
- missingChildElementError("(region-body, region-before?," +
- " region-after?, region-start?, region-end?)");
+ } else if (nsURI == FO_URI && localName.equals("region-before")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-before");
+ } else if (hasRegionBefore) {
+ tooManyNodesError(loc, "fo:region-before");
+ } else if (hasRegionAfter) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-after");
+ } else if (hasRegionStart) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-before", "fo:region-end");
+ } else {
+ hasRegionBody = true;
+ }
+ } else if (nsURI == FO_URI && localName.equals("region-after")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-after");
+ } else if (hasRegionAfter) {
+ tooManyNodesError(loc, "fo:region-after");
+ } else if (hasRegionStart) {
+ nodesOutOfOrderError(loc, "fo:region-after", "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-after", "fo:region-end");
+ } else {
+ hasRegionAfter = true;
+ }
+ } else if (nsURI == FO_URI && localName.equals("region-start")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-start");
+ } else if (hasRegionStart) {
+ tooManyNodesError(loc, "fo:region-start");
+ } else if (hasRegionEnd) {
+ nodesOutOfOrderError(loc, "fo:region-start", "fo:region-end");
+ } else {
+ hasRegionStart = true;
+ }
+ } else if (nsURI == FO_URI && localName.equals("region-end")) {
+ if (!hasRegionBody) {
+ nodesOutOfOrderError(loc, "fo:region-body", "fo:region-end");
+ } else if (hasRegionEnd) {
+ tooManyNodesError(loc, "fo:region-end");
+ } else {
+ hasRegionEnd = true;
+ }
+ } else {
+ invalidChildError(loc, nsURI, localName);
}
}
return true;
}
- /**
- * Returns the name of the simple-page-master.
- * @return the page master name
- */
- public String getMasterName() {
- return getPropString(PR_MASTER_NAME);
- }
-
/**
* @see org.apache.fop.fo.FONode#addChildNode(FONode)
*/
return false;
}
+ /**
+ * Return the Common Margin Properties-Block.
+ */
+ public CommonMarginBlock getCommonMarginBlock() {
+ return commonMarginBlock;
+ }
+
+ /**
+ * Return "master-name" property.
+ */
+ public String getMasterName() {
+ return getPropString(PR_MASTER_NAME);
+ }
+
+ /**
+ * Return the "page-width" property.
+ */
+ public Length getPageWidth() {
+ return pageWidth;
+ }
+
+ /**
+ * Return the "page-height" property.
+ */
+ public Length getPageHeight() {
+ return pageHeight;
+ }
+
+
+ /**
+ * Return the "writing-mode" property.
+ */
+ public int getWritingMode() {
+ return writingMode;
+ }
+
+ /**
+ * Return the "reference-orientation" property.
+ */
+ public int getReferenceOrientation() {
+ return referenceOrientation.getValue();
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
+import org.apache.fop.fo.PropertyList;
/**
* A single-page-master-reference formatting object.
public class SinglePageMasterReference extends FObj
implements SubSequenceSpecifier {
+ // The value of properties relevant for fo:single-page-master-reference.
+ private String masterReference;
+ // End of property values
+
private static final int FIRST = 0;
private static final int DONE = 1;
this.state = FIRST;
}
+ /**
+ * @see org.apache.fop.fo.FObj#bind(PropertyList)
+ */
+ public void bind(PropertyList pList) {
+ masterReference = pList.get(PR_MASTER_REFERENCE).getString();
+ }
+
+ /**
+ * @see org.apache.fop.fo.FONode#startOfNode
+ */
+ protected void startOfNode() throws SAXParseException {
+ PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
+ if (masterReference == null) {
+ missingPropertyError("master-reference");
+ } else {
+ pageSequenceMaster.addSubsequenceSpecifier(this);
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#addProperties
*/
}
/**
- * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
- * XSL Content Model: (%block;)+
+ * @see org.apache.fop.fo.FONode#startOfNode()
*/
- protected void validateChildNode(Locator loc, String nsURI, String localName)
- throws SAXParseException {
- if (!isBlockItem(nsURI, localName)) {
- invalidChildError(loc, nsURI, localName);
+ protected void startOfNode() throws SAXParseException {
+ if (getFlowName() == null || getFlowName().equals("")) {
+ throw new SAXParseException("A 'flow-name' is required for "
+ + getName() + ".", locator);
}
+ getFOEventHandler().startFlow(this);
}
/**
getFOEventHandler().endFlow(this);
}
+ /**
+ * @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
+ * XSL Content Model: (%block;)+
+ */
+ protected void validateChildNode(Locator loc, String nsURI, String localName)
+ throws SAXParseException {
+ if (!isBlockItem(nsURI, localName)) {
+ invalidChildError(loc, nsURI, localName);
+ }
+ }
+
/**
* @see org.apache.fop.fo.FObj#getName()
*/
import org.xml.sax.SAXParseException;
// FOP
+import org.apache.fop.datatypes.ColorType;
+import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FObjMixed;
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.CommonFont;
+import org.apache.fop.fo.properties.CommonMarginInline;
/**
* Class modelling the fo:title object.
*/
public class Title extends FObjMixed {
+ // The value of properties relevant for fo:title.
+ private CommonAccessibility commonAccessibility;
+ private CommonAural commonAural;
+ private CommonBorderPaddingBackground commonBorderPaddingBackground;
+ private CommonFont commonFont;
+ private CommonMarginInline commonMarginInline;
+ private ColorType color;
+ private Length lineHeight;
+ // private ToBeImplementedProperty visibility;
/**
* @param parent FONode that is the parent of this object
super(parent);
}
+ public void bind(PropertyList pList) {
+ commonAccessibility = pList.getAccessibilityProps();
+ commonAural = pList.getAuralProps();
+ commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps();
+ commonFont = pList.getFontProps();
+ commonMarginInline = pList.getMarginInlineProps();
+ color = pList.get(PR_COLOR).getColorType();
+ lineHeight = pList.get(PR_LINE_HEIGHT).getLength();
+ // visibility = pList.get(PR_VISIBILITY);
+ }
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL/FOP: (#PCDATA|%inline;)*
setRegionPosition(r, body, absRegVPRect);
int columnCount =
r.getProperty(PR_COLUMN_COUNT).getNumber().intValue();
- if ((columnCount > 1) && (r.overflow == Overflow.SCROLL)) {
+ if ((columnCount > 1) && (r.getOverflow() == Overflow.SCROLL)) {
// recover by setting 'column-count' to 1. This is allowed but
// not required by the spec.
log.error("Setting 'column-count' to 1 because "