diff options
author | William Victor Mote <vmote@apache.org> | 2003-08-19 05:19:21 +0000 |
---|---|---|
committer | William Victor Mote <vmote@apache.org> | 2003-08-19 05:19:21 +0000 |
commit | f57272a7c47e82a4ba3131c2d7a730c9529ff272 (patch) | |
tree | 6b5de48ee08cdd8d8b011a690336605fef7745d4 /src/java/org/apache/fop/fo/PropertyManager.java | |
parent | eeaa58076beb48b96bfc0e98ae80a0d4e2ddbc03 (diff) | |
download | xmlgraphics-fop-f57272a7c47e82a4ba3131c2d7a730c9529ff272.tar.gz xmlgraphics-fop-f57272a7c47e82a4ba3131c2d7a730c9529ff272.zip |
create fo/FOTreeControl interface, and make control/Document implement it, to further encapsulate the FO Tree
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@196811 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/PropertyManager.java')
-rw-r--r-- | src/java/org/apache/fop/fo/PropertyManager.java | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/java/org/apache/fop/fo/PropertyManager.java b/src/java/org/apache/fop/fo/PropertyManager.java index 42cc30876..ac0099a58 100644 --- a/src/java/org/apache/fop/fo/PropertyManager.java +++ b/src/java/org/apache/fop/fo/PropertyManager.java @@ -58,7 +58,7 @@ import java.awt.geom.Rectangle2D; import org.apache.fop.area.CTM; import org.apache.fop.datatypes.FODimension; import org.apache.fop.fonts.Font; -import org.apache.fop.control.Document; +import org.apache.fop.fo.FOTreeControl; import org.apache.fop.fo.properties.CommonBorderAndPadding; import org.apache.fop.fo.properties.CommonMarginBlock; import org.apache.fop.fo.properties.CommonMarginInline; @@ -83,7 +83,7 @@ import org.apache.fop.fo.properties.CommonHyphenation; public class PropertyManager { private PropertyList properties; - private Document doc = null; + private FOTreeControl foTreeControl = null; private Font fontState = null; private CommonBorderAndPadding borderAndPadding = null; private CommonHyphenation hyphProps = null; @@ -122,8 +122,8 @@ public class PropertyManager { * available. * @param doc Document containing font information */ - public void setFontInfo(Document doc) { - this.doc = doc; + public void setFontInfo(FOTreeControl foTreeControl) { + this.foTreeControl = foTreeControl; } @@ -133,12 +133,12 @@ public class PropertyManager { * @param doc Document containing the font information * @return a FontState object */ - public Font getFontState(Document doc) { + public Font getFontState(FOTreeControl foTreeControl) { if (fontState == null) { - if (doc == null) { - doc = this.doc; - } else if (this.doc == null) { - this.doc = doc; + if (foTreeControl == null) { + foTreeControl = this.foTreeControl; + } else if (this.foTreeControl == null) { + this.foTreeControl = foTreeControl; } /**@todo this is ugly. need to improve. */ @@ -167,9 +167,9 @@ public class PropertyManager { // various kinds of keywords too int fontSize = properties.get("font-size").getLength().getValue(); //int fontVariant = properties.get("font-variant").getEnum(); - String fname = doc.fontLookup(fontFamily, fontStyle, + String fname = foTreeControl.fontLookup(fontFamily, fontStyle, fontWeight); - FontMetrics metrics = doc.getMetricsFor(fname); + FontMetrics metrics = foTreeControl.getMetricsFor(fname); fontState = new Font(fname, metrics, fontSize); } return fontState; @@ -479,10 +479,10 @@ public class PropertyManager { * @param doc Document containing list of available fonts * @return a TextInfo object */ - public TextInfo getTextLayoutProps(Document doc) { + public TextInfo getTextLayoutProps(FOTreeControl foTreeControl) { if (textInfo == null) { textInfo = new TextInfo(); - textInfo.fs = getFontState(doc); + textInfo.fs = getFontState(foTreeControl); textInfo.color = properties.get("color").getColorType(); textInfo.verticalAlign = |