propertyList.addAttributesToList(attlist);
propMgr = new PropertyManager(propertyList);
setWritingMode();
+
+ // if this FO can have a PR_ID, make sure it is unique
+ if (PropertySets.canHaveId(getNameId())) {
+ setupID();
+ }
+ }
+
+ /**
+ * Setup the id for this formatting object.
+ * Most formatting objects can have an id that can be referenced.
+ * This methods checks that the id isn't already used by another
+ * fo and sets the id attribute of this object.
+ */
+ private void setupID() {
+ Property prop = this.propertyList.get(PR_ID);
+ if (prop != null) {
+ String str = prop.getString();
+ if (str != null && !str.equals("")) {
+ Set idrefs = getFOInputHandler().getIDReferences();
+ if (!idrefs.contains(str)) {
+ id = str;
+ idrefs.add(id);
+ } else {
+ getLogger().warn("duplicate id:" + str + " ignored");
+ }
+ }
+ }
}
/**
return new Integer(0);
}
- /**
- * Setup the id for this formatting object.
- * Most formatting objects can have an id that can be referenced.
- * This methods checks that the id isn't already used by another
- * fo and sets the id attribute of this object.
- */
- public void setupID() {
- Property prop = this.propertyList.get(PR_ID);
- if (prop != null) {
- String str = prop.getString();
- if (str != null && !str.equals("")) {
- Set idrefs = getFOInputHandler().getIDReferences();
- if (!idrefs.contains(str)) {
- id = str;
- idrefs.add(id);
- } else {
- getLogger().warn("duplicate id:" + str + " ignored");
- }
- }
- }
- }
-
/**
* Get the id string for this formatting object.
* This will be unique for the fo document.
addChildNode(ft);
}
- private void setup() {
- if (this.propertyList != null) {
- setupID();
- }
- }
-
/**
* @return iterator for this object
*/
public class PropertySets {
private static short[][] mapping = null;
private static BitSet can_have_markers = null;
+ private static BitSet can_have_id = null;
private Element[] elements = new Element[Constants.ELEMENT_COUNT+1];
private BitSet block_elems = new BitSet();
elem.addProperty(Constants.PR_RETRIEVE_POSITION);
elem.addProperty(Constants.PR_RETRIEVE_BOUNDARY);
-
-
// Merge the attributes from the children into the parent.
for (boolean dirty = true; dirty; ) {
dirty = false;
return can_have_markers.get(elementId);
}
+ /**
+ * Determines if the XSL "id" property is applicable for this FO
+ * @param elementId Constants enumeration ID of the FO (e.g., FO_ROOT)
+ * @return true if id property is applicable, false otherwise
+ * @todo see if we can stop merging properties applicable for the children
+ * of an FO into the FO in the mapping[] array above. If so, we can
+ * rely on getPropertySet() instead of this method.
+ */
+ public static boolean canHaveId(int elementId) {
+ if (can_have_id == null) {
+ can_have_id = new BitSet();
+ can_have_id.set(Constants.FO_BASIC_LINK);
+ can_have_id.set(Constants.FO_BIDI_OVERRIDE);
+ can_have_id.set(Constants.FO_BLOCK);
+ can_have_id.set(Constants.FO_BLOCK_CONTAINER);
+ can_have_id.set(Constants.FO_CHARACTER);
+ can_have_id.set(Constants.FO_EXTERNAL_GRAPHIC);
+ can_have_id.set(Constants.FO_INITIAL_PROPERTY_SET);
+ can_have_id.set(Constants.FO_INLINE);
+ can_have_id.set(Constants.FO_INLINE_CONTAINER);
+ can_have_id.set(Constants.FO_INSTREAM_FOREIGN_OBJECT);
+ can_have_id.set(Constants.FO_LEADER);
+ can_have_id.set(Constants.FO_LIST_BLOCK);
+ can_have_id.set(Constants.FO_LIST_ITEM);
+ can_have_id.set(Constants.FO_LIST_ITEM_BODY);
+ can_have_id.set(Constants.FO_LIST_ITEM_LABEL);
+ can_have_id.set(Constants.FO_MULTI_CASE);
+ can_have_id.set(Constants.FO_MULTI_PROPERTIES);
+ can_have_id.set(Constants.FO_MULTI_PROPERTY_SET);
+ can_have_id.set(Constants.FO_MULTI_SWITCH);
+ can_have_id.set(Constants.FO_MULTI_TOGGLE);
+ can_have_id.set(Constants.FO_PAGE_NUMBER);
+ can_have_id.set(Constants.FO_PAGE_NUMBER_CITATION);
+ can_have_id.set(Constants.FO_PAGE_SEQUENCE);
+ can_have_id.set(Constants.FO_TABLE_AND_CAPTION);
+ can_have_id.set(Constants.FO_TABLE);
+ can_have_id.set(Constants.FO_TABLE_BODY);
+ can_have_id.set(Constants.FO_TABLE_CAPTION);
+ can_have_id.set(Constants.FO_TABLE_CELL);
+ can_have_id.set(Constants.FO_TABLE_FOOTER);
+ can_have_id.set(Constants.FO_TABLE_HEADER);
+ can_have_id.set(Constants.FO_TABLE_ROW);
+ can_have_id.set(Constants.FO_WRAPPER);
+ }
+ return can_have_id.get(elementId);
+ }
+
/**
* An object that represent the properties and contents of a fo element
*/
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
// This logic is for determining the link represented by this FO.
String ext = propertyList.get(PR_EXTERNAL_DESTINATION).getString();
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
}
/**
this.lfTreatment =
this.propertyList.get(PR_LINEFEED_TREATMENT).getEnum();
- setupID();
this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum();
this.alignLast =
this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum();
import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonAbsolutePosition;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonMarginBlock;
import org.apache.fop.layoutmgr.BlockContainerLayoutManager;
import org.xml.sax.Attributes;
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
this.span = this.propertyList.get(PR_SPAN).getEnum();
- setupID();
- }
-
- private void setup() {
-
- // Common Accessibility Properties
- CommonAbsolutePosition mAbsProps = propMgr.getAbsolutePositionProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Margin-Block Properties
- CommonMarginBlock mProps = propMgr.getMarginProps();
-
- // this.propertyList.get("block-progression-dimension");
- // this.propertyList.get("break-after");
- // this.propertyList.get("break-before");
- // this.propertyList.get("clip");
- // this.propertyList.get("display-align");
- // this.propertyList.get("height");
- setupID();
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
- // this.propertyList.get("overflow");
- // this.propertyList.get("reference-orientation");
- // this.propertyList.get("span");
- // this.propertyList.get("width");
- // this.propertyList.get("writing-mode");
-
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
-
- this.width = this.propertyList.get(PR_WIDTH).getLength().getValue();
- this.height = this.propertyList.get(PR_HEIGHT).getLength().getValue();
- span = this.propertyList.get(PR_SPAN).getEnum();
+ this.backgroundColor =
+ this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
+ this.width = this.propertyList.get(PR_WIDTH).getLength().getValue();
+ this.height = this.propertyList.get(PR_HEIGHT).getLength().getValue();
}
/**
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.OneCharIterator;
import org.apache.fop.layoutmgr.AddLMVisitor;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonBackground;
-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.apps.FOPException;
import org.apache.fop.fo.LMVisited;
/**
invalidChildError(loc, nsURI, localName);
}
- private void setup() throws FOPException {
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Font Properties
- //this.fontState = propMgr.getFontState(area.getFontInfo());
-
- // Common Hyphenation Properties
- CommonHyphenation mHyphProps = propMgr.getHyphenationProps();
-
- // Common Margin Properties-Inline
- CommonMarginInline mProps = propMgr.getMarginInlineProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps =
- propMgr.getRelativePositionProps();
-
- // this.propertyList.get("alignment-adjust");
- // this.propertyList.get("treat-as-word-space");
- // this.propertyList.get("alignment-baseline");
- // this.propertyList.get("baseline-shift");
- // this.propertyList.get("character");
- // this.propertyList.get("color");
- // this.propertyList.get("dominant-baseline");
- // this.propertyList.get("text-depth");
- // this.propertyList.get("text-altitude");
- // this.propertyList.get("glyph-orientation-horizontal");
- // this.propertyList.get("glyph-orientation-vertical");
- setupID();
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
- // this.propertyList.get("letter-spacing");
- // this.propertyList.get("line-height");
- // this.propertyList.get("line-height-shift-adjustment");
- // this.propertyList.get("score-spaces");
- // this.propertyList.get("suppress-at-line-break");
- // this.propertyList.get("text-decoration");
- // this.propertyList.get("text-shadow");
- // this.propertyList.get("text-transform");
- // this.propertyList.get("word-spacing");
- }
-
/**
* @see org.apache.fop.fo.FObj#charIterator
*/
* This gets the sizes for the image and the dimensions and clipping.
*/
private void setup() {
- setupID();
url = this.propertyList.get(PR_SRC).getString();
if (url == null) {
return;
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonRelativePosition;
/**
* Class modelling the fo:initial-property-set object. See Sec. 6.6.4 of the
invalidChildError(loc, nsURI, localName);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Font Properties
- //this.fontState = propMgr.getFontState(area.getFontInfo());
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("color");
- setupID();
- // this.propertyList.get("letter-spacing");
- // this.propertyList.get("line-height");
- // this.propertyList.get("line-height-shift-adjustment");
- // this.propertyList.get("score-spaces");
- // this.propertyList.get("text-decoration");
- // this.propertyList.get("text-shadow");
- // this.propertyList.get("text-transform");
- // this.propertyList.get("word-spacing");
-
- }
-
public String getName() {
return "fo:initial-property-set";
}
+ " be directly under flow", locator);
}
- setupID();
-
int textDecoration = this.propertyList.get(PR_TEXT_DECORATION).getEnum();
if (textDecoration == TextDecoration.UNDERLINE) {
import org.apache.fop.layoutmgr.ICLayoutManager;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonMarginInline;
-import org.apache.fop.fo.properties.CommonRelativePosition;
/**
* Class modelling the fo:inline-container object. See Sec. 6.6.8 of the XSL-FO
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Margin Properties-Inline
- CommonMarginInline mProps = propMgr.getMarginInlineProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps =
- propMgr.getRelativePositionProps();
-
- // this.propertyList.get("alignment-adjust");
- // this.propertyList.get("alignment-baseline");
- // this.propertyList.get("baseline-shift");
- // this.propertyList.get("block-progression-dimension");
- // this.propertyList.get("clip");
- // this.propertyList.get("display-align");
- // this.propertyList.get("dominant-baseline");
- // this.propertyList.get("height");
- setupID();
- // this.propertyList.get("inline-progression-dimension");
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
- // this.propertyList.get("line-height");
- // this.propertyList.get("line-height-shift-adjustment");
- // this.propertyList.get("overflow");
- // this.propertyList.get("reference-orientation");
- // this.propertyList.get("width");
- // this.propertyList.get("writing-mode");
}
/**
import org.apache.fop.fo.FONode;
import org.apache.fop.layoutmgr.AddLMVisitor;
import org.apache.fop.fo.FObjMixed;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonMarginInline;
-import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.PercentLength;
import org.apache.fop.fonts.Font;
import org.apache.fop.fo.LMVisited;
super(parent);
}
+ /**
+ * @todo convert to addProperties()
+ */
private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
// Common Font Properties
this.fontState = propMgr.getFontState(getFOInputHandler().getFontInfo());
- // Common Margin Properties-Inline
- CommonMarginInline mProps = propMgr.getMarginInlineProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("alignment-adjust");
- // this.propertyList.get("alignment-baseline");
- // this.propertyList.get("baseline-shift");
- // this.propertyList.get("color");
- // this.propertyList.get("dominant-baseline");
- // this.propertyList.get("text-depth");
- // this.propertyList.get("text-altitude");
- setupID();
- // this.propertyList.get("leader-alignment");
- // this.propertyList.get("leader-length");
- // this.propertyList.get("leader-pattern");
- // this.propertyList.get("leader-pattern-width");
- // this.propertyList.get("rule-style");
- // this.propertyList.get("rule-thickness");
- // this.propertyList.get("letter-spacing");
- // this.propertyList.get("line-height");
- // this.propertyList.get("line-height-shift-adjustment");
- // this.propertyList.get("text-shadow");
- // this.propertyList.get("visibility");
- // this.propertyList.get("word-spacing");
- // this.propertyList.get("z-index");
-
// color properties
ColorType c = this.propertyList.get(PR_COLOR).getColorType();
float red = c.getRed();
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum();
this.alignLast = this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum();
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
getFOInputHandler().startListItem(this);
- }
-
- private void setup() {
- setupID();
this.align = this.propertyList.get(PR_TEXT_ALIGN).getEnum();
this.alignLast = this.propertyList.get(PR_TEXT_ALIGN_LAST).getEnum();
this.lineHeight =
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:list-item-body object. See Sec. 6.8.4 of the XSL-FO
super(parent);
}
+ /**
+ * @todo convert to addProperties()
+ */
private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- setupID();
- // this.propertyList.get("keep-together");
-
/*
* For calculating the lineage - The fo:list-item-body formatting object
* does not generate any areas. The fo:list-item-body formatting object
* returns the sequence of areas created by concatenating the sequences
* of areas returned by each of the child nodes of the fo:list-item-body.
*/
-
}
public String getName() {
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:list-item-label object. See Sec. 6.8.5 of the XSL-FO
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
getFOInputHandler().startListLabel();
- }
-
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- setupID();
- // this.propertyList.get("keep-together");
-
/*
* For calculating the lineage - The fo:list-item-label formatting object
* does not generate any areas. The fo:list-item-label formatting object
* returns the sequence of areas created by concatenating the sequences
* of areas returned by each of the child nodes of the fo:list-item-label.
*/
-
}
protected void endOfNode() throws SAXParseException {
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:multi-case object. See Sec. 6.9.4 of the XSL-FO
super(parent);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- setupID();
- // this.propertyList.get("starting-state");
- // this.propertyList.get("case-name");
- // this.propertyList.get("case-title");
-
- }
-
public String getName() {
return "fo:multi-case";
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:multi-properties object. See Sec. 6.9.6 of the XSL-FO
super(parent);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- setupID();
-
- }
-
public String getName() {
return "fo:multi-properties";
}
invalidChildError(loc, nsURI, localName);
}
- private void setup() {
- setupID();
- // this.propertyList.get("active-state");
- }
-
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:multi-property-set";
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:multi-switch object. See Sec. 6.9.3 of the XSL-FO
super(parent);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // this.propertyList.get("auto-restore");
- setupID();
-
- }
-
public String getName() {
return "fo:multi-switch";
}
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
/**
* Class modelling the fo:multi-toggle property. See Sec. 6.9.5 of the XSL-FO
super(parent);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- setupID();
- // this.propertyList.get("switch-to");
-
- }
-
+ /**
+ * @see org.apache.fop.fo.FObj#getName()
+ */
public String getName() {
return "fo:multi-toggle";
}
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setup();
- getFOInputHandler().startPageNumber(this);
- }
- private void setup() {
// Common Font Properties
this.fontState = propMgr.getFontState(getFOInputHandler().getFontInfo());
- setupID();
-
ColorType c = this.propertyList.get(PR_COLOR).getColorType();
this.red = c.getRed();
this.green = c.getGreen();
this.blue = c.getBlue();
this.wrapOption = this.propertyList.get(PR_WRAP_OPTION).getEnum();
+
+ getFOInputHandler().startPageNumber(this);
}
/**
// Common Font Properties
this.fontState = propMgr.getFontState(getFOInputHandler().getFontInfo());
- setupID();
-
ColorType c = this.propertyList.get(PR_COLOR).getColorType();
this.red = c.getRed();
this.green = c.getGreen();
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
- getFOInputHandler().startTable(this);
- }
-
- /**
- * @see org.apache.fop.fo.FONode#addChildNode(FONode)
- */
- protected void addChildNode(FONode child) {
- if (child.getName().equals("fo:table-column")) {
- if (columns == null) {
- columns = new ArrayList();
- }
- columns.add(((TableColumn)child));
- } else if (child.getName().equals("fo:table-footer")) {
- tableFooter = (TableBody)child;
- } else if (child.getName().equals("fo:table-header")) {
- tableHeader = (TableBody)child;
- } else {
- // add bodies
- super.addChildNode(child);
- }
- }
-
- private void setup() {
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Margin Properties-Block
- CommonMarginBlock mProps = propMgr.getMarginProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps =
- propMgr.getRelativePositionProps();
-
- // this.propertyList.get("block-progression-dimension");
- // this.propertyList.get("border-after-precendence");
- // this.propertyList.get("border-before-precedence");
- // this.propertyList.get("border-collapse");
- // this.propertyList.get("border-end-precendence");
- // this.propertyList.get("border-separation");
- // this.propertyList.get("border-start-precendence");
- // this.propertyList.get("break-after");
- // this.propertyList.get("break-before");
- setupID();
- // this.propertyList.get("inline-progression-dimension");
- // this.propertyList.get("height");
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
- // this.propertyList.get("table-layout");
- // this.propertyList.get("table-omit-footer-at-break");
- // this.propertyList.get("table-omit-header-at-break");
- // this.propertyList.get("width");
- // this.propertyList.get("writing-mode");
-
this.breakBefore = this.propertyList.get(PR_BREAK_BEFORE).getEnum();
this.breakAfter = this.propertyList.get(PR_BREAK_AFTER).getEnum();
this.spaceBefore = this.propertyList.get(
this.omitFooterAtBreak = this.propertyList.get(
PR_TABLE_OMIT_FOOTER_AT_BREAK).getEnum()
== TableOmitFooterAtBreak.TRUE;
+ getFOInputHandler().startTable(this);
+ }
+ /**
+ * @see org.apache.fop.fo.FONode#addChildNode(FONode)
+ */
+ protected void addChildNode(FONode child) {
+ if (child.getName().equals("fo:table-column")) {
+ if (columns == null) {
+ columns = new ArrayList();
+ }
+ columns.add(((TableColumn)child));
+ } else if (child.getName().equals("fo:table-footer")) {
+ tableFooter = (TableBody)child;
+ } else if (child.getName().equals("fo:table-header")) {
+ tableHeader = (TableBody)child;
+ } else {
+ // add bodies
+ super.addChildNode(child);
+ }
}
/**
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonMarginBlock;
-import org.apache.fop.fo.properties.CommonRelativePosition;
/**
* Class modelling the fo:table-and-caption property. See Sec. 6.7.2 of the
super(parent);
}
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Margin Properties-Block
- CommonMarginBlock mProps = propMgr.getMarginProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("caption-side");
- setupID();
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
-
- }
-
/**
* @return false (TableAndCaption doesn't generate inline areas)
*/
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.layoutmgr.AddLMVisitor;
-
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.LMVisited;
-
/**
* Class modelling the fo:table-body object. See Sec. 6.7.8 of the XSL-FO
* Standard.
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
- getFOInputHandler().startBody(this);
- }
-
- private void setup() {
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps =
- propMgr.getRelativePositionProps();
-
- setupID();
-
this.spaceBefore = this.propertyList.get(
PR_SPACE_BEFORE | CP_OPTIMUM).getLength().getValue();
this.spaceAfter = this.propertyList.get(
PR_SPACE_AFTER | CP_OPTIMUM).getLength().getValue();
this.backgroundColor =
this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
-
+ getFOInputHandler().startBody(this);
}
/**
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.ToBeImplementedElement;
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonRelativePosition;
/**
* Class modelling the fo:table-caption object. See Sec. 6.7.5 of the XSL-FO
super(parent);
}
- /**
- * Initialize property values.
- */
- private void setup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("block-progression-dimension");
- // this.propertyList.get("height");
- setupID();
- // this.propertyList.get("inline-progression-dimension");
- // this.propertyList.get("keep-togethe");
- // this.propertyList.get("width");
-
- }
-
public String getName() {
return "fo:table-caption";
}
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.layoutmgr.table.Cell;
-
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonRelativePosition;
/**
* Class modelling the fo:table-cell object. See Sec. 6.7.10 of the XSL-FO
return numRowsSpanned;
}
+ /**
+ * @todo convert to addProperties()
+ */
private void doSetup() {
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("border-after-precedence");
- // this.propertyList.get("border-before-precendence");
- // this.propertyList.get("border-end-precendence");
- // this.propertyList.get("border-start-precendence");
- // this.propertyList.get("block-progression-dimension");
- // this.propertyList.get("column-number");
- // this.propertyList.get("display-align");
- // this.propertyList.get("relative-align");
- // this.propertyList.get("empty-cells");
- // this.propertyList.get("ends-row");
- // this.propertyList.get("height");
- setupID();
- // this.propertyList.get("number-columns-spanned");
- // this.propertyList.get("number-rows-spanned");
- // this.propertyList.get("starts-row");
- // this.propertyList.get("width");
this.iColNumber =
propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-
/**
* Class modelling the fo:table-column object. See Sec. 6.7.4 of the XSL-FO
* Standard.
return numColumnsRepeated;
}
+ /**
+ * @todo convert to addProperties()
+ */
public void initialize() {
-
- // Common Border, Padding, and Background Properties
- // only background apply, border apply if border-collapse
- // is collapse.
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // this.propertyList.get("column-width");
- // this.propertyList.get("number-columns-repeated");
- // this.propertyList.get("number-columns-spanned");
- // this.propertyList.get("visibility");
-
iColumnNumber = propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
numColumnsRepeated =
columnWidth = this.propertyList.get(PR_COLUMN_WIDTH).getLength();
- // initialize id
- setupID();
-
initialized = true;
}
import org.apache.fop.fo.FObj;
import org.apache.fop.layoutmgr.table.Row;
import org.apache.fop.fo.Constants;
-
-import org.apache.fop.fo.properties.CommonAccessibility;
-import org.apache.fop.fo.properties.CommonAural;
-import org.apache.fop.fo.properties.CommonBackground;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonRelativePosition;
import org.apache.fop.fo.properties.Property;
*/
protected void addProperties(Attributes attlist) throws SAXParseException {
super.addProperties(attlist);
- setupID();
getFOInputHandler().startRow(this);
}
}
private void doSetup() {
-
- // Common Accessibility Properties
- CommonAccessibility mAccProps = propMgr.getAccessibilityProps();
-
- // this.propertyList.get("block-progression-dimension");
-
- // Common Aural Properties
- CommonAural mAurProps = propMgr.getAuralProps();
-
- // Common Border, Padding, and Background Properties
- // only background apply, border apply if border-collapse
- // is collapse.
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
-
- // Common Relative Position Properties
- CommonRelativePosition mRelProps = propMgr.getRelativePositionProps();
-
- // this.propertyList.get("break-before");
- // this.propertyList.get("break-after");
- setupID();
- // this.propertyList.get("height");
- // this.propertyList.get("keep-together");
- // this.propertyList.get("keep-with-next");
- // this.propertyList.get("keep-with-previous");
-
-
this.breakAfter = this.propertyList.get(PR_BREAK_AFTER).getEnum();
this.backgroundColor =
this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
// this.propertyList.get("country");
// this.propertyList.get("language");
- setupID();
//call startStructuredPageSequence to ensure, that startPageSequence is called
//before startFlow.