if (!p.isResolved()) {
String[] idrefs = p.getIDRefs();
for (int count = 0; count < idrefs.length; count++) {
- log.warn("Page " + p.getPageNumber() +
+ log.warn("Page " + p.getPageNumberString() +
": Unresolved id reference \"" + idrefs[count]
+ "\" found.");
}
private Page page;
private Rectangle2D viewArea;
private boolean clip = false;
- private String pageNumber = null;
+ private String pageNumberString = null;
// list of id references and the rectangle on the page
private Map idReferences = null;
* Set the page number for this page.
* @param num the string representing the page number
*/
- public void setPageNumber(String num) {
- pageNumber = num;
+ public void setPageNumberString(String num) {
+ pageNumberString = num;
}
/**
* Get the page number of this page.
* @return the string that represents this page
*/
- public String getPageNumber() {
- return pageNumber;
+ public String getPageNumberString() {
+ return pageNumberString;
}
/**
public String toString() {
StringBuffer sb = new StringBuffer(64);
sb.append("PageViewport: page=");
- sb.append(getPageNumber());
+ sb.append(getPageNumberString());
return sb.toString();
}
}
if (!p.isResolved()) {
String[] idrefs = p.getIDRefs();
for (int count = 0; count < idrefs.length; count++) {
- log.warn("Page " + p.getPageNumber() +
+ log.warn("Page " + p.getPageNumberString() +
": Unresolved id reference \"" + idrefs[count]
+ "\" found.");
}
if (pageIDRef.equals(id) && pages != null) {
resolved = true;
PageViewport page = (PageViewport)pages.get(0);
- text = page.getPageNumber();
+ text = page.getPageNumberString();
/**@todo Update IPD ??? */
}
}
public int currentPageNumber = 0;
private int explicitFirstNumber = 0; // explicitly specified
public int firstPageNumber = 0; // actual
- public PageNumberGenerator pageNumberGenerator;
+ private PageNumberGenerator pageNumberGenerator;
private int pageCount = 0;
private boolean isForcing = false;
}
/**
- * Public accessor for getting the PageNumberGenerator.
- * @return the PageNumberGenerator
+ * Retrieves the string representation of a page number applicable
+ * for this page sequence
+ * @return string representation of the page number
*/
- public PageNumberGenerator getPageNumberGenerator() {
- return pageNumberGenerator;
+ public String makeFormattedPageNumber(int pageNumber) {
+ return pageNumberGenerator.makeFormattedPageNumber(pageNumber);
}
/**
PageViewport page = parentLM.resolveRefID(fobj.getRefId());
InlineArea inline = null;
if (page != null) {
- String str = page.getPageNumber();
+ String str = page.getPageNumberString();
// get page string from parent, build area
TextArea text = new TextArea();
inline = text;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.Constants;
import org.apache.fop.fo.flow.Marker;
-import org.apache.fop.fo.pagination.PageNumberGenerator;
import org.apache.fop.fo.pagination.PageSequence;
import org.apache.fop.fo.pagination.Region;
import org.apache.fop.fo.pagination.RegionBody;
}
}
- private PageNumberGenerator pageNumberGenerator;
private int pageCount = 1;
private String pageNumberString;
private boolean isFirstPage = true;
public void activateLayout() {
pageSeq.initPageNumber();
pageCount = pageSeq.getCurrentPageNumber();
- pageNumberGenerator = pageSeq.getPageNumberGenerator();
- pageNumberString = pageNumberGenerator.makeFormattedPageNumber(pageCount);
+ pageNumberString = pageSeq.makeFormattedPageNumber(pageCount);
LineArea title = null;
if (pageSeq.getTitleFO() != null) {
// finish page and add to area tree
finishPage();
pageCount++;
- pageNumberString = pageNumberGenerator.makeFormattedPageNumber(pageCount);
+ pageNumberString = pageSeq.makeFormattedPageNumber(pageCount);
}
}
pageCount--;
log.error("Cannot create page", fopex);
}
- curPage.setPageNumber(getCurrentPageNumber());
+ curPage.setPageNumberString(getCurrentPageNumber());
if (log.isDebugEnabled()) {
- log.debug("[" + curPage.getPageNumber() + "]");
+ log.debug("[" + curPage.getPageNumberString() + "]");
}
RegionViewport rv = curPage.getPage().getRegionViewport(
FO_REGION_BODY);
this.currentPageNumber++;
gen.writeDSCComment(DSCConstants.PAGE, new Object[]
- {page.getPageNumber(),
+ {page.getPageNumberString(),
new Integer(this.currentPageNumber)});
final Integer zero = new Integer(0);
final long pagewidth = Math.round(page.getViewArea().getWidth());
public void renderPage(PageViewport page) throws IOException, FOPException {
atts.clear();
addAttribute("bounds", page.getViewArea());
- addAttribute("nr", page.getPageNumber());
+ addAttribute("nr", page.getPageNumberString());
startElement("pageViewport", atts);
startElement("page");
super.renderPage(page);