diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2013-10-31 20:07:19 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2013-10-31 20:07:19 +0000 |
commit | b0c8e3a541682a9a2becd5438e21d585d2f1656d (patch) | |
tree | 62f55f3fd25400e21916cd64797dc051d3a529db /src/java/org/apache | |
parent | 69f539c6f5fb7ef4b1ade45ad110901253772892 (diff) | |
download | xmlgraphics-fop-b0c8e3a541682a9a2becd5438e21d585d2f1656d.tar.gz xmlgraphics-fop-b0c8e3a541682a9a2becd5438e21d585d2f1656d.zip |
Re-ordered methods from higher to lower level
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_InlineContainer@1537614 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java | 70 |
1 files changed, 35 insertions, 35 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java index 669b88838..75eb12d5b 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java @@ -107,6 +107,24 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen } } + private List<ListElement> getChildKnuthElements(LayoutContext layoutContext, int alignment) { + List<ListElement> allChildElements = new LinkedList<ListElement>(); + LayoutManager childLM; + while ((childLM = getChildLM()) != null) { + LayoutContext childLC = LayoutContext.offspringOf(layoutContext); // TODO copyOf? newInstance? + childLC.setRefIPD(layoutContext.getRefIPD()); + @SuppressWarnings("unchecked") + List<ListElement> childElements = childLM.getNextKnuthElements(childLC, alignmentBaseline); + allChildElements.addAll(childElements); + // TODO breaks, keeps, empty content + } + handleIPDOverflow(); + wrapPositions(allChildElements); + SpaceResolver.resolveElementList(allChildElements); + // TODO break-before, break-after + return allChildElements; + } + private void determineBPD() { LengthRangeProperty bpd = ((InlineContainer) fobj).getBlockProgressionDimension(); Property optimum = bpd.getOptimum(this); @@ -129,30 +147,15 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen } } - private BlockLevelEventProducer getBlockLevelEventProducer() { - return BlockLevelEventProducer.Provider.get(fobj.getUserAgent().getEventBroadcaster()); - } - - private boolean canRecoverFromOverflow() { - return ((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW; - } - - private List<ListElement> getChildKnuthElements(LayoutContext layoutContext, int alignment) { - List<ListElement> allChildElements = new LinkedList<ListElement>(); - LayoutManager childLM; - while ((childLM = getChildLM()) != null) { - LayoutContext childLC = LayoutContext.offspringOf(layoutContext); // TODO copyOf? newInstance? - childLC.setRefIPD(layoutContext.getRefIPD()); - @SuppressWarnings("unchecked") - List<ListElement> childElements = childLM.getNextKnuthElements(childLC, alignmentBaseline); - allChildElements.addAll(childElements); - // TODO breaks, keeps, empty content - } - handleIPDOverflow(); - wrapPositions(allChildElements); - SpaceResolver.resolveElementList(allChildElements); - // TODO break-before, break-after - return allChildElements; + protected AlignmentContext makeAlignmentContext(LayoutContext context) { + InlineContainer ic = (InlineContainer) fobj; + FontInfo fi = fobj.getFOEventHandler().getFontInfo(); + FontTriplet[] fontkeys = ic.getCommonFont().getFontState(fi); + Font fs = fi.getFontInstance(fontkeys[0], ic.getCommonFont().fontSize.getValue(this)); + return new AlignmentContext(contentAreaBPD, + ic.getAlignmentAdjust(), ic.getAlignmentBaseline(), + ic.getBaselineShift(), ic.getDominantBaseline(), + context.getAlignmentContext()); } private void handleIPDOverflow() { @@ -172,6 +175,14 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen } } + private BlockLevelEventProducer getBlockLevelEventProducer() { + return BlockLevelEventProducer.Provider.get(fobj.getUserAgent().getEventBroadcaster()); + } + + private boolean canRecoverFromOverflow() { + return ((InlineContainer) fobj).getOverflow() != EN_ERROR_IF_OVERFLOW; + } + @Override public void addAreas(PositionIterator posIter, LayoutContext context) { Position inlineContainerPosition = null; @@ -242,17 +253,6 @@ public class InlineContainerLayoutManager extends AbstractLayoutManager implemen return (overflow == EN_HIDDEN || overflow == EN_ERROR_IF_OVERFLOW); } - protected AlignmentContext makeAlignmentContext(LayoutContext context) { - InlineContainer ic = (InlineContainer) fobj; - FontInfo fi = fobj.getFOEventHandler().getFontInfo(); - FontTriplet[] fontkeys = ic.getCommonFont().getFontState(fi); - Font fs = fi.getFontInstance(fontkeys[0], ic.getCommonFont().fontSize.getValue(this)); - return new AlignmentContext(contentAreaBPD, - ic.getAlignmentAdjust(), ic.getAlignmentBaseline(), - ic.getBaselineShift(), ic.getDominantBaseline(), - context.getAlignmentContext()); - } - public boolean handleOverflow(int milliPoints) { ipdOverflow = Math.max(ipdOverflow, milliPoints); return true; |