]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
cleaned up some style errors
authorKeiron Liddle <keiron@apache.org>
Thu, 23 Jan 2003 18:59:08 +0000 (18:59 +0000)
committerKeiron Liddle <keiron@apache.org>
Thu, 23 Jan 2003 18:59:08 +0000 (18:59 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195879 13f79535-47bb-0310-9956-ffa450edef68

13 files changed:
src/org/apache/fop/area/AreaTreeModel.java
src/org/apache/fop/area/BodyRegion.java
src/org/apache/fop/area/CTM.java
src/org/apache/fop/area/CachedRenderPagesModel.java
src/org/apache/fop/area/MinOptMax.java
src/org/apache/fop/area/RegionViewport.java
src/org/apache/fop/area/RenderPagesModel.java
src/org/apache/fop/area/Span.java
src/org/apache/fop/area/StorePagesModel.java
src/org/apache/fop/area/Trait.java
src/org/apache/fop/area/inline/Container.java
src/org/apache/fop/area/inline/InlineArea.java
src/org/apache/fop/area/inline/Word.java

index 2c99f1d3ddeeba8b20cdc5dee12cb5c2322f0ee4..0a10acafd4ee99fad93677f3121a9e0d626cdb8c 100644 (file)
@@ -1,9 +1,9 @@
 /*
-* $Id$
-* Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
-* For details on use and redistribution please refer to the
-* LICENSE file included with these sources.
-*/
+ * $Id$
+ * Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
+ */
 
 package org.apache.fop.area;
 
index 70ceb5f054c8ae44e10e0d78798407da33eb93c6..d620522be0d60fe05b4c7504967f9bea10a96abb 100644 (file)
@@ -19,7 +19,7 @@ public class BodyRegion extends RegionReference {
     private int columnGap;
     private int columnCount;
 
-    /** Referenc inline progression dimension for the body. */
+    /** Reference inline progression dimension for the body. */
     private int refIPD;
 
     /**
@@ -30,46 +30,95 @@ public class BodyRegion extends RegionReference {
         super(BODY);
     }
 
-    // Number of columns when not spanning
+    /**
+     * Set the number of columns for blocks when not spanning
+     *
+     * @param colCount the number of columns
+     */
     public void setColumnCount(int colCount) {
         this.columnCount = colCount;
     }
 
-    // Number of columns when not spanning
+    /**
+     * Get the number of columns when not spanning
+     *
+     * @return the number of columns
+     */
     public int getColumnCount() {
         return this.columnCount;
     }
 
-    // A length (mpoints)
+    /**
+     * Set the column gap between columns
+     * The length is in millipoints.
+     *
+     * @param colGap the column gap in millipoints
+     */
     public void setColumnGap(int colGap) {
         this.columnGap = colGap;
     }
 
+    /**
+     * Set the before float area.
+     *
+     * @param bf the before float area
+     */
     public void setBeforeFloat(BeforeFloat bf) {
         beforeFloat = bf;
     }
 
+    /**
+     * Set the main reference area.
+     *
+     * @param mr the main reference area
+     */
     public void setMainReference(MainReference mr) {
         mainReference = mr;
     }
 
+    /**
+     * Set the footnote area.
+     *
+     * @param foot the footnote area
+     */
     public void setFootnote(Footnote foot) {
         footnote = foot;
     }
 
-
+    /**
+     * Get the before float area.
+     *
+     * @return the before float area
+     */
     public BeforeFloat getBeforeFloat() {
         return beforeFloat;
     }
 
+    /**
+     * Get the main reference area.
+     *
+     * @return the main reference area
+     */
     public MainReference getMainReference() {
         return mainReference;
     }
 
+    /**
+     * Get the footnote area.
+     *
+     * @return the footnote area
+     */
     public Footnote getFootnote() {
         return footnote;
     }
 
+    /**
+     * Clone this object.
+     * This is only used to clone the current object, the child areas
+     * are assumed to be null and are not cloned.
+     *
+     * @return a shallow copy of this object
+     */ 
     public Object clone() {
         BodyRegion br = new BodyRegion();
         br.setCTM(getCTM());
index d2cacdbdc523a42754b05458d8c9a20d97d63cb1..bcb342790ea956a80df066fe15157540e75483d2 100644 (file)
@@ -23,6 +23,7 @@ public class CTM implements Serializable {
     private static CTM s_CTM_lrtb = new CTM(1, 0, 0, 1, 0, 0);
     private static CTM s_CTM_rltb = new CTM(-1, 0, 0, 1, 0, 0);
     private static CTM s_CTM_tbrl = new CTM(0, 1, -1, 0, 0, 0);
+
     /**
      * Create the identity matrix
      */
@@ -37,6 +38,13 @@ public class CTM implements Serializable {
 
     /**
      * Initialize a CTM from the passed arguments.
+     *
+     * @param a the x scale
+     * @param b the x shear
+     * @param c the y shear
+     * @param d the y scale
+     * @param e the x shift
+     * @param f the y shift
      */
     public CTM(double a, double b, double c, double d, double e, double f) {
         this.a = a;
@@ -49,7 +57,10 @@ public class CTM implements Serializable {
 
     /**
      * Initialize a CTM to the identity matrix with a translation
-     * specified by x and y.
+     * specified by x and y
+     *
+     * @param x the x shift
+     * @param y the y shift.
      */
     public CTM(double x, double y) {
         this.a = 1;
@@ -60,6 +71,11 @@ public class CTM implements Serializable {
         this.f = y;
     }
 
+    /**
+     * Initialize a CTM with the values of another CTM.
+     *
+     * @param ctm another CTM
+     */
     protected CTM(CTM ctm) {
         this.a = ctm.a;
         this.b = ctm.b;
@@ -78,6 +94,7 @@ public class CTM implements Serializable {
      * CTM is being set..
      * @param bpd The block-progression dimension of the reference area whose
      * CTM is being set.
+     * @return a new CTM with the required transform
      */
     public static CTM getWMctm(int wm, int ipd, int bpd) {
         CTM wmctm;
@@ -179,10 +196,10 @@ public class CTM implements Serializable {
         // recalculate the width and height
         int x1t = (int)(inRect.getX() * a + inRect.getY() * c + e);
         int y1t = (int)(inRect.getX() * b + inRect.getY() * d + f);
-        int x2t = (int)((inRect.getX() + inRect.getWidth()) * a +
-                        (inRect.getY() + inRect.getHeight()) * c + e);
-        int y2t = (int)((inRect.getX() + inRect.getWidth()) * b +
-                        (inRect.getY() + inRect.getHeight()) * d + f);
+        int x2t = (int)((inRect.getX() + inRect.getWidth()) * a
+                        (inRect.getY() + inRect.getHeight()) * c + e);
+        int y2t = (int)((inRect.getX() + inRect.getWidth()) * b
+                        (inRect.getY() + inRect.getHeight()) * d + f);
         // Normalize with x1 < x2
         if (x1t > x2t) {
             int tmp = x2t;
@@ -197,11 +214,22 @@ public class CTM implements Serializable {
         return new Rectangle(x1t, y1t, x2t - x1t, y2t - y1t);
     }
 
+    /**
+     * Get string for this transform.
+     *
+     * @return a string with the transform values
+     */
     public String toString() {
-        return "[" + a + " " + b + " " + c + " " + d + " " + e + " " +
-               f + "]";
+        return "[" + a + " " + b + " " + c + " " + d + " " + e + " "
+               f + "]";
     }
 
+    /**
+     * Get an array containing the values of this transform.
+     * This creates and returns a new transform with the values in it.
+     *
+     * @return an array containing the transform values
+     */
     public double[] toArray() {
         return new double[]{a, b, c, d, e, f};
     }
index 32130341e4e969944b87a72cebc7ab63e0468439..81bbd43f479bf630d4819ecf7929060b344eee51 100644 (file)
@@ -42,6 +42,8 @@ public class CachedRenderPagesModel extends RenderPagesModel {
      * Check prepared pages
      * If a page is resolved it loads the page contents from
      * the file.
+     *
+     * @param newpage the new page being added
      * @return true if the current page should be rendered
      *         false if the renderer doesn't support out of order
      *         rendering and there are pending pages
@@ -50,7 +52,7 @@ public class CachedRenderPagesModel extends RenderPagesModel {
         for (Iterator iter = prepared.iterator(); iter.hasNext();) {
             PageViewport p = (PageViewport)iter.next();
             if (p.isResolved()) {
-                if(p != newpage) {
+                if (p != newpage) {
                     try {
                         // load page from cache
                         String name = (String)pageMap.get(p);
@@ -82,7 +84,7 @@ public class CachedRenderPagesModel extends RenderPagesModel {
                 }
             }
         }
-        if(newpage != null && newpage.getPage() != null) {
+        if (newpage != null && newpage.getPage() != null) {
             savePage(newpage);
         }
         return renderer.supportsOutOfOrder() || prepared.isEmpty();
index 3c68fafb09783e50c9335cb116b9fe87b301823e..7332336d2ed7bf0d05f8a85e830df86b9960e66c 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  * For details on use and redistribution please refer to the
  * LICENSE file included with these sources.
  */
index cbcbe50fe11ace8a220c21adc18e085240ca4539..025b147a54cd2c2a0bb3024e572657638f4868e1 100644 (file)
@@ -95,7 +95,7 @@ public class RegionViewport extends Area implements Cloneable {
     public Object clone() {
         RegionViewport rv = new RegionViewport((Rectangle2D)viewArea.clone());
         rv.region = (RegionReference)region.clone();
-        if(props != null) {
+        if (props != null) {
             rv.props = (HashMap)props.clone();
         }
         return rv;
index 6292227e527586bc004b376e64aa6ac2492ff824..324425d0207045b938124baff0a72db374b9560d 100644 (file)
@@ -1,9 +1,9 @@
 /*
-* $Id$
-* Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
-* For details on use and redistribution please refer to the
-* LICENSE file included with these sources.
-*/
+ * $Id$
+ * Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
+ */
 
 package org.apache.fop.area;
 
@@ -94,6 +94,8 @@ public class RenderPagesModel extends StorePagesModel {
 
     /**
      * Check prepared pages
+     *
+     * @param newpage the new page being added
      * @return true if the current page should be rendered
      *         false if the renderer doesn't support out of order
      *         rendering and there are pending pages
index 01a7bb1ff2d12cd3625f5ef99fbfbd276450c473..57000fa9d4659da6217156a5da5d32b5117d8488 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2001-2002 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  * For details on use and redistribution please refer to the
  * LICENSE file included with these sources.
  */
@@ -10,28 +10,58 @@ package org.apache.fop.area;
 import java.util.List;
 import java.util.ArrayList;
 
-// this is a reference area block area with 0 border and padding
+/**
+ * The span reference area.
+ * This is a reference area block area with 0 border and padding
+ * The span reference areas are stacked inside the main reference area.
+ */
 public class Span extends Area {
     // the list of flow reference areas in this span area
     private List flowAreas;
     private int height;
 
+    /**
+     * Create a span area with the number of columns for this span area.
+     *
+     * @param cols the number of columns in the span
+     */
     public Span(int cols) {
         flowAreas = new ArrayList(cols);
     }
 
+    /**
+     * Add the flow area to this span area.
+     *
+     * @param flow the flow area to add
+     */
     public void addFlow(Flow flow) {
         flowAreas.add(flow);
     }
 
+    /**
+     * Get the column count for this span area.
+     *
+     * @return the number of columns in this span area
+     */
     public int getColumnCount() {
         return flowAreas.size();
     }
 
+    /**
+     * Get the height of this span area.
+     *
+     * @return the height of this span area
+     */
     public int getHeight() {
         return height;
     }
 
+    /**
+     * Get the flow area for a particular column.
+     *
+     * @param count the column number for the flow
+     * @return the flow area for the requested column
+     */
     public Flow getFlow(int count) {
         return (Flow) flowAreas.get(count);
     }
index 0005ad315a36cc3ac0f5ff7fca8c772b830963df..7ef01c94c495c66f02ffee761ab58ffa49166df4 100644 (file)
@@ -1,9 +1,9 @@
 /*
-* $Id$
-* Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
-* For details on use and redistribution please refer to the
-* LICENSE file included with these sources.
-*/
+ * $Id$
+ * Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
+ * For details on use and redistribution please refer to the
+ * LICENSE file included with these sources.
+ */
 
 package org.apache.fop.area;
 
@@ -134,4 +134,4 @@ public class StorePagesModel extends AreaTreeModel {
      */
     public void endDocument() {
     }
-}
\ No newline at end of file
+}
index fa4d6b422895d398afd24022c6b0c0c7075f3ead..2042fdb0d5b5b236d80e939e15e12d2cb95bcfae 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  * For details on use and redistribution please refer to the
  * LICENSE file included with these sources.
  */
@@ -128,7 +128,7 @@ public class Trait implements Serializable {
      */
     public static final Integer PADDING_AFTER = new Integer(22);
 
-    private static final Map shmTraitInfo = new HashMap();
+    private static final Map TRAIT_INFO = new HashMap();
 
     private static class TraitInfo {
         String sName;
@@ -141,42 +141,42 @@ public class Trait implements Serializable {
 
     static {
         // Create a hashmap mapping trait code to name for external representation
-        shmTraitInfo.put(ID_LINK, new TraitInfo("id-link", String.class));
-        shmTraitInfo.put(INTERNAL_LINK,
+        TRAIT_INFO.put(ID_LINK, new TraitInfo("id-link", String.class));
+        TRAIT_INFO.put(INTERNAL_LINK,
                           new TraitInfo("internal-link", String.class));
-        shmTraitInfo.put(EXTERNAL_LINK,
+        TRAIT_INFO.put(EXTERNAL_LINK,
                           new TraitInfo("external-link", String.class));
-        shmTraitInfo.put(FONT_NAME,
+        TRAIT_INFO.put(FONT_NAME,
                           new TraitInfo("font-family", String.class));
-        shmTraitInfo.put(FONT_SIZE,
+        TRAIT_INFO.put(FONT_SIZE,
                           new TraitInfo("font-size", Integer.class));
-        shmTraitInfo.put(COLOR, new TraitInfo("color", String.class));
-        shmTraitInfo.put(ID_AREA, new TraitInfo("id-area", String.class));
-        shmTraitInfo.put(BACKGROUND,
+        TRAIT_INFO.put(COLOR, new TraitInfo("color", String.class));
+        TRAIT_INFO.put(ID_AREA, new TraitInfo("id-area", String.class));
+        TRAIT_INFO.put(BACKGROUND,
                           new TraitInfo("background", Background.class));
-        shmTraitInfo.put(UNDERLINE,
+        TRAIT_INFO.put(UNDERLINE,
                           new TraitInfo("underline", Boolean.class));
-        shmTraitInfo.put(OVERLINE,
+        TRAIT_INFO.put(OVERLINE,
                           new TraitInfo("overline", Boolean.class));
-        shmTraitInfo.put(LINETHROUGH,
+        TRAIT_INFO.put(LINETHROUGH,
                           new TraitInfo("linethrough", Boolean.class));
-        shmTraitInfo.put(OFFSET, new TraitInfo("offset", Integer.class));
-        shmTraitInfo.put(SHADOW, new TraitInfo("shadow", Integer.class));
-        shmTraitInfo.put(BORDER_START,
+        TRAIT_INFO.put(OFFSET, new TraitInfo("offset", Integer.class));
+        TRAIT_INFO.put(SHADOW, new TraitInfo("shadow", Integer.class));
+        TRAIT_INFO.put(BORDER_START,
                           new TraitInfo("border-start", BorderProps.class));
-        shmTraitInfo.put(BORDER_END,
+        TRAIT_INFO.put(BORDER_END,
                           new TraitInfo("border-end", BorderProps.class));
-        shmTraitInfo.put(BORDER_BEFORE,
+        TRAIT_INFO.put(BORDER_BEFORE,
                           new TraitInfo("border-before", BorderProps.class));
-        shmTraitInfo.put(BORDER_AFTER,
+        TRAIT_INFO.put(BORDER_AFTER,
                           new TraitInfo("border-after", BorderProps.class));
-        shmTraitInfo.put(PADDING_START,
+        TRAIT_INFO.put(PADDING_START,
                           new TraitInfo("padding-start", Integer.class));
-        shmTraitInfo.put(PADDING_END,
+        TRAIT_INFO.put(PADDING_END,
                           new TraitInfo("padding-end", Integer.class));
-        shmTraitInfo.put(PADDING_BEFORE,
+        TRAIT_INFO.put(PADDING_BEFORE,
                           new TraitInfo("padding-before", Integer.class));
-        shmTraitInfo.put(PADDING_AFTER,
+        TRAIT_INFO.put(PADDING_AFTER,
                           new TraitInfo("padding-after", Integer.class));
     }
 
@@ -187,7 +187,7 @@ public class Trait implements Serializable {
      * @return the trait name
      */
     public static String getTraitName(Object traitCode) {
-        Object obj = shmTraitInfo.get(traitCode);
+        Object obj = TRAIT_INFO.get(traitCode);
         if (obj != null) {
             return ((TraitInfo) obj).sName;
         } else {
@@ -202,7 +202,7 @@ public class Trait implements Serializable {
      * @return the trait code object
      */
     public static Object getTraitCode(String sTraitName) {
-        Iterator iter = shmTraitInfo.entrySet().iterator();
+        Iterator iter = TRAIT_INFO.entrySet().iterator();
         while (iter.hasNext()) {
             Map.Entry entry = (Map.Entry) iter.next();
             TraitInfo ti = (TraitInfo) entry.getValue();
@@ -220,7 +220,7 @@ public class Trait implements Serializable {
      * @return the class type for the trait
      */
     private static Class getTraitClass(Object oTraitCode) {
-        TraitInfo ti = (TraitInfo) shmTraitInfo.get(oTraitCode);
+        TraitInfo ti = (TraitInfo) TRAIT_INFO.get(oTraitCode);
         return (ti != null ? ti.sClass : null);
     }
 
@@ -270,8 +270,9 @@ public class Trait implements Serializable {
         // See what type of object it is
         // Convert string value to an object of that type
         Class tclass = getTraitClass(oCode);
-        if (tclass == null)
+        if (tclass == null) {
             return null;
+        }
         if (tclass.equals(String.class)) {
             return sTraitValue;
         }
index 12d10acbd8a552e4c46bee7d17792524ed7c9bbe..d988a9ef2c5c7a020dcf5f56eed6bb54cc27df22 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2001 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2001-2003 The Apache Software Foundation. All rights reserved.
  * For details on use and redistribution please refer to the
  * LICENSE file included with these sources.
  */
index b0452a8cf52dd06b35e7c1af4f5059671b9c2944..78c329c8091f4d58d7f71bdbe0bf8b79b55846e9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * $Id$
- * Copyright (C) 2002 The Apache Software Foundation. All rights reserved.
+ * Copyright (C) 2002-2003 The Apache Software Foundation. All rights reserved.
  * For details on use and redistribution please refer to the
  * LICENSE file included with these sources.
  */
@@ -22,10 +22,15 @@ import org.apache.fop.traits.BorderProps;
 public class InlineArea extends Area {
     // int width;
     private int height;
+    /**
+     * The content ipd of this inline area
+     */
     protected int contentIPD = 0;
 
-    // offset position from top of parent area
-    int verticalPosition = 0;
+    /**
+     * offset position from top of parent area
+     */
+    protected int verticalPosition = 0;
 
     /**
      * Render this inline area.
@@ -58,26 +63,59 @@ public class InlineArea extends Area {
         return contentIPD;
     }
 
+    /**
+     * Set the inline progression dimension of this inline area.
+     *
+     * @param ipd the inline progression dimension
+     */
     public void setIPD(int ipd) {
         this.contentIPD = ipd;
     }
 
+    /**
+     * Get the inline progression dimension
+     *
+     * @return the inline progression dimension of this area
+     */
     public int getIPD() {
         return this.contentIPD;
     }
 
+    /**
+     * Increase the inline progression dimensions of this area.
+     * This is used for inline parent areas that contain mulitple child areas.
+     *
+     * @param ipd the inline progression to increase by
+     */
     public void increaseIPD(int ipd) {
         this.contentIPD += ipd;
     }
 
+    /**
+     * Set the height of this inline area.
+     *
+     * @param h the height value to set
+     */
     public void setHeight(int h) {
         height = h;
     }
 
+    /**
+     * Get the height of this inline area.
+     *
+     * @return the height of the inline area
+     */
     public int getHeight() {
         return height;
     }
 
+    /**
+     * Get the allocation inline progression dimension of this area.
+     * This adds the content, borders and the padding to find the
+     * total allocated IPD.
+     *
+     * @return the total IPD allocation for this area
+     */
     public int getAllocIPD() {
         // If start or end border or padding is non-zero, add to content IPD
         int iBP = contentIPD;
index 4b3ca7b8c43920a7b8b15b792b464cd3e367f47e..1f18ffdfa135784402241835ff62f2da47f38d00 100644 (file)
@@ -9,6 +9,11 @@ package org.apache.fop.area.inline;
 
 import org.apache.fop.render.Renderer;
 
+/**
+ * A word inline area.
+ * This is really a collection character inline areas collected together
+ * into a single word.
+ */
 public class Word extends InlineArea {
     /**
      * The word for this word area.