You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by ar...@apache.org on 2001/07/08 07:04:11 UTC
cvs commit: xml-fop/src/org/apache/fop/fo/pagination PageSequence.java
arved 01/07/07 22:04:11
Modified: src/org/apache/fop/fo/pagination PageSequence.java
Log:
Supports page-number formatting
Revision Changes Path
1.30 +14 -3 xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java
Index: PageSequence.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/pagination/PageSequence.java,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- PageSequence.java 2001/06/22 08:52:08 1.29
+++ PageSequence.java 2001/07/08 05:04:10 1.30
@@ -1,4 +1,4 @@
-/*-- $Id: PageSequence.java,v 1.29 2001/06/22 08:52:08 keiron Exp $ --
+/*-- $Id: PageSequence.java,v 1.30 2001/07/08 05:04:10 arved Exp $ --
* Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
* For details on use and redistribution please refer to the
* LICENSE file included with these sources.
@@ -83,8 +83,10 @@
private Page currentPage;
+ // page number and elated formatting variables
private int currentPageNumber = 0;
-
+ private PageNumberGenerator pageNumberGenerator;
+
/** specifies page numbering type (auto|auto-even|auto-odd|explicit) */
private int pageNumberType;
@@ -144,8 +146,14 @@
}
masterName = this.properties.get("master-name").getString();
-
+ // get the 'format' properties
+ this.pageNumberGenerator =
+ new PageNumberGenerator( this.properties.get("format").getString(),
+ this.properties.get("grouping-separator").getCharacter(),
+ this.properties.get("grouping-size").getNumber().intValue(),
+ this.properties.get("letter-value").getEnum()
+ );
}
public void addFlow(Flow flow) throws FOPException {
@@ -219,6 +227,9 @@
tempIsFirstPage, isEmptyPage);
currentPage.setNumber(this.currentPageNumber);
+ String formattedPageNumber =
+ pageNumberGenerator.makeFormattedPageNumber(this.currentPageNumber);
+ currentPage.setFormattedNumber(formattedPageNumber);
this.root.setRunningPageNumberCounter(this.currentPageNumber);
MessageHandler.log(" [" + currentPageNumber);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org