pbwest      2004/05/10 04:28:29

  Modified:    src/java/org/apache/fop/area Tag: FOP_0-20-0_Alt-Design
                        Page.java
  Log:
  getRegionBodyRefArea realised
  Implements PageListElement and PageSetElement
  
  Revision  Changes    Path
  No                   revision
  No                   revision
  1.4.2.6   +45 -19    xml-fop/src/java/org/apache/fop/area/Page.java
  
  Index: Page.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/area/Page.java,v
  retrieving revision 1.4.2.5
  retrieving revision 1.4.2.6
  diff -u -r1.4.2.5 -r1.4.2.6
  --- Page.java 8 May 2004 13:14:34 -0000       1.4.2.5
  +++ Page.java 10 May 2004 11:28:28 -0000      1.4.2.6
  @@ -38,7 +38,40 @@
    * @author pbw
    * @version $Revision$ $Name$
    */
  -public class Page extends AreaNode implements Cloneable {
  +public class Page extends AreaNode
  +implements PageListElement, PageSetElement, Cloneable {
  +
  +    // Implementation of PageList interface.
  +    // N.B. getId is required for both interfaces.
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.fop.area.PageSetElement#isPageList()
  +     */
  +    public boolean isPageList() {
  +        return false;
  +    }
  +
  +    // Implementation of PageSet interface
  +    // N.B. getId is required for both interfaces.
  +
  +    /* (non-Javadoc)
  +     * @see org.apache.fop.area.PageListElement#isPageSet()
  +     */
  +    public boolean isPageSet() {
  +        return false;
  +    }
  +
  +    /** Unique ID for this page.  0 is an invalid ID.  */
  +    private long pageId = 0;
  +
  +    /**
  +     * @return the pageId
  +     */
  +    public long getId() {
  +        synchronized (sync) {
  +            return pageId;
  +        }
  +    }
       
       /**
        * Create a page at the root of a tree, synchronized on itself,
  @@ -69,22 +102,10 @@
           this.pageId = pageId;
       }
   
  -    /** Unique ID for this page.  0 is an invalid ID.  */
  -    private long pageId = 0;
  -
  -    /**
  -     * @return the pageId
  -     */
  -    public long getPageId() {
  -        synchronized (sync) {
  -            return pageId;
  -        }
  -    }
  -
       /**
        * @param pageId to set
        */
  -    public void setPageId(long pageId) {
  +    public void setId(long pageId) {
           synchronized (sync) {
               this.pageId = pageId;
           }
  @@ -129,6 +150,7 @@
       protected FoSimplePageMaster pageMaster = null;
       /** The single <code>page-viewport</code> child of this page */
       protected PageViewport vport = null;
  +    /** The single <code>page-reference-area</code> child of the viewport */
       protected PageRefArea pageRefArea = null;
   
       /**
  @@ -150,15 +172,19 @@
           this.pageRefArea = pageRefArea;
       }
       public PageRefArea getPageRefArea() {
  -        return vport.getPageRefArea();
  +        return pageRefArea;
       }
       /** The formatted page number */
       private String pageNumber = null;
   
  -    public Area getRegionBodyRefArea() {
  -        // TODO - make the real version of this
  -        Area regionBodyRef = null;
  -        return regionBodyRef;
  +    /**
  +     * Gets the <code>region-body-reference-area</code> associated with this
  +     * page
  +     * @return the <code>region-body-reference-area</code>
  +     */
  +    public RegionBodyRefArea getRegionBodyRefArea() {
  +        return (RegionBodyRefArea)(
  +                pageRefArea.getRegionBodyVport().getRegionRefArea());
       }
       /**
        * Set the page number for this page.
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to