diff options
author | Glen Mazza <gmazza@apache.org> | 2003-10-28 04:22:14 +0000 |
---|---|---|
committer | Glen Mazza <gmazza@apache.org> | 2003-10-28 04:22:14 +0000 |
commit | 153b66c5d6b402f88f10101614c73b2fe188618d (patch) | |
tree | 92242a16295065a0ad5b596bc894759dd95bc8c9 /src/java/org/apache/fop/layoutmgr | |
parent | a25886fa6eb7c702e71c46e2921e57c449344ee2 (diff) | |
download | xmlgraphics-fop-153b66c5d6b402f88f10101614c73b2fe188618d.tar.gz xmlgraphics-fop-153b66c5d6b402f88f10101614c73b2fe188618d.zip |
renamed org.apache.fop.area.inline.Word to .TextArea (.Text not used to avoid
conflicts with org.w3c.dom.Text)
changed Renderer.renderWord() method to renderText().
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196973 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/AddLMVisitor.java | 24 | ||||
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/TextLayoutManager.java | 16 |
2 files changed, 20 insertions, 20 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java index c0908b4a4..652589172 100644 --- a/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java +++ b/src/java/org/apache/fop/layoutmgr/AddLMVisitor.java @@ -71,7 +71,7 @@ import org.apache.fop.area.inline.InlineParent; import org.apache.fop.area.inline.Space; import org.apache.fop.area.inline.UnresolvedPageNumber; import org.apache.fop.area.inline.Viewport; -import org.apache.fop.area.inline.Word; +import org.apache.fop.area.inline.TextArea; import org.apache.fop.datatypes.Length; import org.apache.fop.fo.FONode; import org.apache.fop.fo.FOText; @@ -378,15 +378,15 @@ public class AddLMVisitor implements FOTreeVisitor { } else if (node.getLeaderPattern() == LeaderPattern.SPACE) { leaderArea = new Space(); } else if (node.getLeaderPattern() == LeaderPattern.DOTS) { - Word w = new Word(); + TextArea t = new TextArea(); char dot = '.'; // userAgent.getLeaderDotCharacter(); - w.setWord("" + dot); - w.addTrait(Trait.FONT_NAME, node.getFontState().getFontName()); - w.addTrait(Trait.FONT_SIZE, + t.setTextArea("" + dot); + t.addTrait(Trait.FONT_NAME, node.getFontState().getFontName()); + t.addTrait(Trait.FONT_SIZE, new Integer(node.getFontState().getFontSize())); // set offset of dot within inline parent - w.setOffset(node.getFontState().getAscender()); + t.setOffset(node.getFontState().getAscender()); int width = node.getFontState().getCharWidth(dot); Space spacer = null; if (node.getPatternWidth() > width) { @@ -396,7 +396,7 @@ public class AddLMVisitor implements FOTreeVisitor { } FilledArea fa = new FilledArea(); fa.setUnitWidth(width); - fa.addChild(w); + fa.addChild(t); if (spacer != null) { fa.addChild(spacer); } @@ -738,14 +738,14 @@ public class AddLMVisitor implements FOTreeVisitor { lm = new LeafNodeLayoutManager() { public InlineArea get(LayoutContext context) { // get page string from parent, build area - Word inline = new Word(); + TextArea inline = new TextArea(); String str = parentLM.getCurrentPageNumber(); int width = 0; for (int count = 0; count < str.length(); count++) { width += node.getFontState().getCharWidth( str.charAt(count)); } - inline.setWord(str); + inline.setTextArea(str); inline.setIPD(width); inline.setHeight(node.getFontState().getAscender() - node.getFontState().getDescender()); @@ -808,10 +808,10 @@ public class AddLMVisitor implements FOTreeVisitor { if (page != null) { String str = page.getPageNumber(); // get page string from parent, build area - Word word = new Word(); - inline = word; + TextArea text = new TextArea(); + inline = text; int width = node.getStringWidth(str); - word.setWord(str); + text.setTextArea(str); inline.setIPD(width); inline.setHeight(node.getFontState().getAscender() - node.getFontState().getDescender()); diff --git a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java index 46a72f224..d10be582f 100644 --- a/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java @@ -56,7 +56,7 @@ import org.apache.fop.fo.TextInfo; import org.apache.fop.traits.SpaceVal; import org.apache.fop.area.Trait; import org.apache.fop.area.inline.InlineArea; -import org.apache.fop.area.inline.Word; +import org.apache.fop.area.inline.TextArea; import org.apache.fop.area.inline.Space; import org.apache.fop.util.CharUtilities; import org.apache.fop.traits.MinOptMax; @@ -68,7 +68,7 @@ import org.apache.fop.traits.MinOptMax; public class TextLayoutManager extends AbstractLayoutManager { /** - * Store information about each potential word area. + * Store information about each potential text area. * Index of character which ends the area, IPD of area, including * any word-space and letter-space. * Number of word-spaces? @@ -523,15 +523,15 @@ public class TextLayoutManager extends AbstractLayoutManager { word = new Space(); word.setWidth(ai.ipdArea.opt + iAdjust); } else { - Word w = createWord( + TextArea t = createText( str, ai.ipdArea.opt + iAdjust, context.getBaseline()); if (iWScount > 0) { //getLogger().error("Adjustment per word-space= " + // iAdjust / iWScount); - w.setWSadjust(iAdjust / iWScount); + t.setTSadjust(iAdjust / iWScount); } - word = w; + word = t; } if ((chars[iStart] == SPACE || chars[iStart] == NBSPACE) && context.getLeadingSpace().hasSpaces()) { @@ -567,15 +567,15 @@ public class TextLayoutManager extends AbstractLayoutManager { * @param base the baseline position * @return the new word area */ - protected Word createWord(String str, int width, int base) { - Word curWordArea = new Word(); + protected TextArea createText(String str, int width, int base) { + TextArea curWordArea = new TextArea(); curWordArea.setWidth(width); curWordArea.setHeight(textInfo.fs.getAscender() - textInfo.fs.getDescender()); curWordArea.setOffset(textInfo.fs.getAscender()); curWordArea.setOffset(base); - curWordArea.setWord(str); + curWordArea.setTextArea(str); curWordArea.addTrait(Trait.FONT_NAME, textInfo.fs.getFontName()); curWordArea.addTrait(Trait.FONT_SIZE, new Integer(textInfo.fs.getFontSize())); |