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 vh...@apache.org on 2013/10/31 21:07:19 UTC
svn commit: r1537614 -
/xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
Author: vhennebert
Date: Thu Oct 31 20:07:19 2013
New Revision: 1537614
URL: http://svn.apache.org/r1537614
Log:
Re-ordered methods from higher to lower level
Modified:
xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
Modified: xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java?rev=1537614&r1=1537613&r2=1537614&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_InlineContainer/src/java/org/apache/fop/layoutmgr/inline/InlineContainerLayoutManager.java Thu Oct 31 20:07:19 2013
@@ -107,6 +107,24 @@ public class InlineContainerLayoutManage
}
}
+ 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 InlineContainerLayoutManage
}
}
- 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 InlineContainerLayoutManage
}
}
+ 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 InlineContainerLayoutManage
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;
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org