curPV = makeNewPage(false, false);
+ addIDToPage(pageSeq.getId());
Flow mainFlow = pageSeq.getMainFlow();
childFLM = getLayoutManagerMaker().
makeFlowLayoutManager(this, mainFlow);
private InlineArea getCharacterInlineArea(Character node) {
org.apache.fop.area.inline.Character ch =
new org.apache.fop.area.inline.Character(node.getCharacter());
+ TraitSetter.setProducerID(ch, node.getId());
TraitSetter.addTextDecoration(ch, fobj.getTextDecoration());
return ch;
}
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.apache.fop.area.inline.Viewport;
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.flow.ExternalGraphic;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.layoutmgr.TraitSetter;
/**
default:
break;
}
+
+
+ CommonBorderPaddingBackground borderProps = fobj.getCommonBorderPaddingBackground();
+
+ //Determine extra BPD from borders etc.
+ int beforeBPD = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false);
+ beforeBPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE,
+ false);
+ int afterBPD = borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false);
+ afterBPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false);
+
+ yoffset += beforeBPD;
+ viewHeight += beforeBPD;
+ viewHeight += afterBPD;
+
+ //Determine extra IPD from borders etc.
+ int startIPD = borderProps.getPadding(CommonBorderPaddingBackground.START,
+ false/*bNotFirst*/);
+ startIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.START,
+ false/*bNotFirst*/);
+ int endIPD = borderProps.getPadding(CommonBorderPaddingBackground.END, false/*bNotLast*/);
+ endIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, false/*bNotLast*/);
+
+ xoffset += startIPD;
+ viewWidth += startIPD;
+ viewWidth += endIPD;
+
placement = new Rectangle2D.Float(xoffset, yoffset, cwidth, cheight);
}
*/
public InlineArea getExternalGraphicInlineArea() {
Image imArea = new Image(fobj.getSrc());
+ TraitSetter.setProducerID(imArea, fobj.getId());
Viewport vp = new Viewport(imArea);
+ TraitSetter.setProducerID(vp, fobj.getId());
vp.setIPD(viewWidth);
vp.setBPD(viewHeight);
vp.setClip(clip);
return vp;
}
- protected void addId() {
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addId() */
+ protected void addId() {
getPSLM().addIDToPage(fobj.getId());
}
}
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import java.util.ListIterator;
import java.util.LinkedList;
+import org.apache.fop.area.inline.InlineParent;
+import org.apache.fop.fo.flow.Inline;
import org.apache.fop.fo.flow.InlineLevel;
import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.fo.properties.CommonMarginInline;
initialize();
}
+ private Inline getInlineFO() {
+ return (Inline)fobj;
+ }
+
private void initialize() {
inlineProps = fobj.getCommonMarginInline();
borderProps = fobj.getCommonBorderPaddingBackground();
return inlineProps.spaceEnd;
}
+ /** @see org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager#createArea() */
+ protected InlineParent createArea() {
+ InlineParent area = super.createArea();
+ TraitSetter.setProducerID(area, getInlineFO().getId());
+ return area;
+ }
+
+ /**
+ * @see org.apache.fop.layoutmgr.inline.InlineStackingLayoutManager#setTraits(boolean, boolean)
+ */
protected void setTraits(boolean bNotFirst, boolean bNotLast) {
// Add border and padding to current area and set flags (FIRST, LAST ...)
}
}
+ /** @see org.apache.fop.layoutmgr.LayoutManager */
public LinkedList getNextKnuthElements(LayoutContext lc, int alignment) {
InlineLevelLayoutManager curLM;
}
return returnList;
}*/
+
+ /** @see org.apache.fop.layoutmgr.inline.LeafNodeLayoutManager#addId() */
+ protected void addId() {
+ getPSLM().addIDToPage(getInlineFO().getId());
+ }
+
}
return new InlineParent();
}
+ /**
+ * This method is called by addAreas() so IDs can be added to a page for FOs that
+ * support the 'id' property.
+ */
+ protected void addId() {
+ // Do nothing here, overriden in subclasses that have an 'id' property.
+ }
+
/**
* Generate and add areas to parent area.
* Set size of each area. This should only create and return one
*/
public void addAreas(PositionIterator parentIter,
LayoutContext context) {
+ addId();
InlineParent parent = createArea();
parent.setBPD(context.getLineHeight());
parent.setOffset(0);
/*
- * Copyright 1999-2004 The Apache Software Foundation.
+ * Copyright 1999-2005 The Apache Software Foundation.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
import org.apache.fop.datatypes.Length;
import org.apache.fop.fo.XMLObj;
import org.apache.fop.fo.flow.InstreamForeignObject;
+import org.apache.fop.fo.properties.CommonBorderPaddingBackground;
import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.area.inline.ForeignObject;
import org.apache.fop.area.inline.Viewport;
int xoffset = fobj.computeXOffset(ipd, cwidth);
int yoffset = fobj.computeYOffset(bpd, cheight);
+ CommonBorderPaddingBackground borderProps = fobj.getCommonBorderPaddingBackground();
+
+ //Determine extra BPD from borders etc.
+ int beforeBPD = borderProps.getPadding(CommonBorderPaddingBackground.BEFORE, false);
+ beforeBPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.BEFORE,
+ false);
+ int afterBPD = borderProps.getPadding(CommonBorderPaddingBackground.AFTER, false);
+ afterBPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.AFTER, false);
+
+ yoffset += beforeBPD;
+ bpd += beforeBPD;
+ bpd += afterBPD;
+
+ //Determine extra IPD from borders etc.
+ int startIPD = borderProps.getPadding(CommonBorderPaddingBackground.START,
+ false/*bNotFirst*/);
+ startIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.START,
+ false/*bNotFirst*/);
+ int endIPD = borderProps.getPadding(CommonBorderPaddingBackground.END, false/*bNotLast*/);
+ endIPD += borderProps.getBorderWidth(CommonBorderPaddingBackground.END, false/*bNotLast*/);
+
+ xoffset += startIPD;
+ ipd += startIPD;
+ ipd += endIPD;
+
Rectangle2D placement = new Rectangle2D.Float(xoffset, yoffset, cwidth, cheight);
org.w3c.dom.Document doc = child.getDOMDocument();
//fobj.childNodes = null; This is bad for i-f-o in static-content!!!!!
ForeignObject foreign = new ForeignObject(doc, ns);
+ TraitSetter.setProducerID(foreign, fobj.getId());
Viewport vp = new Viewport(foreign);
+ TraitSetter.setProducerID(vp, fobj.getId());
vp.setIPD(ipd);
vp.setBPD(bpd);
vp.setContentPosition(placement);
import org.apache.fop.layoutmgr.LeafPosition;
import org.apache.fop.layoutmgr.Position;
import org.apache.fop.layoutmgr.PositionIterator;
+import org.apache.fop.layoutmgr.TraitSetter;
import org.apache.fop.traits.MinOptMax;
import java.util.List;
}
leaderArea = fa;
}
+ TraitSetter.setProducerID(leaderArea, fobj.getId());
return leaderArea;
}
return curArea;
}
+ /**
+ * This method is called by addAreas() so IDs can be added to a page for FOs that
+ * support the 'id' property.
+ */
protected void addId() {
// Do nothing here, overriden in subclasses that have an 'id' property.
}
inline.setIPD(width);
}
+ TraitSetter.setProducerID(inline, fobj.getId());
inline.setBPD(font.getAscender() - font.getDescender());
inline.setOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
//TODO or even better: delay area creation until addAreas() stage
//TextArea is cloned because the LM is reused in static areas and the area can't be.
TextArea ta = new TextArea();
+ TraitSetter.setProducerID(ta, fobj.getId());
ta.setIPD(baseArea.getIPD());
ta.setBPD(baseArea.getBPD());
ta.setOffset(baseArea.getOffset());