2.) Switched from fo.FOTreeControl to apps.Document throughout app, to better clarify that it is the apps.Document object being accessed/used. git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@197716 13f79535-47bb-0310-9956-ffa450edef68tags/Root_Temp_KnuthStylePageBreaking
@@ -28,7 +28,6 @@ import org.apache.fop.area.AreaTree; | |||
import org.apache.fop.area.AreaTreeModel; | |||
import org.apache.fop.fo.FOInputHandler; | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.apache.fop.fonts.FontInfo; | |||
import org.apache.commons.logging.Log; | |||
@@ -40,7 +39,7 @@ import org.xml.sax.SAXException; | |||
* Class storing information for the FOP Document being processed, and managing | |||
* the processing of it. | |||
*/ | |||
public class Document implements FOTreeControl { | |||
public class Document { | |||
/** The parent Driver object */ | |||
private Driver driver; |
@@ -511,7 +511,7 @@ public class Driver { | |||
foInputHandler.setLogger(getLogger()); | |||
treeBuilder.setFOInputHandler(foInputHandler); | |||
treeBuilder.setFOTreeControl(currentDocument); | |||
treeBuilder.setDocument(currentDocument); | |||
return new ProxyContentHandler(treeBuilder) { | |||
@@ -94,8 +94,8 @@ public abstract class FOInputHandler { | |||
} | |||
/** | |||
* Returns the FOTreeControl object associated with this FOInputHandler. | |||
* @return the FOTreeControl object | |||
* Returns the Document object associated with this FOInputHandler. | |||
* @return the Document object | |||
*/ | |||
public Document getDocument() { | |||
return doc; |
@@ -28,9 +28,10 @@ import org.xml.sax.Locator; | |||
import org.apache.commons.logging.Log; | |||
// FOP | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.util.CharUtilities; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.util.CharUtilities; | |||
import org.apache.fop.fo.extensions.ExtensionElementMapping; | |||
import org.apache.fop.fo.extensions.svg.SVGElementMapping; | |||
@@ -59,7 +60,7 @@ public abstract class FONode { | |||
* @return FOUserAgent | |||
*/ | |||
public FOUserAgent getUserAgent() { | |||
return getFOTreeControl().getDriver().getUserAgent(); | |||
return getDocument().getDriver().getUserAgent(); | |||
} | |||
/** | |||
@@ -67,7 +68,7 @@ public abstract class FONode { | |||
* @return the logger | |||
*/ | |||
public Log getLogger() { | |||
return getFOTreeControl().getDriver().getLogger(); | |||
return getDocument().getDriver().getLogger(); | |||
} | |||
/** | |||
@@ -183,8 +184,8 @@ public abstract class FONode { | |||
* which returns the parent Document. | |||
* @return the Document object that is the parent of this node. | |||
*/ | |||
public FOTreeControl getFOTreeControl() { | |||
return parent.getFOTreeControl(); | |||
public Document getDocument() { | |||
return parent.getDocument(); | |||
} | |||
/** |
@@ -31,6 +31,7 @@ import java.util.Set; | |||
import org.apache.commons.logging.Log; | |||
import org.apache.commons.logging.LogFactory; | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.fo.ElementMapping.Maker; | |||
import org.apache.fop.fo.pagination.Root; | |||
@@ -79,8 +80,8 @@ public class FOTreeBuilder extends DefaultHandler { | |||
*/ | |||
private FOInputHandler foInputHandler; | |||
/** The FOTreeControl object managing the FO Tree that is being built */ | |||
private FOTreeControl foTreeControl; | |||
/** The Document object managing the FO Tree that is being built */ | |||
private Document document; | |||
/** The SAX locator object managing the line and column counters */ | |||
private Locator locator; | |||
@@ -93,11 +94,11 @@ public class FOTreeBuilder extends DefaultHandler { | |||
} | |||
/** | |||
* Sets the FO Tree Control for this object | |||
* @param fotc FOTreeControl instance | |||
* Sets the apps.Document for this object | |||
* @param doc Document instance | |||
*/ | |||
public void setFOTreeControl(FOTreeControl fotc) { | |||
this.foTreeControl = fotc; | |||
public void setDocument(Document doc) { | |||
this.document = doc; | |||
} | |||
/** | |||
@@ -253,7 +254,7 @@ public class FOTreeBuilder extends DefaultHandler { | |||
if (rootFObj == null) { | |||
rootFObj = (Root) foNode; | |||
rootFObj.setFOTreeControl(foTreeControl); | |||
rootFObj.setDocument(document); | |||
} else { | |||
currentFObj.addChild(foNode); | |||
} |
@@ -1,62 +0,0 @@ | |||
/* | |||
* Copyright 1999-2004 The Apache Software Foundation. | |||
* | |||
* Licensed under the Apache License, Version 2.0 (the "License"); | |||
* you may not use this file except in compliance with the License. | |||
* You may obtain a copy of the License at | |||
* | |||
* http://www.apache.org/licenses/LICENSE-2.0 | |||
* | |||
* Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | |||
* limitations under the License. | |||
*/ | |||
/* $Id$ */ | |||
package org.apache.fop.fo; | |||
// Java | |||
import java.util.Map; | |||
import java.util.Set; | |||
// FOP | |||
import org.apache.fop.apps.Driver; | |||
import org.apache.fop.fonts.FontMetrics; | |||
import org.apache.fop.fonts.FontInfo; | |||
/** | |||
* An interface for classes that are conceptually the parent class of the | |||
* fo.pagination.Root object. The purpose of the interface is to maintain | |||
* encapsulation of the FO Tree classes, but to acknowledge that a higher-level | |||
* object is needed to control the building of the FO Tree, to provide it | |||
* with information about the environment, and to keep track of meta-type | |||
* information. | |||
*/ | |||
public interface FOTreeControl { | |||
/** | |||
* Returns the set of ID references found in the FO Tree. | |||
* @return the ID references | |||
*/ | |||
Set getIDReferences(); | |||
/** | |||
* @return the FOInputHandler for parsing this FO Tree | |||
*/ | |||
FOInputHandler getFOInputHandler(); | |||
/** | |||
* @return the Driver associated with this FO Tree | |||
*/ | |||
Driver getDriver(); | |||
/** | |||
* @return the FontInfo object associated with this FOTree | |||
*/ | |||
FontInfo getFontInfo(); | |||
} |
@@ -98,7 +98,7 @@ public class FOTreeHandler extends FOInputHandler { | |||
/** | |||
* Main constructor | |||
* @param foTreeControl the FOTreeControl implementation that governs this | |||
* @param document the apps.Document implementation that governs this | |||
* FO Tree | |||
* @param store if true then use the store pages model and keep the | |||
* area tree in memory | |||
@@ -478,7 +478,7 @@ public class FOTreeHandler extends FOInputHandler { | |||
* | |||
* @return the font information | |||
*/ | |||
public FOTreeControl getFontInfo() { | |||
public Document getFontInfo() { | |||
return doc; | |||
} | |||
@@ -298,7 +298,7 @@ public class FObj extends FONode implements Constants { | |||
if (prop != null) { | |||
String str = prop.getString(); | |||
if (str != null && !str.equals("")) { | |||
Set idrefs = getFOTreeControl().getIDReferences(); | |||
Set idrefs = getDocument().getIDReferences(); | |||
if (!idrefs.contains(str)) { | |||
id = str; | |||
idrefs.add(id); |
@@ -46,8 +46,8 @@ public class FObjMixed extends FObj { | |||
if (textInfo == null) { | |||
// Really only need one of these, but need to get fontInfo | |||
// stored in propMgr for later use. | |||
propMgr.setFontInfo(getFOTreeControl()); | |||
textInfo = propMgr.getTextLayoutProps(getFOTreeControl()); | |||
propMgr.setFontInfo(getDocument()); | |||
textInfo = propMgr.getTextLayoutProps(getDocument()); | |||
} | |||
FOText ft = new FOText(data, start, length, textInfo, this); | |||
@@ -55,7 +55,7 @@ public class FObjMixed extends FObj { | |||
ft.setName("text"); | |||
/* characters() processing empty for FOTreeHandler, not empty for RTF & MIFHandlers */ | |||
getFOTreeControl().getFOInputHandler().characters(ft.ca, ft.startIndex, ft.endIndex); | |||
getDocument().getFOInputHandler().characters(ft.ca, ft.startIndex, ft.endIndex); | |||
addChild(ft); | |||
} |
@@ -19,6 +19,7 @@ | |||
package org.apache.fop.fo; | |||
// FOP | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.fonts.Font; | |||
import org.apache.fop.fo.properties.Property; | |||
@@ -44,7 +45,7 @@ import org.xml.sax.Attributes; | |||
public class PropertyManager implements Constants { | |||
private PropertyList propertyList; | |||
private FOTreeControl foTreeControl = null; | |||
private Document document = null; | |||
private Font fontState = null; | |||
private CommonBorderAndPadding borderAndPadding = null; | |||
private CommonHyphenation hyphProps = null; | |||
@@ -72,27 +73,27 @@ public class PropertyManager implements Constants { | |||
/** | |||
* Sets the Document object telling the property manager which fonts are | |||
* available. | |||
* @param foTreeControl foTreeControl implementation containing font | |||
* @param document apps.Document implementation containing font | |||
* information | |||
*/ | |||
public void setFontInfo(FOTreeControl foTreeControl) { | |||
this.foTreeControl = foTreeControl; | |||
public void setFontInfo(Document document) { | |||
this.document = document; | |||
} | |||
/** | |||
* Constructs a FontState object. If it was constructed before it is | |||
* reused. | |||
* @param foTreeControl FOTreeControl implementation containing the font | |||
* @param document apps.Document implementation containing the font | |||
* information | |||
* @return a FontState object | |||
*/ | |||
public Font getFontState(FOTreeControl foTreeControl) { | |||
public Font getFontState(Document document) { | |||
if (fontState == null) { | |||
if (foTreeControl == null) { | |||
foTreeControl = this.foTreeControl; | |||
} else if (this.foTreeControl == null) { | |||
this.foTreeControl = foTreeControl; | |||
if (document == null) { | |||
document = this.document; | |||
} else if (this.document == null) { | |||
this.document = document; | |||
} | |||
/**@todo this is ugly. need to improve. */ | |||
@@ -121,9 +122,9 @@ public class PropertyManager implements Constants { | |||
// various kinds of keywords too | |||
int fontSize = propertyList.get(PR_FONT_SIZE).getLength().getValue(); | |||
//int fontVariant = propertyList.get("font-variant").getEnum(); | |||
String fname = foTreeControl.getFontInfo().fontLookup(fontFamily, fontStyle, | |||
String fname = document.getFontInfo().fontLookup(fontFamily, fontStyle, | |||
fontWeight); | |||
FontMetrics metrics = foTreeControl.getFontInfo().getMetricsFor(fname); | |||
FontMetrics metrics = document.getFontInfo().getMetricsFor(fname); | |||
fontState = new Font(fname, metrics, fontSize); | |||
} | |||
return fontState; | |||
@@ -457,14 +458,14 @@ public class PropertyManager implements Constants { | |||
/** | |||
* Constructs a TextInfo objects. If it was constructed before it is | |||
* reused. | |||
* @param foTreeControl FOTreeControl implementation containing list of | |||
* @param document apps.Document implementation containing list of | |||
* available fonts | |||
* @return a TextInfo object | |||
*/ | |||
public TextInfo getTextLayoutProps(FOTreeControl foTreeControl) { | |||
public TextInfo getTextLayoutProps(Document document) { | |||
if (textInfo == null) { | |||
textInfo = new TextInfo(); | |||
textInfo.fs = getFontState(foTreeControl); | |||
textInfo.fs = getFontState(document); | |||
textInfo.color = propertyList.get(PR_COLOR).getColorType(); | |||
textInfo.verticalAlign = |
@@ -54,7 +54,7 @@ public class BasicLink extends Inline { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startLink(this); | |||
getDocument().getFOInputHandler().startLink(this); | |||
} | |||
public void setup() { | |||
@@ -143,7 +143,7 @@ public class BasicLink extends Inline { | |||
public void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endLink(); | |||
getDocument().getFOInputHandler().endLink(); | |||
} | |||
public String getName() { |
@@ -111,7 +111,7 @@ public class Block extends FObjMixed { | |||
setupID(); | |||
getFOTreeControl().getFOInputHandler().startBlock(this); | |||
getDocument().getFOInputHandler().startBlock(this); | |||
} | |||
private void setup() { | |||
@@ -238,7 +238,7 @@ public class Block extends FObjMixed { | |||
*/ | |||
public void end() { | |||
handleWhiteSpace(); | |||
getFOTreeControl().getFOInputHandler().endBlock(this); | |||
getDocument().getFOInputHandler().endBlock(this); | |||
} | |||
private void handleWhiteSpace() { |
@@ -63,7 +63,7 @@ public class ExternalGraphic extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().image(this); | |||
getDocument().getFOInputHandler().image(this); | |||
} | |||
/** |
@@ -48,7 +48,7 @@ public class Footnote extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startFootnote(this); | |||
getDocument().getFOInputHandler().startFootnote(this); | |||
} | |||
/** | |||
@@ -79,7 +79,7 @@ public class Footnote extends FObj { | |||
protected void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endFootnote(this); | |||
getDocument().getFOInputHandler().endFootnote(this); | |||
} | |||
public String getName() { |
@@ -52,7 +52,7 @@ public class FootnoteBody extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startFootnoteBody(this); | |||
getDocument().getFOInputHandler().startFootnoteBody(this); | |||
} | |||
public void acceptVisitor(FOTreeVisitor fotv) { | |||
@@ -62,7 +62,7 @@ public class FootnoteBody extends FObj { | |||
protected void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endFootnoteBody(this); | |||
getDocument().getFOInputHandler().endFootnoteBody(this); | |||
} | |||
public String getName() { |
@@ -114,7 +114,7 @@ public class Inline extends FObjMixed { | |||
this.lineThrough = true; | |||
} | |||
getFOTreeControl().getFOInputHandler().startInline(this); | |||
getDocument().getFOInputHandler().startInline(this); | |||
} | |||
/** | |||
@@ -139,7 +139,7 @@ public class Inline extends FObjMixed { | |||
* @see org.apache.fop.fo.FONode#end | |||
*/ | |||
public void end() { | |||
getFOTreeControl().getFOInputHandler().endInline(this); | |||
getDocument().getFOInputHandler().endInline(this); | |||
} | |||
public String getName() { |
@@ -66,7 +66,7 @@ public class Leader extends FObjMixed { | |||
CommonBackground bProps = propMgr.getBackgroundProps(); | |||
// Common Font Properties | |||
this.fontState = propMgr.getFontState(getFOTreeControl()); | |||
this.fontState = propMgr.getFontState(getDocument()); | |||
// Common Margin Properties-Inline | |||
CommonMarginInline mProps = propMgr.getMarginInlineProps(); |
@@ -64,7 +64,7 @@ public class ListBlock extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startList(this); | |||
getDocument().getFOInputHandler().startList(this); | |||
} | |||
private void setup() throws FOPException { | |||
@@ -139,7 +139,7 @@ public class ListBlock extends FObj { | |||
protected void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endList(this); | |||
getDocument().getFOInputHandler().endList(this); | |||
} | |||
public String getName() { |
@@ -64,7 +64,7 @@ public class ListItem extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startListItem(this); | |||
getDocument().getFOInputHandler().startListItem(this); | |||
} | |||
private void setup() { | |||
@@ -148,7 +148,7 @@ public class ListItem extends FObj { | |||
protected void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endListItem(this); | |||
getDocument().getFOInputHandler().endListItem(this); | |||
} | |||
public String getName() { |
@@ -46,7 +46,7 @@ public class ListItemLabel extends FObj { | |||
*/ | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
getFOTreeControl().getFOInputHandler().startListLabel(); | |||
getDocument().getFOInputHandler().startListLabel(); | |||
} | |||
private void setup() { | |||
@@ -86,7 +86,7 @@ public class ListItemLabel extends FObj { | |||
protected void end() { | |||
super.end(); | |||
getFOTreeControl().getFOInputHandler().endListLabel(); | |||
getDocument().getFOInputHandler().endListLabel(); | |||
} | |||
public String getName() { |
@@ -61,7 +61,7 @@ public class PageNumber extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
setup(); | |||
getFOTreeControl().getFOInputHandler().startPageNumber(this); | |||
getDocument().getFOInputHandler().startPageNumber(this); | |||
} | |||
public void setup() { | |||
@@ -77,7 +77,7 @@ public class PageNumber extends FObj { | |||
CommonBackground bProps = propMgr.getBackgroundProps(); | |||
// Common Font Properties | |||
this.fontState = propMgr.getFontState(getFOTreeControl()); | |||
this.fontState = propMgr.getFontState(getDocument()); | |||
// Common Margin Properties-Inline | |||
CommonMarginInline mProps = propMgr.getMarginInlineProps(); | |||
@@ -129,7 +129,7 @@ public class PageNumber extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endPageNumber(this); | |||
getDocument().getFOInputHandler().endPageNumber(this); | |||
} | |||
public String getName() { |
@@ -82,7 +82,7 @@ public class PageNumberCitation extends FObj { | |||
CommonBackground bProps = propMgr.getBackgroundProps(); | |||
// Common Font Properties | |||
this.fontState = propMgr.getFontState(getFOTreeControl()); | |||
this.fontState = propMgr.getFontState(getDocument()); | |||
// Common Margin Properties-Inline | |||
CommonMarginInline mProps = propMgr.getMarginInlineProps(); |
@@ -81,7 +81,7 @@ public class Table extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
setupID(); | |||
getFOTreeControl().getFOInputHandler().startTable(this); | |||
getDocument().getFOInputHandler().startTable(this); | |||
} | |||
/** | |||
@@ -203,7 +203,7 @@ public class Table extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endTable(this); | |||
getDocument().getFOInputHandler().endTable(this); | |||
} | |||
public String getName() { |
@@ -57,7 +57,7 @@ public class TableBody extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
setupID(); | |||
getFOTreeControl().getFOInputHandler().startBody(this); | |||
getDocument().getFOInputHandler().startBody(this); | |||
} | |||
private void setup() throws FOPException { | |||
@@ -104,7 +104,7 @@ public class TableBody extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endBody(this); | |||
getDocument().getFOInputHandler().endBody(this); | |||
} | |||
public String getName() { |
@@ -123,7 +123,7 @@ public class TableCell extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
doSetup(); // init some basic property values | |||
getFOTreeControl().getFOInputHandler().startCell(this); | |||
getDocument().getFOInputHandler().startCell(this); | |||
} | |||
/** | |||
@@ -348,7 +348,7 @@ public class TableCell extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endCell(this); | |||
getDocument().getFOInputHandler().endCell(this); | |||
} | |||
public String getName() { |
@@ -60,7 +60,7 @@ public class TableColumn extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
initialize(); // init some basic property values | |||
getFOTreeControl().getFOInputHandler().startColumn(this); | |||
getDocument().getFOInputHandler().startColumn(this); | |||
} | |||
/** | |||
@@ -124,7 +124,7 @@ public class TableColumn extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endColumn(this); | |||
getDocument().getFOInputHandler().endColumn(this); | |||
} | |||
public String getName() { |
@@ -68,7 +68,7 @@ public class TableRow extends FObj { | |||
protected void addProperties(Attributes attlist) throws FOPException { | |||
super.addProperties(attlist); | |||
setupID(); | |||
getFOTreeControl().getFOInputHandler().startRow(this); | |||
getDocument().getFOInputHandler().startRow(this); | |||
} | |||
/** | |||
@@ -145,7 +145,7 @@ public class TableRow extends FObj { | |||
} | |||
protected void end() { | |||
getFOTreeControl().getFOInputHandler().endRow(this); | |||
getDocument().getFOInputHandler().endRow(this); | |||
} | |||
public String getName() { |
@@ -24,6 +24,7 @@ import java.util.Map; | |||
import java.util.Iterator; | |||
// FOP | |||
import org.apache.fop.fo.FOElementMapping; | |||
import org.apache.fop.fo.FONode; | |||
import org.apache.fop.fo.FObj; | |||
import org.apache.fop.fo.FOTreeVisitor; | |||
@@ -50,6 +51,19 @@ public class Declarations extends FObj { | |||
((Root) parent).setDeclarations(this); | |||
} | |||
/** | |||
* @see org.apache.fop.fo.FONode#validateChildNode(String, String) | |||
XSL 1.0: (color-profile)+ (and non-XSL NS nodes) | |||
FOP (currently): (color-profile)* (and non-XSL NS nodes) | |||
*/ | |||
protected void validateChildNode(String nsURI, String localName) { | |||
if (nsURI == FOElementMapping.URI) { | |||
if (!localName.equals("color-profile")) { | |||
invalidChildError(nsURI, localName); | |||
} | |||
} // anything outside of XSL namespace is OK. | |||
} | |||
/** | |||
* At the end of this element sort out the child into | |||
* a hashmap of color profiles and a list of external xml. | |||
@@ -79,7 +93,7 @@ public class Declarations extends FObj { | |||
} | |||
external.add(node); | |||
} else { | |||
getLogger().warn("invalid element " + node.getName() + "inside declarations"); | |||
getLogger().warn("invalid element " + node.getName() + " inside declarations"); | |||
} | |||
} | |||
} |
@@ -92,14 +92,14 @@ public class Flow extends FObj { | |||
// Now done in addChild of page-sequence | |||
//pageSequence.addFlow(this); | |||
getFOTreeControl().getFOInputHandler().startFlow(this); | |||
getDocument().getFOInputHandler().startFlow(this); | |||
} | |||
/** | |||
* Tell the StructureRenderer that we are at the end of the flow. | |||
*/ | |||
public void end() { | |||
getFOTreeControl().getFOInputHandler().endFlow(this); | |||
getDocument().getFOInputHandler().endFlow(this); | |||
} | |||
/** |
@@ -291,7 +291,7 @@ public class PageSequence extends FObj { | |||
*/ | |||
private void startStructuredPageSequence() { | |||
if (!sequenceStarted) { | |||
getFOTreeControl().getFOInputHandler().startPageSequence(this); | |||
getDocument().getFOInputHandler().startPageSequence(this); | |||
sequenceStarted = true; | |||
} | |||
} | |||
@@ -303,7 +303,7 @@ public class PageSequence extends FObj { | |||
*/ | |||
public void end() { | |||
try { | |||
this.getFOTreeControl().getFOInputHandler().endPageSequence(this); | |||
this.getDocument().getFOInputHandler().endPageSequence(this); | |||
} catch (FOPException fopex) { | |||
getLogger().error("Error in PageSequence.end(): " | |||
+ fopex.getMessage(), fopex); |
@@ -22,7 +22,7 @@ package org.apache.fop.fo.pagination; | |||
import java.util.List; | |||
// FOP | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.fo.FONode; | |||
import org.apache.fop.fo.FObj; | |||
import org.apache.fop.fo.FOElementMapping; | |||
@@ -47,7 +47,7 @@ public class Root extends FObj { | |||
*/ | |||
private int runningPageNumberCounter = 0; | |||
private FOTreeControl foTreeControl = null; | |||
private Document document = null; | |||
/** | |||
* @see org.apache.fop.fo.FONode#FONode(FONode) | |||
@@ -197,23 +197,23 @@ public class Root extends FObj { | |||
} | |||
/** | |||
* Sets the FOTreeControl that this Root is attached to | |||
* @param foTreeControl the FOTreeControl implementation to which this Root | |||
* Sets the Document that this Root is attached to | |||
* @param document the apps.Document implementation to which this Root | |||
* is attached | |||
*/ | |||
public void setFOTreeControl(FOTreeControl foTreeControl) { | |||
this.foTreeControl = foTreeControl; | |||
public void setDocument(Document document) { | |||
this.document = document; | |||
} | |||
/** | |||
* This method overrides the FONode version. The FONode version calls the | |||
* method by the same name for the parent object. Since Root is at the top | |||
* of the tree, it returns the actual foTreeControl object. Thus, any FONode | |||
* can use this chain to find which foTreeControl it is being built for. | |||
* @return the FOTreeControl implementation that this Root is attached to | |||
* of the tree, it returns the actual apps.Document object. Thus, any FONode | |||
* can use this chain to find which apps.Document it is being built for. | |||
* @return the Document implementation that this Root is attached to | |||
*/ | |||
public FOTreeControl getFOTreeControl() { | |||
return foTreeControl; | |||
public Document getDocument() { | |||
return document; | |||
} | |||
/** |
@@ -59,7 +59,7 @@ public class Title extends FObjMixed { | |||
CommonBackground bProps = propMgr.getBackgroundProps(); | |||
// Common Font Properties | |||
Font fontState = propMgr.getFontState(getFOTreeControl()); | |||
Font fontState = propMgr.getFontState(getDocument()); | |||
// Common Margin Properties-Inline | |||
CommonMarginInline mProps = propMgr.getMarginInlineProps(); |
@@ -74,7 +74,7 @@ public class BlockLayoutManager extends BlockStackingLayoutManager { | |||
childLMiter = new BlockLMiter(this, childLMiter); | |||
userAgent = inBlock.getUserAgent(); | |||
setBlockTextInfo(inBlock.getPropertyManager().getTextLayoutProps( | |||
inBlock.getFOTreeControl())); | |||
inBlock.getDocument())); | |||
} | |||
private void setBlockTextInfo(TextInfo ti) { |
@@ -46,6 +46,7 @@ import java.util.Map; | |||
import java.util.Vector; | |||
import org.apache.fop.fonts.FontInfo; | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.apps.InputHandler; | |||
import org.apache.fop.area.Area; | |||
@@ -55,7 +56,6 @@ import org.apache.fop.area.RegionViewport; | |||
import org.apache.fop.area.Trait; | |||
import org.apache.fop.area.inline.TextArea; | |||
import org.apache.fop.datatypes.ColorType; | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.apache.fop.image.FopImage; | |||
import org.apache.fop.image.ImageFactory; | |||
import org.apache.fop.render.AbstractRenderer; |
@@ -44,7 +44,6 @@ import org.apache.fop.fonts.Typeface; | |||
import org.apache.fop.fonts.FontInfo; | |||
import org.apache.fop.render.AbstractRenderer; | |||
import org.apache.fop.render.RendererContext; | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.apache.fop.image.FopImage; | |||
import org.apache.fop.image.ImageFactory; | |||
@@ -226,7 +225,7 @@ public class PSRenderer extends AbstractRenderer { | |||
/** | |||
* Set up the font info | |||
* | |||
* @param foTreeControl the font info object to set up | |||
* @param inFontInfo the font info object to set up | |||
*/ | |||
public void setupFontInfo(FontInfo inFontInfo) { | |||
this.fontInfo = inFontInfo; |
@@ -18,6 +18,7 @@ | |||
package org.apache.fop.render.svg; | |||
import org.apache.fop.apps.Document; | |||
import org.apache.fop.apps.FOPException; | |||
import org.apache.fop.area.PageViewport; | |||
import org.apache.fop.area.Title; | |||
@@ -27,7 +28,6 @@ import org.apache.fop.area.inline.TextArea; | |||
import org.apache.fop.svg.SVGUtilities; | |||
import org.apache.fop.fonts.FontInfo; | |||
import org.apache.fop.apps.FOUserAgent; | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.w3c.dom.Node; | |||
import org.w3c.dom.svg.SVGSVGElement; | |||
@@ -132,7 +132,7 @@ public class SVGRenderer extends AbstractRenderer implements XMLHandler { | |||
} | |||
/** | |||
* @see org.apache.fop.render.Renderer#setupFontInfo(FOTreeControl) | |||
* @see org.apache.fop.render.Renderer#setupFontInfo(FontInfo) | |||
*/ | |||
public void setupFontInfo(FontInfo fontInfo) { | |||
// create a temp Image to test font metrics on |
@@ -59,7 +59,6 @@ import org.apache.fop.area.inline.Viewport; | |||
import org.apache.fop.area.inline.TextArea; | |||
import org.apache.fop.fonts.FontSetup; | |||
import org.apache.fop.fonts.FontInfo; | |||
import org.apache.fop.fo.FOTreeControl; | |||
import org.apache.fop.fo.pagination.Region; | |||
/** |