diff options
author | Andreas L. Delmelle <adelmelle@apache.org> | 2011-02-05 00:59:17 +0000 |
---|---|---|
committer | Andreas L. Delmelle <adelmelle@apache.org> | 2011-02-05 00:59:17 +0000 |
commit | 9e56df1048a109dcd04d77779335aa7d7431dd01 (patch) | |
tree | f169b9ee214927b9b0ff1a0dbfafd7a243f4f3cc /src | |
parent | 8addb610e119ae5192f697dc19ddcc55612a83e6 (diff) | |
download | xmlgraphics-fop-9e56df1048a109dcd04d77779335aa7d7431dd01.tar.gz xmlgraphics-fop-9e56df1048a109dcd04d77779335aa7d7431dd01.zip |
Decommission private PositionIterator subclasses in list package (+ minor fixups)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1067365 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java | 25 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java | 25 |
2 files changed, 15 insertions, 35 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java index 8ab79d2c4..9ffe015d3 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java @@ -65,20 +65,6 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager private MinOptMax effSpaceBefore; private MinOptMax effSpaceAfter; - private static class StackingIter extends PositionIterator { - StackingIter(Iterator parentIter) { - super(parentIter); - } - - protected LayoutManager getLM(Object nextObj) { - return ((Position) nextObj).getLM(); - } - - protected Position getPos(Object nextObj) { - return ((Position) nextObj); - } - } - /** * Create a new list block layout manager. * @param node list-block to create the layout manager for @@ -96,6 +82,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ + @Override public void initialize() { foSpaceBefore = new SpaceVal( getListBlockFO().getCommonMarginBlock().spaceBefore, this).getSpace(); @@ -115,6 +102,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ + @Override public List getNextKnuthElements(LayoutContext context, int alignment) { resetSpaces(); List returnList = super.getNextKnuthElements(context, alignment); @@ -135,6 +123,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager } /** {@inheritDoc} */ + @Override public List getChangedKnuthElements(List oldList, int alignment) { //log.debug("LBLM.getChangedKnuthElements>"); return super.getChangedKnuthElements(oldList, alignment); @@ -147,6 +136,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager * @param parentIter the position iterator * @param layoutContext the layout context for adding areas */ + @Override public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); @@ -170,10 +160,10 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager // "unwrap" the NonLeafPositions stored in parentIter // and put them in a new list; - LinkedList positionList = new LinkedList(); + LinkedList<Position> positionList = new LinkedList<Position>(); Position pos; while (parentIter.hasNext()) { - pos = (Position)parentIter.next(); + pos = parentIter.next(); if (pos.getIndex() >= 0) { if (firstPos == null) { firstPos = pos; @@ -194,7 +184,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager addMarkersToPage(true, isFirst(firstPos), isLast(lastPos)); - StackingIter childPosIter = new StackingIter(positionList.listIterator()); + PositionIterator childPosIter = new PositionIterator(positionList.listIterator()); while ((childLM = childPosIter.getNextChildLM()) != null) { // Add the block areas to Area // set the space adjustment ratio @@ -235,6 +225,7 @@ public class ListBlockLayoutManager extends BlockStackingLayoutManager * @param childArea the child area * @return the parent area of the child */ + @Override public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); diff --git a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java index 246c57094..f2e3b7d95 100644 --- a/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java @@ -19,7 +19,6 @@ package org.apache.fop.layoutmgr.list; -import java.util.Iterator; import java.util.LinkedList; import java.util.List; @@ -49,20 +48,6 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { private int xoffset; private int itemIPD; - private static class StackingIter extends PositionIterator { - StackingIter(Iterator parentIter) { - super(parentIter); - } - - protected LayoutManager getLM(Object nextObj) { - return ((Position) nextObj).getLM(); - } - - protected Position getPos(Object nextObj) { - return ((Position) nextObj); - } - } - /** * Create a new Cell layout manager. * @param node list-item-label node @@ -99,6 +84,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { } /** {@inheritDoc} */ + @Override public List getChangedKnuthElements(List oldList, int alignment) { //log.debug(" ListItemContentLayoutManager.getChanged>"); return super.getChangedKnuthElements(oldList, alignment); @@ -112,6 +98,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { * @param parentIter the iterator of the break positions * @param layoutContext the layout context for adding the areas */ + @Override public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) { getParentArea(null); @@ -127,10 +114,10 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { // "unwrap" the NonLeafPositions stored in parentIter // and put them in a new list; - LinkedList positionList = new LinkedList(); + LinkedList<Position> positionList = new LinkedList<Position>(); Position pos; while (parentIter.hasNext()) { - pos = (Position)parentIter.next(); + pos = parentIter.next(); if (pos == null) { continue; } @@ -156,7 +143,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { addMarkersToPage(true, isFirst(firstPos), isLast(lastPos)); - StackingIter childPosIter = new StackingIter(positionList.listIterator()); + PositionIterator childPosIter = new PositionIterator(positionList.listIterator()); while ((childLM = childPosIter.getNextChildLM()) != null) { // Add the block areas to Area lc.setFlags(LayoutContext.FIRST_AREA, childLM == firstLM); @@ -189,6 +176,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { * @param childArea the child area to get the parent for * @return the parent area */ + @Override public Area getParentArea(Area childArea) { if (curBlockArea == null) { curBlockArea = new Block(); @@ -215,6 +203,7 @@ public class ListItemContentLayoutManager extends BlockStackingLayoutManager { * * @param childArea the child to add to the cell */ + @Override public void addChildArea(Area childArea) { if (curBlockArea != null) { curBlockArea.addBlock((Block) childArea); |