]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Moved the FLAGGED_PENALTY constant to the KnuthPenalty class
authorGlen Mazza <gmazza@apache.org>
Wed, 11 May 2005 07:08:49 +0000 (07:08 +0000)
committerGlen Mazza <gmazza@apache.org>
Wed, 11 May 2005 07:08:49 +0000 (07:08 +0000)
because it will be easier to understand this constant's meaning
within the framework of comments/notes in this class.

Removed unused setFObj() requirement from LayoutManager interface.

git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_KnuthStylePageBreaking@198611 13f79535-47bb-0310-9956-ffa450edef68

src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
src/java/org/apache/fop/layoutmgr/BidiLayoutManager.java
src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java
src/java/org/apache/fop/layoutmgr/KnuthPenalty.java
src/java/org/apache/fop/layoutmgr/LayoutManager.java
src/java/org/apache/fop/layoutmgr/TextLayoutManager.java

index 3afa2fdf50b99757bdec7baa3e7aeb44d5e905bc..7ee9756fac443c140ba953ef3e901af244f74fa5 100644 (file)
@@ -79,15 +79,6 @@ public abstract class AbstractLayoutManager implements LayoutManager, Constants
         if (fo == null) {
             throw new IllegalStateException("Null formatting object found.");
         }
-        setFObj(fo);
-    }
-
-    /**
-     * Set the FO object for this layout manager
-     *
-     * @param fo the formatting object for this layout manager
-     */
-    public void setFObj(FObj fo) {
         markers = fo.getMarkers();
         fobjIter = fo.getChildNodes();
         childLMiter = new LMiter(this);
index c20237ac2e0062256c45e2fd290ad8ea641fbde9..bffc4c758440134a3f80e84f5359902ff16a1e30 100644 (file)
@@ -37,7 +37,6 @@ public class BidiLayoutManager extends LeafNodeLayoutManager {
     public BidiLayoutManager(BidiOverride node, InlineLayoutManager cLM) {
         super(node);
         children = new ArrayList();
-        setFObj(node);
 /*
         for (int count = cLM.size() - 1; count >= 0; count--) {
             InlineArea ia = cLM.get(count);
index 4db661310c1ad4f6fec4895c4a2e4ce21a3fd20e..372f0ca7d315cd70af9eb16257fdafa8343bd157 100644 (file)
@@ -19,7 +19,6 @@
 package org.apache.fop.layoutmgr;
 
 import org.apache.fop.apps.FOUserAgent;
-import org.apache.fop.fo.FObj;
 import org.apache.fop.fo.Constants;
 import org.apache.fop.fo.pagination.Title;
 import org.apache.fop.area.Area;
@@ -199,10 +198,6 @@ public class ContentLayoutManager implements InlineLevelLayoutManager {
         return userAgent;
     }
 
-    /** @see org.apache.fop.layoutmgr.LayoutManager */
-    public void setFObj(FObj fobj) {
-    }
-
     /** @see org.apache.fop.layoutmgr.LayoutManager */
     public void setParent(LayoutManager lm) {
         parentLM = lm;
index ffef97bffae889b32a27414bb7bae9e2f08c8ee7..e0b528867685212683b53a1b540697c0ec8807db 100644 (file)
@@ -38,6 +38,8 @@ package org.apache.fop.layoutmgr;
  */
 public class KnuthPenalty extends KnuthElement {
 
+    public static final int FLAGGED_PENALTY = 50;
+
     private int penalty;
     private boolean bFlagged; 
     private int breakClass = -1;
index 721bb8dbee1b272973fc00da50c9c6bdbcbb8d6b..6c3187117b36c0d41aaa96452460f9dc319186ec 100644 (file)
@@ -22,22 +22,12 @@ import java.util.LinkedList;
 import java.util.List;
 
 import org.apache.fop.area.Area;
-import org.apache.fop.fo.FObj;
 
 /**
  * The interface for all LayoutManagers.
  */
 public interface LayoutManager {
 
-    /**
-     * Set the FO object for this layout manager.
-     * For layout managers that are created without an FO
-     * this may not be called.
-     *
-     * @param obj the FO object for this layout manager
-     */
-    void setFObj(FObj obj);
-
     /**
      * Set the parent layout manager.
      * The parent layout manager is required for adding areas.
@@ -216,5 +206,4 @@ public interface LayoutManager {
     LinkedList getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/
                                        int alignment);
    
-    public static final int FLAGGED_PENALTY = 50;
 }
index 53871939f2094fd59d2d3d1d144f2f1b19c7ceaf..13d6d89adb5843bd521f95c768e44c6a81f56afd 100644 (file)
@@ -837,7 +837,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
                     && textArray[iTempStart] != SPACE
                     && textArray[iTempStart] != NBSPACE) {
                     returnList.add
-                        (new KnuthPenalty(0, LayoutManager.FLAGGED_PENALTY, true,
+                        (new KnuthPenalty(0, KnuthPenalty.FLAGGED_PENALTY, true,
                                           new LeafPosition(this, -1), false));
                     returnList.add
                         (new KnuthGlue(letterSpaceIPD.opt,
@@ -872,7 +872,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
             // the last character could be used as a line break
             // append new elements to oldList
             oldListIterator = oldList.listIterator(oldList.size());
-            oldListIterator.add(new KnuthPenalty(0, LayoutManager.FLAGGED_PENALTY, true,
+            oldListIterator.add(new KnuthPenalty(0, KnuthPenalty.FLAGGED_PENALTY, true,
                                                  new LeafPosition(this, -1), false));
             oldListIterator.add(new KnuthGlue(letterSpaceIPD.opt,
                                        letterSpaceIPD.max - letterSpaceIPD.opt,
@@ -1033,7 +1033,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
                 }
                 if (ai.bHyphenated) {
                     returnList.add
-                        (new KnuthPenalty(hyphIPD, LayoutManager.FLAGGED_PENALTY, true,
+                        (new KnuthPenalty(hyphIPD, KnuthPenalty.FLAGGED_PENALTY, true,
                                           new LeafPosition(this, -1), false));
                 }
                 // if the last character is '-' or '/', it could be used as a line end;
@@ -1042,7 +1042,7 @@ public class TextLayoutManager extends LeafNodeLayoutManager {
                 if (BREAK_CHARS.indexOf(textArray[ai.iBreakIndex - 1]) >= 0
                     && ai.iLScount == (ai.iBreakIndex - ai.iStartIndex)) {
                     returnList.add
-                        (new KnuthPenalty(0, LayoutManager.FLAGGED_PENALTY, true,
+                        (new KnuthPenalty(0, KnuthPenalty.FLAGGED_PENALTY, true,
                                           new LeafPosition(this, -1), false));
                     returnList.add
                         (new KnuthGlue(letterSpaceIPD.opt,