diff options
author | Finn Bock <bckfnn@apache.org> | 2004-10-19 08:53:51 +0000 |
---|---|---|
committer | Finn Bock <bckfnn@apache.org> | 2004-10-19 08:53:51 +0000 |
commit | b0839fa1f93f128c6dd271930209e59228bb0472 (patch) | |
tree | f3ed77c6f9d3f58314beb64e7557eaf117f2d6aa /src/java/org/apache/fop/fo/flow/BasicLink.java | |
parent | 85506764aad78e6aa4b675838aaed1f6fd23883a (diff) | |
download | xmlgraphics-fop-b0839fa1f93f128c6dd271930209e59228bb0472.tar.gz xmlgraphics-fop-b0839fa1f93f128c6dd271930209e59228bb0472.zip |
First phase of performance improvement. Added bind() and startOfNode()
methods to the FO nodes, unused for now.
PR: 31699
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@198054 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/fo/flow/BasicLink.java')
-rw-r--r-- | src/java/org/apache/fop/fo/flow/BasicLink.java | 75 |
1 files changed, 67 insertions, 8 deletions
diff --git a/src/java/org/apache/fop/fo/flow/BasicLink.java b/src/java/org/apache/fop/fo/flow/BasicLink.java index 101d0ccfa..3b9424b99 100644 --- a/src/java/org/apache/fop/fo/flow/BasicLink.java +++ b/src/java/org/apache/fop/fo/flow/BasicLink.java @@ -28,6 +28,7 @@ import org.xml.sax.SAXParseException; // FOP import org.apache.fop.fo.FONode; +import org.apache.fop.fo.PropertyList; import org.apache.fop.layoutmgr.BasicLinkLayoutManager; /** @@ -38,6 +39,17 @@ import org.apache.fop.layoutmgr.BasicLinkLayoutManager; * reference). */ public class BasicLink extends Inline { + // The value of properties relevant for fo:basic-link. + // private ToBeImplementedProperty destinationPlacementOffset; + // private ToBeImplementedProperty dominantBaseline; + private String externalDestination; + // private ToBeImplementedProperty indicateDestination; + private String internalDestination; + // private ToBeImplementedProperty showDestination; + // private ToBeImplementedProperty targetProcessingContext; + // private ToBeImplementedProperty targetPresentationContext; + // private ToBeImplementedProperty targetStylesheet; + // End of property values // link represented by this FO private String link = null; @@ -56,6 +68,47 @@ public class BasicLink extends Inline { } /** + * @see org.apache.fop.fo.FObj#bind(PropertyList) + */ + public void bind(PropertyList pList) throws SAXParseException { + super.bind(pList); + // destinationPlacementOffset = pList.get(PR_DESTINATION_PLACEMENT_OFFSET); + // dominantBaseline = pList.get(PR_DOMINANT_BASELINE); + externalDestination = pList.get(PR_EXTERNAL_DESTINATION).getString(); + // indicateDestination = pList.get(PR_INDICATE_DESTINATION); + internalDestination = pList.get(PR_INTERNAL_DESTINATION).getString(); + // showDestination = pList.get(PR_SHOW_DESTINATION); + // targetProcessingContext = pList.get(PR_TARGET_PROCESSING_CONTEXT); + // targetPresentationContext = pList.get(PR_TARGET_PRESENTATION_CONTEXT); + // targetStylesheet = pList.get(PR_TARGET_STYLESHEET); + + // per spec, internal takes precedence if both specified + if (internalDestination.length() > 0) { + externalDestination = null; + } else if (externalDestination.length() == 0) { + // slightly stronger than spec "should be specified" + attributeError("Missing attribute: Either external-destination or " + + "internal-destination must be specified."); + } + } + + /** + * @see org.apache.fop.fo.FONode#startOfNode + */ + protected void startOfNode() throws SAXParseException { + super.startOfNode(); + getFOEventHandler().startLink(this); + } + + /** + * @see org.apache.fop.fo.FONode#endOfNode + */ + protected void endOfNode() throws SAXParseException { + super.endOfNode(); + getFOEventHandler().endLink(); + } + + /** * @see org.apache.fop.fo.FObj#addProperties */ protected void addProperties(Attributes attlist) throws SAXParseException { @@ -98,14 +151,6 @@ public class BasicLink extends Inline { } /** - * @see org.apache.fop.fo.FONode#endOfNode - */ - protected void endOfNode() throws SAXParseException { - super.endOfNode(); - getFOEventHandler().endLink(); - } - - /** * @see org.apache.fop.fo.FONode#addLayoutManager(List) */ public void addLayoutManager(List list) { @@ -128,6 +173,20 @@ public class BasicLink extends Inline { } /** + * Return the "internal-destination" property. + */ + public String getInternalDestination() { + return internalDestination; + } + + /** + * Return the "external-destination" property. + */ + public String getExternalDestination() { + return externalDestination; + } + + /** * @see org.apache.fop.fo.FObj#getName() */ public String getName() { |