diff options
author | arved <arved@unknown> | 2000-04-16 01:34:52 +0000 |
---|---|---|
committer | arved <arved@unknown> | 2000-04-16 01:34:52 +0000 |
commit | 4d4ebdc749135022352b9abfa071d8e6cd048aba (patch) | |
tree | b3c7a8de871aa8e879ffd1c479525f13f345f896 /src | |
parent | 560bfb1ba1ae52b6f43eb08881fcb5c62aff4333 (diff) | |
download | xmlgraphics-fop-4d4ebdc749135022352b9abfa071d8e6cd048aba.tar.gz xmlgraphics-fop-4d4ebdc749135022352b9abfa071d8e6cd048aba.zip |
ADD: initial-page-number for page-sequence
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@193327 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/org/apache/fop/fo/properties/InitialPageNumber.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/src/org/apache/fop/fo/properties/InitialPageNumber.java b/src/org/apache/fop/fo/properties/InitialPageNumber.java new file mode 100644 index 000000000..ff1cae41c --- /dev/null +++ b/src/org/apache/fop/fo/properties/InitialPageNumber.java @@ -0,0 +1,52 @@ + +package org.apache.fop.fo.properties; + +import org.apache.fop.datatypes.*; +import org.apache.fop.fo.*; +import org.apache.fop.apps.FOPException; + +public class InitialPageNumber extends Property { + + public static class Maker extends Property.Maker { + public boolean isInherited() { return true; } + + public Property make(PropertyList propertyList, String value) throws FOPException { + + int pageNum = 0; + try { + pageNum = Integer.parseInt( value ); + + // round to 0 if less than 0; SL spec and this implementation + if (pageNum < 0) + pageNum = 0; + } + catch (NumberFormatException nfe) { + System.err.println( "'initial-page-number' not numeric" ); + } + + return new InitialPageNumber(propertyList, pageNum ); + + + } + + public Property make(PropertyList propertyList) throws FOPException { + return make(propertyList, "0"); + } + } + + public static Property.Maker maker() { + return new InitialPageNumber.Maker(); + } + + private int value; + + public InitialPageNumber(PropertyList propertyList, int explicitValue) { + this.propertyList = propertyList; + this.value = explicitValue; + } + + public int getInitialPageNumber() { + return this.value; + } + +} |