]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
open up access in misc places by either adding accessor methods or by loosening acess...
authorWilliam Victor Mote <vmote@apache.org>
Fri, 10 Oct 2003 15:40:31 +0000 (15:40 +0000)
committerWilliam Victor Mote <vmote@apache.org>
Fri, 10 Oct 2003 15:40:31 +0000 (15:40 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196953 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/area/AreaTree.java
src/java/org/apache/fop/area/AreaTreeControl.java
src/java/org/apache/fop/fo/pagination/LayoutMasterSet.java
src/java/org/apache/fop/fo/pagination/PageSequence.java
src/java/org/apache/fop/image/ImageFactory.java

index 0076ef16b468644e6aaa14656a9242fc3bfc2d4d..10772a716301dcb5db15922fd8c187e7f86b175d 100644 (file)
@@ -284,4 +284,8 @@ public class AreaTree {
         return data;
     }
 
+    public AreaTreeControl getAreaTreeControl() {
+        return atControl;
+    }
+
 }
index 1db93735cd49c8077f22784862117c40e19c5b2e..1664e777f5185c7c7e85092db65226abb3d3208a 100644 (file)
@@ -57,6 +57,9 @@ import org.apache.fop.fo.extensions.Bookmarks;
 // Avalon
 import org.apache.avalon.framework.logger.Logger;
 
+// Java
+import java.util.Set;
+
 /**
  * An interface for classes that are conceptually the parent class of the
  * area.AreaTree object. The purpose of the interface is to keep the AreaTree
@@ -76,4 +79,10 @@ public interface AreaTreeControl {
      */
     Logger getLogger();
 
+    /**
+     * The current set of IDs in the document.
+     * @return the Set of IDReferences in the document.
+     */
+    Set getIDReferences();
+
 }
