From c04a030afcf5ab0fcae24ba2fc8754ce5775c13d Mon Sep 17 00:00:00 2001 From: Vincent Hennebert Date: Tue, 16 Nov 2010 12:25:06 +0000 Subject: [PATCH] Re-ordered class members git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1035611 13f79535-47bb-0310-9956-ffa450edef68 --- .../layoutmgr/inline/LineLayoutManager.java | 63 +++++++++---------- 1 file changed, 31 insertions(+), 32 deletions(-) diff --git a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java index 964a4e2a5..3a03257f8 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java @@ -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) { -- 2.39.5