Things to do:
Get images working
+[PARTIAL] Get padding working
[PARTIAL] Incorporate Arved Sandstrom's simple-link implementation
[PARTIAL] Implement basic keeps
[PARTIAL] Incorporate Eric Schaeffer's further table fixes
- should "preview" be an option when calling FOP instead of having
it's own main method?
-Done:
+Done since 0.12.0 release:
+
+basic support for padding-{top,left,bottom,right} on blocks.
+
+Done for 0.12.0 release:
Make sure Makefiles work
Switch to using Status object as return from layout()
<datatype>ColorType</datatype>
<default>transparent</default>
</property>
+ <property>
+ <name>padding-top</name>
+ <class-name>PaddingTop</class-name>
+ <inherited>false</inherited>
+ <datatype>Length</datatype>
+ <default>0pt</default>
+ </property>
+ <property>
+ <name>padding-left</name>
+ <class-name>PaddingLeft</class-name>
+ <inherited>false</inherited>
+ <datatype>Length</datatype>
+ <default>0pt</default>
+ </property>
+ <property>
+ <name>padding-bottom</name>
+ <class-name>PaddingBottom</class-name>
+ <inherited>false</inherited>
+ <datatype>Length</datatype>
+ <default>0pt</default>
+ </property>
+ <property>
+ <name>padding-right</name>
+ <class-name>PaddingRight</class-name>
+ <inherited>false</inherited>
+ <datatype>Length</datatype>
+ <default>0pt</default>
+ </property>
</property-list>
-
+
* @return the version string
*/
public static String getVersion() {
- return "FOP 0.12.0";
+ return "FOP 0.12.1[dev]";
}
}
propertyTable.put("column-width",ColumnWidth.maker());
propertyTable.put("keep-with-next",KeepWithNext.maker());
propertyTable.put("background-color",BackgroundColor.maker());
+ propertyTable.put("padding-top",PaddingTop.maker());
+ propertyTable.put("padding-bottom",PaddingBottom.maker());
+ propertyTable.put("padding-left",PaddingLeft.maker());
+ propertyTable.put("padding-right",PaddingRight.maker());
propertyTable.put("height",SVGLength.maker());
propertyTable.put("width",SVGLength.maker());
int textIndent;
int keepWithNext;
ColorType backgroundColor;
+ int paddingTop;
+ int paddingBottom;
+ int paddingLeft;
+ int paddingRight;
BlockArea blockArea;
this.properties.get("keep-with-next").getEnum();
this.backgroundColor =
this.properties.get("background-color").getColorType();
+ this.paddingTop =
+ this.properties.get("padding-top").getLength().mvalue();
+ this.paddingLeft =
+ this.properties.get("padding-left").getLength().mvalue();
+ this.paddingBottom =
+ this.properties.get("padding-bottom").getLength().mvalue();
+ this.paddingRight =
+ this.properties.get("padding-right").getLength().mvalue();
if (area instanceof BlockArea) {
area.end();
textIndent, align, alignLast, lineHeight);
blockArea.setPage(area.getPage());
blockArea.setBackgroundColor(backgroundColor);
+ blockArea.setPadding(paddingTop, paddingLeft, paddingBottom,
+ paddingRight);
blockArea.start();
int numChildren = this.children.size();
protected ColorType backgroundColor;
+ protected int paddingTop;
+ protected int paddingLeft;
+ protected int paddingBottom;
+ protected int paddingRight;
+
public Area (FontState fontState) {
this.fontState = fontState;
}
return this.backgroundColor;
}
+ public int getPaddingTop() {
+ return this.paddingTop;
+ }
+
+ public int getPaddingLeft() {
+ return this.paddingLeft;
+ }
+
+ public int getPaddingBottom() {
+ return this.paddingBottom;
+ }
+
+ public int getPaddingRight() {
+ return this.paddingRight;
+ }
+
public void increaseHeight(int amount) {
this.currentHeight += amount;
}
this.backgroundColor = bgColor;
}
+ public void setPadding(int top, int left, int bottom, int right) {
+ this.paddingTop = top;
+ this.paddingLeft = left;
+ this.paddingBottom = bottom;
+ this.paddingRight = right;
+ }
+
public int spaceLeft() {
return maxHeight - currentHeight;
}
int w = area.getContentWidth();
int h = area.getHeight();
ColorType bg = area.getBackgroundColor();
+ int pt = area.getPaddingTop();
+ int pl = area.getPaddingLeft();
+ int pb = area.getPaddingBottom();
+ int pr = area.getPaddingRight();
// I'm not sure I should have to check for bg being null
// but I do
if ((bg != null) && (bg.alpha() == 0)) {
- this.addRect(rx, ry, w, -h,
+ this.addRect(rx - pl, ry + pt, w + pl + pr , - (h + pt + pb),
bg.red(), bg.green(), bg.blue(),
bg.red(), bg.green(), bg.blue());
}