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 ad...@apache.org on 2011/02/05 01:59:17 UTC
svn commit: r1067365 - in
/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list:
ListBlockLayoutManager.java ListItemContentLayoutManager.java
Author: adelmelle
Date: Sat Feb 5 00:59:17 2011
New Revision: 1067365
URL: http://svn.apache.org/viewvc?rev=1067365&view=rev
Log:
Decommission private PositionIterator subclasses in list package (+ minor fixups)
Modified:
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java?rev=1067365&r1=1067364&r2=1067365&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListBlockLayoutManager.java Sat Feb 5 00:59:17 2011
@@ -65,20 +65,6 @@ public class ListBlockLayoutManager exte
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 exte
}
/** {@inheritDoc} */
+ @Override
public void initialize() {
foSpaceBefore = new SpaceVal(
getListBlockFO().getCommonMarginBlock().spaceBefore, this).getSpace();
@@ -115,6 +102,7 @@ public class ListBlockLayoutManager exte
}
/** {@inheritDoc} */
+ @Override
public List getNextKnuthElements(LayoutContext context, int alignment) {
resetSpaces();
List returnList = super.getNextKnuthElements(context, alignment);
@@ -135,6 +123,7 @@ public class ListBlockLayoutManager exte
}
/** {@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 exte
* @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 exte
// "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 exte
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 exte
* @param childArea the child area
* @return the parent area of the child
*/
+ @Override
public Area getParentArea(Area childArea) {
if (curBlockArea == null) {
curBlockArea = new Block();
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java?rev=1067365&r1=1067364&r2=1067365&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/list/ListItemContentLayoutManager.java Sat Feb 5 00:59:17 2011
@@ -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 ListItemContentLayoutManage
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 ListItemContentLayoutManage
}
/** {@inheritDoc} */
+ @Override
public List getChangedKnuthElements(List oldList, int alignment) {
//log.debug(" ListItemContentLayoutManager.getChanged>");
return super.getChangedKnuthElements(oldList, alignment);
@@ -112,6 +98,7 @@ public class ListItemContentLayoutManage
* @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 ListItemContentLayoutManage
// "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 ListItemContentLayoutManage
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 ListItemContentLayoutManage
* @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 ListItemContentLayoutManage
*
* @param childArea the child to add to the cell
*/
+ @Override
public void addChildArea(Area childArea) {
if (curBlockArea != null) {
curBlockArea.addBlock((Block) childArea);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org