diff options
author | Adrian Cumiskey <acumiskey@apache.org> | 2008-04-25 13:12:30 +0000 |
---|---|---|
committer | Adrian Cumiskey <acumiskey@apache.org> | 2008-04-25 13:12:30 +0000 |
commit | 7a70e99012aece4d8c53121d11b454b43e432994 (patch) | |
tree | ac6599271ede68ae0848815176fc1b949c6c84f8 /src/java/org/apache/fop/layoutmgr | |
parent | 25a8131ea662070fddd811a77c9de352dea3b050 (diff) | |
download | xmlgraphics-fop-7a70e99012aece4d8c53121d11b454b43e432994.tar.gz xmlgraphics-fop-7a70e99012aece4d8c53121d11b454b43e432994.zip |
Merged revisions 651575 via svnmerge from
https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk
........
r651575 | adelmelle | 2008-04-25 12:27:19 +0100 (Fri, 25 Apr 2008) | 3 lines
Bugzilla 44634: Added partial implementation for show-destination.
Only works for PDF output, when the PDF is opened in a standalone viewer, and for links that point to destinations in another PDF document.
........
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/branches/Temp_AFPGOCAResources@651599 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/java/org/apache/fop/layoutmgr')
-rw-r--r-- | src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java | 14 | ||||
-rwxr-xr-x | src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java | 11 |
2 files changed, 13 insertions, 12 deletions
diff --git a/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java index e7339034c..b8979e187 100644 --- a/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/BasicLinkLayoutManager.java @@ -21,7 +21,7 @@ package org.apache.fop.layoutmgr.inline; import org.apache.fop.datatypes.URISpecification; import org.apache.fop.fo.flow.BasicLink; -import org.apache.fop.layoutmgr.LayoutManager; +import org.apache.fop.fo.Constants; import org.apache.fop.layoutmgr.PageSequenceLayoutManager; import org.apache.fop.area.inline.InlineArea; import org.apache.fop.area.Trait; @@ -31,7 +31,6 @@ import org.apache.fop.area.LinkResolver; * LayoutManager for the fo:basic-link formatting object */ public class BasicLinkLayoutManager extends InlineLayoutManager { - private BasicLink fobj; /** * Create an fo:basic-link layout manager. @@ -40,23 +39,22 @@ public class BasicLinkLayoutManager extends InlineLayoutManager { */ public BasicLinkLayoutManager(BasicLink node) { super(node); - fobj = node; } /** {@inheritDoc} */ protected InlineArea createArea(boolean bInlineParent) { InlineArea area = super.createArea(bInlineParent); - setupBasicLinkArea(parentLM, area); + setupBasicLinkArea(area); return area; } /* * Detect internal or external link and add it as an area trait * - * @param parentLM the parent LayoutManager * @param area the basic-link's area */ - private void setupBasicLinkArea(LayoutManager parentLM, InlineArea area) { + private void setupBasicLinkArea(InlineArea area) { + BasicLink fobj = (BasicLink) this.fobj; // internal destinations take precedence: if (fobj.hasInternalDestination()) { String idref = fobj.getInternalDestination(); @@ -70,8 +68,10 @@ public class BasicLinkLayoutManager extends InlineLayoutManager { } } else if (fobj.hasExternalDestination()) { String url = URISpecification.getURL(fobj.getExternalDestination()); + boolean newWindow = (fobj.getShowDestination() == Constants.EN_NEW); if (url.length() > 0) { - area.addTrait(Trait.EXTERNAL_LINK, url); + area.addTrait(Trait.EXTERNAL_LINK, + new Trait.ExternalLink(url, newWindow)); } } } diff --git a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java index f3bb66022..b59f0466a 100755 --- a/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java +++ b/src/java/org/apache/fop/layoutmgr/inline/InlineLayoutManager.java @@ -68,8 +68,6 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { */ private static Log log = LogFactory.getLog(InlineLayoutManager.class); - private InlineLevel fobj; - private CommonMarginInline inlineProps = null; private CommonBorderPaddingBackground borderProps = null; @@ -105,7 +103,6 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { // The node should be FObjMixed public InlineLayoutManager(InlineLevel node) { super(node); - fobj = node; } private Inline getInlineFO() { @@ -114,6 +111,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { /** {@inheritDoc} */ public void initialize() { + InlineLevel fobj = (InlineLevel) this.fobj; + int padding = 0; FontInfo fi = fobj.getFOEventHandler().getFontInfo(); FontTriplet[] fontkeys = fobj.getCommonFont().getFontState(fi); @@ -555,7 +554,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { if (returnList instanceof BlockKnuthSequence) { return; } - CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground(); + CommonBorderPaddingBackground borderAndPadding = + ((InlineLevel)fobj).getCommonBorderPaddingBackground(); if (borderAndPadding != null) { int ipStart = borderAndPadding.getBorderStartWidth(false) + borderAndPadding.getPaddingStart(false, this); @@ -579,7 +579,8 @@ public class InlineLayoutManager extends InlineStackingLayoutManager { if (returnList instanceof BlockKnuthSequence) { return; } - CommonBorderPaddingBackground borderAndPadding = fobj.getCommonBorderPaddingBackground(); + CommonBorderPaddingBackground borderAndPadding = + ((InlineLevel)fobj).getCommonBorderPaddingBackground(); if (borderAndPadding != null) { int ipEnd = borderAndPadding.getBorderEndWidth(false) + borderAndPadding.getPaddingEnd(false, this); |