Browse Source

Re-ordered class members


git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1035611 13f79535-47bb-0310-9956-ffa450edef68
tags/fop-1_1rc1old
Vincent Hennebert 13 years ago
parent
commit
c04a030afc
1 changed files with 31 additions and 32 deletions
  1. 31
    32
      src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java

+ 31
- 32
src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java View File

@@ -81,6 +81,14 @@ import org.apache.fop.traits.MinOptMax;
public class LineLayoutManager extends InlineStackingLayoutManager
implements BlockLevelLayoutManager {

/**
* this constant is used to create elements when text-align is center:
* every TextLM descendant of LineLM must use the same value,
* otherwise the line breaking algorithm does not find the right
* break point
*/
public static final int DEFAULT_SPACE_WIDTH = 3336;

/**
* logging instance
*/
@@ -89,29 +97,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager
private Block fobj;
private boolean isFirstInBlock;

/** {@inheritDoc} */
public void initialize() {
textAlignment = fobj.getTextAlign();
textAlignmentLast = fobj.getTextAlignLast();
textIndent = fobj.getTextIndent();
lastLineEndIndent = fobj.getLastLineEndIndent();
hyphenationProperties = fobj.getCommonHyphenation();
hyphenationLadderCount = fobj.getHyphenationLadderCount();
wrapOption = fobj.getWrapOption();
whiteSpaceTreament = fobj.getWhitespaceTreatment();
//
effectiveAlignment = getEffectiveAlignment(textAlignment, textAlignmentLast);
isFirstInBlock = (this == getParent().getChildLMs().get(0));
}

private int getEffectiveAlignment(int alignment, int alignmentLast) {
if (textAlignment != EN_JUSTIFY && textAlignmentLast == EN_JUSTIFY) {
return 0;
} else {
return textAlignment;
}
}

/**
* Private class to store information about inline breaks.
* Each value holds the start and end indexes into a List of
@@ -182,15 +167,6 @@ public class LineLayoutManager extends InlineStackingLayoutManager
*/
private boolean hyphenationPerformed;

/**
* this constant is used to create elements when text-align is center:
* every TextLM descendant of LineLM must use the same value,
* otherwise the line breaking algorithm does not find the right
* break point
*/
public static final int DEFAULT_SPACE_WIDTH = 3336;


/**
* This class is used to remember
* which was the first element in the paragraph
@@ -557,6 +533,29 @@ public class LineLayoutManager extends InlineStackingLayoutManager
follow = f;
}

/** {@inheritDoc} */
public void initialize() {
textAlignment = fobj.getTextAlign();
textAlignmentLast = fobj.getTextAlignLast();
textIndent = fobj.getTextIndent();
lastLineEndIndent = fobj.getLastLineEndIndent();
hyphenationProperties = fobj.getCommonHyphenation();
hyphenationLadderCount = fobj.getHyphenationLadderCount();
wrapOption = fobj.getWrapOption();
whiteSpaceTreament = fobj.getWhitespaceTreatment();
//
effectiveAlignment = getEffectiveAlignment(textAlignment, textAlignmentLast);
isFirstInBlock = (this == getParent().getChildLMs().get(0));
}

private int getEffectiveAlignment(int alignment, int alignmentLast) {
if (textAlignment != EN_JUSTIFY && textAlignmentLast == EN_JUSTIFY) {
return 0;
} else {
return textAlignment;
}
}

/** {@inheritDoc} */
public List getNextKnuthElements(LayoutContext context, int alignment) {
if (alignmentContext == null) {

Loading…
Cancel
Save