aboutsummaryrefslogtreecommitdiffstats
path: root/src/java
diff options
context:
space:
mode:
authorVincent Hennebert <vhennebert@apache.org>2013-11-14 09:45:39 +0000
committerVincent Hennebert <vhennebert@apache.org>2013-11-14 09:45:39 +0000
commit7a151fd401340c0c4578a4d865a3245551ff85c4 (patch)
treed802dc5df37b00d6ba43b9df65a2eef393209fda /src/java
parentd1ac3aa05b692e9d9ead48b93e8e9e9ad4297416 (diff)
downloadxmlgraphics-fop-7a151fd401340c0c4578a4d865a3245551ff85c4.tar.gz
xmlgraphics-fop-7a151fd401340c0c4578a4d865a3245551ff85c4.zip
Code clean-up and simplification
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1541863 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java')
-rw-r--r--src/java/org/apache/fop/fo/flow/InlineContainer.java8
-rw-r--r--src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java32
2 files changed, 17 insertions, 23 deletions
diff --git a/src/java/org/apache/fop/fo/flow/InlineContainer.java b/src/java/org/apache/fop/fo/flow/InlineContainer.java
index 13ea9943a..bcff3dc72 100644
--- a/src/java/org/apache/fop/fo/flow/InlineContainer.java
+++ b/src/java/org/apache/fop/fo/flow/InlineContainer.java
@@ -158,10 +158,18 @@ public class InlineContainer extends FObj {
return this.displayAlign;
}
+ public KeepProperty getKeepWithPrevious() {
+ return keepWithPrevious;
+ }
+
public KeepProperty getKeepTogether() {
return keepTogether;
}
+ public KeepProperty getKeepWithNext() {
+ return keepWithNext;
+ }
+
public SpaceProperty getLineHeight() {
return lineHeight;
}
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
index 5127794c0..771bda255 100644
--- a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
+++ b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
@@ -19,6 +19,7 @@
package org.apache.fop.layoutmgr.inline;
+import java.awt.geom.Rectangle2D;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
@@ -86,11 +87,9 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
@Override
public List<KnuthSequence> getNextKnuthElements(LayoutContext context, int alignment) {
determineIPD(context);
- LayoutContext childLC = LayoutContext.offspringOf(context); // TODO copyOf?
- childLC.setRefIPD(contentAreaIPD);
- childElements = getChildKnuthElements(childLC, alignment); // TODO which alignment?
+ childElements = getChildKnuthElements(context, alignment);
determineBPD();
- alignmentContext = makeAlignmentContext(context); // TODO correct?
+ alignmentContext = makeAlignmentContext(context);
Position position = new Position(this, 0);
KnuthSequence knuthSequence = new InlineKnuthSequence();
knuthSequence.add(new KnuthInlineBox(contentAreaIPD, alignmentContext, position, false));
@@ -117,18 +116,16 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
List<ListElement> allChildElements = new LinkedList<ListElement>();
LayoutManager childLM;
while ((childLM = getChildLM()) != null) {
- LayoutContext childLC = LayoutContext.offspringOf(layoutContext); // TODO copyOf? newInstance?
- childLC.setRefIPD(layoutContext.getRefIPD());
+ LayoutContext childLC = LayoutContext.offspringOf(layoutContext);
+ childLC.setRefIPD(contentAreaIPD);
@SuppressWarnings("unchecked")
List<ListElement> childElements = childLM.getNextKnuthElements(childLC, alignment);
allChildElements.addAll(childElements);
- // TODO breaks, keeps, empty content
}
handleIPDOverflow();
wrapPositions(allChildElements);
SpaceResolver.resolveElementList(allChildElements);
SpaceResolver.performConditionalsNotification(allChildElements, 0, allChildElements.size() - 1, -1);
- // TODO break-before, break-after
return allChildElements;
}
@@ -254,9 +251,6 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
assert inlineContainerPosition != null;
KnuthPossPosIter childPosIter = new KnuthPossPosIter(childElements);
AreaAdditionUtil.addAreas(this, childPosIter, context);
-
-// boolean isLast = (context.isLastArea() && prevLM == lastChildLM);
-// context.setFlags(LayoutContext.LAST_AREA, isLast);
}
@Override
@@ -267,23 +261,15 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen
TraitSetter.setProducerID(referenceArea, fobj.getId());
referenceArea.setIPD(contentAreaIPD);
currentViewport = new InlineViewport(referenceArea);
- currentViewport.setBlockProgressionOffset(alignmentContext.getOffset());
currentViewport.addTrait(Trait.IS_VIEWPORT_AREA, Boolean.TRUE);
+ TraitSetter.setProducerID(currentViewport, fobj.getId());
+ currentViewport.setBlockProgressionOffset(alignmentContext.getOffset());
currentViewport.setIPD(getContentAreaIPD());
currentViewport.setBPD(getContentAreaBPD());
- TraitSetter.setProducerID(currentViewport, fobj.getId());
- TraitSetter.addBorders(currentViewport,
- borderProps,
- false, false, false, false, this);
- TraitSetter.addPadding(currentViewport,
- borderProps,
- false, false, false, false, this);
- TraitSetter.addBackground(currentViewport,
- borderProps,
- this);
+ TraitSetter.addBackground(currentViewport, borderProps, this);
currentViewport.setClip(needClip());
currentViewport.setContentPosition(
- new java.awt.geom.Rectangle2D.Float(0, 0, getContentAreaIPD(), getContentAreaBPD()));
+ new Rectangle2D.Float(0, 0, getContentAreaIPD(), getContentAreaBPD()));
getParent().addChildArea(currentViewport);
}
return referenceArea;