import org.apache.fop.fo.FONode;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.FOTreeVisitor;
-import org.apache.fop.fo.properties.CommonBorderAndPadding;
-import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.fo.properties.TextAlign;
import org.apache.fop.fo.properties.Overflow;
import org.apache.fop.fo.properties.DisplayAlign;
import org.apache.fop.image.ImageFactory;
import org.apache.fop.image.FopImage;
import org.apache.fop.area.inline.InlineArea;
-import org.apache.fop.layoutmgr.TraitSetter;
-import org.apache.fop.area.inline.Image;
-import org.apache.fop.area.inline.Viewport;
import org.apache.fop.datatypes.Length;
// Java
super(parent);
}
- /**
- * Get the inline area for this external grpahic.
- * This creates the image area and puts it inside a viewport.
- *
- * @return the viewport containing the image area
- */
- public InlineArea getInlineArea() {
- setup();
- if (url == null) {
- return null;
- }
- Image imArea = new Image(url);
- Viewport vp = new Viewport(imArea);
- vp.setWidth(viewWidth);
- vp.setHeight(viewHeight);
- vp.setClip(clip);
- vp.setContentPosition(placement);
- vp.setOffset(0);
-
- // Common Border, Padding, and Background Properties
- CommonBorderAndPadding bap = propMgr.getBorderAndPadding();
- CommonBackground bProps = propMgr.getBackgroundProps();
- TraitSetter.addBorders(vp, bap);
- TraitSetter.addBackground(vp, bProps);
-
- return vp;
- }
-
/**
* Setup this image.
* This gets the sizes for the image and the dimensions and clipping.
fotv.serveVisitor(this);
}
-}
+ public String getURL() {
+ return url;
+ }
+ public int getViewWidth() {
+ return viewWidth;
+ }
+
+ public boolean getClip() {
+ return clip;
+ }
+
+ public Rectangle2D getPlacement() {
+ return placement;
+ }
+
+}
import org.apache.fop.area.inline.FilledArea;
import org.apache.fop.area.inline.Space;
import org.apache.fop.area.inline.Word;
+import org.apache.fop.area.inline.Image;
+import org.apache.fop.area.inline.Viewport;
import org.apache.fop.fo.FOTreeVisitor;
import org.apache.fop.fo.FObj;
import org.apache.fop.fo.pagination.Flow;
import org.apache.fop.fo.properties.LeaderPattern;
+import org.apache.fop.fo.properties.CommonBorderAndPadding;
+import org.apache.fop.fo.properties.CommonBackground;
import org.apache.fop.layoutmgr.BidiLayoutManager;
import org.apache.fop.layoutmgr.LayoutProcessor;
* created viewport/image area.
*/
public void serveVisitor(ExternalGraphic node) {
- InlineArea area = node.getInlineArea();
+ InlineArea area = getExternalGraphicInlineArea(node);
if (area != null) {
node.setupID();
LeafNodeLayoutManager lm = new LeafNodeLayoutManager();
}
}
+ /**
+ * Get the inline area for this external grpahic.
+ * This creates the image area and puts it inside a viewport.
+ *
+ * @return the viewport containing the image area
+ */
+ public InlineArea getExternalGraphicInlineArea(ExternalGraphic node) {
+ node.setup();
+ if (node.getURL() == null) {
+ return null;
+ }
+ Image imArea = new Image(node.getURL());
+ Viewport vp = new Viewport(imArea);
+ vp.setWidth(node.getViewWidth());
+ vp.setHeight(node.getViewHeight());
+ vp.setClip(node.getClip());
+ vp.setContentPosition(node.getPlacement());
+ vp.setOffset(0);
+
+ // Common Border, Padding, and Background Properties
+ CommonBorderAndPadding bap = node.getPropertyManager().getBorderAndPadding();
+ CommonBackground bProps = node.getPropertyManager().getBackgroundProps();
+ TraitSetter.addBorders(vp, bap);
+ TraitSetter.addBackground(vp, bProps);
+
+ return vp;
+ }
+
public void serveVisitor(BlockContainer node) {
BlockContainerLayoutManager blm = new BlockContainerLayoutManager();
blm.setUserAgent(node.getUserAgent());