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 je...@apache.org on 2008/07/25 14:46:22 UTC
svn commit: r679781 [17/34] - in
/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign: ./
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ ...
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Page.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Page.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Page.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Page.java Fri Jul 25 05:44:20 2008
@@ -34,39 +34,39 @@
private SimplePageMaster spm;
private PageViewport pageViewport;
-
+
/**
* Main constructor
* @param spm the simple-page-master used for this page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(SimplePageMaster spm, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = spm;
this.pageViewport = new PageViewport(spm, pageNumber, pageNumberStr, blank);
}
-
+
/**
* Auxiliary constructor used when there's no SimplePageMaster.
* @param viewArea the view area of the page
* @param pageNumber the page number (as an int)
- * @param pageNumberStr the page number (as a String)
+ * @param pageNumberStr the page number (as a String)
* @param blank true if this is a blank page
*/
public Page(Rectangle2D viewArea, int pageNumber, String pageNumberStr, boolean blank) {
this.spm = null;
this.pageViewport = new PageViewport(viewArea, pageNumber, pageNumberStr, null, blank);
}
-
+
/** @return the simple-page-master that created this page */
public SimplePageMaster getSimplePageMaster() {
return this.spm;
}
-
+
/** @return the page viewport representing this page in the area tree */
public PageViewport getPageViewport() {
return this.pageViewport;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreaker.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreaker.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreaker.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreaker.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -39,14 +39,14 @@
* Handles the breaking of pages in an fo:flow
*/
public class PageBreaker extends AbstractBreaker {
-
+
private PageSequenceLayoutManager pslm;
private boolean firstPart = true;
private boolean pageBreakHandled;
private boolean needColumnBalancing;
private PageProvider pageProvider;
private Block separatorArea;
-
+
/**
* The FlowLayoutManager object, which processes
* the single fo:flow of the fo:page-sequence
@@ -61,23 +61,23 @@
this.childFLM = pslm.getLayoutManagerMaker().makeFlowLayoutManager(
pslm, pslm.getPageSequence().getMainFlow());
}
-
+
/** {@inheritDoc} */
protected void updateLayoutContext(LayoutContext context) {
int flowIPD = pslm.getCurrentPV().getCurrentSpan().getColumnWidth();
context.setRefIPD(flowIPD);
}
-
+
/** {@inheritDoc} */
protected LayoutManager getTopLevelLM() {
return pslm;
}
-
+
/** {@inheritDoc} */
protected PageProvider getPageProvider() {
return pslm.getPageProvider();
}
-
+
/** {@inheritDoc} */
protected PageBreakingLayoutListener createLayoutListener() {
return new PageBreakingLayoutListener() {
@@ -98,7 +98,7 @@
amount, needClip, canRecover,
body.getLocator());
}
-
+
};
}
@@ -118,7 +118,7 @@
}
/** {@inheritDoc} */
- protected int getNextBlockList(LayoutContext childLC,
+ protected int getNextBlockList(LayoutContext childLC,
int nextSequenceStartsOn) {
if (!firstPart) {
// if this is the first page that will be created by
@@ -129,15 +129,15 @@
}
firstPart = false;
pageBreakHandled = true;
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
return super.getNextBlockList(childLC, nextSequenceStartsOn);
}
-
+
/** {@inheritDoc} */
protected List getNextKnuthElements(LayoutContext context, int alignment) {
List contentList = null;
-
+
while (!childFLM.isFinished() && contentList == null) {
contentList = childFLM.getNextKnuthElements(context, alignment);
}
@@ -161,7 +161,7 @@
// store the lists of elements representing the footnote bodies
// in the box representing the line containing their references
while (footnoteBodyIterator.hasNext()) {
- FootnoteBodyLayoutManager fblm
+ FootnoteBodyLayoutManager fblm
= (FootnoteBodyLayoutManager) footnoteBodyIterator.next();
fblm.setParent(childFLM);
fblm.initialize();
@@ -178,7 +178,7 @@
footnoteSeparator = pslm.getPageSequence().getStaticContent("xsl-footnote-separator");
if (footnoteSeparator != null) {
// the footnote separator can contain page-dependent content such as
- // page numbers or retrieve markers, so its areas cannot simply be
+ // page numbers or retrieve markers, so its areas cannot simply be
// obtained now and repeated in each page;
// we need to know in advance the separator bpd: the actual separator
// could be different from page to page, but its bpd would likely be
@@ -199,7 +199,7 @@
}
return contentList;
}
-
+
/**
* @return current display alignment
*/
@@ -207,14 +207,14 @@
return pslm.getCurrentPage().getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY).getDisplayAlign();
}
-
+
/**
* @return whether or not this flow has more page break opportunities
*/
protected boolean hasMoreContent() {
return !childFLM.isFinished();
}
-
+
/**
* Adds an area to the flow layout manager
* @param posIter the position iterator
@@ -235,18 +235,18 @@
footnoteSeparatorLM.doLayout();
}
- childFLM.addAreas(posIter, context);
+ childFLM.addAreas(posIter, context);
}
-
+
/**
* Performs phase 3 operation
- *
+ *
* @param alg page breaking algorithm
* @param partCount part count
* @param originalList the block sequence original list
* @param effectiveList the block sequence effective list
*/
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
if (needColumnBalancing) {
doPhase3WithColumnBalancing(alg, partCount, originalList, effectiveList);
@@ -261,7 +261,7 @@
}
}
- private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithLastPage(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
int newStartPos;
int restartPoint = pageProvider.getStartingPartIndexForLastPage(partCount);
@@ -281,13 +281,13 @@
}
AbstractBreaker.log.debug("Last page handling now!!!");
AbstractBreaker.log.debug("===================================================");
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
int currentPageNum = pslm.getCurrentPageNum();
- pageProvider.setStartOfNextElementList(currentPageNum,
+ pageProvider.setStartOfNextElementList(currentPageNum,
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
pageProvider.setLastPageIndex(currentPageNum);
@@ -295,7 +295,7 @@
PageBreakingAlgorithm algRestart = new PageBreakingAlgorithm(
getTopLevelLM(),
getPageProvider(), createLayoutListener(),
- alg.getAlignment(), alg.getAlignmentLast(),
+ alg.getAlignment(), alg.getAlignmentLast(),
footnoteSeparatorLength,
isPartOverflowRecoveryActivated(), false, false);
//alg.setConstantLineWidth(flowBPD);
@@ -304,8 +304,8 @@
1, true, BreakingAlgorithm.ALL_BREAKS);
AbstractBreaker.log.debug("restart: iOptPageCount= " + iOptPageCount
+ " pageBreaks.size()= " + algRestart.getPageBreaks().size());
- boolean replaceLastPage
- = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
+ boolean replaceLastPage
+ = iOptPageCount <= pslm.getCurrentPV().getBodyRegion().getColumnCount();
if (replaceLastPage) {
//Replace last page
pslm.setCurrentPage(pageProvider.getPage(false, currentPageNum));
@@ -322,7 +322,7 @@
AbstractBreaker.log.debug("===================================================");
}
- private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
+ private void doPhase3WithColumnBalancing(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
AbstractBreaker.log.debug("Column balancing now!!!");
AbstractBreaker.log.debug("===================================================");
@@ -342,12 +342,12 @@
} else {
newStartPos = 0;
}
- AbstractBreaker.log.debug("Restarting at " + restartPoint
+ AbstractBreaker.log.debug("Restarting at " + restartPoint
+ ", new start position: " + newStartPos);
pageBreakHandled = true;
//Update so the available BPD is reported correctly
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
//Restart last page
@@ -376,15 +376,15 @@
addAreas(algRestart, iOptPageCount, originalList, effectiveList);
AbstractBreaker.log.debug("===================================================");
}
-
+
protected void startPart(BlockSequence list, int breakClass) {
AbstractBreaker.log.debug("startPart() breakClass=" + breakClass);
if (pslm.getCurrentPage() == null) {
throw new IllegalStateException("curPage must not be null");
}
if (!pageBreakHandled) {
-
- //firstPart is necessary because we need the first page before we start the
+
+ //firstPart is necessary because we need the first page before we start the
//algorithm so we have a BPD and IPD. This may subject to change later when we
//start handling more complex cases.
if (!firstPart) {
@@ -394,7 +394,7 @@
// otherwise, we may simply need a new page
handleBreakTrait(breakClass);
}
- pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
+ pageProvider.setStartOfNextElementList(pslm.getCurrentPageNum(),
pslm.getCurrentPV().getCurrentSpan().getCurrentFlowIndex());
}
pageBreakHandled = false;
@@ -402,12 +402,12 @@
// finish page and add to area tree
firstPart = false;
}
-
+
/** {@inheritDoc} */
protected void handleEmptyContent() {
pslm.getCurrentPV().getPage().fakeNonEmpty();
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
// add footnote areas
if (pbp.footnoteFirstListIndex < pbp.footnoteLastListIndex
@@ -415,16 +415,16 @@
// call addAreas() for each FootnoteBodyLM
for (int i = pbp.footnoteFirstListIndex; i <= pbp.footnoteLastListIndex; i++) {
LinkedList elementList = alg.getFootnoteList(i);
- int firstIndex = (i == pbp.footnoteFirstListIndex
+ int firstIndex = (i == pbp.footnoteFirstListIndex
? pbp.footnoteFirstElementIndex : 0);
- int lastIndex = (i == pbp.footnoteLastListIndex
+ int lastIndex = (i == pbp.footnoteLastListIndex
? pbp.footnoteLastElementIndex : elementList.size() - 1);
- SpaceResolver.performConditionalsNotification(elementList,
+ SpaceResolver.performConditionalsNotification(elementList,
firstIndex, lastIndex, -1);
LayoutContext childLC = new LayoutContext(0);
- AreaAdditionUtil.addAreas(null,
- new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
+ AreaAdditionUtil.addAreas(null,
+ new KnuthPossPosIter(elementList, firstIndex, lastIndex + 1),
childLC);
}
// set the offset from the top margin
@@ -438,20 +438,20 @@
}
pslm.getCurrentPV().getCurrentSpan().notifyFlowsFinished();
}
-
+
/**
* @return the current child flow layout manager
*/
protected LayoutManager getCurrentChildLM() {
return childFLM;
}
-
+
/** {@inheritDoc} */
protected void observeElementList(List elementList) {
- ElementListObserver.observe(elementList, "breaker",
+ ElementListObserver.observe(elementList, "breaker",
((PageSequence)pslm.getFObj()).getId());
}
-
+
/**
* Depending on the kind of break condition, move to next column
* or page. May need to make an empty page if next page would
@@ -471,17 +471,17 @@
|| breakVal <= 0
|| breakVal == Constants.EN_AUTO) {
PageViewport pv = curPage.getPageViewport();
-
+
//Check if previous page was spanned
boolean forceNewPageWithSpan = false;
RegionBody rb = (RegionBody)curPage.getSimplePageMaster().getRegion(
Constants.FO_REGION_BODY);
- if (breakVal < 0
- && rb.getColumnCount() > 1
+ if (breakVal < 0
+ && rb.getColumnCount() > 1
&& pv.getCurrentSpan().getColumnCount() == 1) {
forceNewPageWithSpan = true;
}
-
+
if (forceNewPageWithSpan) {
curPage = pslm.makeNewPage(false, false);
curPage.getPageViewport().createSpan(true);
@@ -492,7 +492,7 @@
}
return;
}
- log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ log.debug("handling break-before after page " + pslm.getCurrentPageNum()
+ " breakVal=" + breakVal);
if (needBlankPageBeforeNew(breakVal)) {
curPage = pslm.makeNewPage(true, false);
@@ -501,7 +501,7 @@
curPage = pslm.makeNewPage(false, false);
}
}
-
+
/**
* Check if a blank page is needed to accomodate
* desired even or odd page number.
@@ -520,7 +520,7 @@
}
}
}
-
+
/**
* See if need to generate a new page
* @param breakVal - value of break-before or break-after trait.
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageBreakingAlgorithm.java Fri Jul 25 05:44:20 2008
@@ -73,13 +73,13 @@
/** Index of the last element of the last footnote inserted on the current page. */
private int footnoteElementIndex = -1;
- // demerits for a page break that splits a footnote
+ // demerits for a page break that splits a footnote
private int splitFootnoteDemerits = 5000;
- // demerits for a page break that defers a whole footnote to the following page
+ // demerits for a page break that defers a whole footnote to the following page
private int deferredFootnoteDemerits = 10000;
private MinOptMax footnoteSeparatorLength = null;
- // the method noBreakBetween(int, int) uses these variables
+ // the method noBreakBetween(int, int) uses these variables
// to store parameters and result of the last call, in order
// to reuse them and take less time
private int storedPrevBreakIndex = -1;
@@ -88,10 +88,10 @@
//Controls whether overflows should be warned about or not
private boolean autoHeight = false;
-
+
//Controls whether a single part should be forced if possible (ex. block-container)
private boolean favorSinglePart = false;
-
+
public PageBreakingAlgorithm(LayoutManager topLevelLM,
PageProvider pageProvider,
PageBreakingLayoutListener layoutListener,
@@ -202,7 +202,7 @@
totalWidth, totalStretch, totalShrink,
((BestPageRecords) best).getFootnotesLength(fitness),
((BestPageRecords) best).getFootnoteListIndex(fitness),
- ((BestPageRecords) best).getFootnoteElementIndex(fitness),
+ ((BestPageRecords) best).getFootnoteElementIndex(fitness),
best.getAdjust(fitness), best.getAvailableShrink(fitness),
best.getAvailableStretch(fitness), best.getDifference(fitness),
best.getDemerits(fitness), best.getNode(fitness));
@@ -247,11 +247,11 @@
ListIterator elementListsIterator = elementLists.listIterator();
while (elementListsIterator.hasNext()) {
LinkedList noteList = (LinkedList) elementListsIterator.next();
-
- //Space resolution (Note: this does not respect possible stacking constraints
+
+ //Space resolution (Note: this does not respect possible stacking constraints
//between footnotes!)
SpaceResolver.resolveElementList(noteList);
-
+
int noteLength = 0;
footnotesList.add(noteList);
ListIterator noteListIterator = noteList.listIterator();
@@ -261,8 +261,8 @@
noteLength += element.getW();
}
}
- int prevLength = (lengthList.size() == 0
- ? 0
+ int prevLength = (lengthList.size() == 0
+ ? 0
: ((Integer) lengthList.get(lengthList.size() - 1)).intValue());
lengthList.add(new Integer(prevLength + noteLength));
totalFootnotesLength += noteLength;
@@ -423,7 +423,7 @@
index < breakIndex;
index++) {
if (par.getElement(index).isGlue() && par.getElement(index - 1).isBox()
- || par.getElement(index).isPenalty()
+ || par.getElement(index).isPenalty()
&& ((KnuthElement) par.getElement(index)).getP() < KnuthElement.INFINITE) {
// break found
break;
@@ -520,7 +520,7 @@
}
// as this method is called only if it is not possible to insert
// all footnotes, at this point listIndex and elementIndex points to
- // an existing element, the next one we will try to insert
+ // an existing element, the next one we will try to insert
}
// try adding a split of the next note
@@ -582,7 +582,7 @@
// prevIndex is -1 if we have added only some whole footnotes
footnoteListIndex = (prevIndex != -1) ? listIndex : listIndex - 1;
footnoteElementIndex = (prevIndex != -1)
- ? prevIndex
+ ? prevIndex
: ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1;
}
return prevSplitLength;
@@ -618,7 +618,7 @@
}
}
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -649,11 +649,11 @@
if (footnotesPending) {
if (footnoteListIndex < footnotesList.size() - 1) {
// add demerits for the deferred footnotes
- demerits += (footnotesList.size() - 1 - footnoteListIndex)
+ demerits += (footnotesList.size() - 1 - footnoteListIndex)
* deferredFootnoteDemerits;
}
if (footnoteListIndex < footnotesList.size()) {
- if (footnoteElementIndex
+ if (footnoteElementIndex
< ((LinkedList) footnotesList.get(footnoteListIndex)).size() - 1) {
// add demerits for the footnote split between pages
demerits += splitFootnoteDemerits;
@@ -710,7 +710,7 @@
// cannot add any content: create a new node and start again
KnuthPageNode node = (KnuthPageNode)
createNode(lastNode.position, prevNode.line + 1, 1,
- insertedFootnotesLength - prevNode.totalFootnotes,
+ insertedFootnotesLength - prevNode.totalFootnotes,
0, 0,
0, 0, 0,
0, 0, prevNode);
@@ -744,7 +744,7 @@
}
pageBreaks.addFirst(pageBreak);
}
-
+
/**
* Removes all page breaks from the result list. This is used by block-containers and
* static-content when it is only desired to know where there is an overflow but later the
@@ -758,14 +758,14 @@
pageBreaks.removeFirst();
}
}
-
+
public void updateData1(int total, double demerits) {
}
public void updateData2(KnuthNode bestActiveNode,
KnuthSequence sequence,
int total) {
- //int difference = (bestActiveNode.line < total)
+ //int difference = (bestActiveNode.line < total)
// ? bestActiveNode.difference : bestActiveNode.difference + fillerMinWidth;
int difference = bestActiveNode.difference;
if (difference + bestActiveNode.availableShrink < 0) {
@@ -818,10 +818,10 @@
// add nodes at the beginning of the list, as they are found
// backwards, from the last one to the first one
if (log.isDebugEnabled()) {
- log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ log.debug("BBA> difference=" + difference + " ratio=" + ratio
+ " position=" + bestActiveNode.position);
}
- insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
+ insertPageBreakAsFirst(new PageBreakPosition(this.topLevelLM,
bestActiveNode.position,
firstListIndex, firstElementIndex,
((KnuthPageNode) bestActiveNode).footnoteListIndex,
@@ -834,8 +834,8 @@
KnuthNode bestActiveNode = null;
for (int i = startLine; i < endLine; i++) {
for (KnuthNode node = getNode(i); node != null; node = node.next) {
- if (favorSinglePart
- && node.line > 1
+ if (favorSinglePart
+ && node.line > 1
&& bestActiveNode != null
&& Math.abs(bestActiveNode.difference) < bestActiveNode.availableShrink) {
//favor current best node, so just skip the current node because it would
@@ -854,12 +854,12 @@
public LinkedList getFootnoteList(int index) {
return (LinkedList) footnotesList.get(index);
}
-
+
/** @return the associated top-level formatting object. */
public FObj getFObj() {
return topLevelLM.getFObj();
}
-
+
/** {@inheritDoc} */
protected int getLineWidth(int line) {
int bpd;
@@ -873,7 +873,7 @@
}
return bpd;
}
-
+
/**
* Interface to notify about layout events during page breaking.
*/
@@ -886,7 +886,7 @@
* @param obj the root FO object where this happens
*/
void notifyOverflow(int part, int amount, FObj obj);
-
+
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageProvider.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageProvider.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageProvider.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageProvider.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -35,38 +35,38 @@
* </p>
* <p>Additional functionality makes sure that surplus instances that are requested by the
* page breaker are properly discarded, especially in situations where hard breaks cause
- * blank pages. The reason for that: The page breaker sometimes needs to preallocate
+ * blank pages. The reason for that: The page breaker sometimes needs to preallocate
* additional pages since it doesn't know exactly until the end how many pages it really needs.
* </p>
*/
public class PageProvider implements Constants {
-
+
private Log log = LogFactory.getLog(PageProvider.class);
/** Indices are evaluated relative to the first page in the page-sequence. */
public static final int RELTO_PAGE_SEQUENCE = 0;
/** Indices are evaluated relative to the first page in the current element list. */
public static final int RELTO_CURRENT_ELEMENT_LIST = 1;
-
+
private int startPageOfPageSequence;
private int startPageOfCurrentElementList;
private int startColumnOfCurrentElementList;
private List cachedPages = new java.util.ArrayList();
-
+
private int lastPageIndex = -1;
private int indexOfCachedLastPage = -1;
-
+
//Cache to optimize getAvailableBPD() calls
private int lastRequestedIndex = -1;
private int lastReportedBPD = -1;
- /**
+ /**
* AreaTreeHandler which activates the PSLM and controls
* the rendering of its pages.
*/
private AreaTreeHandler areaTreeHandler;
- /**
+ /**
* fo:page-sequence formatting object being
* processed by this class
*/
@@ -82,12 +82,12 @@
this.pageSeq = ps;
this.startPageOfPageSequence = ps.getStartingPageNumber();
}
-
+
/**
* The page breaker notifies the provider about the page number an element list starts
* on so it can later retrieve PageViewports relative to this first page.
* @param startPage the number of the first page for the element list.
- * @param startColumn the starting column number for the element list.
+ * @param startColumn the starting column number for the element list.
*/
public void setStartOfNextElementList(int startPage, int startColumn) {
log.debug("start of the next element list is:"
@@ -98,7 +98,7 @@
this.lastRequestedIndex = -1;
this.lastReportedBPD = -1;
}
-
+
/**
* Sets the index of the last page. This is done as soon as the position of the last page
* is known or assumed.
@@ -107,7 +107,7 @@
public void setLastPageIndex(int index) {
this.lastPageIndex = index;
}
-
+
/**
* Returns the available BPD for the part/page indicated by the index parameter.
* The index is the part/page relative to the start of the current element list.
@@ -145,9 +145,9 @@
}
return this.lastReportedBPD;
}
-
+
/**
- * Returns the part index (0<x<partCount) which denotes the first part on the last page
+ * Returns the part index (0<x<partCount) which denotes the first part on the last page
* generated by the current element list.
* @param partCount Number of parts determined by the breaking algorithm
* @return the requested part index
@@ -177,7 +177,7 @@
* Returns a Page.
* @param isBlank true if this page is supposed to be blank.
* @param index Index of the page (see relativeTo)
- * @param relativeTo Defines which value the index parameter should be evaluated relative
+ * @param relativeTo Defines which value the index parameter should be evaluated relative
* to. (One of PageProvider.RELTO_*)
* @return the requested Page
*/
@@ -193,7 +193,7 @@
"Illegal value for relativeTo: " + relativeTo);
}
}
-
+
/**
* Returns a Page.
* @param isBlank true if the Page should be a blank one
@@ -203,7 +203,7 @@
protected Page getPage(boolean isBlank, int index) {
boolean isLastPage = (lastPageIndex >= 0) && (index == lastPageIndex);
if (log.isTraceEnabled()) {
- log.trace("getPage(" + index + " " + (isBlank ? "blank" : "non-blank")
+ log.trace("getPage(" + index + " " + (isBlank ? "blank" : "non-blank")
+ (isLastPage ? " <LAST>" : "") + ")");
}
int intIndex = index - startPageOfPageSequence;
@@ -248,12 +248,12 @@
}
}
}
-
+
private Page cacheNextPage(int index, boolean isBlank, boolean isLastPage) {
String pageNumberString = pageSeq.makeFormattedPageNumber(index);
SimplePageMaster spm = pageSeq.getNextSimplePageMaster(
index, (startPageOfPageSequence == index), isLastPage, false, isBlank);
-
+
Region body = spm.getRegion(FO_REGION_BODY);
if (!pageSeq.getMainFlow().getFlowName().equals(body.getRegionName())) {
// this is fine by the XSL Rec (fo:flow's flow-name can be mapped to
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PageSequenceLayoutManager.java Fri Jul 25 05:44:20 2008
@@ -57,9 +57,9 @@
public PageProvider getPageProvider() {
return this.pageProvider;
}
-
+
/**
- * @return the PageSequence being managed by this layout manager
+ * @return the PageSequence being managed by this layout manager
*/
protected PageSequence getPageSequence() {
return (PageSequence)pageSeq;
@@ -72,7 +72,7 @@
public PageSequenceLayoutManager getPSLM() {
return this;
}
-
+
/** {@inheritDoc} */
public void activateLayout() {
initialize();
@@ -100,7 +100,7 @@
}
curPage = makeNewPage(false, false);
-
+
PageBreaker breaker = new PageBreaker(this);
int flowBPD = getCurrentPV().getBodyRegion().getRemainingBPD();
breaker.doLayout(flowBPD);
@@ -118,7 +118,7 @@
areaTreeHandler.notifyPageSequenceFinished(pageSeq,
(currentPageNum - startPageNum) + 1);
getPageSequence().releasePageSequence();
-
+
// If this sequence has a page sequence master so we must reset
// it in preparation for the next sequence
String masterReference = getPageSequence().getMasterReference();
@@ -132,13 +132,13 @@
log.debug("Ending layout");
}
}
-
+
/** {@inheritDoc} */
protected Page createPage(int pageNumber, boolean isBlank) {
return pageProvider.getPage(isBlank,
pageNumber, PageProvider.RELTO_PAGE_SEQUENCE);
}
-
+
private void layoutSideRegion(int regionID) {
SideRegion reg = (SideRegion)curPage.getSimplePageMaster().getRegion(regionID);
if (reg == null) {
@@ -158,12 +158,12 @@
/** {@inheritDoc} */
protected void finishPage() {
// Layout side regions
- layoutSideRegion(FO_REGION_BEFORE);
+ layoutSideRegion(FO_REGION_BEFORE);
layoutSideRegion(FO_REGION_AFTER);
layoutSideRegion(FO_REGION_START);
layoutSideRegion(FO_REGION_END);
-
+
super.finishPage();
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Position.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Position.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Position.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/Position.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,11 +16,11 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
public class Position {
-
+
private LayoutManager layoutManager;
private int index = -1;
@@ -39,14 +39,14 @@
public Position getPosition() {
return null;
}
-
+
public boolean generatesAreas() {
return false;
}
/**
* Sets the index of this position in the sequence of Position elements.
- *
+ *
* @param value this position's index
*/
public void setIndex(int value) {
@@ -55,13 +55,13 @@
/**
* Returns the index of this position in the sequence of Position elements.
- *
+ *
* @return the index of this position in the sequence of Position elements
*/
public int getIndex() {
return this.index;
}
-
+
public String getShortLMName() {
if (getLM() != null) {
String lm = getLM().toString();
@@ -75,7 +75,7 @@
return "null";
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PositionIterator.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PositionIterator.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PositionIterator.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/PositionIterator.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,14 +16,14 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
import java.util.Iterator;
import java.util.NoSuchElementException;
public abstract class PositionIterator implements Iterator {
-
+
private Iterator parentIter;
private Object nextObj;
private LayoutManager childLM;
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/RelSide.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/RelSide.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/RelSide.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/RelSide.java Fri Jul 25 05:44:20 2008
@@ -30,7 +30,7 @@
public static final RelSide START = new RelSide("start");
/** the end side */
public static final RelSide END = new RelSide("end");
-
+
private String name;
/**
@@ -45,10 +45,10 @@
public String getName() {
return this.name;
}
-
+
/** {@inheritDoc} */
public String toString() {
return "RelSide:" + name;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceElement.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceElement.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceElement.java Fri Jul 25 05:44:20 2008
@@ -30,7 +30,7 @@
public class SpaceElement extends UnresolvedListElementWithLength {
private int precedence;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -40,21 +40,21 @@
* @param isLast true if this is a space-after of the last area generated.
* @param context the property evaluation context
*/
- public SpaceElement(Position position, SpaceProperty space, RelSide side,
+ public SpaceElement(Position position, SpaceProperty space, RelSide side,
boolean isFirst, boolean isLast,
PercentBaseContext context) {
- super(position,
+ super(position,
MinOptMaxUtil.toMinOptMax(
- space.getSpace().getLengthRange(),
+ space.getSpace().getLengthRange(),
context), side, space.isDiscard(), isFirst, isLast);
int en = space.getSpace().getPrecedence().getEnum();
if (en == Constants.EN_FORCE) {
this.precedence = Integer.MAX_VALUE;
} else {
- this.precedence = space.getSpace().getPrecedence().getNumber().intValue();
+ this.precedence = space.getSpace().getPrecedence().getNumber().intValue();
}
}
-
+
/** @return true if the space is forcing. */
public boolean isForcing() {
return this.precedence == Integer.MAX_VALUE;
@@ -64,7 +64,7 @@
public int getPrecedence() {
return this.precedence;
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
LayoutManager lm = getOriginatingLayoutManager();
@@ -72,11 +72,11 @@
((ConditionalElementListener)lm).notifySpace(
getSide(), effectiveLength);
} else {
- log.warn("Cannot notify LM. It does not implement ConditionalElementListener:"
+ log.warn("Cannot notify LM. It does not implement ConditionalElementListener:"
+ lm.getClass().getName());
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("Space[");
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceResolver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceResolver.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceResolver.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceResolver.java Fri Jul 25 05:44:20 2008
@@ -37,19 +37,19 @@
/** Logger instance */
protected static Log log = LogFactory.getLog(SpaceResolver.class);
-
+
private UnresolvedListElementWithLength[] firstPart;
private BreakElement breakPoss;
private UnresolvedListElementWithLength[] secondPart;
private UnresolvedListElementWithLength[] noBreak;
-
+
private MinOptMax[] firstPartLengths;
private MinOptMax[] secondPartLengths;
private MinOptMax[] noBreakLengths;
-
+
private boolean isFirst;
private boolean isLast;
-
+
/**
* Main constructor.
* @param first Element list before a break (optional)
@@ -58,7 +58,7 @@
* @param isFirst Resolution at the beginning of a (full) element list
* @param isLast Resolution at the end of a (full) element list
*/
- private SpaceResolver(List first, BreakElement breakPoss, List second,
+ private SpaceResolver(List first, BreakElement breakPoss, List second,
boolean isFirst, boolean isLast) {
this.isFirst = isFirst;
this.isLast = isLast;
@@ -95,14 +95,14 @@
if (breakPoss != null) {
if (breakPoss.getPendingAfterMarks() != null) {
if (log.isTraceEnabled()) {
- log.trace(" adding pending before break: "
+ log.trace(" adding pending before break: "
+ breakPoss.getPendingAfterMarks());
}
first.addAll(0, breakPoss.getPendingAfterMarks());
}
if (breakPoss.getPendingBeforeMarks() != null) {
if (log.isTraceEnabled()) {
- log.trace(" adding pending after break: "
+ log.trace(" adding pending after break: "
+ breakPoss.getPendingBeforeMarks());
}
second.addAll(0, breakPoss.getPendingBeforeMarks());
@@ -134,7 +134,7 @@
}
resolve();
}
-
+
private String toString(Object[] arr1, Object[] arr2) {
if (arr1.length != arr2.length) {
new IllegalArgumentException("The length of both arrays must be equal");
@@ -151,7 +151,7 @@
sb.append("]");
return sb.toString();
}
-
+
private void removeConditionalBorderAndPadding(
UnresolvedListElement[] elems, MinOptMax[] lengths, boolean reverse) {
for (int i = 0; i < elems.length; i++) {
@@ -175,7 +175,7 @@
log.trace("-->Resulting list: " + toString(elems, lengths));
}
}
-
+
private void performSpaceResolutionRule1(UnresolvedListElement[] elems, MinOptMax[] lengths,
boolean reverse) {
for (int i = 0; i < elems.length; i++) {
@@ -204,14 +204,14 @@
}
}
- private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems,
+ private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems,
MinOptMax[] lengths, int start, int end) {
if (log.isTraceEnabled()) {
log.trace("rule 2-3: " + start + "-" + end);
}
SpaceElement space;
int remaining;
-
+
//Rule 2 (4.3.1, XSL 1.0)
boolean hasForcing = false;
remaining = 0;
@@ -237,7 +237,7 @@
space = (SpaceElement)elems[i];
if (!space.isForcing()) {
if (log.isDebugEnabled()) {
- log.debug("Nulling non-forcing space-specifier using 4.3.1, rule 2: "
+ log.debug("Nulling non-forcing space-specifier using 4.3.1, rule 2: "
+ elems[i]);
}
lengths[i] = null;
@@ -245,7 +245,7 @@
}
return; //If rule is triggered skip rule 3
}
-
+
//Rule 3 (4.3.1, XSL 1.0)
//Determine highes precedence
int highestPrecedence = Integer.MIN_VALUE;
@@ -269,8 +269,8 @@
space = (SpaceElement)elems[i];
if (space.getPrecedence() != highestPrecedence) {
if (log.isDebugEnabled()) {
- log.debug("Nulling space-specifier with precedence "
- + space.getPrecedence() + " using 4.3.1, rule 3: "
+ log.debug("Nulling space-specifier with precedence "
+ + space.getPrecedence() + " using 4.3.1, rule 3: "
+ elems[i]);
}
lengths[i] = null;
@@ -295,7 +295,7 @@
if (space.getLength().opt < greatestOptimum) {
if (log.isDebugEnabled()) {
log.debug("Nulling space-specifier with smaller optimum length "
- + "using 4.3.1, rule 3: "
+ + "using 4.3.1, rule 3: "
+ elems[i]);
}
lengths[i] = null;
@@ -318,7 +318,7 @@
max = Math.min(max, space.getLength().max);
if (remaining > 1) {
if (log.isDebugEnabled()) {
- log.debug("Nulling non-last space-specifier using 4.3.1, rule 3, second part: "
+ log.debug("Nulling non-last space-specifier using 4.3.1, rule 3, second part: "
+ elems[i]);
}
lengths[i] = null;
@@ -334,7 +334,7 @@
log.trace("-->Resulting list: " + toString(elems, lengths));
}
}
-
+
private void performSpaceResolutionRules2to3(UnresolvedListElement[] elems,
MinOptMax[] lengths) {
int start = 0;
@@ -354,15 +354,15 @@
start = i;
}
}
-
+
private boolean hasFirstPart() {
return firstPart != null && firstPart.length > 0;
}
-
+
private boolean hasSecondPart() {
return secondPart != null && secondPart.length > 0;
}
-
+
private void resolve() {
if (breakPoss != null) {
if (hasFirstPart()) {
@@ -387,7 +387,7 @@
removeConditionalBorderAndPadding(firstPart, firstPartLengths, true);
performSpaceResolutionRule1(firstPart, firstPartLengths, true);
}
-
+
if (hasFirstPart()) {
//Now that we've handled isFirst/isLast conditions, we need to look at the
//active part in its normal order so swap it back.
@@ -408,7 +408,7 @@
performSpaceResolutionRules2to3(secondPart, secondPartLengths);
}
}
-
+
private MinOptMax sum(MinOptMax[] lengths) {
MinOptMax sum = new MinOptMax();
for (int i = 0; i < lengths.length; i++) {
@@ -418,7 +418,7 @@
}
return sum;
}
-
+
private void generate(ListIterator iter) {
MinOptMax noBreakLength = new MinOptMax();
MinOptMax glue1; //space before break possibility if break occurs
@@ -427,12 +427,12 @@
glue1 = sum(firstPartLengths);
glue3 = sum(secondPartLengths);
noBreakLength = sum(noBreakLengths);
-
+
//This doesn't produce the right glue2
//glue2 = new MinOptMax(noBreakLength);
//glue2.subtract(glue1);
//glue2.subtract(glue3);
-
+
int glue2w = noBreakLength.opt - glue1.opt - glue3.opt;
int glue2stretch = (noBreakLength.max - noBreakLength.opt);
int glue2shrink = (noBreakLength.opt - noBreakLength.min);
@@ -440,34 +440,34 @@
glue2stretch -= glue3.max - glue3.opt;
glue2shrink -= glue1.opt - glue1.min;
glue2shrink -= glue3.opt - glue3.min;
-
+
boolean hasPrecedingNonBlock = false;
if (log.isDebugEnabled()) {
- log.debug("noBreakLength=" + noBreakLength
- + ", glue1=" + glue1
- + ", glue2=" + glue2w + "+" + glue2stretch + "-" + glue2shrink
+ log.debug("noBreakLength=" + noBreakLength
+ + ", glue1=" + glue1
+ + ", glue2=" + glue2w + "+" + glue2stretch + "-" + glue2shrink
+ ", glue3=" + glue3);
}
if (breakPoss != null) {
boolean forcedBreak = breakPoss.isForcedBreak();
if (glue1.isNonZero()) {
- iter.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ iter.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
false, (Position)null, true));
- iter.add(new KnuthGlue(glue1.opt, glue1.max - glue1.opt, glue1.opt - glue1.min,
+ iter.add(new KnuthGlue(glue1.opt, glue1.max - glue1.opt, glue1.opt - glue1.min,
(Position)null, true));
if (forcedBreak) {
//Otherwise, the preceding penalty and glue will be cut off
iter.add(new KnuthBox(0, (Position)null, true));
}
}
- iter.add(new KnuthPenalty(breakPoss.getPenaltyWidth(), breakPoss.getPenaltyValue(),
- false, breakPoss.getBreakClass(),
+ iter.add(new KnuthPenalty(breakPoss.getPenaltyWidth(), breakPoss.getPenaltyValue(),
+ false, breakPoss.getBreakClass(),
new SpaceHandlingBreakPosition(this, breakPoss), false));
if (breakPoss.getPenaltyValue() <= -KnuthPenalty.INFINITE) {
return; //return early. Not necessary (even wrong) to add additional elements
}
if (glue2w != 0 || glue2stretch != 0 || glue2shrink != 0) {
- iter.add(new KnuthGlue(glue2w, glue2stretch, glue2shrink,
+ iter.add(new KnuthGlue(glue2w, glue2stretch, glue2shrink,
(Position)null, true));
}
} else {
@@ -483,9 +483,9 @@
iter.add(new KnuthBox(0, pos, true));
}
if (glue3.isNonZero()) {
- iter.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
+ iter.add(new KnuthPenalty(0, KnuthPenalty.INFINITE,
false, (Position)null, true));
- iter.add(new KnuthGlue(glue3.opt, glue3.max - glue3.opt, glue3.opt - glue3.min,
+ iter.add(new KnuthGlue(glue3.opt, glue3.max - glue3.opt, glue3.opt - glue3.min,
(Position)null, true));
hasPrecedingNonBlock = true;
}
@@ -494,7 +494,7 @@
iter.add(new KnuthBox(0, (Position)null, true));
}
}
-
+
/**
* Position class for break possibilities. It is used to notify layout manager about the
* effective spaces and conditional lengths.
@@ -503,11 +503,11 @@
private SpaceResolver resolver;
private Position originalPosition;
-
+
/**
* Main constructor.
* @param resolver the space resolver that provides the info about the actual situation
- * @param breakPoss the original break possibility that creates this Position
+ * @param breakPoss the original break possibility that creates this Position
*/
public SpaceHandlingBreakPosition(SpaceResolver resolver, BreakElement breakPoss) {
super(null);
@@ -518,18 +518,18 @@
this.originalPosition = this.originalPosition.getPosition();
}
}
-
+
/** @return the space resolver */
public SpaceResolver getSpaceResolver() {
return this.resolver;
}
-
+
/**
* Notifies all affected layout managers about the current situation in the part to be
* handled for area generation.
* @param isBreakSituation true if this is a break situation.
* @param side defines to notify about the situation whether before or after the break.
- * May be null if isBreakSituation is null.
+ * May be null if isBreakSituation is null.
*/
public void notifyBreakSituation(boolean isBreakSituation, RelSide side) {
if (isBreakSituation) {
@@ -548,7 +548,7 @@
}
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
@@ -558,7 +558,7 @@
return sb.toString();
}
- /**
+ /**
* @return the original Position instance set at the BreakElement that this Position was
* created for.
*/
@@ -566,7 +566,7 @@
return this.originalPosition;
}
}
-
+
/**
* Position class for no-break situations. It is used to notify layout manager about the
* effective spaces and conditional lengths.
@@ -574,7 +574,7 @@
public static class SpaceHandlingPosition extends Position {
private SpaceResolver resolver;
-
+
/**
* Main constructor.
* @param resolver the space resolver that provides the info about the actual situation
@@ -583,12 +583,12 @@
super(null);
this.resolver = resolver;
}
-
+
/** @return the space resolver */
public SpaceResolver getSpaceResolver() {
return this.resolver;
}
-
+
/**
* Notifies all affected layout managers about the current situation in the part to be
* handled for area generation.
@@ -601,7 +601,7 @@
resolver.secondPart[i].notifyLayoutManager(resolver.secondPartLengths[i]);
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
@@ -609,7 +609,7 @@
return sb.toString();
}
}
-
+
/**
* Resolves unresolved elements applying the space resolution rules defined in 4.3.1.
* @param elems the element list
@@ -673,7 +673,7 @@
unresolvedSecond = unresolvedFirst;
unresolvedFirst = swapList;
}
-
+
log.debug("----start space resolution (first=" + first + ", last=" + last + ")...");
SpaceResolver resolver = new SpaceResolver(
unresolvedFirst, breakPoss, unresolvedSecond, first, last);
@@ -689,7 +689,7 @@
first = false;
}
}
-
+
/**
* Inspects an effective element list and notifies all layout managers about the state of
* the spaces and conditional lengths.
@@ -699,7 +699,7 @@
* @param prevBreak index of the the break possibility just before this part (used to
* identify a break condition, lastBreak <= 0 represents a no-break condition)
*/
- public static void performConditionalsNotification(List effectiveList,
+ public static void performConditionalsNotification(List effectiveList,
int startElementIndex, int endElementIndex, int prevBreak) {
KnuthElement el = null;
if (prevBreak > 0) {
@@ -710,7 +710,7 @@
if (el != null && el.isPenalty()) {
Position pos = el.getPosition();
if (pos instanceof SpaceResolver.SpaceHandlingBreakPosition) {
- beforeBreak = (SpaceResolver.SpaceHandlingBreakPosition)pos;
+ beforeBreak = (SpaceResolver.SpaceHandlingBreakPosition)pos;
beforeBreak.notifyBreakSituation(true, RelSide.BEFORE);
}
}
@@ -718,7 +718,7 @@
if (el != null && el.isPenalty()) {
Position pos = el.getPosition();
if (pos instanceof SpaceResolver.SpaceHandlingBreakPosition) {
- afterBreak = (SpaceResolver.SpaceHandlingBreakPosition)pos;
+ afterBreak = (SpaceResolver.SpaceHandlingBreakPosition)pos;
afterBreak.notifyBreakSituation(true, RelSide.AFTER);
}
}
@@ -735,7 +735,7 @@
}
}
}
-
-
+
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/SpaceSpecifier.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -52,7 +52,7 @@
try {
SpaceSpecifier ss = (SpaceSpecifier) super.clone();
ss.startsReferenceArea = startsReferenceArea;
- ss.hasForcing = hasForcing;
+ ss.hasForcing = hasForcing;
// Clone the vector, but share the objects in it!
ss.spaceVals = new ArrayList();
ss.spaceVals.addAll(spaceVals);
@@ -152,7 +152,7 @@
}
return resolvedSpace;
}
-
+
public String toString() {
return "Space Specifier (resolved at begin/end of ref. area:):\n" +
resolve(false).toString() + "\n" +
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/StaticContentLayoutManager.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -16,7 +16,7 @@
*/
/* $Id$ */
-
+
package org.apache.fop.layoutmgr;
import java.util.LinkedList;
@@ -66,7 +66,7 @@
* @param node static-content FO
* @param reg side region to layout into
*/
- public StaticContentLayoutManager(PageSequenceLayoutManager pslm,
+ public StaticContentLayoutManager(PageSequenceLayoutManager pslm,
StaticContent node, SideRegion reg) {
super(node);
setParent(pslm);
@@ -80,11 +80,11 @@
* @param node static-content FO
* @param block the block to layout into
*/
- public StaticContentLayoutManager(PageSequenceLayoutManager pslm,
+ public StaticContentLayoutManager(PageSequenceLayoutManager pslm,
StaticContent node, Block block) {
super(node);
setParent(pslm);
- targetBlock = block;
+ targetBlock = block;
}
/** {@inheritDoc} */
@@ -98,7 +98,7 @@
setContentAreaIPD(context.getRefIPD());
setContentAreaBPD(context.getStackLimitBP().opt);
- //TODO Copied from elsewhere. May be worthwhile to factor out the common parts.
+ //TODO Copied from elsewhere. May be worthwhile to factor out the common parts.
// currently active LM
BlockLevelLayoutManager curLM;
BlockLevelLayoutManager prevLM = null;
@@ -122,7 +122,7 @@
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
- //log.debug("FLM.getNextKnuthElements> returnedList.size() = "
+ //log.debug("FLM.getNextKnuthElements> returnedList.size() = "
// + returnedList.size());
// "wrap" the Position inside each element
@@ -148,8 +148,8 @@
if (prevLM.mustKeepWithNext()
|| curLM.mustKeepWithPrevious()) {
// add an infinite penalty to forbid a break between blocks
- returnList.add(new KnuthPenalty(0,
- KnuthElement.INFINITE, false,
+ returnList.add(new KnuthPenalty(0,
+ KnuthElement.INFINITE, false,
new Position(this), false));
} else if (!((KnuthElement) ListUtil.getLast(returnList))
.isGlue()) {
@@ -180,9 +180,9 @@
return returnList;
}
}
-
+
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
AreaAdditionUtil.addAreas(this, parentIter, layoutContext);
@@ -246,10 +246,10 @@
if (breaker.isOverflow()) {
if (!autoHeight) {
String page = getPSLM().getCurrentPage().getPageViewport().getPageNumberString();
-
+
BlockLevelEventProducer eventProducer = BlockLevelEventProducer.Provider.get(
getStaticContentFO().getUserAgent().getEventBroadcaster());
- boolean canRecover = (regionFO.getOverflow() != EN_ERROR_IF_OVERFLOW);
+ boolean canRecover = (regionFO.getOverflow() != EN_ERROR_IF_OVERFLOW);
boolean needClip = (regionFO.getOverflow() == Constants.EN_HIDDEN
|| regionFO.getOverflow() == Constants.EN_ERROR_IF_OVERFLOW);
eventProducer.regionOverflow(this, regionFO.getName(),
@@ -259,7 +259,7 @@
}
}
}
-
+
/**
* Convenience method that returns the Static Content node.
* @return the static content node
@@ -268,13 +268,13 @@
return (StaticContent) fobj;
}
- private class StaticContentBreaker extends AbstractBreaker {
+ private class StaticContentBreaker extends AbstractBreaker {
private StaticContentLayoutManager lm;
private int displayAlign;
private int ipd;
private int overflow = 0;
-
- public StaticContentBreaker(StaticContentLayoutManager lm, int ipd,
+
+ public StaticContentBreaker(StaticContentLayoutManager lm, int ipd,
int displayAlign) {
this.lm = lm;
this.ipd = ipd;
@@ -290,7 +290,7 @@
}
ElementListObserver.observe(elementList, "static-content", elementListID);
}
-
+
/** {@inheritDoc} */
protected boolean isPartOverflowRecoveryActivated() {
//For side regions, this must be disabled because of wanted overflow.
@@ -300,11 +300,11 @@
public boolean isOverflow() {
return (this.overflow != 0);
}
-
+
public int getOverflowAmount() {
return this.overflow;
}
-
+
/** {@inheritDoc} */
protected PageBreakingLayoutListener createLayoutListener() {
return new PageBreakingLayoutListener() {
@@ -314,7 +314,7 @@
StaticContentBreaker.this.overflow = amount;
}
}
-
+
};
}
@@ -327,7 +327,7 @@
lc.setRefIPD(ipd);
return lc;
}
-
+
protected List getNextKnuthElements(LayoutContext context, int alignment) {
LayoutManager curLM; // currently active LM
List returnList = new LinkedList();
@@ -339,7 +339,7 @@
childLC.setWritingMode(context.getWritingMode());
List returnedList = null;
- //The following is a HACK! Ignore leading and trailing white space
+ //The following is a HACK! Ignore leading and trailing white space
boolean ignore = curLM instanceof TextLayoutManager;
if (!curLM.isFinished()) {
returnedList = curLM.getNextKnuthElements(childLC, alignment);
@@ -356,39 +356,39 @@
protected int getCurrentDisplayAlign() {
return displayAlign;
}
-
+
protected boolean hasMoreContent() {
return !lm.isFinished();
}
-
+
protected void addAreas(PositionIterator posIter, LayoutContext context) {
- AreaAdditionUtil.addAreas(lm, posIter, context);
+ AreaAdditionUtil.addAreas(lm, posIter, context);
}
-
- protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
+
+ protected void doPhase3(PageBreakingAlgorithm alg, int partCount,
BlockSequence originalList, BlockSequence effectiveList) {
if (partCount > 1) {
PageBreakPosition pos = (PageBreakPosition)alg.getPageBreaks().getFirst();
int firstPartLength = ElementListUtils.calcContentLength(effectiveList,
effectiveList.ignoreAtStart, pos.getLeafPos());
- overflow += alg.totalWidth - firstPartLength;
- }
- //Rendering all parts (not just the first) at once for the case where the parts that
+ overflow += alg.totalWidth - firstPartLength;
+ }
+ //Rendering all parts (not just the first) at once for the case where the parts that
//overflow should be visible.
alg.removeAllPageBreaks();
//Directly add areas after finding the breaks
this.addAreas(alg, 1, originalList, effectiveList);
}
-
+
protected void finishPart(PageBreakingAlgorithm alg, PageBreakPosition pbp) {
//nop for static content
}
-
+
protected LayoutManager getCurrentChildLM() {
return null; //TODO NYI
}
- }
-
+ }
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -396,12 +396,12 @@
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
/** {@inheritDoc} */
protected void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
@@ -409,16 +409,16 @@
public int getContentAreaBPD() {
return contentAreaBPD;
}
-
+
private void setContentAreaBPD(int contentAreaBPD) {
this.contentAreaBPD = contentAreaBPD;
}
-
+
/** {@inheritDoc} */
public int getKeepTogetherStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -428,6 +428,6 @@
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TopLevelLayoutManager.java Fri Jul 25 05:44:20 2008
@@ -5,9 +5,9 @@
* 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.
@@ -29,7 +29,7 @@
/**
* Activate the layout of this page sequence.
- * PageViewports corresponding to each page generated by this
+ * PageViewports corresponding to each page generated by this
* page sequence will be created and sent to the AreaTreeModel
* for rendering.
*/
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TraitSetter.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TraitSetter.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TraitSetter.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/TraitSetter.java Fri Jul 25 05:44:20 2008
@@ -42,7 +42,7 @@
/** logger */
protected static Log log = LogFactory.getLog(TraitSetter.class);
-
+
/**
* Sets border and padding traits on areas.
* @param area area to set the traits on
@@ -73,18 +73,18 @@
}
addBorderTrait(area, bpProps, bNotFirst,
- CommonBorderPaddingBackground.START,
+ CommonBorderPaddingBackground.START,
BorderProps.SEPARATE, Trait.BORDER_START);
- addBorderTrait(area, bpProps, bNotLast,
+ addBorderTrait(area, bpProps, bNotLast,
CommonBorderPaddingBackground.END,
BorderProps.SEPARATE, Trait.BORDER_END);
- addBorderTrait(area, bpProps, false,
+ addBorderTrait(area, bpProps, false,
CommonBorderPaddingBackground.BEFORE,
BorderProps.SEPARATE, Trait.BORDER_BEFORE);
- addBorderTrait(area, bpProps, false,
+ addBorderTrait(area, bpProps, false,
CommonBorderPaddingBackground.AFTER,
BorderProps.SEPARATE, Trait.BORDER_AFTER);
}
@@ -182,7 +182,7 @@
* @param borderAfter the resolved after border
* @param borderStart the resolved start border
* @param borderEnd the resolved end border
- * @param outer 4 boolean values indicating if the side represents the
+ * @param outer 4 boolean values indicating if the side represents the
* table's outer border. Order: before, after, start, end
*/
public static void addCollapsingBorders(Area area,
@@ -207,7 +207,7 @@
}
}
- private static void addPadding(Area area, CommonBorderPaddingBackground bordProps,
+ private static void addPadding(Area area, CommonBorderPaddingBackground bordProps,
PercentBaseContext context) {
addPadding(area, bordProps, false, false, false, false, context);
}
@@ -228,32 +228,32 @@
boolean discardBefore, boolean discardAfter,
boolean discardStart, boolean discardEnd,
PercentBaseContext context) {
- int padding = bordProps.getPadding(CommonBorderPaddingBackground.BEFORE,
+ int padding = bordProps.getPadding(CommonBorderPaddingBackground.BEFORE,
discardBefore, context);
if (padding != 0) {
area.addTrait(Trait.PADDING_BEFORE, new java.lang.Integer(padding));
}
- padding = bordProps.getPadding(CommonBorderPaddingBackground.AFTER,
+ padding = bordProps.getPadding(CommonBorderPaddingBackground.AFTER,
discardAfter, context);
if (padding != 0) {
area.addTrait(Trait.PADDING_AFTER, new java.lang.Integer(padding));
}
- padding = bordProps.getPadding(CommonBorderPaddingBackground.START,
+ padding = bordProps.getPadding(CommonBorderPaddingBackground.START,
discardStart, context);
if (padding != 0) {
area.addTrait(Trait.PADDING_START, new java.lang.Integer(padding));
}
- padding = bordProps.getPadding(CommonBorderPaddingBackground.END,
+ padding = bordProps.getPadding(CommonBorderPaddingBackground.END,
discardEnd, context);
if (padding != 0) {
area.addTrait(Trait.PADDING_END, new java.lang.Integer(padding));
}
}
-
+
private static BorderProps getBorderProps(CommonBorderPaddingBackground bordProps, int side) {
int width = bordProps.getBorderWidth(side, false);
if (width != 0) {
@@ -289,17 +289,17 @@
* background-position-horizontal/vertical to ensure the background images are
* correctly placed. Indeed the placement of images must be made WRT the
* column/body/row and not the cell.
- *
+ *
* <p>Note: The area's IPD and BPD must be set before calling this method.</p>
- *
+ *
* <p>TODO the regular
* {@link #addBackground(Area, CommonBorderPaddingBackground, PercentBaseContext)}
* method should be used instead, and a means to retrieve the original area's
* dimensions must be found.</p>
- *
+ *
* <p>TODO the placement of images in the x- or y-direction will be incorrect if
* background-repeat is set for that direction.</p>
- *
+ *
* @param area the area to set the traits on
* @param backProps the background properties
* @param context Property evaluation context
@@ -310,7 +310,7 @@
* @param referenceIPD value to use as a reference for percentage calculation
* @param referenceBPD value to use as a reference for percentage calculation
*/
- public static void addBackground(Area area,
+ public static void addBackground(Area area,
CommonBorderPaddingBackground backProps,
PercentBaseContext context,
int ipdShift, int bpdShift, int referenceIPD, int referenceBPD) {
@@ -325,7 +325,7 @@
back.setImageInfo(backProps.getImageInfo());
back.setRepeat(backProps.backgroundRepeat);
if (backProps.backgroundPositionHorizontal != null) {
- if (back.getRepeat() == Constants.EN_NOREPEAT
+ if (back.getRepeat() == Constants.EN_NOREPEAT
|| back.getRepeat() == Constants.EN_REPEATY) {
if (area.getIPD() > 0) {
PercentBaseContext refContext = new SimplePercentBaseContext(context,
@@ -343,7 +343,7 @@
}
}
if (backProps.backgroundPositionVertical != null) {
- if (back.getRepeat() == Constants.EN_NOREPEAT
+ if (back.getRepeat() == Constants.EN_NOREPEAT
|| back.getRepeat() == Constants.EN_REPEATX) {
if (area.getBPD() > 0) {
PercentBaseContext refContext = new SimplePercentBaseContext(context,
@@ -373,7 +373,7 @@
* @param backProps the background properties
* @param context Property evaluation context
*/
- public static void addBackground(Area area,
+ public static void addBackground(Area area,
CommonBorderPaddingBackground backProps,
PercentBaseContext context) {
if (!backProps.hasBackground()) {
@@ -387,14 +387,14 @@
back.setImageInfo(backProps.getImageInfo());
back.setRepeat(backProps.backgroundRepeat);
if (backProps.backgroundPositionHorizontal != null) {
- if (back.getRepeat() == Constants.EN_NOREPEAT
+ if (back.getRepeat() == Constants.EN_NOREPEAT
|| back.getRepeat() == Constants.EN_REPEATY) {
if (area.getIPD() > 0) {
int width = area.getIPD();
width += backProps.getPaddingStart(false, context);
width += backProps.getPaddingEnd(false, context);
back.setHoriz(backProps.backgroundPositionHorizontal.getValue(
- new SimplePercentBaseContext(context,
+ new SimplePercentBaseContext(context,
LengthBase.IMAGE_BACKGROUND_POSITION_HORIZONTAL,
(width - back.getImageInfo().getSize().getWidthMpt())
)
@@ -408,14 +408,14 @@
}
}
if (backProps.backgroundPositionVertical != null) {
- if (back.getRepeat() == Constants.EN_NOREPEAT
+ if (back.getRepeat() == Constants.EN_NOREPEAT
|| back.getRepeat() == Constants.EN_REPEATX) {
if (area.getBPD() > 0) {
int height = area.getBPD();
height += backProps.getPaddingBefore(false, context);
height += backProps.getPaddingAfter(false, context);
back.setVertical(backProps.backgroundPositionVertical.getValue(
- new SimplePercentBaseContext(context,
+ new SimplePercentBaseContext(context,
LengthBase.IMAGE_BACKGROUND_POSITION_VERTICAL,
(height - back.getImageInfo().getSize().getHeightMpt())
)
@@ -450,7 +450,7 @@
if (startIndent != 0) {
area.addTrait(Trait.START_INDENT, new Integer(startIndent));
}
-
+
int spaceStart = startIndent
- bpProps.getBorderStartWidth(false)
- bpProps.getPaddingStart(false, context);
@@ -488,7 +488,7 @@
}
/**
- * Returns the effective space length of a resolved space specifier based on the adjustment
+ * Returns the effective space length of a resolved space specifier based on the adjustment
* value.
* @param adjust the adjustment value
* @param space the space specifier
@@ -506,7 +506,7 @@
}
return sp;
}
-
+
/**
* Adds traits for space-before and space-after to an area.
* @param area the target area
@@ -514,7 +514,7 @@
* @param spaceBefore the space-before space specifier
* @param spaceAfter the space-after space specifier
*/
- public static void addSpaceBeforeAfter(Area area, double adjust,
+ public static void addSpaceBeforeAfter(Area area, double adjust,
MinOptMax spaceBefore, MinOptMax spaceAfter) {
int space;
space = getEffectiveSpace(adjust, spaceBefore);
@@ -526,7 +526,7 @@
area.addTrait(Trait.SPACE_AFTER, new Integer(space));
}
}
-
+
/**
* Sets the traits for breaks on an area.
* @param area the area to set the traits on.
@@ -539,7 +539,7 @@
area.addTrait(Trait.BREAK_BEFORE, new Integer(breakBefore));
*/
}
-
+
/**
* Adds font traits to an area
* @param area the target are
@@ -549,7 +549,7 @@
area.addTrait(Trait.FONT, font.getFontTriplet());
area.addTrait(Trait.FONT_SIZE, new Integer(font.getFontSize()));
}
-
+
/**
* Adds the text-decoration traits to the area.
* @param area the area to set the traits on
@@ -575,9 +575,9 @@
}
}
}
-
+
/**
- * Sets the producer's ID as a trait on the area. This can be used to track back the
+ * Sets the producer's ID as a trait on the area. This can be used to track back the
* generating FO node.
* @param area the area to set the traits on
* @param id the ID to set
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElement.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElement.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElement.java Fri Jul 25 05:44:20 2008
@@ -31,10 +31,10 @@
public UnresolvedListElement(Position position) {
super(position);
}
-
+
/** @return true if the element is conditional (conditionality="discard") */
public abstract boolean isConditional();
-
+
/** @return the layout manager that created this ListElement */
protected LayoutManager getOriginatingLayoutManager() {
Position pos = getPosition();
@@ -43,5 +43,5 @@
}
return pos.getLM();
}
-
+
}
Modified: xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java?rev=679781&r1=679780&r2=679781&view=diff
==============================================================================
--- xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java (original)
+++ xmlgraphics/fop/branches/Temp_AreaTreeNewDesign/src/java/org/apache/fop/layoutmgr/UnresolvedListElementWithLength.java Fri Jul 25 05:44:20 2008
@@ -31,13 +31,13 @@
/** Logger instance */
protected static Log log = LogFactory.getLog(UnresolvedListElementWithLength.class);
-
+
private MinOptMax length;
private boolean conditional;
private RelSide side;
private boolean isFirst;
private boolean isLast;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -47,7 +47,7 @@
* @param isFirst true if this is a space-before of the first area generated.
* @param isLast true if this is a space-after of the last area generated.
*/
- public UnresolvedListElementWithLength(Position position, MinOptMax length,
+ public UnresolvedListElementWithLength(Position position, MinOptMax length,
RelSide side,
boolean conditional, boolean isFirst, boolean isLast) {
super(position);
@@ -57,32 +57,32 @@
this.isFirst = isFirst;
this.isLast = isLast;
}
-
+
/** {@inheritDoc} */
public boolean isConditional() {
return this.conditional;
}
-
+
/** @return the space as resolved MinOptMax instance */
public MinOptMax getLength() {
return this.length;
}
-
+
/** @return the side this element was generated for */
public RelSide getSide() {
return this.side;
}
-
+
/** @return true if this is a space-before of the first area generated. */
public boolean isFirst() {
return this.isFirst;
}
-
+
/** @return true if this is a space-after of the last area generated. */
public boolean isLast() {
return this.isLast;
}
-
+
/**
* Called to notify the affected layout manager about the effective length after resolution.
* This method is called once before each call to the layout manager's addAreas() method.
@@ -90,7 +90,7 @@
* zero effective length)
*/
public abstract void notifyLayoutManager(MinOptMax effectiveLength);
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
@@ -109,5 +109,5 @@
}
return sb.toString();
}
-
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-commits-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: fop-commits-help@xmlgraphics.apache.org