private LineAdjustingInfo adjustingInfo = null;
- //private int stacking = LR;
- // contains inline areas
- // has start indent and length, dominant baseline, height
- private int startIndent;
-
- // this is the offset for the dominant baseline
- //private int baseLine;
-
// this class can contain the dominant char styling info
// this means that many renderers can optimise a bit
return inlineAreas;
}
- /**
- * Set the start indent of this line area.
- * The start indent is used for offsetting the start of
- * the inline areas for alignment or other indents.
- *
- * @param si the start indent value
- */
- public void setStartIndent(int si) {
- startIndent = si;
- }
-
/**
* Get the start indent of this line area.
* The start indent is used for offsetting the start of
* @return the start indent value
*/
public int getStartIndent() {
- return startIndent;
+ if (hasTrait(Trait.START_INDENT)) {
+ return getTraitAsInteger(Trait.START_INDENT);
+ } else {
+ return 0;
+ }
}
/**
break;
case Constants.EN_CENTER:
// re-compute indent
- startIndent -= ipdVariation / 2;
+ addTrait(Trait.START_INDENT, new Integer(getStartIndent() - ipdVariation / 2));
break;
case Constants.EN_END:
// re-compute indent
- startIndent -= ipdVariation;
+ addTrait(Trait.START_INDENT, new Integer(getStartIndent() - ipdVariation));
break;
case Constants.EN_JUSTIFY:
// compute variation factor
* limitations under the License.
*/
-/* $Id: LineLayoutManager.java,v 1.17 2004/04/02 10:38:29 cbowditch Exp $ */
+/* $Id$ */
package org.apache.fop.layoutmgr.inline;
= new LineArea((lbp.getLeafPos() < seq.size() - 1
? textAlignment : textAlignmentLast),
lbp.difference, lbp.availableStretch, lbp.availableShrink);
- lineArea.setStartIndent(lbp.startIndent);
+ lineArea.addTrait(Trait.START_INDENT, new Integer(lbp.startIndent));
lineArea.setBPD(lbp.lineHeight);
lineArea.setIPD(lbp.lineWidth);
lineArea.addTrait(Trait.SPACE_BEFORE, new Integer(lbp.spaceBefore));
// re-compute indent
int updatedIndent = lbp.startIndent
+ (context.getStackLimit().opt - lbp.lineWidth) / 2;
- lineArea.setStartIndent(updatedIndent);
+ lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
} else if (false && textAlignment == EN_END) {
// re-compute indent
int updatedIndent = lbp.startIndent
+ (context.getStackLimit().opt - lbp.lineWidth);
- lineArea.setStartIndent(updatedIndent);
+ lineArea.addTrait(Trait.START_INDENT, new Integer(updatedIndent));
}
setCurrentArea(lineArea);