diff options
author | Vincent Hennebert <vhennebert@apache.org> | 2010-11-16 12:25:06 +0000 |
---|---|---|
committer | Vincent Hennebert <vhennebert@apache.org> | 2010-11-16 12:25:06 +0000 |
commit | c04a030afcf5ab0fcae24ba2fc8754ce5775c13d (patch) | |
tree | a64797eef6ed1b7f4dcb7963f24704ca21b93fb3 | |
parent | 338ae70df433a47a824126d39ac1fc1b24b2189e (diff) | |
download | xmlgraphics-fop-c04a030afcf5ab0fcae24ba2fc8754ce5775c13d.tar.gz xmlgraphics-fop-c04a030afcf5ab0fcae24ba2fc8754ce5775c13d.zip |
Re-ordered class members
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@1035611 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/LineLayoutManager.java | 63 |
1 files 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 @@ -82,6 +82,14 @@ 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 */ private static Log log = LogFactory.getLog(LineLayoutManager.class); @@ -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 @@ -183,15 +168,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 * returned by each LM. @@ -558,6 +534,29 @@ public class LineLayoutManager extends InlineStackingLayoutManager } /** {@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) { FontInfo fi = fobj.getFOEventHandler().getFontInfo(); |