diff options
author | Keiron Liddle <keiron@apache.org> | 2002-09-07 08:58:07 +0000 |
---|---|---|
committer | Keiron Liddle <keiron@apache.org> | 2002-09-07 08:58:07 +0000 |
commit | cf02e02cc3e1d392b9abfd2eabba9054bb5f5ddc (patch) | |
tree | fc107ad0958bac3485a4b4278a062af90dac027e /src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java | |
parent | 514cf028e74ee9c45b77cbed401ad07340458fce (diff) | |
download | xmlgraphics-fop-cf02e02cc3e1d392b9abfd2eabba9054bb5f5ddc.tar.gz xmlgraphics-fop-cf02e02cc3e1d392b9abfd2eabba9054bb5f5ddc.zip |
implemented basic link with linking from pdf
improved some resolving of references
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195155 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java')
-rw-r--r-- | src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java b/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java index a0f7ea24f..59ebf978e 100644 --- a/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java +++ b/src/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java @@ -23,6 +23,7 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { private InlineArea curArea = null; private int alignment; private int lead; + private MinOptMax ipd; public LeafNodeLayoutManager(FObj fobj) { super(fobj); @@ -76,7 +77,8 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { BreakPoss.CAN_BREAK_AFTER | BreakPoss.CAN_BREAK_BEFORE | BreakPoss.ISFIRST | BreakPoss.ISLAST); - bp.setStackingSize(curArea.getAllocationIPD()); + ipd = getAllocationIPD(context.getRefIPD()); + bp.setStackingSize(ipd); bp.setNonStackingSize(curArea.getAllocationBPD()); bp.setTrailingSpace(new SpaceSpecifier(false)); @@ -101,6 +103,10 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { return bp; } + protected MinOptMax getAllocationIPD(int refIPD) { + return new MinOptMax(curArea.getIPD()); + } + public void resetPosition(Position resetPos) { // only reset if setting null, start again if(resetPos == null) { @@ -113,6 +119,15 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { addID(); + offsetArea(context); + widthAdjustArea(context); + + while (posIter.hasNext()) { + posIter.next(); + } + } + + protected void offsetArea(LayoutContext context) { int bpd = curArea.getHeight(); switch(alignment) { case VerticalAlign.MIDDLE: @@ -129,9 +144,10 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { curArea.setOffset(context.getBaseline() - bpd); break; } + } + protected void widthAdjustArea(LayoutContext context) { double dAdjust = context.getIPDAdjust(); - MinOptMax ipd = curArea.getAllocationIPD(); int width = ipd.opt; if(dAdjust < 0) { width = (int)(width + dAdjust * (ipd.opt - ipd.min)); @@ -139,10 +155,6 @@ public class LeafNodeLayoutManager extends AbstractLayoutManager { width = (int)(width + dAdjust * (ipd.max - ipd.opt)); } curArea.setWidth(width); - - while (posIter.hasNext()) { - posIter.next(); - } } public boolean canBreakBefore(LayoutContext context) { |