[FOray-commit] SF.net SVN: foray: [9182] trunk/foray
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2007-04-13 18:02:43
|
Revision: 9182
http://svn.sourceforge.net/foray/?rev=9182&view=rev
Author: victormote
Date: 2007-04-13 11:02:35 -0700 (Fri, 13 Apr 2007)
Log Message:
-----------
Conform to axsl changes removing the absolute traitPadding?? methods in favor of their relative equivalents.
Modified Paths:
--------------
trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
Modified: trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java
===================================================================
--- trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-04-13 17:45:10 UTC (rev 9181)
+++ trunk/foray/foray-areatree/src/java/org/foray/area/TableCellRA.java 2007-04-13 18:02:35 UTC (rev 9182)
@@ -65,21 +65,21 @@
* by the parent row. */
private int contentPD = 0;
- /** Adjustment to the top padding due to centering from the "display-align"
- * property. */
- private int centeringPaddingTop = 0;
+ /** Adjustment to the before padding due to centering from the
+ * "display-align" property. */
+ private int centeringPaddingBefore = 0;
- /** Adjustment to the bottom padding due to centering from the
+ /** Adjustment to the after padding due to centering from the
* "display-align" property. */
- private int centeringPaddingBottom = 0;
+ private int centeringPaddingAfter = 0;
- /** Adjustment to the left padding due to centering from the "display-align"
- * property. */
- private int centeringPaddingLeft = 0;
+ /** Adjustment to the start padding due to centering from the
+ * "display-align" property. */
+ private int centeringPaddingStart = 0;
- /** Adjustment to the right padding due to centering from the
+ /** Adjustment to the end padding due to centering from the
* "display-align" property. */
- private int centeringPaddingRight = 0;
+ private int centeringPaddingEnd = 0;
/**
* Private Constructor.
@@ -117,36 +117,36 @@
* Return the total padding on the top of this cell.
* @return The total padding on the top of this cell.
*/
- public int getPaddingTop() {
- return this.traitGeneratedBy().traitPaddingTop(this)
- + getCenteringPaddingTop();
+ public int getPaddingBefore() {
+ return this.traitGeneratedBy().traitPaddingBefore(this, true)
+ + getCenteringPaddingBefore();
}
/**
* Return the total padding on the left of this cell.
* @return The total padding on the left of this cell.
*/
- public int getPaddingLeft() {
- return this.traitGeneratedBy().traitPaddingLeft(this)
- + getCenteringPaddingLeft();
+ public int getPaddingStart() {
+ return this.traitGeneratedBy().traitPaddingStart(this, true)
+ + getCenteringPaddingStart();
}
/**
* Return the total padding on the bottom of this cell.
* @return The total padding on the bottom of this cell.
*/
- public int getPaddingBottom() {
- return this.traitGeneratedBy().traitPaddingBottom(this)
- + getCenteringPaddingBottom();
+ public int getPaddingAfter() {
+ return this.traitGeneratedBy().traitPaddingAfter(this, true)
+ + getCenteringPaddingAfter();
}
/**
* Return the total padding on the right of this cell.
* @return The total padding on the right of this cell.
*/
- public int getPaddingRight() {
- return this.traitGeneratedBy().traitPaddingRight(this)
- + getCenteringPaddingRight();
+ public int getPaddingEnd() {
+ return this.traitGeneratedBy().traitPaddingEnd(this, true)
+ + getCenteringPaddingEnd();
}
/**
@@ -169,64 +169,64 @@
* Returns the padding needed on the bottom of this cell to center it.
* @return Returns the centeringPaddingBottom.
*/
- public int getCenteringPaddingBottom() {
- return centeringPaddingBottom;
+ public int getCenteringPaddingAfter() {
+ return centeringPaddingAfter;
}
/**
* Returns the padding needed on the left of this cell to center it.
* @return Returns the centeringPaddingLeft.
*/
- public int getCenteringPaddingLeft() {
- return centeringPaddingLeft;
+ public int getCenteringPaddingStart() {
+ return centeringPaddingStart;
}
/**
* Returns the padding needed on the right of this cell to center it.
* @return Returns the centeringPaddingRight.
*/
- public int getCenteringPaddingRight() {
- return centeringPaddingRight;
+ public int getCenteringPaddingEnd() {
+ return centeringPaddingEnd;
}
/**
* Returns the padding needed on the top of this cell to center it.
* @return Returns the centeringPaddingTop.
*/
- public int getCenteringPaddingTop() {
- return centeringPaddingTop;
+ public int getCenteringPaddingBefore() {
+ return centeringPaddingBefore;
}
/**
* Sets the bottom padding value due to centering.
* @param padding The new centering bottom padding value.
*/
- public void setCenteringPaddingBottom(final int padding) {
- this.centeringPaddingBottom = padding;
+ public void setCenteringPaddingAfter(final int padding) {
+ this.centeringPaddingAfter = padding;
}
/**
* Sets the left padding value due to centering.
* @param padding The new centering left padding value.
*/
- public void setCenteringPaddingLeft(final int padding) {
- this.centeringPaddingLeft = padding;
+ public void setCenteringPaddingStart(final int padding) {
+ this.centeringPaddingStart = padding;
}
/**
* Sets the right padding value due to centering.
* @param padding The new centering right padding value.
*/
- public void setCenteringPaddingRight(final int padding) {
- this.centeringPaddingRight = padding;
+ public void setCenteringPaddingEnd(final int padding) {
+ this.centeringPaddingEnd = padding;
}
/**
* Sets the top padding value due to centering.
* @param padding The new centering top padding value.
*/
- public void setCenteringPaddingTop(final int padding) {
- this.centeringPaddingTop = padding;
+ public void setCenteringPaddingBefore(final int padding) {
+ this.centeringPaddingBefore = padding;
}
/**
@@ -239,10 +239,10 @@
if (tableCell.traitBorderCollapse(this) == BorderModel.SEPARATE) {
final int iSep = tableCell.traitBorderSeparationIPD(this);
return iSep / 2 + tableCell.traitBorderStartWidth(this, true)
- + tableCell.traitPaddingLeft(this);
+ + tableCell.traitPaddingStart(this, true);
}
return tableCell.traitBorderStartWidth(this, true) / 2
- + tableCell.traitPaddingLeft(this);
+ + tableCell.traitPaddingStart(this, true);
}
/**
@@ -354,16 +354,16 @@
switch (displayAlign) {
case CENTER:
/* Increase cell padding before and after. */
- this.setCenteringPaddingTop(delta / 2);
- this.setCenteringPaddingBottom(delta - delta / 2);
+ this.setCenteringPaddingBefore(delta / 2);
+ this.setCenteringPaddingAfter(delta - delta / 2);
break;
case AFTER:
/* Increase cell padding before. */
- this.setCenteringPaddingTop(delta);
+ this.setCenteringPaddingBefore(delta);
break;
case BEFORE:
/* Increase cell padding after. */
- this.setCenteringPaddingBottom(delta);
+ this.setCenteringPaddingAfter(delta);
break;
default:
/* No adjustment needed. */
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-13 17:45:10 UTC (rev 9181)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/FObj.java 2007-04-13 18:02:35 UTC (rev 9182)
@@ -37,7 +37,6 @@
import org.foray.fotree.fo.obj.Table;
import org.axsl.common.value.AbsoluteAxis;
-import org.axsl.common.value.AbsoluteCompass;
import org.axsl.common.value.AbsoluteDirection;
import org.axsl.common.value.BackgroundRepeat;
import org.axsl.common.value.Baseline;
@@ -1931,38 +1930,6 @@
/**
* {@inheritDoc}
*/
- public int traitPaddingLeft(final FoContext context) {
- return propertyList.getPadding(context, AbsoluteCompass.LEFT,
- true);
- }
-
- /**
- * {@inheritDoc}
- */
- public int traitPaddingRight(final FoContext context) {
- return propertyList.getPadding(context, AbsoluteCompass.RIGHT,
- true);
- }
-
- /**
- * {@inheritDoc}
- */
- public int traitPaddingTop(final FoContext context) {
- return propertyList.getPadding(context, AbsoluteCompass.TOP,
- true);
- }
-
- /**
- * {@inheritDoc}
- */
- public int traitPaddingBottom(final FoContext context) {
- return propertyList.getPadding(context, AbsoluteCompass.BOTTOM,
- true);
- }
-
- /**
- * {@inheritDoc}
- */
public Color traitBackgroundColor(final FoContext context) {
return propertyList.getBackgroundColor(context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-04-13 17:45:10 UTC (rev 9181)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/PropertyList.java 2007-04-13 18:02:35 UTC (rev 9182)
@@ -2708,7 +2708,8 @@
* width is computed "is-last" in the reference area.
* @return The width, in millipoints, of the padding.
*/
- public int getPadding(final FoContext context, final Compass direction,
+ public int getPadding(final FoContext context,
+ final RelativeCompass direction,
final boolean isOuterEdge) {
Padding padding = null;
// Try the most explicit setting first, e.g "padding-top"
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-04-13 17:45:10 UTC (rev 9181)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Padding.java 2007-04-13 18:02:35 UTC (rev 9182)
@@ -116,7 +116,8 @@
return collection;
}
- public int getValue(final FoContext context, final Compass direction,
+ public int getValue(final FoContext context,
+ final RelativeCompass direction,
final FObj fobj, final boolean isOuterEdge) {
if (value() instanceof PropertyCollection) {
return getCollectionValue(context, direction, fobj, isOuterEdge);
@@ -157,7 +158,7 @@
}
private int getCollectionValue(final FoContext context,
- final Compass direction, final FObj fobj,
+ final RelativeCompass direction, final FObj fobj,
final boolean isOuterEdge) {
final PropertyCollection collection = (PropertyCollection) value();
final int whichElement = collection.whichElementForDirectional(
@@ -168,7 +169,7 @@
}
private int getKeywordValue(final FoContext context,
- final Compass direction,
+ final RelativeCompass direction,
final FObj fobj, final boolean isOuterEdge) {
final PropertyKeyword kw = (PropertyKeyword) value();
final FObj effectiveParent = fobj.effectiveParent(context);
@@ -186,18 +187,6 @@
if (direction == RelativeCompass.END) {
return effectiveParent.traitPaddingEnd(context, isOuterEdge);
}
- if (direction == AbsoluteCompass.LEFT) {
- return effectiveParent.traitPaddingLeft(context);
- }
- if (direction == AbsoluteCompass.RIGHT) {
- return effectiveParent.traitPaddingRight(context);
- }
- if (direction == AbsoluteCompass.TOP) {
- return effectiveParent.traitPaddingTop(context);
- }
- if (direction == AbsoluteCompass.BOTTOM) {
- return effectiveParent.traitPaddingBottom(context);
- }
}
}
return getValueNoInstance();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|