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 gm...@apache.org on 2005/06/07 22:43:43 UTC

cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr/list ListItemLayoutManager.java ListBlockLayoutManager.java

gmazza      2005/06/07 13:43:43

  Modified:    src/java/org/apache/fop/layoutmgr LineLayoutManager.java
                        InlineLayoutManager.java AbstractLayoutManager.java
                        PageSequenceLayoutManager.java
                        ContentLayoutManager.java LayoutManager.java
                        BlockLayoutManager.java
                        BlockContainerLayoutManager.java
               src/java/org/apache/fop/layoutmgr/table Cell.java
                        TableLayoutManager.java
               src/java/org/apache/fop/layoutmgr/list
                        ListItemLayoutManager.java
                        ListBlockLayoutManager.java
  Log:
  Removed LM.initialize() -- switched to internal initialization of all LM's.
  Did initialization from constructor, as that appeared sufficient for all of them.
  Should for any LM, initialization not be available until the parentLM set,
  then we just need to do this process within a setParent() override.
  
  Also removed calls to superclass initialization, because as yet no initialization
  was occurring in those superclasses.
  
  Revision  Changes    Path
  1.47      +1 -4      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.46
  retrieving revision 1.47
  diff -u -r1.46 -r1.47
  --- LineLayoutManager.java	18 May 2005 08:59:36 -0000	1.46
  +++ LineLayoutManager.java	7 Jun 2005 20:43:42 -0000	1.47
  @@ -50,10 +50,7 @@
   
       private Block fobj; 
       
  -    /**
  -     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  -     */
  -    protected void initProperties() {
  +    private void initialize() {
           bTextAlignment = fobj.getTextAlign();
           bTextAlignmentLast = fobj.getTextAlignLast();
           textIndent = fobj.getTextIndent();
  
  
  
  1.6       +3 -5      xml-fop/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java
  
  Index: InlineLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineLayoutManager.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- InlineLayoutManager.java	13 May 2005 19:16:51 -0000	1.5
  +++ InlineLayoutManager.java	7 Jun 2005 20:43:42 -0000	1.6
  @@ -52,12 +52,10 @@
       public InlineLayoutManager(InlineLevel node) {
           super(node);
           fobj = node;
  +        initialize();
       }
       
  -    /**
  -     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  -     */
  -    protected void initProperties() {
  +    private void initialize() {
           inlineProps = fobj.getCommonMarginInline();
           borderProps = fobj.getCommonBorderPaddingBackground();
   
  
  
  
  1.48      +0 -20     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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- AbstractLayoutManager.java	1 Jun 2005 04:22:18 -0000	1.47
  +++ AbstractLayoutManager.java	7 Jun 2005 20:43:42 -0000	1.48
  @@ -45,7 +45,6 @@
   
       /** True if this LayoutManager has handled all of its content. */
       private boolean bFinished = false;
  -    protected boolean bInited = false;
       
       /** child LM and child LM iterator during getNextBreakPoss phase */
       protected LayoutManager curChildLM = null;
  @@ -76,24 +75,6 @@
           childLMiter = new LMiter(this);
       }
   
  -    /**
  -     * 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 (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() {
  -    }
  -
       public void setParent(LayoutManager lm) {
           this.parentLM = lm;
       }
  @@ -337,7 +318,6 @@
               return;
           }
           lm.setParent(this);
  -        lm.initialize();
           if (childLMs == null) {
               childLMs = new java.util.ArrayList(10);
           }
  
  
  
  1.65      +8 -4      xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
  
  Index: PageSequenceLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java,v
  retrieving revision 1.64
  retrieving revision 1.65
  diff -u -r1.64 -r1.65
  --- PageSequenceLayoutManager.java	6 Jun 2005 05:46:00 -0000	1.64
  +++ PageSequenceLayoutManager.java	7 Jun 2005 20:43:42 -0000	1.65
  @@ -452,7 +452,9 @@
               throw new IllegalArgumentException("Cannot create page: " + fopex.getMessage());
           }
   
  -        log.debug("[" + curPV.getPageNumberString() + (bIsBlank ? "*" : "") + "]");
  +        if (log.isDebugEnabled()) {
  +            log.debug("[" + curPV.getPageNumberString() + (bIsBlank ? "*" : "") + "]");
  +        }
           return curPV;
       }
   
  @@ -484,8 +486,10 @@
           areaTreeHandler.tryIDResolution(curPV);
           // Queue for ID resolution and rendering
           areaTreeHandler.getAreaTreeModel().addPage(curPV);
  -        log.debug("page finished: " + curPV.getPageNumberString() 
  -                + ", current num: " + currentPageNum);
  +        if (log.isDebugEnabled()) {
  +            log.debug("page finished: " + curPV.getPageNumberString() 
  +                    + ", current num: " + currentPageNum);
  +        }
           curPV = null;
       }
       
  
  
  
  1.29      +0 -6      xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java
  
  Index: ContentLayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ContentLayoutManager.java,v
  retrieving revision 1.28
  retrieving revision 1.29
  diff -u -r1.28 -r1.29
  --- ContentLayoutManager.java	4 Jun 2005 04:47:31 -0000	1.28
  +++ ContentLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.29
  @@ -218,11 +218,6 @@
       }
   
       /** @see org.apache.fop.layoutmgr.LayoutManager */
  -    public void initialize() {
  -        //to be done
  -    }
  -
  -    /** @see org.apache.fop.layoutmgr.LayoutManager */
       public void resetPosition(Position position) {
           //to be done
       }
  @@ -255,7 +250,6 @@
               return;
           }
           lm.setParent(this);
  -        lm.initialize();
           childLM = (InlineLevelLayoutManager)lm;
           log.trace(this.getClass().getName()
                     + ": Adding child LM " + lm.getClass().getName());
  
  
  
  1.26      +0 -5      xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java
  
  Index: LayoutManager.java
  ===================================================================
  RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LayoutManager.java,v
  retrieving revision 1.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- LayoutManager.java	30 May 2005 09:11:09 -0000	1.25
  +++ LayoutManager.java	7 Jun 2005 20:43:43 -0000	1.26
  @@ -43,11 +43,6 @@
       LayoutManager getParent();
   
       /**
  -     * Initialize this layout manager.
  -     */
  -    void initialize();
  -
  -    /**
        * Get the active PageSequenceLayoutManager instance for this
        * layout process.
        * @return the PageSequenceLayoutManager
  
  
  
  1.48      +2 -6      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.47
  retrieving revision 1.48
  diff -u -r1.47 -r1.48
  --- BlockLayoutManager.java	30 May 2005 09:11:09 -0000	1.47
  +++ BlockLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.48
  @@ -73,14 +73,10 @@
           follow = -fs.getDescender();
           middleShift = -fs.getXHeight() / 2;
           lineHeight = getBlockFO().getLineHeight().getOptimum().getLength().getValue();
  +        initialize();
       }
   
  -    /**
  -     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  -     * @todo need to take into account somewhere the effects of fo:initial-property-set,
  -     *      if defined for the block.
  -     */
  -    protected void initProperties() {
  +    private void initialize() {
           foBlockSpaceBefore = new SpaceVal(getBlockFO().getCommonMarginBlock().spaceBefore).getSpace();
   /*LF*/  bpUnit = 0; //layoutProps.blockProgressionUnit;
   /*LF*/  if (bpUnit == 0) {
  
  
  
  1.43      +2 -4      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.42
  retrieving revision 1.43
  diff -u -r1.42 -r1.43
  --- BlockContainerLayoutManager.java	30 May 2005 09:11:09 -0000	1.42
  +++ BlockContainerLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.43
  @@ -73,12 +73,10 @@
        */
       public BlockContainerLayoutManager(BlockContainer node) {
           super(node);
  +        initialize();
       }
       
  -    /**
  -     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  -     */
  -    protected void initProperties() {
  +    private void initialize() {
           abProps = getBlockContainerFO().getCommonAbsolutePosition();
           foBlockSpaceBefore = new SpaceVal(getBlockContainerFO().getCommonMarginBlock()
                       .spaceBefore).getSpace();
  
  
  
  1.33      +2 -5      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.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- Cell.java	30 May 2005 09:11:10 -0000	1.32
  +++ Cell.java	7 Jun 2005 20:43:43 -0000	1.33
  @@ -71,6 +71,7 @@
           super(node);
           fobj = node;
           this.gridUnit = pgu;
  +        initialize();
       }
   
       /** @return the table-cell FO */
  @@ -82,11 +83,7 @@
           return fobj.isSeparateBorderModel();
       }
       
  -    /**
  -     * @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties()
  -     */
  -    protected void initProperties() {
  -        super.initProperties();
  +    private void initialize() {
           borderAndPaddingBPD = 0;
           borderAndPaddingBPD += fobj.getCommonBorderPaddingBackground().getBorderBeforeWidth(false);
           borderAndPaddingBPD += fobj.getCommonBorderPaddingBackground().getBorderAfterWidth(false);
  
  
  
  1.26      +2 -3      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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- TableLayoutManager.java	30 May 2005 09:11:10 -0000	1.25
  +++ TableLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.26
  @@ -84,6 +84,7 @@
           super(node);
           fobj = node;
           this.columns = new ColumnSetup(node);
  +        initialize();
       }
   
       /** @return the table FO */
  @@ -98,9 +99,7 @@
           return this.columns;
       }
       
  -    /** @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */
  -    protected void initProperties() {
  -        super.initProperties();
  +    private void initialize() {
           spaceBefore = new SpaceVal(fobj.getCommonMarginBlock().spaceBefore).getSpace();
           spaceAfter = new SpaceVal(fobj.getCommonMarginBlock().spaceAfter).getSpace();
           
  
  
  
  1.26      +2 -3      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.25
  retrieving revision 1.26
  diff -u -r1.25 -r1.26
  --- ListItemLayoutManager.java	30 May 2005 09:11:09 -0000	1.25
  +++ ListItemLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.26
  @@ -124,6 +124,7 @@
           super(node);
           setLabel(node.getLabel());
           setBody(node.getBody());
  +        initialize();
       }
   
       /**
  @@ -152,9 +153,7 @@
           body.setParent(this);
       }
   
  -    /** @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */
  -    protected void initProperties() {
  -        super.initProperties();
  +    private void initialize() {
           spaceBefore = new SpaceVal(getListItemFO().getCommonMarginBlock().spaceBefore).getSpace();
           spaceAfter = new SpaceVal(getListItemFO().getCommonMarginBlock().spaceAfter).getSpace();
       }
  
  
  
  1.18      +2 -3      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.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- ListBlockLayoutManager.java	30 May 2005 09:11:09 -0000	1.17
  +++ ListBlockLayoutManager.java	7 Jun 2005 20:43:43 -0000	1.18
  @@ -77,6 +77,7 @@
        */
       public ListBlockLayoutManager(ListBlock node) {
           super(node);
  +        initialize();
       }
   
       /**
  @@ -87,9 +88,7 @@
           return (ListBlock)fobj;
       }
   
  -    /** @see org.apache.fop.layoutmgr.AbstractLayoutManager#initProperties() */
  -    protected void initProperties() {
  -        super.initProperties();
  +    private void initialize() {
           spaceBefore = new SpaceVal(getListBlockFO().getCommonMarginBlock().spaceBefore).getSpace();
           spaceAfter = new SpaceVal(getListBlockFO().getCommonMarginBlock().spaceAfter).getSpace();
       }
  
  
  

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