diff options
author | Jeremias Maerki <jeremias@apache.org> | 2006-03-23 14:45:17 +0000 |
---|---|---|
committer | Jeremias Maerki <jeremias@apache.org> | 2006-03-23 14:45:17 +0000 |
commit | 97564f21e19e5a726a2f011b1a03ea73444626f4 (patch) | |
tree | ea30ce816ff7ad48bd8ab910d500e53b17468427 /src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java | |
parent | 8b35a2107b43d55ca410ab5730055b72f26b7c5e (diff) | |
download | xmlgraphics-fop-97564f21e19e5a726a2f011b1a03ea73444626f4.tar.gz xmlgraphics-fop-97564f21e19e5a726a2f011b1a03ea73444626f4.zip |
Initial support for page-position="last". Feedback requested!
See also: http://wiki.apache.org/xmlgraphics-fop/PagePositionLast
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@388182 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java')
-rw-r--r-- | src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java index d688b0fab..1ac786751 100644 --- a/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java +++ b/src/java/org/apache/fop/fo/pagination/ConditionalPageMasterReference.java @@ -1,5 +1,5 @@ /* - * Copyright 1999-2005 The Apache Software Foundation. + * Copyright 1999-2006 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -90,28 +90,32 @@ public class ConditionalPageMasterReference extends FObj { * matches. * @param isOddPage True if page number odd * @param isFirstPage True if page is first page + * @param isLastPage True if page is last page * @param isBlankPage True if page is blank * @return True if the conditions for this reference are met */ protected boolean isValid(boolean isOddPage, boolean isFirstPage, + boolean isLastPage, boolean isBlankPage) { // page-position if (isFirstPage) { if (pagePosition == EN_REST) { return false; } else if (pagePosition == EN_LAST) { - // ?? how can one know at this point? - getLogger().debug("LAST PagePosition NYI"); + return false; + } + } else if (isLastPage) { + if (pagePosition == EN_REST) { + return false; + } else if (pagePosition == EN_FIRST) { return false; } } else { if (pagePosition == EN_FIRST) { return false; } else if (pagePosition == EN_LAST) { - // ?? how can one know at this point? - getLogger().debug("LAST PagePosition NYI"); - // potentially valid, don't return + return false; } } @@ -139,21 +143,22 @@ public class ConditionalPageMasterReference extends FObj { return true; } - /** - * Returns the "master-reference" property. - */ + /** @return the "master-reference" property. */ public String getMasterReference() { return masterReference; } + /** @return the page-position property value */ + public int getPagePosition() { + return this.pagePosition; + } + /** @see org.apache.fop.fo.FONode#getLocalName() */ public String getLocalName() { return "conditional-page-master-reference"; } - /** - * @see org.apache.fop.fo.FObj#getNameId() - */ + /** @see org.apache.fop.fo.FObj#getNameId() */ public int getNameId() { return FO_CONDITIONAL_PAGE_MASTER_REFERENCE; } |