gmazza      2004/05/25 21:22:40

  Modified:    src/java/org/apache/fop/layoutmgr AbstractLayoutManager.java
                        BlockContainerLayoutManager.java
                        BlockLayoutManager.java
                        InlineStackingLayoutManager.java
                        LineLayoutManager.java
               src/java/org/apache/fop/layoutmgr/list Item.java
                        ListBlockLayoutManager.java
                        ListItemLayoutManager.java
               src/java/org/apache/fop/layoutmgr/table Body.java Cell.java
                        Column.java Row.java TableLayoutManager.java
  Log:
  Removed PropertyManager argument from initProperties(), as it is already
  available within its FObj object.
  
  Revision  Changes    Path
  1.14      +18 -21    
xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java
  
  Index: AbstractLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/AbstractLayoutManager.java,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- AbstractLayoutManager.java        18 May 2004 11:42:08 -0000      1.13
  +++ AbstractLayoutManager.java        26 May 2004 04:22:39 -0000      1.14
  @@ -84,6 +84,24 @@
       }
   
       /**
  +     * This method provides a hook for a LayoutManager to initialize traits
  +     * for the areas it will create, based on Properties set on its FO.
  +     */
  +    public void initialize() {
  +        if (fobj != null && bInited == false) {
  +            initProperties();
  +            bInited = true;
  +        }
  +    }
  +
  +    /**
  +     * This method is called by initialize() to set any method variables
  +     * based on Properties set on its FO.
  +     */
  +    protected void initProperties() {
  +    }
  +
  +    /**
        * Set the user agent.
        *
        * @param ua the user agent
  @@ -223,27 +241,6 @@
           //      reset(null);
           //  }
       }
  -
  -
  -    /**
  -     * This method provides a hook for a LayoutManager to initialize traits
  -     * for the areas it will create, based on Properties set on its FO.
  -     */
  -    public void initialize() {
  -        if (fobj != null && bInited == false) {
  -            initProperties(fobj.getPropertyManager());
  -            bInited = true;
  -        }
  -    }
  -
  -    /**
  -     * This method provides a hook for a LayoutManager to initialize traits
  -     * for the areas it will create, based on Properties set on its FO.
  -     */
  -    protected void initProperties(PropertyManager pm) {
  -        //log.debug("AbstractLayoutManager.initProperties");
  -    }
  -
   
       /**
        * Tell whether this LayoutManager has handled all of its content.
  
  
  
  1.19      +20 -20    
xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java
  
  Index: BlockContainerLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockContainerLayoutManager.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BlockContainerLayoutManager.java  15 May 2004 21:51:59 -0000      1.18
  +++ BlockContainerLayoutManager.java  26 May 2004 04:22:39 -0000      1.19
  @@ -63,40 +63,40 @@
       /**
        * Create a new block container layout manager.
        */
  -    public BlockContainerLayoutManager() {
  -    }
  -
  -    /**
  -     * Create a new block container layout manager.
  -     */
       public BlockContainerLayoutManager(FObj node) {
           super(node);
       }
   
  -    public void setOverflow(int of) {
  -        overflow = of;
  -    }
  -
  -    protected void initProperties(PropertyManager pm) {
  -        propManager = pm;
  +    /**
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  +     */
  +    protected void initProperties() {
  +        propManager = fobj.getPropertyManager();
   
  -        abProps = pm.getAbsolutePositionProps();
  +        abProps = propManager.getAbsolutePositionProps();
           if (abProps.absolutePosition == AbsolutePosition.ABSOLUTE) {
               Rectangle2D rect = new Rectangle2D.Double(abProps.left,
                                   abProps.top, abProps.right - abProps.left,
                                   abProps.bottom - abProps.top);
               relDims = new FODimension(0, 0);
  -            absoluteCTM = CTM.getCTMandRelDims(pm.getAbsRefOrient(),
  -                pm.getWritingMode(), rect, relDims);
  +            absoluteCTM = CTM.getCTMandRelDims(propManager.getAbsRefOrient(),
  +                propManager.getWritingMode(), rect, relDims);
           }
  -        marginProps = pm.getMarginProps();
  -        borderProps = pm.getBorderAndPadding();
  -        height = pm.getPropertyList().get(PR_BLOCK_PROGRESSION_DIMENSION | 
CP_OPTIMUM).getLength();
  -        width = pm.getPropertyList().get(PR_INLINE_PROGRESSION_DIMENSION | 
CP_OPTIMUM).getLength();
  +        
  +        marginProps = propManager.getMarginProps();
  +        borderProps = propManager.getBorderAndPadding();
  +        height = propManager.getPropertyList().get(
  +            PR_BLOCK_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
  +        width = propManager.getPropertyList().get(
  +            PR_INLINE_PROGRESSION_DIMENSION | CP_OPTIMUM).getLength();
  +    }
  +
  +    public void setOverflow(int of) {
  +        overflow = of;
       }
   
       protected int getRotatedIPD() {
  -        PropertyList props = propManager.getPropertyList();
  +        PropertyList props = fobj.getPropertyList();
           int height = props.get(PR_HEIGHT).getLength().getValue();
           height = props.get(PR_INLINE_PROGRESSION_DIMENSION | 
CP_OPTIMUM).getLength().getValue();
   
  
  
  
  1.19      +13 -13    
xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java
  
  Index: BlockLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockLayoutManager.java,v
  retrieving revision 1.18
  retrieving revision 1.19
  diff -u -r1.18 -r1.19
  --- BlockLayoutManager.java   20 May 2004 08:11:31 -0000      1.18
  +++ BlockLayoutManager.java   26 May 2004 04:22:39 -0000      1.19
  @@ -84,6 +84,19 @@
       }
   
       /**
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  +     */
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        layoutProps = pm.getLayoutProps();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
  +        marginProps = pm.getMarginProps();
  +        foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
  +        prevFoBlockSpaceAfter = foBlockSpaceAfter;
  +    }
  +
  +    /**
        * Iterator for Block layout.
        * This iterator combines consecutive inline areas and
        * creates a line layout manager.
  @@ -137,19 +150,6 @@
               return child;
   
           }
  -    }
  -
  -    /**
  -     * This method provides a hook for a LayoutManager to intialize traits
  -     * for the areas it will create, based on Properties set on its FO.
  -     */
  -    protected void initProperties(PropertyManager pm) {
  -        layoutProps = pm.getLayoutProps();
  -        borderProps = pm.getBorderAndPadding();
  -        backgroundProps = pm.getBackgroundProps();
  -        marginProps = pm.getMarginProps();
  -        foBlockSpaceBefore = layoutProps.spaceBefore.getSpace();
  -        prevFoBlockSpaceAfter = foBlockSpaceAfter;
       }
   
       public BreakPoss getNextBreakPoss(LayoutContext context) {
  
  
  
  1.9       +18 -28    
xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
  
  Index: InlineStackingLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- InlineStackingLayoutManager.java  15 May 2004 21:52:00 -0000      1.8
  +++ InlineStackingLayoutManager.java  26 May 2004 04:22:39 -0000      1.9
  @@ -87,14 +87,6 @@
        * Create an inline stacking layout manager.
        * This is used for fo's that create areas that
        * contain inline areas.
  -     */
  -    public InlineStackingLayoutManager() {
  -    }
  -
  -    /**
  -     * Create an inline stacking layout manager.
  -     * This is used for fo's that create areas that
  -     * contain inline areas.
        *
        * @param node the formatting object that creates the area
        */
  @@ -114,6 +106,24 @@
       }
   
       /**
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  +     */
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        inlineProps = pm.getInlineProps();
  +        borderProps = pm.getBorderAndPadding();
  +        // Calculdate border and padding size in BPD
  +        int iPad = borderProps.getPadding(CommonBorderAndPadding.BEFORE, false);
  +        iPad += borderProps.getBorderWidth(CommonBorderAndPadding.BEFORE,
  +                                             false);
  +        iPad += borderProps.getPadding(CommonBorderAndPadding.AFTER, false);
  +        iPad += borderProps.getBorderWidth(CommonBorderAndPadding.AFTER, false);
  +        extraBPD = new MinOptMax(iPad);
  +
  +        backgroundProps = pm.getBackgroundProps();
  +    }
  +
  +    /**
        * Set the iterator.
        *
        * @param iter the iterator for this LM
  @@ -130,26 +140,6 @@
        */
       public boolean generatesInlineAreas() {
           return true;
  -    }
  -
  -    /**
  -     * Initialize properties for this layout manager.
  -     *
  -     * @param propMgr the property manager from the fo that created this manager
  -     */
  -    protected void initProperties(PropertyManager propMgr) {
  -        // super.initProperties(propMgr);
  -        inlineProps = propMgr.getInlineProps();
  -        borderProps = propMgr.getBorderAndPadding();
  -        // Calculdate border and padding size in BPD
  -        int iPad = borderProps.getPadding(CommonBorderAndPadding.BEFORE, false);
  -        iPad += borderProps.getBorderWidth(CommonBorderAndPadding.BEFORE,
  -                                             false);
  -        iPad += borderProps.getPadding(CommonBorderAndPadding.AFTER, false);
  -        iPad += borderProps.getBorderWidth(CommonBorderAndPadding.AFTER, false);
  -        extraBPD = new MinOptMax(iPad);
  -
  -        backgroundProps = propMgr.getBackgroundProps();
       }
   
       private MinOptMax getExtraIPD(boolean bNotFirst, boolean bNotLast) {
  
  
  
  1.21      +13 -14    xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
  
  Index: LineLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- LineLayoutManager.java    15 May 2004 21:52:00 -0000      1.20
  +++ LineLayoutManager.java    26 May 2004 04:22:39 -0000      1.21
  @@ -49,6 +49,19 @@
   public class LineLayoutManager extends InlineStackingLayoutManager {
   
       /**
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  +     */
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        CommonMarginBlock marginProps = pm.getMarginProps();
  +        iIndents = marginProps.startIndent + marginProps.endIndent;
  +        BlockProps blockProps = pm.getBlockProps();
  +        bTextAlignment = blockProps.textAlign;
  +        textIndent = blockProps.firstIndent;
  +        hyphProps = pm.getHyphenationProps();
  +    }
  +
  +    /**
        * Private class to store information about inline breaks.
        * Each value holds the start and end indexes into a List of
        * inline break positions.
  @@ -105,20 +118,6 @@
           lead = l;
           follow = f;
           initialize(); // Normally done when started by parent!
  -    }
  -
  -    /**
  -     * Initialize the properties for this layout manager.
  -     * The properties are from the block area.
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  -     */
  -    protected void initProperties(PropertyManager propMgr) {
  -        CommonMarginBlock marginProps = propMgr.getMarginProps();
  -        iIndents = marginProps.startIndent + marginProps.endIndent;
  -        BlockProps blockProps = propMgr.getBlockProps();
  -        bTextAlignment = blockProps.textAlign;
  -        textIndent = blockProps.firstIndent;
  -        hyphProps = propMgr.getHyphenationProps();
       }
   
       /**
  
  
  
  1.7       +5 -4      xml-fop/src/java/org/apache/fop/layoutmgr/list/Item.java
  
  Index: Item.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/Item.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Item.java 15 May 2004 21:52:00 -0000      1.6
  +++ Item.java 26 May 2004 04:22:40 -0000      1.7
  @@ -62,11 +62,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.7       +5 -4      
xml-fop/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
  
  Index: ListBlockLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- ListBlockLayoutManager.java       15 May 2004 21:52:00 -0000      1.6
  +++ ListBlockLayoutManager.java       26 May 2004 04:22:40 -0000      1.7
  @@ -68,11 +68,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.10      +5 -4      
xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java
  
  Index: ListItemLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/list/ListItemLayoutManager.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ListItemLayoutManager.java        15 May 2004 21:52:00 -0000      1.9
  +++ ListItemLayoutManager.java        26 May 2004 04:22:40 -0000      1.10
  @@ -70,11 +70,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.9       +5 -6      xml-fop/src/java/org/apache/fop/layoutmgr/table/Body.java
  
  Index: Body.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Body.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Body.java 15 May 2004 21:52:00 -0000      1.8
  +++ Body.java 26 May 2004 04:22:40 -0000      1.9
  @@ -65,13 +65,12 @@
       }
   
       /**
  -     * Initialize properties for this layout manager.
  -     *
  -     * @param propMgr the property manager from the fo object
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.9       +5 -4      xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java
  
  Index: Cell.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Cell.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Cell.java 15 May 2004 21:52:00 -0000      1.8
  +++ Cell.java 26 May 2004 04:22:40 -0000      1.9
  @@ -64,11 +64,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.6       +5 -4      xml-fop/src/java/org/apache/fop/layoutmgr/table/Column.java
  
  Index: Column.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Column.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- Column.java       15 May 2004 21:52:00 -0000      1.5
  +++ Column.java       26 May 2004 04:22:40 -0000      1.6
  @@ -50,11 +50,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.12      +5 -6      xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java
  
  Index: Row.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/Row.java,v
  retrieving revision 1.11
  retrieving revision 1.12
  diff -u -r1.11 -r1.12
  --- Row.java  15 May 2004 21:52:00 -0000      1.11
  +++ Row.java  26 May 2004 04:22:40 -0000      1.12
  @@ -72,13 +72,12 @@
       }
   
       /**
  -     * Initialize properties for this layout manager.
  -     *
  -     * @param propMgr the property manager for the fo
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  
  1.11      +5 -4      
xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java
  
  Index: TableLayoutManager.java
  ===================================================================
  RCS file: 
/home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/table/TableLayoutManager.java,v
  retrieving revision 1.10
  retrieving revision 1.11
  diff -u -r1.10 -r1.11
  --- TableLayoutManager.java   15 May 2004 21:52:00 -0000      1.10
  +++ TableLayoutManager.java   26 May 2004 04:22:40 -0000      1.11
  @@ -81,11 +81,12 @@
       }
   
       /**
  -     * @see 
org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties(PropertyManager)
  +     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
        */
  -    protected void initProperties(PropertyManager propMgr) {
  -        borderProps = propMgr.getBorderAndPadding();
  -        backgroundProps = propMgr.getBackgroundProps();
  +    protected void initProperties() {
  +        PropertyManager pm = fobj.getPropertyManager();
  +        borderProps = pm.getBorderAndPadding();
  +        backgroundProps = pm.getBackgroundProps();
       }
   
       /**
  
  
  

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

Reply via email to