if (parent.getName().equals("fo:root")) {
this.root = (Root)parent;
// this.root.addPageSequence(this);
}
else {
throw new FOPException("page-sequence must be child of root, not "
+ parent.getName());
}
layoutMasterSet = root.getLayoutMasterSet();
// best time to run some checks on LayoutMasterSet
layoutMasterSet.checkRegionNames();
_flowMap = new Hashtable();
thisIsFirstPage =
true; // we are now on the first page of the page sequence
ipnValue = this.properties.get("initial-page-number").getString();
if (ipnValue.equals("auto")) {
pageNumberType = AUTO;
} else if (ipnValue.equals("auto-even")) {
pageNumberType = AUTO_EVEN;
} else if (ipnValue.equals("auto-odd")) {
pageNumberType = AUTO_ODD;
} else {
pageNumberType = EXPLICIT;
try {
int pageStart = new Integer(ipnValue).intValue();
this.currentPageNumber = (pageStart > 0) ? pageStart - 1 : 0;
} catch (NumberFormatException nfe) {
throw new FOPException("\"" + ipnValue
+ "\" is not a valid value for initial-page-number");
}
}
masterName = this.properties.get("master-name").getString();