index 3f61d658c2de635c481f56fe076c5b5a213a486a..5c4cc79a066fcc44d5159ada9bd894e1a5f50876 100644 (file)
@@ -176,7 +176,7 @@ public class LayoutMasterSet extends FObj {
      * duplicate, that it maps to the same region-class.
      * @throws FOPException if there's a name duplication
      */
-    protected void checkRegionNames() throws FOPException {
+    public void checkRegionNames() throws FOPException {
         Map allRegions = new java.util.HashMap();
         for (Iterator spm = simplePageMasters.values().iterator();
                 spm.hasNext();) {
@@ -210,7 +210,7 @@ public class LayoutMasterSet extends FObj {
      * @param regionName name of the region
      * @return true when the region name specified has a region in this LayoutMasterSet
      */
-    protected boolean regionNameExists(String regionName) {
+    public boolean regionNameExists(String regionName) {
         for (Iterator e = simplePageMasters.values().iterator();
                 e.hasNext();) {
             if (((SimplePageMaster)e.next()).regionNameExists(regionName)) {
index 31f9cd15708415e85ec9bc3c9d2a7598b7c551e2..a0c5f017f21dca98bf1bcc45e9479bf5479c7f3f 100644 (file)
@@ -70,10 +70,10 @@ public class PageSequence extends FObj {
     //
     // intial-page-number types
     //
-    private static final int EXPLICIT = 0;
-    private static final int AUTO = 1;
-    private static final int AUTO_EVEN = 2;
-    private static final int AUTO_ODD = 3;
+    public static final int EXPLICIT = 0;
+    public static final int AUTO = 1;
+    public static final int AUTO_EVEN = 2;
+    public static final int AUTO_ODD = 3;
 
     //
     // associations
@@ -96,7 +96,7 @@ public class PageSequence extends FObj {
     /**
      * Map of flows to their flow name (flow-name, Flow)
      */
-    private HashMap flowMap;
+    public HashMap flowMap;
 
     // according to communication from Paul Grosso (XSL-List,
     // 001228, Number 406), confusion in spec section 6.4.5 about
@@ -113,19 +113,19 @@ public class PageSequence extends FObj {
 
     // page number and related formatting variables
     private String ipnValue;
-    private int currentPageNumber = 0;
+    public int currentPageNumber = 0;
     private int explicitFirstNumber = 0; // explicitly specified
-    private int firstPageNumber = 0; // actual
-    private PageNumberGenerator pageNumberGenerator;
+    public int firstPageNumber = 0; // actual
+    public PageNumberGenerator pageNumberGenerator;
 
-    private int forcePageCount = 0;
+    public int forcePageCount = 0;
     private int pageCount = 0;
     private boolean isForcing = false;
 
     /**
      * specifies page numbering type (auto|auto-even|auto-odd|explicit)
      */
-    private int pageNumberType;
+    public int pageNumberType;
 
     /**
      * used to determine whether to calculate auto, auto-even, auto-odd
@@ -139,8 +139,8 @@ public class PageSequence extends FObj {
      * The pageSequenceMaster is null if master-reference refers to a
      * simple-page-master.
      */
-    private SimplePageMaster simplePageMaster;
-    private PageSequenceMaster pageSequenceMaster;
+    public SimplePageMaster simplePageMaster;
+    public PageSequenceMaster pageSequenceMaster;
 
     /**
      * The main content flow for this page-sequence.
index 92a6c39adcd89d93b8a7e43a38fe191013768418..62a46f7f4fd3036153dc6fd87d3b9a566626845c 100644 (file)
@@ -3,34 +3,34 @@
  * ============================================================================
  *                    The Apache Software License, Version 1.1
  * ============================================================================
- * 
+ *
  * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved.
- * 
+ *
  * Redistribution and use in source and binary forms, with or without modifica-
  * tion, are permitted provided that the following conditions are met:
- * 
+ *
  * 1. Redistributions of source code must retain the above copyright notice,
  *    this list of conditions and the following disclaimer.
- * 
+ *
  * 2. Redistributions in binary form must reproduce the above copyright notice,
  *    this list of conditions and the following disclaimer in the documentation
  *    and/or other materials provided with the distribution.
- * 
+ *
  * 3. The end-user documentation included with the redistribution, if any, must
  *    include the following acknowledgment: "This product includes software
  *    developed by the Apache Software Foundation (http://www.apache.org/)."
  *    Alternately, this acknowledgment may appear in the software itself, if
  *    and wherever such third-party acknowledgments normally appear.
- * 
+ *
  * 4. The names "FOP" and "Apache Software Foundation" must not be used to
  *    endorse or promote products derived from this software without prior
  *    written permission. For written permission, please contact
  *    apache@apache.org.
- * 
+ *
  * 5. Products derived from this software may not be called "Apache", nor may
  *    "Apache" appear in their name, without prior written permission of the
  *    Apache Software Foundation.
- * 
+ *
  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * ============================================================================
- * 
+ *
  * This software consists of voluntary contributions made by many individuals
  * on behalf of the Apache Software Foundation and was originally created by
  * James Tauber <jtauber@jtauber.com>. For more information on the Apache
  * Software Foundation, please see <http://www.apache.org/>.
- */ 
+ */
 package org.apache.fop.image;
 
 // Java
@@ -74,9 +74,9 @@ import org.apache.fop.apps.FOUserAgent;
  * @author Eric SCHAEFFER
  */
 public class ImageFactory {
-    
+
     private static ImageFactory factory = new ImageFactory();
-    
+
     private ImageCache cache = new ContextImageCache(true);
 
     private ImageFactory() {
@@ -161,7 +161,7 @@ public class ImageFactory {
      * @param ua the user agent context
      * @return the fop image instance
      */
-    protected static FopImage loadImage(String href, FOUserAgent ua) {
+    public static FopImage loadImage(String href, FOUserAgent ua) {
         Logger log = ua.getLogger();
 
         InputStream in = openStream(href, ua);
@@ -176,7 +176,7 @@ public class ImageFactory {
             imgInfo = ImageReaderFactory.make(
                           href, in, ua);
         } catch (Exception e) {
-            log.error("Error while recovering image information (" 
+            log.error("Error while recovering image information ("
                     + href + ") : " + e.getMessage(), e);
             return null;
         }
@@ -187,7 +187,7 @@ public class ImageFactory {
             } catch (Exception e) {
                 log.debug("Error closing the InputStream for the image", e);
             }
-            log.error("No ImageReader for this type of image (" 
+            log.error("No ImageReader for this type of image ("
                     + href + ")");
             return null;
         }
@@ -195,7 +195,7 @@ public class ImageFactory {
         String imgMimeType = imgInfo.mimeType;
         String imgClassName = getImageClassName(imgMimeType);
         if (imgClassName == null) {
-            log.error("Unsupported image type (" 
+            log.error("Unsupported image type ("
                     + href + "): " + imgMimeType);
             return null;
         }
@@ -222,18 +222,18 @@ public class ImageFactory {
             } else {
                 msg = ex.getMessage();
             }
-            log.error("Error creating FopImage object (" 
+            log.error("Error creating FopImage object ("
                     + href + "): " + msg, (t == null) ? ex : t);
             return null;
         } catch (Exception ex) {
-            log.error("Error creating FopImage object (" 
+            log.error("Error creating FopImage object ("
                     + href + "): " + ex.getMessage(), ex);
             return null;
         }
         if (!(imageInstance instanceof org.apache.fop.image.FopImage)) {
-            log.error("Error creating FopImage object (" 
-                    + href + "): " + "class " 
-                    + imageClass.getName() 
+            log.error("Error creating FopImage object ("
+                    + href + "): " + "class "
+                    + imageClass.getName()
                     + " doesn't implement org.apache.fop.image.FopImage interface");
             return null;
         }
@@ -254,7 +254,7 @@ public class ImageFactory {
         try {
             in = ua.getStream(href);
         } catch (IOException ioe) {
-            log.error("Error while opening stream for (" 
+            log.error("Error while opening stream for ("
                     + href + "): " + ioe.getMessage(), ioe);
             return null;
         }
@@ -277,7 +277,7 @@ public class ImageFactory {
             } catch (Exception e) {
                 // maybe relative
                 if (ua.getBaseURL() == null) {
-                    log.error("Error with image URL: " + e.getMessage() 
+                    log.error("Error with image URL: " + e.getMessage()
                             + " and no base URL is specified", e);
                     return null;
                 }
@@ -285,7 +285,7 @@ public class ImageFactory {
                     absoluteURL = new URL(ua.getBaseURL() + absoluteURL.getFile());
                 } catch (MalformedURLException e_context) {
                     // pb context url
-                    log.error("Invalid Image URL - error on relative URL: " 
+                    log.error("Invalid Image URL - error on relative URL: "
                             + e_context.getMessage(), e_context);
                     return null;
                 }
@@ -300,11 +300,11 @@ public class ImageFactory {
                 log.error("Could not resolve URI for image: " + href);
                 return null;
             }
-            
+
             //Decorate the InputStream with a BufferedInputStream
             return new java.io.BufferedInputStream(in);
         } catch (Exception e) {
-            log.error("Error while opening stream for (" 
+            log.error("Error while opening stream for ("
                     + href + "): " + e.getMessage(), e);
             return null;
         }
@@ -346,7 +346,7 @@ public class ImageFactory {
  * This keeps track of invalid images.
  */
 class BasicImageCache implements ImageCache {
-    
+
     private Set invalid = Collections.synchronizedSet(new java.util.HashSet());
     private Map contextStore = Collections.synchronizedMap(new java.util.HashMap());
 
@@ -385,7 +385,7 @@ class BasicImageCache implements ImageCache {
  * weak hashmap so they may be garbage collected.
  */
 class ContextImageCache implements ImageCache {
-    
+
     // if this cache is collective then images can be shared
     // among contexts, this implies that the base directory
     // is either the same or does not effect the images being