diff options
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); |