import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// private ToBeImplementedProperty targetStylesheet;
// End of property values
- // link represented by this FO
- private String link = null;
-
- // indicator of whether link is internal or external
- private boolean isExternalLink = false;
-
// used only for FO validation
private boolean blockOrInlineItemFound = false;
getFOEventHandler().endLink();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- // This logic is for determining the link represented by this FO.
- String ext = propertyList.get(PR_EXTERNAL_DESTINATION).getString();
- String internal = propertyList.get(PR_INTERNAL_DESTINATION).getString();
-
- // per spec, internal takes precedence if both specified
- if (internal.length() > 0) {
- link = internal;
- } else if (ext.length() > 0) {
- link = ext;
- isExternalLink = true;
- } else {
- // slightly stronger than spec "should be specified"
- attributeError("Missing attribute: Either external-destination or " +
- "internal-destination must be specified.");
- }
-
- getFOEventHandler().startLink(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
list.add(lm);
}
- /**
- * @return link represented by this fo:basic-link
- */
- public String getLink() {
- return link;
- }
-
- /**
- * @return true if link is external, false if internal
- */
- public boolean isExternalLink() {
- return isExternalLink;
- }
-
/**
* Return the "internal-destination" property.
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
prWordSpacing = pList.get(PR_WORD_SPACING).getSpace();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- * @todo see if can use a BitSet to determine if an FO should
- * have its ID setup; then move setupID() instances to FObj.
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
private int wrapOption;
// End of property values
- private int align;
- private int alignLast;
- private int _lineHeight;
- private int startIndent;
- private int endIndent;
- private int spaceBefore;
- private int spaceAfter;
- private int _textIndent;
- private int _keepWithNext;
- private ColorType backgroundColor;
- private int blockWidows;
- private int blockOrphans;
-
- private int wsTreatment; //ENUMERATION
- private int lfTreatment; //ENUMERATION
- private boolean bWScollapse; //true if white-space-collapse=true
-
// this may be helpful on other FOs too
private boolean anythingLaidOut = false;
return textIndent;
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.span = getPropEnum(PR_SPAN);
- this.wsTreatment = getPropEnum(PR_WHITE_SPACE_TREATMENT);
- this.bWScollapse = (getPropEnum(PR_WHITE_SPACE_COLLAPSE) == Constants.TRUE);
- this.lfTreatment = getPropEnum(PR_LINEFEED_TREATMENT);
- 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.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.blockWidows =
- this.propertyList.get(PR_WIDOWS).getNumber().intValue();
- this.blockOrphans =
- this.propertyList.get(PR_ORPHANS).getNumber().intValue();
-
- getFOEventHandler().startBlock(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* initial-property-set? (#PCDATA|%inline;|%block;)*
/* Some kind of whitespace character, except linefeed. */
boolean bIgnore = false;
- switch (wsTreatment) {
+ switch (whiteSpaceTreatment) {
case Constants.IGNORE:
bIgnore = true;
break;
// Handle ignore and replacement
if (bIgnore) {
charIter.remove();
- } else if (bWScollapse) {
- if (bInWS || (lfTreatment == Constants.PRESERVE
+ } else if (whiteSpaceCollapse == TRUE) {
+ if (bInWS || (linefeedTreatment == Constants.PRESERVE
&& (bPrevWasLF || lfCheck.nextIsLF()))) {
charIter.remove();
} else {
lfCheck.reset();
bPrevWasLF = true; // for following whitespace
- switch (lfTreatment) {
+ switch (linefeedTreatment) {
case Constants.IGNORE:
charIter.remove();
break;
// only if bWScollapse=true
charIter.remove();
} else {
- if (bWScollapse) {
+ if (whiteSpaceCollapse == TRUE) {
bInWS = true;
// remove the linefeed if no word in block
// encountered yet
import java.util.List;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.properties.LengthRangeProperty;
import org.apache.fop.layoutmgr.BlockContainerLayoutManager;
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
/**
// private ToBeImplementedProperty zIndex;
// End of property values
- private ColorType backgroundColor;
- private int position;
-
- private int top;
- private int bottom;
- private int left;
- private int right;
- private int _width;
- private int _height;
-
-
/**
* @param parent FONode that is the parent of this object
*/
getFOEventHandler().startBlockContainer(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.span = getPropEnum(PR_SPAN);
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
-
- this._width = getPropLength(PR_WIDTH);
- this._height = getPropLength(PR_HEIGHT);
- getFOEventHandler().startBlockContainer(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#endOfNode
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
/** constant indicating that the character does not fit */
public static final int DOESNOT_FIT = 1;
- private char characterValue;
-
/**
* @param parent FONode that is the parent of this object
*/
invalidChildError(loc, nsURI, localName);
}
-
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- characterValue = propertyList.get(PR_CHARACTER).getCharacter();
- getFOEventHandler().character(this);
- }
-
/**
* @see org.apache.fop.fo.FObj#charIterator
*/
public CharIterator charIterator() {
- return new OneCharIterator(characterValue);
+ return new OneCharIterator(character);
// But what if the character is ignored due to white space handling?
}
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
invalidChildError(loc, nsURI, localName);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- * @todo switch method from image() to startImage()?
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().image(this);
- }
-
/**
* Return the Common Border, Padding, and Background Properties.
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
commonAccessibility = pList.getAccessibilityProps();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startFootnote(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#startOfNode
*/
package org.apache.fop.fo.flow;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
getFOEventHandler().startFootnoteBody(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startFootnoteBody(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: (%block;)+
package org.apache.fop.fo.flow;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
getFOEventHandler().endInline(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- /* 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;
- }
- }
-
- getFOEventHandler().startInline(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (#PCDATA|%inline;|%block;)*
import java.util.ArrayList;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
checkId(id);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- }
-
/**
* Return the "id" property.
*/
private SpaceProperty wordSpacing;
// End of property values
- private int _ruleThickness;
- private int patternWidth;
- /** FontState for this object */
- protected Font fontState;
-
/**
* @param parent FONode that is the parent of this object
*/
protected void startOfNode() throws SAXParseException {
checkId(id);
}
-
- /**
- * @todo convert to addProperties()
- */
- private void setup() {
- // Common Font Properties
- this.fontState = propMgr.getFontState(getFOEventHandler().getFontInfo());
-
- // color properties
- ColorType c = this.propertyList.get(PR_COLOR).getColorType();
- float red = c.getRed();
- float green = c.getGreen();
- float blue = c.getBlue();
-
- // fo:leader specific properties
- // determines the pattern of leader; allowed values: space, rule,dots, use-content
- leaderPattern = getPropEnum(PR_LEADER_PATTERN);
- switch(leaderPattern) {
- case LeaderPattern.SPACE:
- // use Space
- break;
- case LeaderPattern.RULE:
- // the following properties only apply
- // for leader-pattern = "rule"
- _ruleThickness = getPropLength(PR_RULE_THICKNESS);
- ruleStyle = getPropEnum(PR_RULE_STYLE);
- 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;
- }
-
- // if leaderPatternWidth = 0 = default = use-font-metric
- patternWidth = getPropLength(PR_LEADER_PATTERN_WIDTH);
- }
/**
* @todo check need for each of these accessors (should be LM instead?)
*/
- public int getLength(int propId, int dim) {
+ public int getLength(Length maxlength, int dim) {
int length;
- Length maxlength = propertyList.get(propId).getLength();
if (maxlength instanceof PercentLength) {
length = (int)(((PercentLength)maxlength).value() * dim);
} else {
}
public int getRuleThickness() {
- return _ruleThickness;
+ return ruleThickness.getValue();
}
public Font getFontState() {
- return fontState;
+ return propMgr.getFontState(getFOEventHandler().getFontInfo());
}
public int getPatternWidth() {
- return patternWidth;
+ return leaderPatternWidth.getValue();
}
/**
* @see org.apache.fop.fo.FONode#addLayoutManager(List)
*/
public void addLayoutManager(List list) {
- setup();
LeaderLayoutManager lm = new LeaderLayoutManager(this);
list.add(lm);
}
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
getFOEventHandler().endList(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startList(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (list-item)+
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
getFOEventHandler().endListItem(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startListItem(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (list-item-label,list-item-body)
getFOEventHandler().endListBody();
}
- /**
- * @todo convert to addProperties()
- */
- private void setup() {
- /*
- * 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.
- */
- }
-
/**
* Return the "id" property.
*/
package org.apache.fop.fo.flow;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
getFOEventHandler().endListLabel();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startListLabel();
- /*
- * 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.
- */
- }
-
/**
* Return the "id" property.
*/
package org.apache.fop.fo.flow;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
markerClassName = pList.get(PR_MARKER_CLASS_NAME).getString();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: (#PCDATA|%inline;|%block;)*
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
private int wrapOption;
// End of property values
- /** FontState for this object */
- protected Font fontState;
-
- private float red;
- private float green;
- private float blue;
-
/**
* @param parent FONode that is the parent of this object
*/
invalidChildError(loc, nsURI, localName);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- // Common Font Properties
- this.fontState = propMgr.getFontState(getFOEventHandler().getFontInfo());
-
- ColorType c = this.propertyList.get(PR_COLOR).getColorType();
- this.red = c.getRed();
- this.green = c.getGreen();
- this.blue = c.getBlue();
-
- this.wrapOption = getPropEnum(PR_WRAP_OPTION);
- getFOEventHandler().startPageNumber(this);
- }
-
/**
* @return the FontState object for this PageNumber
*/
public Font getFontState() {
- return fontState;
+ return propMgr.getFontState(getFOEventHandler().getFontInfo());
+
}
/**
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
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.
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
retrieveBoundary = pList.get(PR_RETRIEVE_BOUNDARY).getEnum();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.retrieveClassName = getPropString(PR_RETRIEVE_CLASS_NAME);
- this.retrievePosition = getPropEnum(PR_RETRIEVE_POSITION);
- this.retrieveBoundary = getPropEnum(PR_RETRIEVE_BOUNDARY);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: empty
import java.util.ArrayList;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
protected ArrayList columns = null;
private TableBody tableHeader = null;
private TableBody tableFooter = null;
- private boolean omitHeaderAtBreak = false;
- private boolean omitFooterAtBreak = false;
-
- private int spaceBefore;
- private int spaceAfter;
- private ColorType backgroundColor;
- private LengthRangeProperty ipd;
- private int _height;
-
- private boolean bAutoLayout = false;
- private int contentWidth = 0; // Sum of column widths
- /** Optimum inline-progression-dimension */
- private int optIPD;
- /** Minimum inline-progression-dimension */
- private int minIPD;
- /** Maximum inline-progression-dimension */
- private int maxIPD;
/**
* @param parent FONode that is the parent of this object
getFOEventHandler().endTable(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.breakBefore = getPropEnum(PR_BREAK_BEFORE);
- this.breakAfter = getPropEnum(PR_BREAK_AFTER);
- this.spaceBefore = getPropLength(PR_SPACE_BEFORE | CP_OPTIMUM);
- this.spaceAfter = getPropLength(PR_SPACE_AFTER | CP_OPTIMUM);
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
- this.ipd = this.propertyList.get(
- PR_INLINE_PROGRESSION_DIMENSION).getLengthRange();
- this._height = getPropLength(PR_HEIGHT);
- this.bAutoLayout = (getPropEnum(PR_TABLE_LAYOUT) == TableLayout.AUTO);
-
- this.omitHeaderAtBreak = getPropEnum(PR_TABLE_OMIT_HEADER_AT_BREAK)
- == TableOmitHeaderAtBreak.TRUE;
- this.omitFooterAtBreak = getPropEnum(PR_TABLE_OMIT_FOOTER_AT_BREAK)
- == TableOmitFooterAtBreak.TRUE;
- getFOEventHandler().startTable(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#addChildNode(FONode)
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.PropertyList;
// private ToBeImplementedProperty visibility;
// End of property values
- private int spaceBefore;
- private int spaceAfter;
- private ColorType backgroundColor;
-
/**
* @param parent FONode that is the parent of the object
*/
getFOEventHandler().endBody(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.spaceBefore = getPropLength(PR_SPACE_BEFORE | CP_OPTIMUM);
- this.spaceAfter = getPropLength(PR_SPACE_AFTER | CP_OPTIMUM);
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
- getFOEventHandler().startBody(this);
- }
-
/**
* Return the Common Border, Padding, and Background Properties.
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FONode;
private Length width;
// End of property values
- // private int spaceBefore;
- // private int spaceAfter;
- private ColorType backgroundColor;
-
- private int numColumnsSpanned;
- private int numRowsSpanned;
- private int iColNumber = -1; // uninitialized
-
/** used for FO validation */
private boolean blockItemFound = false;
*/
protected int startOffset;
- /**
- * Dimension of allocation rectangle in inline-progression-direction,
- * determined by the width of the column(s) occupied by the cell
- */
- protected int _width;
-
/**
* Offset of content rectangle, in block-progression-direction,
* relative to the row.
/** For collapsed border style */
protected int borderHeight = 0;
- /** Minimum content height of cell. */
- protected int minCellHeight = 0;
-
- /** Height of cell */
- protected int _height = 0;
-
/** Ypos of cell ??? */
protected int top;
- /** corresponds to display-align property */
- protected int verticalAlign;
-
- /** is this cell relatively aligned? */
- protected boolean bRelativeAlign = false;
-
- // boolean setup = false;
- private boolean bSepBorders = true;
-
/**
* Set to true if all content completely laid out.
*/
private boolean bDone = false;
- /**
- * Border separation value in the block-progression dimension.
- * Used in calculating cells height.
- */
- private int _borderSeparation = 0;
-
/**
* @param parent FONode that is the parent of this object
*/
getFOEventHandler().endCell(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.iColNumber =
- propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
- if (iColNumber < 0) {
- iColNumber = 0;
- }
- this.numColumnsSpanned =
- this.propertyList.get(PR_NUMBER_COLUMNS_SPANNED).getNumber().intValue();
- if (numColumnsSpanned < 1) {
- numColumnsSpanned = 1;
- }
- this.numRowsSpanned =
- this.propertyList.get(PR_NUMBER_ROWS_SPANNED).getNumber().intValue();
- if (numRowsSpanned < 1) {
- numRowsSpanned = 1;
- }
-
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
-
- bSepBorders = (getPropEnum(PR_BORDER_COLLAPSE) == BorderCollapse.SEPARATE);
-
- calcBorders(propMgr.getBorderAndPadding());
-
- // Vertical cell alignment
- verticalAlign = getPropEnum(PR_DISPLAY_ALIGN);
- if (verticalAlign == DisplayAlign.AUTO) {
- // Depends on all cells starting in row
- bRelativeAlign = true;
- verticalAlign = getPropEnum(PR_RELATIVE_ALIGN);
- } else {
- bRelativeAlign = false; // Align on a per-cell basis
- }
-
- this.minCellHeight = getPropLength(PR_HEIGHT);
- getFOEventHandler().startCell(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (%block;)+
startOffset = offset;
}
- /**
- * Sets the width of the cell. Initially this width is the same as the
- * width of the column containing this cell, or the sum of the spanned
- * columns if numColumnsSpanned > 1
- * @param width the width of the cell (in millipoints ??)
- */
- public void setWidth(int width) {
- this._width = width;
- }
-
- /**
- * @return number of the column containing this cell
- */
- public int getColumnNumber() {
- return iColNumber;
- }
-
- /**
- * @return the number of columns spanned by this cell
- */
- public int getNumColumnsSpanned() {
- return numColumnsSpanned;
- }
-
- /**
- * @return the number of rows spanned by this cell
- */
- public int getNumRowsSpanned() {
- return numRowsSpanned;
- }
-
/**
* Calculate cell border and padding, including offset of content
* rectangle from the theoretical grid position.
*/
private void calcBorders(CommonBorderAndPadding bp) {
- if (this.bSepBorders) {
+ if (this.borderCollapse == BorderCollapse.SEPARATE) {
/*
* Easy case.
* Cell border is the property specified directly on cell.
+ bp.getPaddingEnd(false);
// Offset of content rectangle in the block-progression direction
- _borderSeparation = getPropLength(PR_BORDER_SEPARATION |
+ int bSep = getPropLength(PR_BORDER_SEPARATION |
CP_BLOCK_PROGRESSION_DIRECTION);
- this.beforeOffset = _borderSeparation / 2
+ this.beforeOffset = bSep / 2
+ bp.getBorderBeforeWidth(false)
+ bp.getPaddingBefore(false);
}
/**
- * @return number of the column containing this cell
- * TODO 31699
+ * Return the "column-number" property.
*/
- public int ___getColumnNumber() {
- return columnNumber.getValue();
+ public int getColumnNumber() {
+ return Math.max(columnNumber.getValue(), 0);
}
/**
}
/**
- * @return the number of columns spanned by this cell
+ * Return the "number-columns-spanned" property.
*/
public int getNumberColumnsSpanned() {
- return numberColumnsSpanned.getValue();
+ return Math.max(numberColumnsSpanned.getValue(), 1);
}
/**
- * @return the number of rows spanned by this cell
+ * Return the "number-rows-spanned" property.
*/
public int getNumberRowsSpanned() {
- return numberRowsSpanned.getValue();
+ return Math.max(numberRowsSpanned.getValue(), 1);
}
/**
package org.apache.fop.fo.flow;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.Length;
import org.apache.fop.datatypes.Numeric;
import org.apache.fop.fo.FONode;
// private ToBeImplementedProperty visibility;
// End of property values
- private ColorType backgroundColor;
- private int columnOffset;
- private int numColumnsRepeated;
- private int iColumnNumber;
-
/**
* @param parent FONode that is the parent of this object
*/
invalidChildError(loc, nsURI, localName);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties(Attributes)
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- iColumnNumber = propertyList.get(PR_COLUMN_NUMBER).getNumber().intValue();
- numColumnsRepeated =
- propertyList.get(PR_NUMBER_COLUMNS_REPEATED).getNumber().intValue();
- this.backgroundColor =
- this.propertyList.get(PR_BACKGROUND_COLOR).getColorType();
- columnWidth = this.propertyList.get(PR_COLUMN_WIDTH).getLength();
-
- getFOEventHandler().startColumn(this);
- }
-
- /**
- * @return value for number of columns repeated
- */
- public int getNumColumnsRepeated() {
- return numColumnsRepeated;
- }
-
/**
* Return the Common Border, Padding, and Background Properties.
*/
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
// FOP
-import org.apache.fop.datatypes.ColorType;
import org.apache.fop.datatypes.KeepValue;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.FONode;
private boolean setup = false;
- private ColorType backgroundColor;
-
- private KeepValue _keepWithNext;
- private KeepValue _keepWithPrevious;
- private KeepValue _keepTogether;
-
- private int minHeight = 0; // force row height
-
/**
* @param parent FONode that is the parent of this object
*/
getFOEventHandler().endRow(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- getFOEventHandler().startRow(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: (table-cell+)
}
}
- /**
- * @return keepWithPrevious
- */
- public KeepValue getKeepWithPrevious() {
- return _keepWithPrevious;
- }
-
- /**
- * @todo see if should remove, or move code to addProperties()
- */
- private void doSetup() {
- this.breakAfter = getPropEnum(PR_BREAK_AFTER);
- 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 =
- getKeepValue(PR_KEEP_WITH_PREVIOUS | CP_WITHIN_COLUMN);
-
- this.minHeight = getPropLength(PR_HEIGHT);
- setup = true;
- }
-
private KeepValue getKeepValue(int propId) {
Property p = this.propertyList.get(propId);
Number n = p.getNumber();
package org.apache.fop.fo.pagination;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
private RepeatablePageMasterAlternatives repeatablePageMasterAlternatives;
- private String masterName;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
invalidChildError(loc, nsURI, localName);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- if (getProperty(PR_MASTER_REFERENCE) != null) {
- setMasterName(getProperty(PR_MASTER_REFERENCE).getString());
- }
-
- validateParent(parent);
-
- this.pagePosition = getPropEnum(PR_PAGE_POSITION);
- this.oddOrEven = getPropEnum(PR_ODD_OR_EVEN);
- this.blankOrNotBlank = getPropEnum(PR_BLANK_OR_NOT_BLANK);
- }
-
- /**
- * Sets the master name.
- * @param masterName name for the master
- */
- protected void setMasterName(String masterName) {
- this.masterName = masterName;
- }
-
- /**
- * Returns the "master-name" attribute of this page master reference
- * @return the master name
- */
- public String getMasterName() {
- return masterName;
- }
-
/**
* Check if the conditions for this reference are met.
* checks the page number and emptyness to determine if this
this.repeatablePageMasterAlternatives =
(RepeatablePageMasterAlternatives)parent;
- if (getMasterName() == null) {
+ if (getMasterReference() == null) {
getLogger().warn("single-page-master-reference"
+ "does not have a master-name and so is being ignored");
} else {
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
*/
private ArrayList markerSnapshot;
- /**
- * Content-width of current column area during layout
- */
- private int contentWidth;
-
/** used for FO validation */
private boolean blockItemFound = false;
getFOEventHandler().endFlow(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- // check flow_name property
- String flowName = getPropString(PR_FLOW_NAME);
-
- if (flowName == null || flowName.equals("")) {
- missingPropertyError("flow-name");
- }
-
- getFOEventHandler().startFlow(this);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: marker* (%block;)+
}
}
- /**
- * @param contentWidth content width of this flow, in millipoints (??)
- */
- protected void setContentWidth(int contentWidth) {
- this.contentWidth = contentWidth;
- }
-
- /**
- * @return the content width of this flow (really of the region
- * in which it is flowing), in millipoints (??).
- */
- public int getContentWidth() {
- return this.contentWidth;
- }
-
/**
* @return true (Flow can generate reference areas)
*/
}
/**
- * @return the name of this flow
+ * Return "flow-name" property.
*/
public String getFlowName() {
return flowName;
import java.util.Map;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
throw new SAXParseException("fo:layout-master-set must be child of fo:root, not "
+ parent.getName(), locator);
}
+ simplePageMasters = new java.util.HashMap();
+ pageSequenceMasters = new java.util.HashMap();
}
/**
checkRegionNames();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- 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);
- }
-
- this.simplePageMasters = new java.util.HashMap();
- this.pageSequenceMasters = new java.util.HashMap();
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL/FOP: (simple-page-master|page-sequence-master)+
import java.util.HashMap;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
getFOEventHandler().endPageSequence(this);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- this.root = (Root) parent;
- layoutMasterSet = root.getLayoutMasterSet();
- flowMap = new HashMap();
-
- // we are now on the first page of the page sequence
- thisIsFirstPage = true;
- Property ipnValue = getProperty(PR_INITIAL_PAGE_NUMBER);
-
- if (ipnValue.getEnum() != 0) {
- // auto | auto-odd | auto-even.
- pageNumberType = ipnValue.getEnum();
- } else {
- pageNumberType = EXPLICIT;
- int pageStart = ipnValue.getNumber().intValue();
- this.explicitFirstNumber = (pageStart > 0) ? pageStart : 1;
- }
-
- String masterName = getPropString(PR_MASTER_REFERENCE);
- this.simplePageMaster =
- this.layoutMasterSet.getSimplePageMaster(masterName);
- if (this.simplePageMaster == null) {
- this.pageSequenceMaster =
- this.layoutMasterSet.getPageSequenceMaster(masterName);
- if (this.pageSequenceMaster == null) {
- throw new SAXParseException("master-reference '" + masterName
- + "' for fo:page-sequence matches no"
- + " simple-page-master or page-sequence-master", locator);
- }
- }
-
- // get the 'format' properties
- this.pageNumberGenerator =
- new PageNumberGenerator(getPropString(PR_FORMAT),
- this.propertyList.get(PR_GROUPING_SEPARATOR).getCharacter(),
- this.propertyList.get(PR_GROUPING_SIZE).getNumber().intValue(),
- getPropEnum(PR_LETTER_VALUE));
-
- this.forcePageCount = getPropEnum(PR_FORCE_PAGE_COUNT);
-
- // this.propertyList.get("country");
- // this.propertyList.get("language");
-
- //call startStructuredPageSequence to ensure, that startPageSequence is called
- //before startFlow.
- startStructuredPageSequence();
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
XSL Content Model: (title?,static-content*,flow)
import java.util.List;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
}
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- subSequenceSpecifiers = new java.util.ArrayList();
- if (parent.getName().equals("fo:layout-master-set")) {
- this.layoutMasterSet = (LayoutMasterSet)parent;
- masterName = getPropString(PR_MASTER_NAME);
- 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#validateChildNode(Locator, String, String)
* XSL/FOP: (single-page-master-reference|repeatable-page-master-reference|
import java.awt.Rectangle;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
private SimplePageMaster layoutMaster;
- /** Holds the writing mode */
- protected int wm;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
}
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- // regions may have name, or default
- if (null == this.propertyList.get(PR_REGION_NAME)) {
- setRegionName(getDefaultRegionName());
- } else if (getPropString(PR_REGION_NAME).equals("")) {
- setRegionName(getDefaultRegionName());
- } else {
- setRegionName(getPropString(PR_REGION_NAME));
- // 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);
- }
- }
-
- this.wm = getPropEnum(PR_WRITING_MODE);
- this.overflow = getPropEnum(PR_OVERFLOW);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: empty
// Java
import java.awt.Rectangle;
-// XML
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXParseException;
-
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.datatypes.FODimension;
*/
public class RegionAfter extends RegionBA {
- private int extent = 0;
- private boolean precedence = false;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- extent = getPropLength(PR_EXTENT);
- precedence = (getPropEnum(PR_PRECEDENCE) == Precedence.TRUE);
- }
-
- /**
- * Indicates if this region gets precedence.
- * @return True if it gets precedence
- */
- public boolean getPrecedence() {
- return precedence;
- }
-
/**
* @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
*/
public Rectangle getViewportRectangle (FODimension reldims) {
// Depends on extent, precedence ans writing mode
Rectangle vpRect;
- if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
- vpRect = new Rectangle(0, reldims.bpd - extent, reldims.ipd, extent);
+ if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), reldims.ipd, getExtent().getValue());
} else {
- vpRect = new Rectangle(0, reldims.bpd - extent, extent, reldims.ipd);
+ vpRect = new Rectangle(0, reldims.bpd - getExtent().getValue(), getExtent().getValue(), reldims.ipd);
}
- if (precedence == false) {
- adjustIPD(vpRect, this.wm);
+ if (getPrecedence() == FALSE) {
+ adjustIPD(vpRect, this.getWritingMode());
}
return vpRect;
}
import java.awt.Rectangle;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
precedence = pList.get(PR_PRECEDENCE).getEnum();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- }
-
/**
* Return the "extent" property.
*/
/**
* Return the "precedence" property.
- * TODO: 31699
*/
- public int ___getPrecedence() {
+ public int getPrecedence() {
return precedence;
}
// Java
import java.awt.Rectangle;
-// XML
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXParseException;
-
// FOP
import org.apache.fop.datatypes.FODimension;
import org.apache.fop.fo.FONode;
* The fo:region-before element.
*/
public class RegionBefore extends RegionBA {
-
- private int extent = 0;
- private boolean precedence = false;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- extent = getPropLength(PR_EXTENT);
- precedence = (getPropEnum(PR_PRECEDENCE) == Precedence.TRUE);
- }
-
- /**
- * Indicates if this region gets precedence.
- * @return True if it gets precedence
- */
- public boolean getPrecedence() {
- return precedence;
- }
-
/**
* @see org.apache.fop.fo.pagination.Region#getDefaultRegionName()
*/
// Before is always 0, start depends on extent
// ipd depends on precedence, bpd=extent
Rectangle vpRect;
- if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
- vpRect = new Rectangle(0, 0, reldims.ipd, extent);
+ if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ vpRect = new Rectangle(0, 0, reldims.ipd, getExtent().getValue());
} else {
- vpRect = new Rectangle(0, 0, extent, reldims.ipd);
+ vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.ipd);
}
- if (precedence == false) {
- adjustIPD(vpRect, this.wm);
+ if (getPrecedence() == FALSE) {
+ adjustIPD(vpRect, this.getWritingMode());
}
return vpRect;
}
// Java
import java.awt.Rectangle;
-// XML
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXParseException;
-
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.datatypes.FODimension;
* The fo:region-end element.
*/
public class RegionEnd extends RegionSE {
-
- private int extent = 0;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- extent = getPropLength(PR_EXTENT);
- }
-
/**
* @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
*/
public Rectangle getViewportRectangle (FODimension reldims) {
// Depends on extent, precedence and writing mode
Rectangle vpRect;
- if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
+ if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
// Rectangle: x , y (of top left point), width, height
- vpRect = new Rectangle(reldims.ipd - extent, 0,
- extent, reldims.bpd);
+ vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0,
+ getExtent().getValue(), reldims.bpd);
} else {
// Rectangle: x , y (of top left point), width, height
- vpRect = new Rectangle(reldims.ipd - extent, 0,
- reldims.bpd, extent);
+ vpRect = new Rectangle(reldims.ipd - getExtent().getValue(), 0,
+ reldims.bpd, getExtent().getValue());
}
- adjustIPD(vpRect, this.wm);
+ adjustIPD(vpRect, this.getWritingMode());
return vpRect;
}
import java.awt.Rectangle;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.SAXParseException;
// FOP
extent = pList.get(PR_EXTENT).getLength();
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- }
-
/**
* Return the "extent" property.
*/
protected void adjustIPD(Rectangle vpRefRect, int wm) {
int offset = 0;
RegionBefore before = (RegionBefore) getSiblingRegion(FO_REGION_BEFORE);
- if (before != null && before.getPrecedence()) {
+ if (before != null && before.getPrecedence() == TRUE) {
offset = before.getPropLength(PR_EXTENT);
vpRefRect.translate(0, offset);
}
RegionAfter after = (RegionAfter) getSiblingRegion(FO_REGION_AFTER);
- if (after != null && after.getPrecedence()) {
+ if (after != null && after.getPrecedence() == TRUE) {
offset += after.getPropLength(PR_EXTENT);
}
if (offset > 0) {
// Java
import java.awt.Rectangle;
-// XML
-import org.xml.sax.Attributes;
-import org.xml.sax.SAXParseException;
-
// FOP
import org.apache.fop.fo.FONode;
import org.apache.fop.datatypes.FODimension;
* The fo:region-start element.
*/
public class RegionStart extends RegionSE {
-
- private int extent = 0;
-
/**
* @see org.apache.fop.fo.FONode#FONode(FONode)
*/
super(parent);
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- extent = getPropLength(PR_EXTENT);
- }
-
/**
* @see org.apache.fop.fo.pagination.Region#getViewportRectangle(FODimension)
*/
// This is the rectangle relative to the page-reference area in
// writing-mode relative coordinates
Rectangle vpRect;
- if (this.wm == WritingMode.LR_TB || this.wm == WritingMode.RL_TB) {
- vpRect = new Rectangle(0, 0, extent, reldims.bpd);
+ if (this.getWritingMode() == WritingMode.LR_TB || this.getWritingMode() == WritingMode.RL_TB) {
+ vpRect = new Rectangle(0, 0, getExtent().getValue(), reldims.bpd);
} else {
- vpRect = new Rectangle(0, 0, reldims.bpd, extent);
+ vpRect = new Rectangle(0, 0, reldims.bpd, getExtent().getValue());
}
- adjustIPD(vpRect, this.wm);
+ adjustIPD(vpRect, this.getWritingMode());
return vpRect;
}
import java.util.ArrayList;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
}
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
- 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);
- }
-
- Property mr = getProperty(PR_MAXIMUM_REPEATS);
-
- if (mr.getEnum() == NO_LIMIT) {
- this._maximumRepeats = INFINITE;
- } else {
- this._maximumRepeats = mr.getNumber().intValue();
- if (this._maximumRepeats < 0) {
- getLogger().debug("negative maximum-repeats: "
- + this.maximumRepeats);
- this._maximumRepeats = 0;
- }
- }
- }
-
/**
* Get the next matching page master from the conditional
* page master references.
ConditionalPageMasterReference cpmr =
(ConditionalPageMasterReference)conditionalPageMasterRefs.get(i);
if (cpmr.isValid(isOddPage, isFirstPage, isBlankPage)) {
- return cpmr.getMasterName();
+ return cpmr.getMasterReference();
}
}
return null;
package org.apache.fop.fo.pagination;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
private static final int INFINITE = -1;
private PageSequenceMaster pageSequenceMaster;
- private int _maximumRepeats;
private int numberConsumed = 0;
/**
pageSequenceMaster.addSubsequenceSpecifier(this);
}
}
-
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
-
- if (getPropString(PR_MASTER_REFERENCE) == null) {
- missingPropertyError("master-reference");
- } else {
- pageSequenceMaster.addSubsequenceSpecifier(this);
- }
-
- Property mr = getProperty(PR_MAXIMUM_REPEATS);
-
- if (mr.getEnum() == NO_LIMIT) {
- this._maximumRepeats = INFINITE;
- } else {
- this._maximumRepeats = mr.getNumber().intValue();
- if (this._maximumRepeats < 0) {
- getLogger().debug("negative maximum-repeats: "
- + this.maximumRepeats);
- this._maximumRepeats = 0;
- }
- }
- }
-
+
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: empty
public String getNextPageMasterName(boolean isOddPage,
boolean isFirstPage,
boolean isEmptyPage) {
- if (_maximumRepeats != INFINITE) {
- if (numberConsumed < _maximumRepeats) {
+ if (getMaximumRepeats() != INFINITE) {
+ if (numberConsumed < getMaximumRepeats()) {
numberConsumed++;
} else {
return null;
import java.util.Map;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
}
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- LayoutMasterSet layoutMasterSet = (LayoutMasterSet) parent;
-
- if (getPropString(PR_MASTER_NAME) == 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);
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: (region-body,region-before?,region-after?,region-start?,region-end?)
package org.apache.fop.fo.pagination;
// XML
-import org.xml.sax.Attributes;
import org.xml.sax.Locator;
import org.xml.sax.SAXParseException;
}
}
- /**
- * @see org.apache.fop.fo.FObj#addProperties
- */
- protected void addProperties(Attributes attlist) throws SAXParseException {
- super.addProperties(attlist);
-
- PageSequenceMaster pageSequenceMaster = (PageSequenceMaster) parent;
- if (getPropString(PR_MASTER_REFERENCE) == null) {
- missingPropertyError("master-reference");
- } else {
- pageSequenceMaster.addSubsequenceSpecifier(this);
- }
- }
-
/**
* @see org.apache.fop.fo.FONode#validateChildNode(Locator, String, String)
* XSL Content Model: empty