ASF Bugzilla – Attachment 26636 Details for
Bug 44885
[PATCH] fo:inline-container implementation
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
updated patch against latest trunk
inline-container.diff (text/plain), 30.59 KB, created by
Andreas L. Delmelle
on 2011-02-10 18:21:04 UTC
(
hide
)
Description:
updated patch against latest trunk
Filename:
MIME Type:
Creator:
Andreas L. Delmelle
Created:
2011-02-10 18:21:04 UTC
Size:
30.59 KB
patch
obsolete
>Index: layoutmgr/inline/InlineContainerLayoutManager.java >=================================================================== >--- layoutmgr/inline/InlineContainerLayoutManager.java (revision 0) >+++ layoutmgr/inline/InlineContainerLayoutManager.java (revision 0) >@@ -0,0 +1,501 @@ >+/* >+ * Licensed to the Apache Software Foundation (ASF) under one or more >+ * contributor license agreements. See the NOTICE file distributed with >+ * this work for additional information regarding copyright ownership. >+ * The ASF licenses this file to You under the Apache License, Version 2.0 >+ * (the "License"); you may not use this file except in compliance with >+ * the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+/* $Id$ */ >+ >+package org.apache.fop.layoutmgr.inline; >+ >+// Java >+import java.util.LinkedList; >+import java.util.List; >+import java.util.ListIterator; >+ >+import org.apache.fop.area.Area; >+import org.apache.fop.area.Block; >+import org.apache.fop.area.Trait; >+import org.apache.fop.area.inline.InlineArea; >+import org.apache.fop.area.inline.InlineBlockParent; >+import org.apache.fop.area.inline.Viewport; >+import org.apache.fop.datatypes.FODimension; >+import org.apache.fop.datatypes.Length; >+import org.apache.fop.fo.flow.InlineContainer; >+import org.apache.fop.fo.properties.CommonBorderPaddingBackground; >+import org.apache.fop.fo.properties.SpaceProperty; >+import org.apache.fop.layoutmgr.AbstractContainerBreaker; >+import org.apache.fop.layoutmgr.AreaAdditionUtil; >+import org.apache.fop.layoutmgr.BlockStackingLayoutManager; >+import org.apache.fop.layoutmgr.InlineKnuthSequence; >+import org.apache.fop.layoutmgr.KnuthElement; >+import org.apache.fop.layoutmgr.KnuthSequence; >+import org.apache.fop.layoutmgr.LayoutContext; >+import org.apache.fop.layoutmgr.LayoutManager; >+import org.apache.fop.layoutmgr.ListElement; >+import org.apache.fop.layoutmgr.NonLeafPosition; >+import org.apache.fop.layoutmgr.Position; >+import org.apache.fop.layoutmgr.PositionIterator; >+import org.apache.fop.layoutmgr.SpaceResolver; >+import org.apache.fop.layoutmgr.SubBreakerPosition; >+import org.apache.fop.layoutmgr.TraitSetter; >+import org.apache.fop.traits.MinOptMax; >+ >+/** >+ * This creates a single inline container area after >+ * laying out the child block areas. All footnotes, floats >+ * and id areas are maintained for later retrieval. >+ */ >+public class InlineContainerLayoutManager extends LeafNodeLayoutManager { >+ >+ Viewport currentViewport; >+ InlineArea referenceArea; >+ Block baseBlockArea; >+ >+ /** The Common Border, Padding and Background properties */ >+ private CommonBorderPaddingBackground borderProps = null; >+ /** The alignment adjust property */ >+ private Length alignmentAdjust; >+ /** The alignment baseline property */ >+ private int alignmentBaseline = EN_BASELINE; >+ /** The baseline shift property */ >+ private Length baselineShift; >+ /** The dominant baseline property */ >+ private int dominantBaseline; >+ /** The line height property */ >+ private SpaceProperty lineHeight; >+ >+ private Length height; >+ private Length width; >+ private boolean autoHeight; >+ private boolean autoWidth; >+ >+ private int contentAreaIPD; >+ private int viewportContentBPD; >+ private int referenceIPD; >+ >+ private FODimension relDims; >+ >+ private LayoutManager lastChildLM = null; >+ >+ >+ /** >+ * Construct a new InlineContainerLayoutManager >+ * for the the given {@link InlineContainer} >+ * >+ * @param node the base {@link InlineContainer} >+ */ >+ public InlineContainerLayoutManager(InlineContainer node) { >+ super(node); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public void initialize() { >+ InlineContainer node = (InlineContainer) fobj; >+ >+ borderProps = node.getCommonBorderPaddingBackground(); >+ >+ alignmentAdjust = node.getAlignmentAdjust(); >+ alignmentBaseline = node.getAlignmentBaseline(); >+ baselineShift = node.getBaselineShift(); >+ dominantBaseline = node.getDominantBaseline(); >+ >+ boolean rotated = (node.getReferenceOrientation() % 180 != 0); >+ if (rotated) { >+ height = node.getInlineProgressionDimension() >+ .getOptimum(this).getLength(); >+ width = node.getBlockProgressionDimension() >+ .getOptimum(this).getLength(); >+ } else { >+ height = node.getBlockProgressionDimension() >+ .getOptimum(this).getLength(); >+ width = node.getInlineProgressionDimension() >+ .getOptimum(this).getLength(); >+ } >+ >+ } >+ >+ /** >+ * Sets the IPD of the content area >+ * @param contentAreaIPD the IPD of the content area >+ */ >+ protected void setContentAreaIPD(int contentAreaIPD) { >+ this.contentAreaIPD = contentAreaIPD; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public List getNextKnuthElements(LayoutContext context, int alignment) { >+ >+ InlineContainer ic = (InlineContainer) fobj; >+ boolean rotated = (ic.getReferenceOrientation() % 180 != 0); >+ autoHeight = false; >+ int maxbpd = context.getStackLimitBP().getOpt(); >+ referenceIPD = context.getRefIPD(); >+ >+ int allocBPD; >+ if (height.getEnum() == EN_AUTO >+ || (!height.isAbsolute() && getAncestorBlockAreaBPD() <= 0)) { >+ //auto height when height="auto" or "if that dimension is not specified explicitly >+ //(i.e., it depends on content's block-progression-dimension)" (XSL 1.0, 7.14.1) >+ allocBPD = 0; >+ autoHeight = true; >+ } else { >+ allocBPD = height.getValue(this); //this is the content-height >+ allocBPD += borderProps.getBPPaddingAndBorder(false, this); >+ } >+ if (width.getEnum() == EN_AUTO) { >+ setContentAreaIPD(referenceIPD); >+ autoWidth = true; >+ } >+ viewportContentBPD = allocBPD - borderProps.getBPPaddingAndBorder(false, this); >+ >+ //double contentRectOffsetX = 0; >+ //contentRectOffsetX += ic.getCommonMarginInline().spaceStart.getLength().getValue(this); >+ //double contentRectOffsetY = 0; >+ //contentRectOffsetY += borderProps.getBorderBeforeWidth(false); >+ //contentRectOffsetY += borderProps.getPaddingBefore(false, this); >+ >+ updateRelDims(); >+ >+ LinkedList<KnuthSequence> returnList = new LinkedList<KnuthSequence>(); >+ KnuthSequence inlineSeq = new InlineKnuthSequence(); >+ >+ addKnuthElementsForBorderPaddingStart(inlineSeq); >+ >+ MinOptMax refIPD = MinOptMax.getInstance(autoWidth ? referenceIPD : width.getValue(this)); >+ InlineContainerBreaker breaker = new InlineContainerBreaker(this, refIPD); >+ breaker.doLayout(height.getValue(this), autoHeight); >+ >+ if (!breaker.isEmpty()) { >+ if (autoHeight) { >+ //Update content BPD now that it is known >+ int newHeight = breaker.getTotalWidth(); >+ if (rotated) { >+ setContentAreaIPD(newHeight); >+ } else { >+ viewportContentBPD = newHeight; >+ } >+ updateRelDims(); >+ } >+ >+ Position icPosition = new SubBreakerPosition(this, breaker); >+ inlineSeq.add( >+ new KnuthInlineBox( >+ refIPD.getOpt(), >+ makeAlignmentContext(context), >+ notifyPos(icPosition), >+ false)); >+ } >+ >+ addKnuthElementsForBorderPaddingEnd(inlineSeq); >+ >+ returnList.add(inlineSeq); >+ >+ setFinished(true); >+ >+ return returnList; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public void addChildArea(Area childArea) { >+ baseBlockArea.addBlock((Block) childArea); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public void addAreas(PositionIterator posIter, LayoutContext context) { >+ >+ LinkedList<Position> positionList = new LinkedList<Position>(); >+ Position pos; >+ LayoutManager lastLM = null; // last child LM in this iterator >+ Position lastPos = null; >+ SubBreakerPosition icPos = null; >+ while (posIter.hasNext()) { >+ pos = posIter.next(); >+ Position innerPosition = pos; >+ if (pos instanceof NonLeafPosition) { >+ innerPosition = pos.getPosition(); >+ } >+ if (pos instanceof SubBreakerPosition) { >+ if (icPos != null) { >+ throw new IllegalStateException("Only one SubBreakerPosition allowed"); >+ } >+ icPos = (SubBreakerPosition) pos; >+ } else if (innerPosition == null) { >+ //ignore (probably a Position for a simple penalty between blocks) >+ } else { >+ // innerPosition was created by another LM >+ positionList.add(innerPosition); >+ lastLM = innerPosition.getLM(); >+ lastPos = innerPosition; >+ } >+ } >+ >+ addId(); >+ addMarkersToPage( >+ true, >+ true, >+ lastPos == null || isLast(lastPos)); >+ >+ LayoutManager prevLM = null; >+ >+ if (icPos == null) { >+ PositionIterator childPosIter >+ = new PositionIterator(positionList.listIterator()); >+ >+ LayoutManager childLM; >+ while ((childLM = childPosIter.getNextChildLM()) != null) { >+ context.setFlags(LayoutContext.LAST_AREA, >+ context.isLastArea() && childLM == lastLM); >+ childLM.addAreas(childPosIter, context); >+ context.setLeadingSpace(context.getTrailingSpace()); >+ context.setFlags(LayoutContext.RESOLVE_LEADING_SPACE, true); >+ prevLM = childLM; >+ } >+ >+ currentViewport.setContent(referenceArea); >+ getParent().addChildArea(currentViewport); >+ } else { >+ ((AbstractContainerBreaker)icPos.getBreaker()).addContainedAreas(); >+ } >+ >+ addMarkersToPage( >+ false, >+ true, >+ lastPos == null || isLast(lastPos)); >+ >+ boolean isLast = (context.isLastArea() && prevLM == lastChildLM); >+ context.setFlags(LayoutContext.LAST_AREA, isLast); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public int getContentAreaIPD() { >+ return width.getEnum() == EN_AUTO >+ ? contentAreaIPD >+ : width.getValue(this); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public int getContentAreaBPD() { >+ return height.getEnum() == EN_AUTO >+ ? viewportContentBPD >+ : height.getValue(this); >+ } >+ >+ /** >+ * Get the parent area for children of this inline-container. >+ * This returns the current inline-container area >+ * and creates it if required. >+ * >+ * {@inheritDoc} >+ */ >+ @Override >+ public Area getParentArea(Area childArea) { >+ if (referenceArea == null) { >+ currentViewport = new Viewport(childArea); >+ currentViewport.addTrait(Trait.IS_VIEWPORT_AREA, Boolean.TRUE); >+ 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); >+ >+ //currentViewport.setCTM(relativeCTM); >+ currentViewport.setClip(needClip()); >+ currentViewport.setContentPosition( >+ new java.awt.geom.Rectangle2D.Float(0, 0, getContentAreaIPD(), getContentAreaBPD())); >+ referenceArea = new InlineBlockParent(); >+ referenceArea.addTrait(Trait.IS_REFERENCE_AREA, Boolean.TRUE); >+ TraitSetter.setProducerID(referenceArea, fobj.getId()); >+ // Set up dimensions >+ // Must get dimensions from parent area >+ getParent().getParentArea(referenceArea); >+ referenceArea.setIPD(referenceIPD); >+ baseBlockArea = new Block(); >+ referenceArea.addChildArea(baseBlockArea); >+ // Get reference IPD from parentArea >+ setCurrentArea(currentViewport); // ??? for generic operations >+ } >+ return referenceArea; >+ } >+ >+ private boolean needClip() { >+ int overflow = ((InlineContainer) fobj).getOverflow(); >+ return (overflow == EN_HIDDEN || overflow == EN_ERROR_IF_OVERFLOW); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected AlignmentContext makeAlignmentContext(LayoutContext context) { >+ return new AlignmentContext( >+ viewportContentBPD >+ , alignmentAdjust >+ , alignmentBaseline >+ , baselineShift >+ , dominantBaseline >+ , context.getAlignmentContext() >+ ); >+ } >+ >+ /** >+ * Get the allocation ipd of the inline area. >+ * This method may be overridden to handle percentage values. >+ * @param refIPD the ipd of the parent reference area >+ * @return the min/opt/max ipd of the inline area >+ */ >+ @Override >+ protected MinOptMax getAllocationIPD(int refIPD) { >+ return MinOptMax.getInstance(curArea.getIPD()); >+ } >+ >+ /** >+ * "wrap" the Position inside each element moving the elements from >+ * SourceList to targetList >+ * @param sourceList source list >+ * @param targetList target list receiving the wrapped position elements >+ */ >+ private void wrapPositionElements(List sourceList, List targetList) { >+ wrapPositionElements(sourceList, targetList, false); >+ } >+ >+ /** >+ * "wrap" the Position inside each element moving the elements from >+ * SourceList to targetList >+ * @param sourceList source list >+ * @param targetList target list receiving the wrapped position elements >+ * @param force if true, every Position is wrapped regardless of its LM of origin >+ */ >+ private void wrapPositionElements(List sourceList, List targetList, boolean force) { >+ >+ ListIterator listIter = sourceList.listIterator(); >+ Object tempElement; >+ while (listIter.hasNext()) { >+ tempElement = listIter.next(); >+ if (tempElement instanceof ListElement) { >+ wrapPositionElement( >+ (ListElement) tempElement, >+ targetList, >+ force); >+ } else if (tempElement instanceof List) { >+ wrapPositionElements( >+ (List) tempElement, >+ targetList, >+ force); >+ } >+ } >+ } >+ >+ /** >+ * "wrap" the Position inside the given element and add it to the target list. >+ * @param el the list element >+ * @param targetList target list receiving the wrapped position elements >+ * @param force if true, every Position is wrapped regardless of its LM of origin >+ */ >+ private void wrapPositionElement(ListElement el, List targetList, boolean force) { >+ if (force || el.getLayoutManager() != this) { >+ el.setPosition(notifyPos(new NonLeafPosition(this, >+ el.getPosition()))); >+ } >+ targetList.add(el); >+ } >+ >+ private void updateRelDims() { >+ relDims = new FODimension(0, 0); >+ /* >+ CTM relativeCTM = CTM.getCTMandRelDims( >+ ((InlineContainer) fobj).getReferenceOrientation(), >+ ((InlineContainer) fobj).getWritingMode(), >+ rect, relDims); >+ */ >+ } >+ >+ private class InlineContainerBreaker extends AbstractContainerBreaker { >+ >+ InlineContainerBreaker(InlineContainerLayoutManager iclm, MinOptMax ipd) { >+ super(iclm, ipd); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public boolean isOverflow() { >+ return !isEmpty() >+ && (deferredAlg.getPageBreaks().size() > 1); >+ //|| (deferredAlg.getOverflowAmount() > 0)); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ public int getOverflowAmount() { >+ return 0; //deferredAlg.getOverflowAmount(); >+ } >+ >+ /** {@inheritDoc}Ê*/ >+ @Override >+ protected LayoutContext createLayoutContext() { >+ LayoutContext lc = super.createLayoutContext(); >+ lc.setWritingMode(((InlineContainer) fobj).getWritingMode()); >+ return lc; >+ } >+ >+ /** {@inheritDoc} */ >+ protected List<KnuthElement> getNextKnuthElements(LayoutContext context, int alignment) { >+ LayoutManager curLM; // currently active LM >+ List<KnuthElement> returnList = new LinkedList<KnuthElement>(); >+ >+ while ((curLM = getChildLM()) != null) { >+ LayoutContext childLC = new LayoutContext(0); >+ childLC.setStackLimitBP(context.getStackLimitBP()); >+ childLC.setRefIPD(context.getRefIPD()); >+ childLC.setWritingMode(((InlineContainer)fobj).getWritingMode()); >+ >+ List<ListElement> returnedList = null; >+ if (!curLM.isFinished()) { >+ returnedList = curLM.getNextKnuthElements(childLC, alignment); >+ } >+ if (returnedList != null) { >+ wrapPositionElements(returnedList, returnList); >+ } >+ } >+ SpaceResolver.resolveElementList(returnList); >+ setFinished(true); >+ return returnList; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected void addAreas(PositionIterator posIter, LayoutContext context) { >+ getTopLevelLM().addAreas(posIter, context); >+ } >+ >+ /** {@inheritDoc}Ê*/ >+ @Override >+ protected int getCurrentDisplayAlign() { >+ return ((InlineContainer)fobj).getDisplayAlign(); >+ } >+ } >+ >+} > >Property changes on: layoutmgr/inline/InlineContainerLayoutManager.java >___________________________________________________________________ >Added: svn:keywords > + Id >Added: svn:eol-style > + native > >Index: layoutmgr/AbstractContainerBreaker.java >=================================================================== >--- layoutmgr/AbstractContainerBreaker.java (revision 0) >+++ layoutmgr/AbstractContainerBreaker.java (revision 0) >@@ -0,0 +1,166 @@ >+/* >+ * Licensed to the Apache Software Foundation (ASF) under one or more >+ * contributor license agreements. See the NOTICE file distributed with >+ * this work for additional information regarding copyright ownership. >+ * The ASF licenses this file to You under the Apache License, Version 2.0 >+ * (the "License"); you may not use this file except in compliance with >+ * the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+/* $Id$ */ >+ >+package org.apache.fop.layoutmgr; >+ >+import org.apache.fop.fo.Constants; >+import org.apache.fop.traits.MinOptMax; >+ >+import java.util.List; >+ >+public abstract class AbstractContainerBreaker extends AbstractBreaker { >+ >+ private AbstractLayoutManager layoutManager; >+ private MinOptMax ipd; >+ >+ //Info for deferred adding of areas >+ protected PageBreakingAlgorithm deferredAlg; >+ private BlockSequence deferredOriginalList; >+ private BlockSequence deferredEffectiveList; >+ >+ /** >+ * Create a new instance for the given layout manager, and >+ * set the available inline-progression-dimension to the given value >+ * @param layoutManager the layout manager >+ * @param ipd the inline-progression-dimension >+ */ >+ public AbstractContainerBreaker(AbstractLayoutManager layoutManager, MinOptMax ipd) { >+ this.layoutManager = layoutManager; >+ this.ipd = ipd; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected void observeElementList(List elementList) { >+ ElementListObserver.observe(elementList, >+ layoutManager.getFObj().getLocalName(), >+ layoutManager.getFObj().getId()); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected boolean isPartOverflowRecoveryActivated() { >+ //disabled by default because of wanted overflow. >+ return false; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected boolean isSinglePartFavored() { >+ return true; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected LayoutManager getTopLevelLM() { >+ return layoutManager; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected LayoutContext createLayoutContext() { >+ LayoutContext lc = super.createLayoutContext(); >+ lc.setRefIPD(ipd.getOpt()); >+ return lc; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected List<KnuthElement> getNextKnuthElements(LayoutContext context, int alignment) { >+ /* >+ LayoutManager curLM; // currently active LM >+ List<KnuthElement> returnList = new LinkedList<KnuthElement>(); >+ >+ while ((curLM = getChildLM()) != null) { >+ LayoutContext childLC = makeChildLayoutContext(context); >+ >+ List<ListElement> returnedList = null; >+ if (!curLM.isFinished()) { >+ returnedList = curLM.getNextKnuthElements(childLC, alignment); >+ } >+ if (returnedList != null) { >+ wrapPositionElements(returnedList, returnList); >+ } >+ } >+ SpaceResolver.resolveElementList(returnList); >+ layoutManager.setFinished(true); >+ return returnList; >+ */ >+ return null; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected boolean hasMoreContent() { >+ return !layoutManager.isFinished(); >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount, >+ AbstractBreaker.BlockSequence originalList, AbstractBreaker.BlockSequence effectiveList) { >+ //Defer adding of areas until addAreas is called by the parent LM >+ this.deferredAlg = alg; >+ this.deferredOriginalList = originalList; >+ this.deferredEffectiveList = effectiveList; >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected void finishPart(PageBreakingAlgorithm alg, AbstractBreaker.PageBreakPosition pbp) { >+ //nop >+ } >+ >+ /** {@inheritDoc} */ >+ @Override >+ protected LayoutManager getCurrentChildLM() { >+ return layoutManager.curChildLM; >+ } >+ >+ /** >+ * Adds contained areas >+ */ >+ public void addContainedAreas() { >+ if (isEmpty()) { >+ return; >+ } >+ //Rendering all parts (not just the first) at once for the case where the parts that >+ //overflow should be visible. >+ this.deferredAlg.removeAllPageBreaks(); >+ this.addAreas(this.deferredAlg, >+ this.deferredAlg.getPageBreaks().size(), >+ this.deferredOriginalList, this.deferredEffectiveList); >+ } >+ >+ public boolean isOverflow() { >+ return !isEmpty() >+ && ((deferredAlg.getPageBreaks().size() > 1) >+ || (deferredAlg.totalWidth - deferredAlg.totalShrink) >+ > deferredAlg.getLineWidth()); >+ } >+ >+ public int getOverflowAmount() { >+ return (deferredAlg.totalWidth - deferredAlg.totalShrink) >+ - deferredAlg.getLineWidth(); >+ } >+ >+ public int getTotalWidth() { >+ return deferredAlg.totalWidth; >+ } >+} > >Property changes on: layoutmgr/AbstractContainerBreaker.java >___________________________________________________________________ >Added: svn:keywords > + Id >Added: svn:eol-style > + native > >Index: layoutmgr/SubBreakerPosition.java >=================================================================== >--- layoutmgr/SubBreakerPosition.java (revision 0) >+++ layoutmgr/SubBreakerPosition.java (revision 0) >@@ -0,0 +1,47 @@ >+/* >+ * Licensed to the Apache Software Foundation (ASF) under one or more >+ * contributor license agreements. See the NOTICE file distributed with >+ * this work for additional information regarding copyright ownership. >+ * The ASF licenses this file to You under the Apache License, Version 2.0 >+ * (the "License"); you may not use this file except in compliance with >+ * the License. You may obtain a copy of the License at >+ * >+ * http://www.apache.org/licenses/LICENSE-2.0 >+ * >+ * Unless required by applicable law or agreed to in writing, software >+ * distributed under the License is distributed on an "AS IS" BASIS, >+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. >+ * See the License for the specific language governing permissions and >+ * limitations under the License. >+ */ >+ >+/* $Id$ */ >+ >+package org.apache.fop.layoutmgr; >+ >+/** >+ * Special type of {@link Position}, meant for use with sub-breakers. >+ */ >+public class SubBreakerPosition extends NonLeafPosition { >+ >+ private AbstractBreaker breaker; >+ >+ /** >+ * Create a new instance for the given layout manager and breaker >+ * @param lm the layout manager >+ * @param breaker the associated breaker >+ */ >+ public SubBreakerPosition(LayoutManager lm, AbstractBreaker breaker) { >+ super(lm, null); >+ this.breaker = breaker; >+ } >+ >+ /** >+ * Return the breaker >+ * @return the breaker >+ */ >+ public AbstractBreaker getBreaker() { >+ return this.breaker; >+ } >+ >+} > >Property changes on: layoutmgr/SubBreakerPosition.java >___________________________________________________________________ >Added: svn:keywords > + Id >Added: svn:eol-style > + native > >Index: fo/flow/InlineContainer.java >=================================================================== >--- fo/flow/InlineContainer.java (revision 1069477) >+++ fo/flow/InlineContainer.java (working copy) >@@ -48,6 +48,7 @@ > private CommonBorderPaddingBackground commonBorderPaddingBackground; > private CommonMarginInline commonMarginInline; > private int clip; >+ private int displayAlign; > private int dominantBaseline; > private LengthRangeProperty inlineProgressionDimension; > private KeepProperty keepTogether; >@@ -57,7 +58,6 @@ > private int writingMode; > // Unused but valid items, commented out for performance: > // private CommonRelativePosition commonRelativePosition; >- // private int displayAlign; > // private Length height; > // private KeepProperty keepWithNext; > // private KeepProperty keepWithPrevious; >@@ -68,7 +68,8 @@ > private boolean blockItemFound = false; > > /** >- * Base constructor >+ * Create an InlineContainer instance that is a child of the given >+ * parent {@link FONode}. > * > * @param parent {@link FONode} that is the parent of this object > */ >@@ -86,6 +87,7 @@ > commonBorderPaddingBackground = pList.getBorderPaddingBackgroundProps(); > commonMarginInline = pList.getMarginInlineProps(); > clip = pList.get(PR_CLIP).getEnum(); >+ displayAlign = pList.get(PR_DISPLAY_ALIGN).getEnum(); > dominantBaseline = pList.get(PR_DOMINANT_BASELINE).getEnum(); > inlineProgressionDimension = pList.get(PR_INLINE_PROGRESSION_DIMENSION).getLengthRange(); > keepTogether = pList.get(PR_KEEP_TOGETHER).getKeep(); >@@ -156,6 +158,11 @@ > return this.commonMarginInline; > } > >+ /** @return the value of the <code>display-align</code> property */ >+ public int getDisplayAlign() { >+ return this.displayAlign; >+ } >+ > /** @return the "dominant-baseline" property */ > public int getDominantBaseline() { > return dominantBaseline; >Index: layoutmgr/LayoutManagerMapping.java >=================================================================== >--- layoutmgr/LayoutManagerMapping.java (revision 1069477) >+++ layoutmgr/LayoutManagerMapping.java (working copy) >@@ -71,7 +71,7 @@ > import org.apache.fop.layoutmgr.inline.ContentLayoutManager; > import org.apache.fop.layoutmgr.inline.ExternalGraphicLayoutManager; > import org.apache.fop.layoutmgr.inline.FootnoteLayoutManager; >-import org.apache.fop.layoutmgr.inline.ICLayoutManager; >+import org.apache.fop.layoutmgr.inline.InlineContainerLayoutManager; > import org.apache.fop.layoutmgr.inline.InlineLayoutManager; > import org.apache.fop.layoutmgr.inline.InstreamForeignObjectLM; > import org.apache.fop.layoutmgr.inline.LeaderLayoutManager; >@@ -274,9 +274,9 @@ > /** a layout manager maker */ > public static class InlineLayoutManagerMaker extends Maker { > /** {@inheritDoc} */ >- public void make(FONode node, List lms) { >- lms.add(new InlineLayoutManager((InlineLevel) node)); >- } >+ public void make(FONode node, List lms) { >+ lms.add(new InlineLayoutManager((InlineLevel) node)); >+ } > } > > /** a layout manager maker */ >@@ -291,9 +291,7 @@ > public static class InlineContainerLayoutManagerMaker extends Maker { > /** {@inheritDoc} */ > public void make(FONode node, List lms) { >- ArrayList childList = new ArrayList(); >- super.make(node, childList); >- lms.add(new ICLayoutManager((InlineContainer) node, childList)); >+ lms.add(new InlineContainerLayoutManager((InlineContainer) node)); > } > } > >Index: layoutmgr/PageBreakingAlgorithm.java >=================================================================== >--- layoutmgr/PageBreakingAlgorithm.java (revision 1069477) >+++ layoutmgr/PageBreakingAlgorithm.java (working copy) >@@ -34,7 +34,7 @@ > import org.apache.fop.traits.MinOptMax; > import org.apache.fop.util.ListUtil; > >-class PageBreakingAlgorithm extends BreakingAlgorithm { >+public class PageBreakingAlgorithm extends BreakingAlgorithm { > > /** the logger for the class */ > private static Log log = LogFactory.getLog(PageBreakingAlgorithm.class);
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 44885
:
21861
|
21862
|
21863
|
21893
|
21894
|
21895
|
21896
|
21897
| 26636