* and destroy the AdjustingInfo object if there are
* no UnresolvedAreas left
*/
- public void finalise() {
+ public void finish() {
if (adjustingInfo.lineAlignment == Constants.EN_JUSTIFY) {
+ if (log.isTraceEnabled()) {
+ log.trace("Applying variation factor to justified line: " + adjustingInfo);
+ }
// justified line: apply the variation factor
boolean bUnresolvedAreasPresent = false;
// recursively apply variation factor to descendant areas
package org.apache.fop.area.inline;
- import org.apache.fop.area.Area;
-
- import java.util.ArrayList;
- import java.util.Iterator;
import java.util.List;
++import java.util.Iterator;
+
+ import org.apache.fop.area.Area;
/**
* Inline parent area.
public boolean applyVariationFactor(double variationFactor,
int lineStretch, int lineShrink) {
boolean bUnresolvedAreasPresent = false;
+ int cumulativeIPD = 0;
// recursively apply variation factor to descendant areas
for (int i = 0, len = inlines.size(); i < len; i++) {
- bUnresolvedAreasPresent |= ((InlineArea)inlines.get(i))
- .applyVariationFactor(variationFactor, lineStretch, lineShrink);
+ InlineArea inline = inlines.get(i);
+ bUnresolvedAreasPresent |= inline.applyVariationFactor(
+ variationFactor, lineStretch, lineShrink);
+ cumulativeIPD += inline.getIPD(); //Update this area's IPD based on changes to children
}
+ setIPD(cumulativeIPD);
+
return bUnresolvedAreasPresent;
}
-}
+ /**
+ * Reset bidirectionality level of all children to default (-1),
+ * signalling that they will inherit the level of their parent text area.
+ */
+ public void resetChildrenLevel() {
+ for ( Iterator it = inlines.iterator(); it.hasNext();) {
+ ( (InlineArea) it.next() ) .resetBidiLevel();
+ }
+ }
+ private void updateLevel ( int newLevel ) {
+ if ( newLevel >= 0 ) {
+ int curLevel = getBidiLevel();
+ if ( curLevel >= 0 ) {
+ if ( newLevel < curLevel ) {
+ setBidiLevel ( newLevel );
+ }
+ } else {
+ setBidiLevel ( newLevel );
+ }
+ }
+ }
+
+
+}