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 ge...@apache.org on 2001/08/06 19:56:35 UTC

cvs commit: xml-fop/src/org/apache/fop/layout AreaTree.java

gears       01/08/06 10:56:35

  Modified:    src/org/apache/fop/apps StreamRenderer.java
               src/org/apache/fop/layout AreaTree.java
  Log:
  This just moves the marker supporting code from before Mark's patch into
  StreamRenderer. However, I'm not satisfied that it actually works the same.
  
  Revision  Changes    Path
  1.3       +41 -0     xml-fop/src/org/apache/fop/apps/StreamRenderer.java
  
  Index: StreamRenderer.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/apps/StreamRenderer.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- StreamRenderer.java	2001/08/01 23:08:54	1.2
  +++ StreamRenderer.java	2001/08/06 17:56:35	1.3
  @@ -271,4 +271,45 @@
               return true;
           }
       }
  +    
  +       public Page getNextPage(Page current, boolean isWithinPageSequence,
  +                            boolean isFirstCall) {
  +        Page nextPage = null;
  +        int pageIndex = 0;
  +        if (isFirstCall)
  +            pageIndex = renderQueue.size();
  +        else
  +            pageIndex = renderQueue.indexOf(current);
  +        if ((pageIndex + 1) < renderQueue.size()) {
  +            nextPage = (Page)renderQueue.elementAt(pageIndex + 1);
  +            if (isWithinPageSequence
  +                    &&!nextPage.getPageSequence().equals(current.getPageSequence())) {
  +                nextPage = null;
  +            }
  +        }
  +        return nextPage;
  +    }
  +
  +    public Page getPreviousPage(Page current, boolean isWithinPageSequence,
  +                                boolean isFirstCall) {
  +        Page previousPage = null;
  +        int pageIndex = 0;
  +        if (isFirstCall)
  +            pageIndex = renderQueue.size();
  +        else
  +            pageIndex = renderQueue.indexOf(current);
  +        // System.out.println("Page index = " + pageIndex);
  +        if ((pageIndex - 1) >= 0) {
  +            previousPage = (Page)renderQueue.elementAt(pageIndex - 1);
  +            PageSequence currentPS = current.getPageSequence();
  +            // System.out.println("Current PS = '" + currentPS + "'");
  +            PageSequence previousPS = previousPage.getPageSequence();
  +            // System.out.println("Previous PS = '" + previousPS + "'");
  +            if (isWithinPageSequence &&!previousPS.equals(currentPS)) {
  +                // System.out.println("Outside page sequence");
  +                previousPage = null;
  +            }
  +        }
  +        return previousPage;
  +    }
   }
  
  
  
  1.13      +3 -3      xml-fop/src/org/apache/fop/layout/AreaTree.java
  
  Index: AreaTree.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/org/apache/fop/layout/AreaTree.java,v
  retrieving revision 1.12
  retrieving revision 1.13
  diff -u -r1.12 -r1.13
  --- AreaTree.java	2001/08/01 23:08:54	1.12
  +++ AreaTree.java	2001/08/06 17:56:35	1.13
  @@ -1,5 +1,5 @@
   /*
  - * $Id: AreaTree.java,v 1.12 2001/08/01 23:08:54 gears Exp $
  + * $Id: AreaTree.java,v 1.13 2001/08/06 17:56:35 gears 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.
  @@ -65,12 +65,12 @@
   
       public Page getNextPage(Page current, boolean isWithinPageSequence,
                               boolean isFirstCall) {
  -        return current;
  +        return streamRenderer.getNextPage(current, isWithinPageSequence,isFirstCall);
       }
   
       public Page getPreviousPage(Page current, boolean isWithinPageSequence,
                                   boolean isFirstCall) {
  -        return current;
  +        return streamRenderer.getPreviousPage(current,isWithinPageSequence,isFirstCall);
       }
   
       public void addPage(Page page)
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org