You are viewing a plain text version of this content. The canonical link for it is here.
Posted to fop-commits@xmlgraphics.apache.org by bc...@apache.org on 2004/09/22 10:24:33 UTC
cvs commit: xml-fop/src/java/org/apache/fop/layoutmgr BlockStackingLayoutManager.java CharacterLayoutManager.java ExternalGraphicLayoutManager.java InlineStackingLayoutManager.java InstreamForeignObjectLM.java LeaderLayoutManager.java LeafNodeLayoutManager.java LineLayoutManager.java PageNumberCitationLayoutManager.java PageNumberLayoutManager.java TextLayoutManager.java
bckfnn 2004/09/22 01:24:32
Modified: src/java/org/apache/fop/layoutmgr
BlockStackingLayoutManager.java
CharacterLayoutManager.java
ExternalGraphicLayoutManager.java
InlineStackingLayoutManager.java
InstreamForeignObjectLM.java
LeaderLayoutManager.java LeafNodeLayoutManager.java
LineLayoutManager.java
PageNumberCitationLayoutManager.java
PageNumberLayoutManager.java TextLayoutManager.java
Log:
Set content ipd/bpd instead of allocation width/height.
Revision Changes Path
1.8 +1 -1 xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java
Index: BlockStackingLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/BlockStackingLayoutManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- BlockStackingLayoutManager.java 15 May 2004 21:51:59 -0000 1.7
+++ BlockStackingLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.8
@@ -90,7 +90,7 @@
}
if (sp != 0) {
Block spacer = new Block();
- spacer.setHeight(sp);
+ spacer.setBPD(sp);
parentLM.addChild(spacer);
}
}
1.4 +4 -5 xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java
Index: CharacterLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/CharacterLayoutManager.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- CharacterLayoutManager.java 6 Sep 2004 18:44:32 -0000 1.3
+++ CharacterLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.4
@@ -73,7 +73,7 @@
* @param context the layout context used for adding the area
*/
protected void offsetArea(LayoutContext context) {
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
switch (alignment) {
case VerticalAlign.MIDDLE:
curArea.setOffset(context.getBaseline() - bpd / 2 /* - fontLead/2 */);
@@ -105,8 +105,7 @@
ipd = new MinOptMax(textInfo.fs.getCharWidth(((org.apache.fop.area.inline.Character) curArea).getChar().charAt(0)));
curArea.setIPD(ipd.opt);
- curArea.setWidth(ipd.opt);
- curArea.setHeight(textInfo.fs.getAscender()
+ curArea.setBPD(textInfo.fs.getAscender()
- textInfo.fs.getDescender());
// offset is set in the offsetArea() method
@@ -118,7 +117,7 @@
new Integer(textInfo.fs.getFontSize()));
curArea.addTrait(Trait.COLOR, textInfo.color);
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
int lead = 0;
int total = 0;
int middle = 0;
1.5 +3 -3 xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java
Index: ExternalGraphicLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/ExternalGraphicLayoutManager.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- ExternalGraphicLayoutManager.java 30 Aug 2004 12:00:54 -0000 1.4
+++ ExternalGraphicLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.5
@@ -217,8 +217,8 @@
public InlineArea getExternalGraphicInlineArea() {
Image imArea = new Image(graphic.getPropString(PR_SRC));
Viewport vp = new Viewport(imArea);
- vp.setWidth(viewWidth);
- vp.setHeight(viewHeight);
+ vp.setIPD(viewWidth);
+ vp.setBPD(viewHeight);
vp.setClip(clip);
vp.setContentPosition(placement);
vp.setOffset(0);
1.12 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java
Index: InlineStackingLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InlineStackingLayoutManager.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- InlineStackingLayoutManager.java 5 Sep 2004 18:16:32 -0000 1.11
+++ InlineStackingLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.12
@@ -447,7 +447,7 @@
public void addAreas(PositionIterator parentIter,
LayoutContext context) {
InlineParent parent = createArea();
- parent.setHeight(context.getLineHeight());
+ parent.setBPD(context.getLineHeight());
parent.setOffset(0);
setCurrentArea(parent);
@@ -583,7 +583,7 @@
if (iAdjust != 0) {
//getLogger().debug("Add leading space: " + iAdjust);
Space ls = new Space();
- ls.setWidth(iAdjust);
+ ls.setIPD(iAdjust);
parentArea.addChild(ls);
}
}
1.5 +4 -4 xml-fop/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java
Index: InstreamForeignObjectLM.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/InstreamForeignObjectLM.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- InstreamForeignObjectLM.java 7 Sep 2004 20:47:11 -0000 1.4
+++ InstreamForeignObjectLM.java 22 Sep 2004 08:24:32 -0000 1.5
@@ -46,7 +46,7 @@
Viewport areaCurrent = getInlineArea();
setCurrentArea(areaCurrent);
setAlignment(node.getPropEnum(PR_VERTICAL_ALIGN));
- setLead(areaCurrent.getHeight());
+ setLead(areaCurrent.getBPD());
}
/**
@@ -177,8 +177,8 @@
ForeignObject foreign = new ForeignObject(doc, ns);
Viewport areaCurrent = new Viewport(foreign);
- areaCurrent.setWidth(ipd);
- areaCurrent.setHeight(bpd);
+ areaCurrent.setIPD(ipd);
+ areaCurrent.setBPD(bpd);
areaCurrent.setContentPosition(placement);
areaCurrent.setClip(clip);
areaCurrent.setOffset(0);
1.6 +5 -5 xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java
Index: LeaderLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeaderLayoutManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- LeaderLayoutManager.java 7 Sep 2004 20:47:11 -0000 1.5
+++ LeaderLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.6
@@ -91,7 +91,7 @@
Space spacer = null;
if (ldrNode.getPatternWidth() > width) {
spacer = new Space();
- spacer.setWidth(ldrNode.getPatternWidth() - width);
+ spacer.setIPD(ldrNode.getPatternWidth() - width);
width = ldrNode.getPatternWidth();
}
FilledArea fa = new FilledArea();
@@ -100,7 +100,7 @@
if (spacer != null) {
fa.addChild(spacer);
}
- fa.setHeight(font.getAscender());
+ fa.setBPD(font.getAscender());
leaderArea = fa;
} else if (ldrNode.getLeaderPattern() == LeaderPattern.USECONTENT) {
@@ -128,7 +128,7 @@
Space spacer = null;
if (ldrNode.getPatternWidth() > width) {
spacer = new Space();
- spacer.setWidth(ldrNode.getPatternWidth() - width);
+ spacer.setIPD(ldrNode.getPatternWidth() - width);
width = ldrNode.getPatternWidth();
}
fa.setUnitWidth(width);
@@ -153,7 +153,7 @@
ipd = getAllocationIPD(context.getRefIPD());
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
int lead = 0;
int total = 0;
int middle = 0;
1.8 +5 -5 xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java
Index: LeafNodeLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LeafNodeLayoutManager.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- LeafNodeLayoutManager.java 5 Sep 2004 18:16:32 -0000 1.7
+++ LeafNodeLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.8
@@ -171,10 +171,10 @@
| BreakPoss.ISLAST);
ipd = getAllocationIPD(context.getRefIPD());
bp.setStackingSize(ipd);
- bp.setNonStackingSize(new MinOptMax(curArea.getHeight()));
+ bp.setNonStackingSize(new MinOptMax(curArea.getBPD()));
bp.setTrailingSpace(new SpaceSpecifier(false));
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
switch (alignment) {
case VerticalAlign.MIDDLE:
bp.setMiddle(bpd / 2 /* - fontLead/2 */);
@@ -245,7 +245,7 @@
* @param context the layout context used for adding the area
*/
protected void offsetArea(LayoutContext context) {
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
switch (alignment) {
case VerticalAlign.MIDDLE:
curArea.setOffset(context.getBaseline() - bpd / 2 /* - fontLead/2 */);
@@ -279,7 +279,7 @@
width = (int) (width + dAdjust * (areaInfo.ipdArea.max
- areaInfo.ipdArea.opt));
}
- curArea.setWidth(width);
+ curArea.setIPD(width);
}
/**
@@ -303,7 +303,7 @@
}
ipd = getAllocationIPD(context.getRefIPD());
- int bpd = curArea.getHeight();
+ int bpd = curArea.getBPD();
int lead = 0;
int total = 0;
int middle = 0;
1.27 +1 -1 xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java
Index: LineLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/LineLayoutManager.java,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- LineLayoutManager.java 6 Sep 2004 18:03:12 -0000 1.26
+++ LineLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.27
@@ -1416,7 +1416,7 @@
LineBreakPosition lbp = (LineBreakPosition) parentIter.next();
LineArea lineArea = new LineArea();
lineArea.setStartIndent(lbp.startIndent);
- lineArea.setHeight(lbp.lineHeight);
+ lineArea.setBPD(lbp.lineHeight);
lc.setBaseline(lbp.baseline);
lc.setLineHeight(lbp.lineHeight);
setCurrentArea(lineArea);
1.6 +3 -3 xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java
Index: PageNumberCitationLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberCitationLayoutManager.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- PageNumberCitationLayoutManager.java 6 Sep 2004 18:44:32 -0000 1.5
+++ PageNumberCitationLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.6
@@ -82,7 +82,7 @@
int width = getStringWidth(str);
text.setTextArea(str);
inline.setIPD(width);
- inline.setHeight(font.getAscender() - font.getDescender());
+ inline.setBPD(font.getAscender() - font.getDescender());
inline.setOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
@@ -95,7 +95,7 @@
String str = "MMM"; // reserve three spaces for page number
int width = getStringWidth(str);
inline.setIPD(width);
- inline.setHeight(font.getAscender() - font.getDescender());
+ inline.setBPD(font.getAscender() - font.getDescender());
inline.setOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
1.3 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java
Index: PageNumberLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/PageNumberLayoutManager.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- PageNumberLayoutManager.java 11 Aug 2004 22:56:48 -0000 1.2
+++ PageNumberLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.3
@@ -52,7 +52,7 @@
}
inline.setTextArea(str);
inline.setIPD(width);
- inline.setHeight(font.getAscender() - font.getDescender());
+ inline.setBPD(font.getAscender() - font.getDescender());
inline.setOffset(font.getAscender());
inline.addTrait(Trait.FONT_NAME, font.getFontName());
inline.addTrait(Trait.FONT_SIZE,
1.20 +2 -2 xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java
Index: TextLayoutManager.java
===================================================================
RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layoutmgr/TextLayoutManager.java,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- TextLayoutManager.java 7 Sep 2004 20:47:11 -0000 1.19
+++ TextLayoutManager.java 22 Sep 2004 08:24:32 -0000 1.20
@@ -609,8 +609,8 @@
*/
protected TextArea createTextArea(String str, int width, int base) {
TextArea textArea = new TextArea();
- textArea.setWidth(width);
- textArea.setHeight(foText.textInfo.fs.getAscender()
+ textArea.setIPD(width);
+ textArea.setBPD(foText.textInfo.fs.getAscender()
- foText.textInfo.fs.getDescender());
textArea.setOffset(foText.textInfo.fs.getAscender());
textArea.setOffset(base);
---------------------------------------------------------------------
To unsubscribe, e-mail: fop-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: fop-cvs-help@xml.apache.org