You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by vh...@apache.org on 2008/07/24 11:37:16 UTC
svn commit: r679326 [15/33] - in /xmlgraphics/fop/trunk:
examples/embedding/java/embedding/ examples/embedding/java/embedding/events/
examples/embedding/java/embedding/intermediate/
examples/embedding/java/embedding/model/ examples/embedding/java/embed...
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java Thu Jul 24 02:35:34 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.
@@ -91,7 +91,7 @@
private Position auxiliaryPosition;
private int contentAreaIPD = 0;
-
+
/**
* @param node the fo this LM deals with
*/
@@ -100,7 +100,7 @@
setGeneratesBlockArea(true);
}
- /**
+ /**
* @return current area being filled
*/
protected BlockParent getCurrentArea() {
@@ -181,7 +181,7 @@
}
return this.auxiliaryPosition;
}
-
+
/**
* @param len length in millipoints to span with bp units
* @return the minimum integer n such that n * bpUnit >= len
@@ -194,7 +194,7 @@
* Determines and sets the content area IPD based on available reference area IPD, start- and
* end-indent properties.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
- *
+ *
* @return the resulting content area IPD
*/
protected int updateContentAreaIPDwithOverconstrainedAdjust() {
@@ -213,9 +213,9 @@
setContentAreaIPD(ipd);
return ipd;
}
-
+
/**
- * Sets the content area IPD by directly supplying the value.
+ * Sets the content area IPD by directly supplying the value.
* end-indent is adjusted based on overconstrained geometry rules, if necessary.
* @param contentIPD the IPD of the content
* @return the resulting content area IPD
@@ -234,7 +234,7 @@
setContentAreaIPD(contentIPD);
return contentIPD;
}
-
+
/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
//log.debug("BLM.getNextKnuthElements> keep-together = "
@@ -247,7 +247,7 @@
BlockLevelLayoutManager prevLM = null; // previously active LM
referenceIPD = context.getRefIPD();
-
+
updateContentAreaIPDwithOverconstrainedAdjust();
List returnedList = null;
@@ -268,16 +268,16 @@
addKnuthElementsForSpaceBefore(returnList, alignment);
context.updateKeepWithPreviousPending(getKeepWithPreviousStrength());
}
-
+
addKnuthElementsForBorderPaddingBefore(returnList, !firstVisibleMarkServed);
firstVisibleMarkServed = true;
//Spaces, border and padding to be repeated at each break
addPendingMarks(context);
-
+
//Used to indicate a special break-after case when all content has already been generated.
BreakElement forcedBreakAfterLast = null;
-
+
while ((curLM = (BlockLevelLayoutManager) getChildLM()) != null) {
LayoutContext childLC = new LayoutContext(0);
childLC.copyPendingMarksFrom(context);
@@ -314,13 +314,13 @@
}
if (contentList.isEmpty()) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered and borders/padding are painted.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), false));
}
// a descendant of this block has break-before
contentList.addAll(returnedList);
-
+
/* extension: conversione di tutta la sequenza fin'ora ottenuta */
if (bpUnit > 0) {
storedList = contentList;
@@ -350,7 +350,7 @@
// a descendant of this block has break-after
if (curLM.isFinished() && !hasNextChildLM()) {
forcedBreakAfterLast = (BreakElement) ListUtil
- .removeLast(contentList);
+ .removeLast(contentList);
context.clearPendingMarks();
break;
}
@@ -385,15 +385,15 @@
if (!contentList.isEmpty()) {
wrapPositionElements(contentList, returnList);
} else if (forcedBreakAfterLast == null) {
- // Empty fo:block, zero-length box makes sure the IDs and/or markers
+ // Empty fo:block, zero-length box makes sure the IDs and/or markers
// are registered.
returnList.add(new KnuthBox(0, notifyPos(new Position(this)), true));
}
addKnuthElementsForBorderPaddingAfter(returnList, true);
addKnuthElementsForSpaceAfter(returnList, alignment);
-
- //All child content is processed. Only break-after can occur now, so...
+
+ //All child content is processed. Only break-after can occur now, so...
context.clearPendingMarks();
if (forcedBreakAfterLast == null) {
addKnuthElementsForBreakAfter(returnList, context);
@@ -403,9 +403,9 @@
forcedBreakAfterLast.clearPendingMarks();
wrapPositionElement(forcedBreakAfterLast, returnList, false);
}
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
-
+
setFinished(true);
return returnList;
@@ -419,20 +419,20 @@
*/
protected void addInBetweenBreak(List contentList, LayoutContext context,
LayoutContext childLC) {
- if (mustKeepTogether()
+ if (mustKeepTogether()
|| context.isKeepWithNextPending()
|| childLC.isKeepWithPreviousPending()) {
-
+
int strength = getKeepTogetherStrength();
-
+
//Handle pending keep-with-next
strength = Math.max(strength, context.getKeepWithNextPending());
context.clearKeepWithNextPending();
-
+
//Handle pending keep-with-previous from child LM
strength = Math.max(strength, childLC.getKeepWithPreviousPending());
childLC.clearKeepWithPreviousPending();
-
+
int penalty = KeepUtil.getPenaltyForKeep(strength);
// add a penalty to forbid or discourage a break between blocks
@@ -440,7 +440,7 @@
new Position(this), penalty, context));
return;
}
-
+
ListElement last = (ListElement) ListUtil.getLast(contentList);
if (last.isGlue()) {
// the last element in contentList is a glue;
@@ -465,7 +465,7 @@
// areas for following Positions. The above test aims at preventing
// such a situation from occurring. add a null penalty to allow a break
// between blocks
-
+
// add a null penalty to allow a break between blocks
contentList.add(new BreakElement(
new Position(this), 0, context));
@@ -473,11 +473,11 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public int negotiateBPDAdjustment(int adj, KnuthElement lastElement) {
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> " + adj);
-/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
+/*LF*/ //log.debug(" lastElement e' " + (lastElement.isPenalty()
// ? "penalty" : (lastElement.isGlue() ? "glue" : "box" )));
/*LF*/ //log.debug(" position e' " + lastElement.getPosition().getClass().getName());
/*LF*/ //log.debug(" " + (bpUnit > 0 ? "unit" : ""));
@@ -497,9 +497,9 @@
return adj;
} else if (innerPosition instanceof MappingPosition) {
// this block has block-progression-unit > 0: the adjustment can concern
- // - the space-before or space-after of this block,
+ // - the space-before or space-after of this block,
// - the line number of a descendant of this block
- MappingPosition mappingPos = (MappingPosition)innerPosition;
+ MappingPosition mappingPos = (MappingPosition)innerPosition;
if (lastElement.isGlue()) {
// lastElement is a glue
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> bpunit con glue");
@@ -512,7 +512,7 @@
newAdjustment += ((BlockLevelLayoutManager)storedElement
.getLayoutManager()).negotiateBPDAdjustment(
adj - newAdjustment, storedElement);
-/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
+/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> (progressivo) righe: "
// + newAdjustment);
}
}
@@ -530,7 +530,7 @@
// the original penalty has width > 0
/*LF*/ //log.debug(" BLM.negotiateBPDAdjustment> chiamata passata");
return ((BlockLevelLayoutManager)storedPenalty.getLayoutManager())
- .negotiateBPDAdjustment(storedPenalty.getW(),
+ .negotiateBPDAdjustment(storedPenalty.getW(),
(KnuthElement)storedPenalty);
} else {
// the original penalty has width = 0
@@ -586,11 +586,11 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public List getChangedKnuthElements(List oldList, int alignment) {
/*LF*/ //log.debug("");
-/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
+/*LF*/ //log.debug(" BLM.getChangedKnuthElements> inizio: oldList.size() = "
// + oldList.size());
ListIterator oldListIterator = oldList.listIterator();
KnuthElement returnedElement;
@@ -605,10 +605,10 @@
while (oldListIterator.hasNext()) {
oldElement = (KnuthElement)oldListIterator.next();
Position innerPosition = ((NonLeafPosition) oldElement.getPosition()).getPosition();
- //log.debug(" BLM> unwrapping: "
- // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
+ //log.debug(" BLM> unwrapping: "
+ // + (oldElement.isBox() ? "box " : (oldElement.isGlue() ? "glue " : "penalty"))
// + " creato da " + oldElement.getLayoutManager().getClass().getName());
- //log.debug(" BLM> unwrapping: "
+ //log.debug(" BLM> unwrapping: "
// + oldElement.getPosition().getClass().getName());
if (innerPosition != null) {
// oldElement was created by a descendant of this BlockLM
@@ -645,18 +645,18 @@
}
int iLast = ((MappingPosition) el.getPosition()).getLastIndex();
- //log-debug(" si usa storedList da " + iFirst + " a " + iLast
+ //log-debug(" si usa storedList da " + iFirst + " a " + iLast
// + " compresi su " + storedList.size() + " elementi totali");
workList = storedList.subList(iFirst, iLast + 1);
}
ListIterator workListIterator = workList.listIterator();
- //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> workList.size() = "
// + workList.size() + " da 0 a " + (workList.size() - 1));
while (workListIterator.hasNext()) {
currElement = (KnuthElement) workListIterator.next();
- //log.debug("elemento n. " + workListIterator.previousIndex()
+ //log.debug("elemento n. " + workListIterator.previousIndex()
// + " nella workList");
if (prevElement != null
&& prevElement.getLayoutManager() != currElement.getLayoutManager()) {
@@ -667,8 +667,8 @@
currElement.getLayoutManager();
boolean bSomethingAdded = false;
if (prevLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da "
- // + fromIndex + " a " + workListIterator.previousIndex() + " su "
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da "
+ // + fromIndex + " a " + workListIterator.previousIndex() + " su "
// + prevLM.getClass().getName());
returnedList.addAll(prevLM.getChangedKnuthElements(workList.subList(
fromIndex, workListIterator.previousIndex()), alignment));
@@ -677,7 +677,7 @@
// prevLM == this
// do nothing
//log.debug(" BLM.getChangedKnuthElements> elementi propri, "
- // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
+ // + "ignorati, da " + fromIndex + " a " + workListIterator.previousIndex()
// + " su " + prevLM.getClass().getName());
}
fromIndex = workListIterator.previousIndex();
@@ -692,7 +692,7 @@
|| prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious())) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (bSomethingAdded
&& !((KnuthElement) ListUtil.getLast(returnedList))
@@ -707,7 +707,7 @@
BlockLevelLayoutManager currLM = (BlockLevelLayoutManager)
currElement.getLayoutManager();
if (currLM != this) {
- //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
+ //log.debug(" BLM.getChangedKnuthElements> chiamata da " + fromIndex
// + " a " + oldList.size() + " su " + currLM.getClass().getName());
returnedList.addAll(currLM.getChangedKnuthElements(
workList.subList(fromIndex, workList.size()), alignment));
@@ -718,7 +718,7 @@
if (!returnedList.isEmpty()) {
ListUtil.removeLast(returnedList);
}
- //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
+ //log.debug(" BLM.getChangedKnuthElements> elementi propri, ignorati, da "
// + fromIndex + " a " + workList.size());
}
}
@@ -747,7 +747,7 @@
}
}
- //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> intermedio: returnedList.size() = "
// + returnedList.size());
/* estensione: conversione complessiva */
@@ -774,18 +774,18 @@
}
if (bpUnit > 0 || adjustedSpaceAfter != 0) {
if (!spaceAfterIsConditional) {
- returnList.add(new KnuthPenalty(0,
+ returnList.add(new KnuthPenalty(0,
KnuthElement.INFINITE, false,
new NonLeafPosition(this, null), false));
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
} else {
returnList.add(new KnuthGlue(adjustedSpaceAfter, 0, 0,
- SPACE_AFTER_ADJUSTMENT,
+ SPACE_AFTER_ADJUSTMENT,
new NonLeafPosition(this, null),
(!spaceAfterIsConditional) ? false : true));
}
@@ -795,7 +795,7 @@
}
}
- //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
+ //log.debug(" BLM.getChangedKnuthElements> finished: returnList.size() = "
// + returnList.size());
return returnList;
}
@@ -807,7 +807,7 @@
protected int getParentKeepTogetherStrength() {
int strength = KEEP_AUTO;
if (getParent() instanceof BlockLevelLayoutManager) {
- strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
+ strength = ((BlockLevelLayoutManager)getParent()).getKeepTogetherStrength();
} else if (getParent() instanceof InlineLayoutManager) {
if (((InlineLayoutManager) getParent()).mustKeepTogether()) {
strength = KEEP_ALWAYS;
@@ -817,7 +817,7 @@
}
return strength;
}
-
+
/** {@inheritDoc} */
public boolean mustKeepTogether() {
return getKeepTogetherStrength() > KEEP_AUTO;
@@ -843,7 +843,7 @@
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
context.addPendingBeforeMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.BEFORE).getWidth(),
RelSide.BEFORE,
@@ -854,15 +854,15 @@
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.BEFORE),
- RelSide.BEFORE,
+ RelSide.BEFORE,
false, false, this));
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
context.addPendingAfterMark(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(
CommonBorderPaddingBackground.AFTER).getWidth(),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
if (borderAndPadding.getPaddingAfter(false, this) > 0) {
@@ -870,12 +870,12 @@
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
CommonBorderPaddingBackground.AFTER),
- RelSide.AFTER,
+ RelSide.AFTER,
false, false, this));
}
}
}
-
+
/** @return the border, padding and background info structure */
private CommonBorderPaddingBackground getBorderPaddingBackground() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -897,7 +897,7 @@
return null;
}
}
-
+
/** @return the space-before property */
private SpaceProperty getSpaceBeforeProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -919,7 +919,7 @@
return null;
}
}
-
+
/** @return the space-after property */
private SpaceProperty getSpaceAfterProperty() {
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -941,11 +941,11 @@
return null;
}
}
-
+
/**
* Creates Knuth elements for before border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isFirst true if this is the first time a layout manager instance needs to generate
+ * @param isFirst true if this is the first time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingBefore(List returnList, boolean isFirst) {
@@ -954,7 +954,7 @@
if (borderAndPadding != null) {
if (borderAndPadding.getBorderBeforeWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.BEFORE)
.getWidth(),
RelSide.BEFORE, isFirst, false, this));
@@ -963,7 +963,7 @@
returnList.add(new PaddingElement(
getAuxiliaryPosition(),
borderAndPadding.getPaddingLengthProperty(
- CommonBorderPaddingBackground.BEFORE),
+ CommonBorderPaddingBackground.BEFORE),
RelSide.BEFORE, isFirst, false, this));
}
}
@@ -972,7 +972,7 @@
/**
* Creates Knuth elements for after border padding and adds them to the return list.
* @param returnList return list to add the additional elements to
- * @param isLast true if this is the last time a layout manager instance needs to generate
+ * @param isLast true if this is the last time a layout manager instance needs to generate
* border and padding
*/
protected void addKnuthElementsForBorderPaddingAfter(List returnList, boolean isLast) {
@@ -988,7 +988,7 @@
}
if (borderAndPadding.getBorderAfterWidth(false) > 0) {
returnList.add(new BorderElement(
- getAuxiliaryPosition(),
+ getAuxiliaryPosition(),
borderAndPadding.getBorderInfo(CommonBorderPaddingBackground.AFTER)
.getWidth(),
RelSide.AFTER, false, isLast, this));
@@ -1002,7 +1002,7 @@
* @param context the layout context
* @return true if an element has been added due to a break-before.
*/
- protected boolean addKnuthElementsForBreakBefore(List returnList,
+ protected boolean addKnuthElementsForBreakBefore(List returnList,
LayoutContext context) {
int breakBefore = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1017,11 +1017,11 @@
breakBefore = ((org.apache.fop.fo.flow.table.Table) fobj).getBreakBefore();
}
if (breakBefore == EN_PAGE
- || breakBefore == EN_COLUMN
- || breakBefore == EN_EVEN_PAGE
+ || breakBefore == EN_COLUMN
+ || breakBefore == EN_EVEN_PAGE
|| breakBefore == EN_ODD_PAGE) {
// return a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakBefore, context));
return true;
} else {
@@ -1035,7 +1035,7 @@
* @param context the layout context
* @return true if an element has been added due to a break-after.
*/
- protected boolean addKnuthElementsForBreakAfter(List returnList,
+ protected boolean addKnuthElementsForBreakAfter(List returnList,
LayoutContext context) {
int breakAfter = -1;
if (fobj instanceof org.apache.fop.fo.flow.Block) {
@@ -1054,7 +1054,7 @@
|| breakAfter == EN_EVEN_PAGE
|| breakAfter == EN_ODD_PAGE) {
// add a penalty element, representing a forced page break
- returnList.add(new BreakElement(getAuxiliaryPosition(),
+ returnList.add(new BreakElement(getAuxiliaryPosition(),
0, -KnuthElement.INFINITE, breakAfter, context));
return true;
} else {
@@ -1067,21 +1067,21 @@
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceBefore(List returnList/*,
+ protected void addKnuthElementsForSpaceBefore(List returnList/*,
Position returnPosition*/, int alignment) {
SpaceProperty spaceBefore = getSpaceBeforeProperty();
// append elements representing space-before
if (spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceBefore,
- RelSide.BEFORE,
+ RelSide.BEFORE,
true, false, this));
}
/*
if (bpUnit > 0
|| spaceBefore != null
- && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceBefore.getMinimum(this).getLength().getValue(this) == 0
&& spaceBefore.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceBefore != null && !spaceBefore.getSpace().isDiscard()) {
// add elements to prevent the glue to be discarded
@@ -1091,7 +1091,7 @@
}
if (bpUnit > 0) {
returnList.add(new KnuthGlue(0, 0, 0,
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
returnList.add(new KnuthGlue(
@@ -1100,11 +1100,11 @@
- spaceBefore.getOptimum(this).getLength().getValue(this),
spaceBefore.getOptimum(this).getLength().getValue(this)
- spaceBefore.getMinimum(this).getLength().getValue(this),
- BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
+ BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
getAuxiliaryPosition(), true));
// } else {
// returnList.add(new KnuthGlue(
-// spaceBefore.getOptimum().getLength().getValue(this),
+// spaceBefore.getOptimum().getLength().getValue(this),
// 0, 0, BlockLevelLayoutManager.SPACE_BEFORE_ADJUSTMENT,
// returnPosition, true));
}
@@ -1116,28 +1116,28 @@
* @param returnList return list to add the additional elements to
* @param alignment vertical alignment
*/
- protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
+ protected void addKnuthElementsForSpaceAfter(List returnList/*, Position returnPosition*/,
int alignment) {
SpaceProperty spaceAfter = getSpaceAfterProperty();
// append elements representing space-after
if (spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
returnList.add(new SpaceElement(getAuxiliaryPosition(), spaceAfter,
- RelSide.AFTER,
+ RelSide.AFTER,
false, true, this));
}
/*
if (bpUnit > 0
|| spaceAfter != null
- && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
+ && !(spaceAfter.getMinimum(this).getLength().getValue(this) == 0
&& spaceAfter.getMaximum(this).getLength().getValue(this) == 0)) {
if (spaceAfter != null && !spaceAfter.getSpace().isDiscard()) {
returnList.add(new KnuthPenalty(0, KnuthElement.INFINITE,
false, getAuxiliaryPosition(), false));
}
if (bpUnit > 0) {
- returnList.add(new KnuthGlue(0, 0, 0,
+ returnList.add(new KnuthGlue(0, 0, 0,
BlockLevelLayoutManager.SPACE_AFTER_ADJUSTMENT,
getAuxiliaryPosition(), true));
} else { //if (alignment == EN_JUSTIFY) {
@@ -1162,7 +1162,7 @@
}
protected List createUnitElements(List oldList) {
- //log.debug("Start conversion: " + oldList.size()
+ //log.debug("Start conversion: " + oldList.size()
// + " elements, space-before.min=" + layoutProps.spaceBefore.getSpace().min
// + " space-after.min=" + layoutProps.spaceAfter.getSpace().min);
// add elements at the beginning and at the end of oldList
@@ -1192,15 +1192,15 @@
KnuthElement element = (KnuthElement) oldListIterator.next();
if (element.isBox()) {
totalLength.add(new MinOptMax(element.getW()));
- //log.debug("box " + element.getW());
+ //log.debug("box " + element.getW());
} else if (element.isGlue()) {
totalLength.min -= ((KnuthGlue) element).getZ();
totalLength.max += ((KnuthGlue) element).getY();
//leafValue = ((LeafPosition) element.getPosition()).getLeafPos();
- //log.debug("glue " + element.getW() + " + "
+ //log.debug("glue " + element.getW() + " + "
// + ((KnuthGlue) element).getY() + " - " + ((KnuthGlue) element).getZ());
} else {
- //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
+ //log.debug((((KnuthPenalty)element).getP() == KnuthElement.INFINITE
// ? "PENALTY " : "penalty ") + element.getW());
}
}
@@ -1294,12 +1294,12 @@
int uNewShrink = (unitsBeforeBreak.opt - unitsBeforeBreak.min)
- (unsuppressibleUnits.opt - unsuppressibleUnits.min);
- //log.debug("("
- // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
+ //log.debug("("
+ // + unsuppressibleUnits.min + "-" + unsuppressibleUnits.opt + "-"
// + unsuppressibleUnits.max + ") "
- // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
+ // + " -> " + unitsBeforeBreak.min + "-" + unitsBeforeBreak.opt + "-"
// + unitsBeforeBreak.max
- // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
+ // + " + " + unitsAfterBreak.min + "-" + unitsAfterBreak.opt + "-"
// + unitsAfterBreak.max
// + (uLengthChange != 0 ? " [length " + uLengthChange + "] " : "")
// + (uStretchChange != 0 ? " [stretch " + uStretchChange + "] " : "")
@@ -1332,9 +1332,9 @@
// new infinite penalty, glue and box, if necessary
if (uNewStretch - uStretchChange > 0
|| uNewShrink - uShrinkChange > 0) {
- int iStretchUnits = (uNewStretch - uStretchChange > 0
+ int iStretchUnits = (uNewStretch - uStretchChange > 0
? (uNewStretch - uStretchChange) : 0);
- int iShrinkUnits = (uNewShrink - uShrinkChange > 0
+ int iShrinkUnits = (uNewShrink - uShrinkChange > 0
? (uNewShrink - uShrinkChange) : 0);
newList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
mappingPos,
@@ -1381,7 +1381,7 @@
//log.debug(" PENALTY");
//log.debug(" glue 0 " + uStretchChange + " " + uShrinkChange);
//log.debug(" penalty " + uLengthChange + " * unit");
- //log.debug(" glue 0 " + (- uStretchChange) + " "
+ //log.debug(" glue 0 " + (- uStretchChange) + " "
// + (- uShrinkChange));
} else if (oldListIterator.hasNext()) {
// new penalty
@@ -1483,11 +1483,11 @@
StackingIter(Iterator parentIter) {
super(parentIter);
}
-
+
protected LayoutManager getLM(Object nextObj) {
return ((Position) nextObj).getLM();
}
-
+
protected Position getPos(Object nextObj) {
return ((Position) nextObj);
}
@@ -1496,24 +1496,24 @@
protected static class MappingPosition extends Position {
private int iFirstIndex;
private int iLastIndex;
-
+
public MappingPosition(LayoutManager lm, int first, int last) {
super(lm);
iFirstIndex = first;
iLastIndex = last;
}
-
+
public int getFirstIndex() {
return iFirstIndex;
}
-
+
public int getLastIndex() {
return iLastIndex;
}
}
/**
- * "wrap" the Position inside each element moving the elements from
+ * "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
@@ -1521,16 +1521,16 @@
protected void wrapPositionElements(List sourceList, List targetList) {
wrapPositionElements(sourceList, targetList, false);
}
-
+
/**
- * "wrap" the Position inside each element moving the elements from
+ * "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
*/
protected void wrapPositionElements(List sourceList, List targetList, boolean force) {
-
+
ListIterator listIter = sourceList.listIterator();
Object tempElement;
while (listIter.hasNext()) {
@@ -1542,7 +1542,7 @@
force);
} else if (tempElement instanceof List) {
wrapPositionElements(
- (List) tempElement,
+ (List) tempElement,
targetList,
force);
}
@@ -1563,12 +1563,12 @@
targetList.add(el);
}
-
+
/** @return the sum of start-indent and end-indent */
protected int getIPIndents() {
return startIndent + endIndent;
}
-
+
/**
* Returns the IPD of the content area
* @return the IPD of the content area
@@ -1576,7 +1576,7 @@
public int getContentAreaIPD() {
return contentAreaIPD;
}
-
+
/**
* Sets the IPD of the content area
* @param contentAreaIPD the IPD of the content area
@@ -1584,7 +1584,7 @@
protected void setContentAreaIPD(int contentAreaIPD) {
this.contentAreaIPD = contentAreaIPD;
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
@@ -1592,6 +1592,6 @@
public int getContentAreaBPD() {
return -1;
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderElement.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderElement.java Thu Jul 24 02:35:34 2008
@@ -42,7 +42,7 @@
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position, condLength, side, isFirst, isLast, context);
}
-
+
/** {@inheritDoc} */
public void notifyLayoutManager(MinOptMax effectiveLength) {
LayoutManager lm = getOriginatingLayoutManager();
@@ -54,7 +54,7 @@
+ lm.getClass().getName());
}
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer("Border[");
@@ -62,5 +62,5 @@
sb.append("]");
return sb.toString();
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BorderOrPaddingElement.java Thu Jul 24 02:35:34 2008
@@ -41,11 +41,11 @@
RelSide side,
boolean isFirst, boolean isLast, PercentBaseContext context) {
super(position,
- new MinOptMax(condLength.getLength().getValue(context)), side,
+ new MinOptMax(condLength.getLength().getValue(context)), side,
condLength.isDiscard(), isFirst, isLast);
}
-
+
/** {@inheritDoc} */
public abstract void notifyLayoutManager(MinOptMax effectiveLength);
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakElement.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakElement.java Thu Jul 24 02:35:34 2008
@@ -33,7 +33,7 @@
private int breakClass = -1;
private List pendingBeforeMarks;
private List pendingAfterMarks;
-
+
/**
* Main constructor
* @param position the Position instance needed by the addAreas stage of the LMs.
@@ -43,10 +43,10 @@
public BreakElement(Position position, int penaltyValue, LayoutContext context) {
this(position, 0, penaltyValue, -1, context);
}
-
+
/**
* Constructor for hard breaks.
- *
+ *
* @param position the Position instance needed by the addAreas stage of the LMs.
* @param penaltyWidth the penalty width
* @param penaltyValue the penalty value for the penalty element to be constructed
@@ -55,7 +55,7 @@
* {@link Constants#EN_EVEN_PAGE}, {@link Constants#EN_ODD_PAGE})
* @param context the layout context which contains the pending conditional elements
*/
- public BreakElement(Position position, int penaltyWidth, int penaltyValue,
+ public BreakElement(Position position, int penaltyWidth, int penaltyValue,
int breakClass, LayoutContext context) {
super(position);
this.penaltyWidth = penaltyWidth;
@@ -64,7 +64,7 @@
this.pendingBeforeMarks = context.getPendingBeforeMarks();
this.pendingAfterMarks = context.getPendingAfterMarks();
}
-
+
/** {@inheritDoc} */
public boolean isConditional() {
return false; //Does not really apply here
@@ -80,12 +80,12 @@
public int getPenaltyWidth() {
return this.penaltyWidth;
}
-
+
/** @return the penalty value */
public int getPenaltyValue() {
return this.penaltyValue;
}
-
+
/**
* Sets the penalty value.
* @param p the new penalty value
@@ -93,15 +93,15 @@
public void setPenaltyValue(int p) {
this.penaltyValue = p;
}
-
+
/** {@inheritDoc} */
public boolean isForcedBreak() {
return penaltyValue == -KnuthElement.INFINITE;
}
-
+
/**
* Returns the break class of this penalty.
- *
+ *
* @return one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
* {@link Constants#EN_ODD_PAGE}
@@ -109,10 +109,10 @@
public int getBreakClass() {
return breakClass;
}
-
+
/**
* Sets the break class.
- *
+ *
* @param breakClass one of {@link Constants#EN_AUTO}, {@link Constants#EN_COLUMN},
* {@link Constants#EN_PAGE}, {@link Constants#EN_EVEN_PAGE},
* {@link Constants#EN_ODD_PAGE}
@@ -120,17 +120,17 @@
public void setBreakClass(int breakClass) {
this.breakClass = breakClass;
}
-
+
/** @return the pending border and padding elements at the before edge */
public List getPendingBeforeMarks() {
return this.pendingBeforeMarks;
}
-
+
/** @return the pending border and padding elements at the after edge */
public List getPendingAfterMarks() {
return this.pendingAfterMarks;
}
-
+
/**
* Clears all pending marks associated with this break element. This is used in break
* cases where we only know very late if the break is actually after all the content
@@ -140,7 +140,7 @@
this.pendingBeforeMarks = null;
this.pendingAfterMarks = null;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer();
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/BreakingAlgorithm.java Thu Jul 24 02:35:34 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.
@@ -26,24 +26,24 @@
/**
* The set of nodes is sorted into lines indexed into activeLines.
- * The nodes in each line are linked together in a single linked list by the
+ * The nodes in each line are linked together in a single linked list by the
* KnuthNode.next field. The activeLines array contains a link to the head of
* the linked list in index 'line*2' and a link to the tail at index 'line*2+1'.
* <p>
- * The set of active nodes can be traversed by
+ * The set of active nodes can be traversed by
* <pre>
* for (int line = startLine; line < endLine; line++) {
* for (KnuthNode node = getNode(line); node != null; node = node.next) {
* // Do something with 'node'
* }
* }
- * </pre>
+ * </pre>
*/
public abstract class BreakingAlgorithm {
/** the logger for the class */
protected static Log log = LogFactory.getLog(BreakingAlgorithm.class);
-
+
/** Maximum adjustment ration */
protected static final int INFINITE_RATIO = 1000;
@@ -79,7 +79,7 @@
* The paragraph of KnuthElements.
*/
protected KnuthSequence par;
-
+
/**
* The width of a line (or height of a column in page-breaking mode).
* -1 indicates that the line widths are different for each line.
@@ -118,12 +118,12 @@
* line number l corresponds to the number of the line ending at the node's breakpoint.
*/
protected KnuthNode[] activeLines;
-
+
/**
* The number of active nodes.
*/
protected int activeNodeCount;
-
+
/**
* The lowest available line in the set of active nodes.
*/
@@ -218,7 +218,7 @@
/** best node for the preceding breakpoint */
public KnuthNode previous;
- /** next possible node in the same line */
+ /** next possible node in the same line */
public KnuthNode next;
/**
@@ -226,7 +226,7 @@
* into a line.
*/
public int fitRecoveryCounter = 0;
-
+
public KnuthNode(int position, int line, int fitness,
int totalWidth, int totalStretch, int totalShrink,
double adjustRatio, int availableShrink, int availableStretch,
@@ -249,7 +249,7 @@
return "<KnuthNode at " + position + " "
+ totalWidth + "+" + totalStretch + "-" + totalShrink
+ " line:" + line + " prev:" + (previous != null ? previous.position : -1)
- + " dem:" + totalDemerits + ">";
+ + " dem:" + totalDemerits + ">";
}
}
@@ -363,10 +363,10 @@
protected int getMaxRecoveryAttempts() {
return MAX_RECOVERY_ATTEMPTS;
}
-
+
/**
* Controls the behaviour of the algorithm in cases where the first element of a part
- * overflows a line/page.
+ * overflows a line/page.
* @return true if the algorithm should try to send the element to the next line/page.
*/
protected boolean isPartOverflowRecoveryActivated() {
@@ -397,13 +397,13 @@
}
/** @see #findBreakingPoints(KnuthSequence, int, double, boolean, int) */
- public int findBreakingPoints(KnuthSequence par,
- double threshold,
+ public int findBreakingPoints(KnuthSequence par,
+ double threshold,
boolean force,
int allowedBreaks) {
return findBreakingPoints(par, 0, threshold, force, allowedBreaks);
}
-
+
/** Finds an optimal set of breakpoints for the given paragraph.
* @param par the paragraph to break
* @param startIndex index of the Knuth element at which the breaking must start
@@ -425,7 +425,7 @@
// reset lastTooShort and lastTooLong, as they could be not null
// because of previous calls to findBreakingPoints
- lastTooShort = lastTooLong = null;
+ lastTooShort = lastTooLong = null;
// reset startLine and endLine
startLine = endLine = 0;
// current element in the paragraph
@@ -449,7 +449,7 @@
if (log.isTraceEnabled()) {
log.trace("Looping over " + (par.size() - startIndex) + " elements");
}
-
+
KnuthNode lastForced = getNode(0);
// main loop
@@ -478,9 +478,9 @@
// consider all penalties, non-flagged penalties or non-forcing penalties
// according to the value of allowedBreaks
if (((KnuthPenalty) thisElement).getP() < KnuthElement.INFINITE
- && (!(allowedBreaks == NO_FLAGGED_PENALTIES)
+ && (!(allowedBreaks == NO_FLAGGED_PENALTIES)
|| !(((KnuthPenalty) thisElement).isFlagged()))
- && (!(allowedBreaks == ONLY_FORCED_BREAKS)
+ && (!(allowedBreaks == ONLY_FORCED_BREAKS)
|| ((KnuthPenalty) thisElement).getP() == -KnuthElement.INFINITE)) {
considerLegalBreak(thisElement, i);
}
@@ -491,9 +491,9 @@
log.debug("Could not find a set of breaking points " + threshold);
return 0;
}
- // lastDeactivated was a "good" break, while lastTooShort and lastTooLong
+ // lastDeactivated was a "good" break, while lastTooShort and lastTooLong
// were "bad" breaks since the beginning;
- // if it is not the node we just restarted from, lastDeactivated can
+ // if it is not the node we just restarted from, lastDeactivated can
// replace either lastTooShort or lastTooLong
if (lastDeactivated != null && lastDeactivated != lastForced) {
if (lastDeactivated.adjustRatio > 0) {
@@ -519,7 +519,7 @@
lastForced = node;
node.fitRecoveryCounter = lastTooLong.previous.fitRecoveryCounter + 1;
if (log.isDebugEnabled()) {
- log.debug("first part doesn't fit into line, recovering: "
+ log.debug("first part doesn't fit into line, recovering: "
+ node.fitRecoveryCounter);
}
if (node.fitRecoveryCounter > getMaxRecoveryAttempts()) {
@@ -621,7 +621,7 @@
* @param difference difference between target and actual line width
* @param totalDemerits minimum total demerits up to the breakpoint
* @param previous active node for the preceding breakpoint
- */
+ */
protected KnuthNode createNode(int position, int line, int fitness,
int totalWidth, int totalStretch, int totalShrink,
double adjustRatio, int availableShrink, int availableStretch,
@@ -680,8 +680,8 @@
protected void considerLegalBreak(KnuthElement element, int elementIdx) {
if (log.isTraceEnabled()) {
- log.trace("considerLegalBreak() at " + elementIdx
- + " (" + totalWidth + "+" + totalStretch + "-" + totalShrink
+ log.trace("considerLegalBreak() at " + elementIdx
+ + " (" + totalWidth + "+" + totalStretch + "-" + totalShrink
+ "), parts/lines: " + startLine + "-" + endLine);
log.trace("\tCurrent active node list: " + activeNodeCount + " " + this.toString("\t"));
}
@@ -711,17 +711,17 @@
removeNode(line, node);
lastDeactivated = compareNodes(lastDeactivated, node);
}
-
+
// The line is within the available shrink and the threshold.
if (r >= -1 && r <= threshold) {
int fitnessClass = computeFitness(r);
double demerits = computeDemerits(node, element, fitnessClass, r);
-
+
if (log.isTraceEnabled()) {
log.trace("\tDemerits=" + demerits);
log.trace("\tFitness class=" + fitnessClass);
}
-
+
if (demerits < best.getDemerits(fitnessClass)) {
// updates best demerits data
best.addRecord(demerits, node, r, availableShrink, availableStretch,
@@ -729,7 +729,7 @@
lastTooShort = null;
}
}
-
+
// The line is way too short, but we are in forcing mode, so a node is
// calculated and stored in lastValidNode.
if (force && (r <= -1 || r > threshold)) {
@@ -739,7 +739,7 @@
int newStretch = totalStretch;
int newShrink = totalShrink;
- // add the width, stretch and shrink of glue elements after
+ // add the width, stretch and shrink of glue elements after
// the break
// this does not affect the dimension of the line / page, only
// the values stored in the node; these would be as if the break
@@ -772,7 +772,7 @@
if (lastTooShort == null || demerits <= lastTooShort.totalDemerits) {
if (considerTooShort) {
//consider possibilities which are too short
- best.addRecord(demerits, node, r,
+ best.addRecord(demerits, node, r,
availableShrink, availableStretch,
difference, fitnessClass);
}
@@ -805,7 +805,7 @@
int newStretch = totalStretch;
int newShrink = totalShrink;
- // add the width, stretch and shrink of glue elements after
+ // add the width, stretch and shrink of glue elements after
// the break
// this does not affect the dimension of the line / page, only
// the values stored in the node; these would be as if the break
@@ -831,7 +831,7 @@
// the nodes in activeList must be ordered
// by line number and position;
if (log.isTraceEnabled()) {
- log.trace("\tInsert new break in list of " + activeNodeCount
+ log.trace("\tInsert new break in list of " + activeNodeCount
+ " from fitness class " + i);
}
KnuthNode newNode = createNode(elementIdx, line + 1, i,
@@ -849,7 +849,7 @@
* @param activeNode node for the previous breakpoint
* @param element currently considered breakpoint
* @return The difference in width. Positive numbers mean extra space in the line,
- * negative number that the line overflows.
+ * negative number that the line overflows.
*/
protected int computeDifference(KnuthNode activeNode, KnuthElement element,
int elementIndex) {
@@ -862,14 +862,14 @@
}
/**
- * Return the adjust ration needed to make up for the difference. A ration of
+ * Return the adjust ration needed to make up for the difference. A ration of
* <ul>
* <li>0 means that the break has the exact right width</li>
- * <li>>= -1 && < 0 means that the break is wider than the line,
- * but within the minimim values of the glues.</li>
- * <li>>0 && < 1 means that the break is smaller than the line width,
+ * <li>>= -1 && < 0 means that the break is wider than the line,
+ * but within the minimim values of the glues.</li>
+ * <li>>0 && < 1 means that the break is smaller than the line width,
* but within the maximum values of the glues.</li>
- * <li>> 1 means that the break is too small to make up for the glues.</li>
+ * <li>> 1 means that the break is too small to make up for the glues.</li>
* </ul>
* @param activeNode
* @param difference
@@ -895,11 +895,11 @@
return 0;
}
}
-
+
/**
* Figure out the fitness class of this line (tight, loose,
* very tight or very loose).
- * See the section on "More Bells and Whistles" in Knuth's
+ * See the section on "More Bells and Whistles" in Knuth's
* "Breaking Paragraphs Into Lines".
* @param r
* @return the fitness class
@@ -923,11 +923,11 @@
* node and ending at the given element.
* @param activeNode considered preceding line break
* @param element considered current line break
- * @param fitnessClass fitness of the current line
+ * @param fitnessClass fitness of the current line
* @param r adjustment ratio for the current line
* @return the demerit of the current line
*/
- protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
+ protected double computeDemerits(KnuthNode activeNode, KnuthElement element,
int fitnessClass, double r) {
double demerits = 0;
// compute demerits
@@ -942,14 +942,14 @@
} else {
demerits = f * f;
}
-
+
if (element.isPenalty() && ((KnuthPenalty) element).isFlagged()
&& getElement(activeNode.position).isPenalty()
&& ((KnuthPenalty) getElement(activeNode.position)).isFlagged()) {
// add demerit for consecutive breaks at flagged penalties
demerits += repeatedFlaggedDemerit;
// there are at least two consecutive lines ending with a flagged penalty;
- // check if the previous line end with a flagged penalty too,
+ // check if the previous line end with a flagged penalty too,
// and if this situation is allowed
int flaggedPenaltiesCount = 2;
for (KnuthNode prevNode = activeNode.previous;
@@ -1084,18 +1084,18 @@
*/
protected int getLineWidth(int line) {
if (this.lineWidth < 0) {
- throw new IllegalStateException("lineWidth must be set"
+ throw new IllegalStateException("lineWidth must be set"
+ (this.lineWidth != 0 ? " and positive, but it is: " + this.lineWidth : ""));
} else {
return this.lineWidth;
}
}
-
+
/** @return the constant line/part width or -1 if there is no such value */
protected int getLineWidth() {
return this.lineWidth;
}
-
+
/**
* Creates a string representation of the active nodes. Used for debugging.
* @param prepend a string to prepend on each entry
@@ -1130,7 +1130,7 @@
bestActiveNode = bestActiveNode.previous;
}
}
-
+
/** @return the alignment for normal lines/parts */
public int getAlignment() {
return this.alignment;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ConditionalElementListener.java Thu Jul 24 02:35:34 2008
@@ -49,5 +49,5 @@
* (null means zero length)
*/
void notifyPadding(RelSide side, MinOptMax effectiveLength);
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListObserver.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListObserver.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListObserver.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListObserver.java Thu Jul 24 02:35:34 2008
@@ -28,9 +28,9 @@
* Please see the subclass within the test code.
*/
public class ElementListObserver {
-
+
private static List activeObservers = null;
-
+
/**
* Adds a new Observer to the list.
* @param observer the observer implementation
@@ -41,7 +41,7 @@
}
activeObservers.add(observer);
}
-
+
/**
* Removes an Observer from the list. This call simply returns if the observer was not on
* the list and does nothing.
@@ -52,7 +52,7 @@
activeObservers.remove(observer);
}
}
-
+
/**
* Notifies all registered observers about the element list.
* @param elementList the Knuth element list
@@ -70,7 +70,7 @@
}
}
}
-
+
/** @return true if observation is active, i.e. Observers are registered. */
public static boolean isObservationActive() {
return activeObservers != null;
@@ -80,7 +80,7 @@
* Implement this interface to receive notifications on element lists.
*/
public interface Observer {
-
+
/**
* Notifies the observer about the element list.
* @param elementList the Knuth element list
@@ -89,7 +89,7 @@
* @param id ID for the element list (may be null)
*/
void observe(List elementList, String category, String id);
-
+
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ElementListUtils.java Thu Jul 24 02:35:34 2008
@@ -29,14 +29,14 @@
* Utilities for Knuth element lists.
*/
public final class ElementListUtils {
-
+
private ElementListUtils() {
// Utility class.
}
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint.opt space is filled will be removed.
* @param elements the element list
* @param constraint min/opt/max value to restrict the range in which the breaks are removed.
@@ -48,7 +48,7 @@
/**
* Removes legal breaks in an element list. A constraint can be specified to limit the
- * range in which the breaks are removed. Legal breaks occuring before at least
+ * range in which the breaks are removed. Legal breaks occuring before at least
* constraint space is filled will be removed.
* @param elements the element list
* @param constraint value to restrict the range in which the breaks are removed.
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/ExternalDocumentLayoutManager.java Thu Jul 24 02:35:34 2008
@@ -61,8 +61,8 @@
private static Log log = LogFactory.getLog(ExternalDocumentLayoutManager.class);
- private ImageLayout imageLayout;
-
+ private ImageLayout imageLayout;
+
/**
* Constructor
*
@@ -74,7 +74,7 @@
}
/**
- * @return the ExternalDocument being managed by this layout manager
+ * @return the ExternalDocument being managed by this layout manager
*/
protected ExternalDocument getExternalDocument() {
return (ExternalDocument)pageSeq;
@@ -84,24 +84,24 @@
public PageSequenceLayoutManager getPSLM() {
throw new IllegalStateException("getPSLM() is illegal for " + getClass().getName());
}
-
+
/** {@inheritDoc} */
public void activateLayout() {
initialize();
FOUserAgent userAgent = pageSeq.getUserAgent();
ImageManager imageManager = userAgent.getFactory().getImageManager();
-
+
String uri = getExternalDocument().getSrc();
Integer firstPageIndex = ImageUtil.getPageIndexFromURI(uri);
boolean hasPageIndex = (firstPageIndex != null);
-
+
try {
ImageInfo info = imageManager.getImageInfo(uri, userAgent.getImageSessionContext());
-
+
Object moreImages = info.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
boolean hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
Dimension intrinsicSize = info.getSize().getDimensionMpt();
ImageLayout layout = new ImageLayout(getExternalDocument(), this, intrinsicSize);
@@ -111,7 +111,7 @@
}
makePageForImage(info, layout);
-
+
if (!hasPageIndex && hasMoreImages) {
if (log.isTraceEnabled()) {
log.trace("Starting multi-page processing...");
@@ -129,16 +129,16 @@
}
ImageInfo subinfo = imageManager.getImageInfo(
tempURI.toASCIIString(), userAgent.getImageSessionContext());
-
+
moreImages = subinfo.getCustomObjects().get(ImageInfo.HAS_MORE_IMAGES);
hasMoreImages = moreImages != null && !Boolean.FALSE.equals(moreImages);
-
+
intrinsicSize = subinfo.getSize().getDimensionMpt();
layout = new ImageLayout(
getExternalDocument(), this, intrinsicSize);
-
+
makePageForImage(subinfo, layout);
-
+
pageIndex++;
}
} catch (URISyntaxException e) {
@@ -170,15 +170,15 @@
fillPage(info.getOriginalURI());
finishPage();
}
-
+
private void fillPage(String uri) {
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
Block blockArea = new Block();
blockArea.setIPD(imageSize.width);
LineArea lineArea = new LineArea();
-
+
Image imageArea = new Image(uri);
TraitSetter.setProducerID(imageArea, fobj.getId());
transferForeignAttributes(imageArea);
@@ -189,7 +189,7 @@
vp.setBPD(imageSize.height);
vp.setContentPosition(imageLayout.getPlacement());
vp.setOffset(0);
-
+
//Link them all together...
lineArea.addInlineArea(vp);
lineArea.updateExtentsFromChildren();
@@ -197,7 +197,7 @@
curPage.getPageViewport().getCurrentFlow().addBlock(blockArea);
curPage.getPageViewport().getCurrentSpan().notifyFlowsFinished();
}
-
+
/** {@inheritDoc} */
public void finishPageSequence() {
if (pageSeq.hasId()) {
@@ -208,7 +208,7 @@
(currentPageNum - startPageNum) + 1);
areaTreeHandler.notifyPageSequenceFinished(pageSeq,
(currentPageNum - startPageNum) + 1);
-
+
if (log.isDebugEnabled()) {
log.debug("Ending layout");
}
@@ -217,9 +217,9 @@
/** {@inheritDoc} */
protected Page createPage(int pageNumber, boolean isBlank) {
String pageNumberString = pageSeq.makeFormattedPageNumber(pageNumber);
-
+
Dimension imageSize = this.imageLayout.getViewportSize();
-
+
// Set up the CTM on the page reference area based on writing-mode
// and reference-orientation
Rectangle referenceRect;
@@ -231,10 +231,10 @@
FODimension reldims = new FODimension(0, 0);
CTM pageCTM = CTM.getCTMandRelDims(pageSeq.getReferenceOrientation(),
Constants.EN_LR_TB, referenceRect, reldims);
-
+
Page page = new Page(referenceRect, pageNumber, pageNumberString, isBlank);
-
- PageViewport pv = page.getPageViewport();
+
+ PageViewport pv = page.getPageViewport();
org.apache.fop.area.Page pageArea = new org.apache.fop.area.Page();
pv.setPage(pageArea);
@@ -242,8 +242,8 @@
rv.setIPD(referenceRect.width);
rv.setBPD(referenceRect.height);
rv.setClip(true);
-
- BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
+
+ BodyRegion body = new BodyRegion(Constants.FO_REGION_BODY,
"fop-image-region", rv, 1, 0);
body.setIPD(imageSize.width);
body.setBPD(imageSize.height);
@@ -256,7 +256,7 @@
//Also creates first normal flow region
pv.createSpan(false);
-
+
return page;
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FlowLayoutManager.java Thu Jul 24 02:35:34 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.
@@ -46,12 +46,12 @@
* logging instance
*/
private static Log log = LogFactory.getLog(FlowLayoutManager.class);
-
+
/** Array of areas currently being filled stored by area class */
private BlockParent[] currentAreas = new BlockParent[Area.CLASS_MAX];
private int currentSpan = EN_NONE;
-
+
/**
* This is the top level layout manager.
* It is created by the PageSequence FO.
@@ -96,7 +96,7 @@
SpaceResolver.resolveElementList(returnList);
return returnList;
}
-
+
// Set up a LayoutContext
//MinOptMax bpd = context.getStackLimit();
@@ -104,7 +104,7 @@
childLC.setStackLimitBP(context.getStackLimitBP());
childLC.setRefIPD(context.getRefIPD());
childLC.setWritingMode(getCurrentPage().getSimplePageMaster().getWritingMode());
-
+
// get elements from curLM
returnedList = curLM.getNextKnuthElements(childLC, alignment);
//log.debug("FLM.getNextKnuthElements> returnedList.size() = " + returnedList.size());
@@ -148,7 +148,7 @@
//Propagate and clear
context.updateKeepWithNextPending(childLC.getKeepWithNextPending());
childLC.clearKeepWithNextPending();
-
+
context.updateKeepWithNextPending(getKeepWithNextStrength());
}
@@ -201,7 +201,7 @@
public int getKeepTogetherStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -211,7 +211,7 @@
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
/** {@inheritDoc} */
public List getChangedKnuthElements(List oldList, /*int flaggedPenalty,*/ int alignment) {
ListIterator oldListIterator = oldList.listIterator();
@@ -255,7 +255,7 @@
if (prevLM.mustKeepWithNext()
|| currLM.mustKeepWithPrevious()) {
// add an infinite penalty to forbid a break between blocks
- returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
+ returnedList.add(new KnuthPenalty(0, KnuthElement.INFINITE, false,
new Position(this), false));
} else if (!((KnuthElement) returnedList.get(returnedList
.size() - 1)).isGlue()) {
@@ -288,7 +288,7 @@
}
/**
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public void addAreas(PositionIterator parentIter, LayoutContext layoutContext) {
AreaAdditionUtil.addAreas(this, parentIter, layoutContext);
@@ -299,7 +299,7 @@
* Add child area to a the correct container, depending on its
* area class. A Flow can fill at most one area container of any class
* at any one time. The actual work is done by BlockStackingLM.
- *
+ *
* @param childArea the area to add
*/
public void addChildArea(Area childArea) {
@@ -314,7 +314,7 @@
public Area getParentArea(Area childArea) {
BlockParent parentArea = null;
int aclass = childArea.getAreaClass();
-
+
if (aclass == Area.CLASS_NORMAL) {
parentArea = getCurrentPV().getCurrentFlow();
} else if (aclass == Area.CLASS_BEFORE_FLOAT) {
@@ -325,7 +325,7 @@
throw new IllegalStateException("(internal error) Invalid "
+ "area class (" + aclass + ") requested.");
}
-
+
this.currentAreas[aclass] = parentArea;
setCurrentArea(parentArea);
return parentArea;
@@ -338,7 +338,7 @@
public int getContentAreaIPD() {
return getCurrentPV().getCurrentSpan().getColumnWidth();
}
-
+
/**
* Returns the BPD of the content area
* @return the BPD of the content area
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/FootnoteBodyLayoutManager.java Thu Jul 24 02:35:34 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.
@@ -95,7 +95,7 @@
public int getKeepTogetherStrength() {
return getParentKeepTogetherStrength();
}
-
+
/** {@inheritDoc} */
public int getKeepWithNextStrength() {
return KEEP_AUTO;
@@ -105,5 +105,5 @@
public int getKeepWithPreviousStrength() {
return KEEP_AUTO;
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/InlineKnuthSequence.java Thu Jul 24 02:35:34 2008
@@ -35,12 +35,12 @@
private boolean isClosed = false;
/**
- * Creates a new and empty list.
+ * Creates a new and empty list.
*/
public InlineKnuthSequence() {
super();
}
-
+
/**
* Creates a new list from an existing list.
* @param list The list from which to create the new list.
@@ -84,14 +84,14 @@
}
/* (non-Javadoc)
- * {@inheritDoc}
+ * {@inheritDoc}
*/
public boolean appendSequence(KnuthSequence sequence, boolean keepTogether,
BreakElement breakElement) {
return appendSequence(sequence);
}
-
+
/* (non-Javadoc)
* {@inheritDoc}
*/
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KeepUtil.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KeepUtil.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KeepUtil.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KeepUtil.java Thu Jul 24 02:35:34 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.
@@ -46,7 +46,7 @@
return keep.getNumber().intValue();
}
}
-
+
/**
* Returns the combined block-level keep strength from a keep property.
* <p>
@@ -60,7 +60,7 @@
getKeepStrength(keep.getWithinPage()),
getKeepStrength(keep.getWithinColumn()));
}
-
+
/**
* Indicates whether a keep strength indicates a keep constraint.
* @param strength the keep strength
@@ -69,7 +69,7 @@
public static boolean hasKeep(int strength) {
return strength > BlockLevelLayoutManager.KEEP_AUTO;
}
-
+
/**
* Returns the penalty value to be used for a certain keep strength.
* <ul>
@@ -90,7 +90,7 @@
}
return penalty;
}
-
+
/**
* Returns a string representation of a keep strength value.
* @param keepStrength the keep strength
@@ -105,5 +105,5 @@
return Integer.toString(keepStrength);
}
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBlockBox.java Thu Jul 24 02:35:34 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.
@@ -28,7 +28,7 @@
* Knuth box used to represent a line in block-progression-dimension (i.e. the width is its height).
*/
public class KnuthBlockBox extends KnuthBox {
-
+
private MinOptMax ipdRange;
/**
* Natural width of the line represented by this box. In addition to ipdRange because
@@ -58,7 +58,7 @@
* Creates a new box.
* @param w block progression dimension of this box
* @param list footnotes cited by elements in this box. The list contains the
- * corresponding FootnoteBodyLayoutManagers
+ * corresponding FootnoteBodyLayoutManagers
* @param pos the Position stored in this box
* @param bAux is this box auxiliary?
*/
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBox.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBox.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBox.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthBox.java Thu Jul 24 02:35:34 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.
@@ -23,11 +23,11 @@
* An instance of this class represents an unbreakable piece of content with
* fixed width: for example an image, a syllable (but only if letter spacing
* is constant), ...
- *
+ *
* A KnuthBox is never a feasible breaking point.
- *
+ *
* The represented piece of content is never suppressed.
- *
+ *
* Besides the inherited methods and attributes, this class has some more
* attributes to store information about the content height and its vertical
* positioning, and the methods used to get them.
@@ -61,5 +61,5 @@
sb.append(getW());
return sb.toString();
}
-
+
}
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthElement.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthElement.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthElement.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthElement.java Thu Jul 24 02:35:34 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.
@@ -21,7 +21,7 @@
/**
* This is the super class for KnuthBox, KnuthGlue and KnuthPenalty.
- *
+ *
* It stores information common to all sub classes, and the methods to get it:
* the width, a Position and a boolean marking KnuthElements used for some
* special feature (for example, the additional elements used to represent
@@ -59,21 +59,21 @@
return width;
}
- /** @return the penalty value of this element, if applicable. */
+ /** @return the penalty value of this element, if applicable. */
public int getP() {
throw new RuntimeException("Element is not a penalty");
}
- /** @return the stretch value of this element, if applicable. */
+ /** @return the stretch value of this element, if applicable. */
public int getY() {
throw new RuntimeException("Element is not a glue");
}
- /** @return the shrink value of this element, if applicable. */
+ /** @return the shrink value of this element, if applicable. */
public int getZ() {
throw new RuntimeException("Element is not a glue");
}
-
+
/** {@inheritDoc} */
public boolean isUnresolvedElement() {
return false;
Modified: xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthGlue.java
URL: http://svn.apache.org/viewvc/xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthGlue.java?rev=679326&r1=679325&r2=679326&view=diff
==============================================================================
--- xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthGlue.java (original)
+++ xmlgraphics/fop/trunk/src/java/org/apache/fop/layoutmgr/KnuthGlue.java Thu Jul 24 02:35:34 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.
@@ -20,16 +20,16 @@
package org.apache.fop.layoutmgr;
/**
- * An instance of this class represents a piece of content with adjustable
+ * An instance of this class represents a piece of content with adjustable
* width: for example a space between words of justified text.
- *
+ *
* A KnuthGlue is a feasible breaking point only if it immediately follows
* a KnuthBox.
- *
+ *
* The represented piece of content is suppressed if either the KnuthGlue
* is a chosen breaking point or there isn't any KnuthBox between the
* previous breaking point and the KnuthGlue itself.
- *
+ *
* So, an unsuppressible piece of content with adjustable width, for example
* a leader or a word with adjustable letter space, cannot be represented
* by a single KnuthGlue; it can be represented using the sequence:
@@ -39,14 +39,14 @@
* KnuthBox(width = 0)
* where the infinity penalty avoids choosing the KnuthGlue as a breaking point
* and the 0-width KnuthBoxes prevent suppression.
- *
+ *
* Besides the inherited methods and attributes, this class has two attributes
* used to store the stretchability (difference between max and opt width) and
* the shrinkability (difference between opt and min width), and the methods
* to get these values.
*/
public class KnuthGlue extends KnuthElement {
-
+
private int stretchability;
private int shrinkability;
private int adjustmentClass = -1;
@@ -88,12 +88,12 @@
public int getZ() {
return shrinkability;
}
-
+
/** @return the adjustment class (or role) of this glue. */
public int getAdjustmentClass() {
return adjustmentClass;
}
-
+
/** {@inheritDoc} */
public String toString() {
StringBuffer sb = new StringBuffer(64);
@@ -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