diff options
author | arved <arved@unknown> | 2001-06-10 17:02:41 +0000 |
---|---|---|
committer | arved <arved@unknown> | 2001-06-10 17:02:41 +0000 |
commit | 53067d87d1226e57b5946c9c9ea9298e5a01f938 (patch) | |
tree | 50c97111f9b931734c08921e087e0f6d291883eb /src/org/apache/fop/fo | |
parent | bf41f666cc7766156ab2796674df0e99e86680f8 (diff) | |
download | xmlgraphics-fop-53067d87d1226e57b5946c9c9ea9298e5a01f938.tar.gz xmlgraphics-fop-53067d87d1226e57b5946c9c9ea9298e5a01f938.zip |
SGK/AHS: inling of images
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@194285 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'src/org/apache/fop/fo')
-rw-r--r-- | src/org/apache/fop/fo/flow/ExternalGraphic.java | 70 |
1 files changed, 61 insertions, 9 deletions
diff --git a/src/org/apache/fop/fo/flow/ExternalGraphic.java b/src/org/apache/fop/fo/flow/ExternalGraphic.java index 46c6be514..d828a5d06 100644 --- a/src/org/apache/fop/fo/flow/ExternalGraphic.java +++ b/src/org/apache/fop/fo/flow/ExternalGraphic.java @@ -44,9 +44,7 @@ package org.apache.fop.fo.flow; import org.apache.fop.fo.*; import org.apache.fop.messaging.MessageHandler; import org.apache.fop.fo.properties.*; -import org.apache.fop.layout.Area; -import org.apache.fop.layout.BlockArea; -import org.apache.fop.layout.FontState; +import org.apache.fop.layout.*; import org.apache.fop.apps.FOPException; import org.apache.fop.image.*; @@ -58,6 +56,8 @@ import java.net.MalformedURLException; public class ExternalGraphic extends FObj { + int breakAfter; + int breakBefore; int align; int startIndent; int endIndent; @@ -103,7 +103,7 @@ public class ExternalGraphic extends FObj { this.id = this.properties.get("id").getString(); area.getIDReferences().createID(id); - +/* if (area instanceof BlockArea) { area.end(); } @@ -114,6 +114,7 @@ public class ExternalGraphic extends FObj { forcedStartOffset; } +*/ this.marker = 0; } @@ -172,12 +173,63 @@ public class ExternalGraphic extends FObj { imageArea.start(); imageArea.end(); - area.addChild(imageArea); - area.increaseHeight(imageArea.getHeight()); + //area.addChild(imageArea); + //area.increaseHeight(imageArea.getHeight()); if (spaceAfter != 0) { area.addDisplaySpace(spaceAfter); } + if (breakBefore == BreakBefore.PAGE || ((spaceBefore + imageArea.getHeight()) > area.spaceLeft())) { + return new Status(Status.FORCE_PAGE_BREAK); + } + + if (breakBefore == BreakBefore.ODD_PAGE) { + return new Status(Status.FORCE_PAGE_BREAK_ODD); + } + + if (breakBefore == BreakBefore.EVEN_PAGE) { + return new Status(Status.FORCE_PAGE_BREAK_EVEN); + } + + + if (area instanceof BlockArea) { + BlockArea ba = (BlockArea)area; + LineArea la = ba.getCurrentLineArea(); + if(la == null) { + return new Status(Status.AREA_FULL_NONE); + } + la.addPending(); + if(imageArea.getContentWidth() > la.getRemainingWidth()) { + la = ba.createNextLineArea(); + if(la == null) { + return new Status(Status.AREA_FULL_NONE); + } + } + la.addInlineArea(imageArea); + } else { + area.addChild(imageArea); + area.increaseHeight(imageArea.getContentHeight()); + } + imageArea.setPage(area.getPage()); + + if (breakAfter == BreakAfter.PAGE) { + this.marker = BREAK_AFTER; + return new Status(Status.FORCE_PAGE_BREAK); + } + + if (breakAfter == BreakAfter.ODD_PAGE) { + this.marker = BREAK_AFTER; + return new Status(Status.FORCE_PAGE_BREAK_ODD); + } + + if (breakAfter == BreakAfter.EVEN_PAGE) { + this.marker = BREAK_AFTER; + return new Status(Status.FORCE_PAGE_BREAK_EVEN); + } + + + + } catch (MalformedURLException urlex) { @@ -191,9 +243,9 @@ public class ExternalGraphic extends FObj { imgex.getMessage()); } - if (area instanceof BlockArea) { - area.start(); - } + //if (area instanceof BlockArea) { + // area.start(); + //} return new Status(Status.OK); } |