Revision: 7813
Author: victormote
Date: 2006-07-22 17:55:19 -0700 (Sat, 22 Jul 2006)
ViewCVS: http://svn.sourceforge.net/foray/?rev=7813&view=rev
Log Message:
-----------
Implement standard use of "final" modifier on local variables and parameters.
Modified Paths:
--------------
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSpacing.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderStyle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/CaseTitle.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Character.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Clip.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Color.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnCount.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnGap.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnNumber.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ColumnWidth.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentDimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ContentType.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Country.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Cue.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DestinationPlacementOffset.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Dimension.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DisplayAlign.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/DominantBaseline.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Elevation.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Enumerated.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Extent.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/ExternalDestination.java
trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Font.java
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteDimension.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -56,15 +56,15 @@
Constants.FOVAL_INHERIT,
};
- public AbsoluteDimension(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
- throws PropertyException {
+ public AbsoluteDimension(final PropertyList propertyList,
+ final short enumeration, final String propertyFullName,
+ final String attributeValue) throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -79,21 +79,21 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(FOContext context, byte relativeAxis,
- FObj fobj, int dimAncestorGenByBlockLevelFO) {
+ public int getValue(final FOContext context, final byte relativeAxis,
+ final FObj fobj, final int dimAncestorGenByBlockLevelFO) {
if (this.value instanceof DtLength) {
return ((DtLength) this.value).getValue(fobj.traitFontSize(context),
0);
}
if (this.value instanceof DtPercentage) {
- int base = dimAncestorGenByBlockLevelFO;
- DtPercentage percentageDT = (DtPercentage) this.value;
- float percentage = percentageDT.getValue();
+ final int base = dimAncestorGenByBlockLevelFO;
+ final DtPercentage percentageDT = (DtPercentage) this.value;
+ final float percentage = percentageDT.getValue();
return Math.round(percentage * base / 100);
}
if (this.value instanceof PropertyKeyword) {
- PropertyKeyword kw = (PropertyKeyword) this.value;
- short keyword = kw.getValue();
+ final PropertyKeyword kw = (PropertyKeyword) this.value;
+ final short keyword = kw.getValue();
switch (keyword) {
case Constants.FOVAL_AUTO: {
return Constants.DIMENSION_AUTO;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AbsoluteOffset.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -46,16 +46,18 @@
Constants.FOVAL_INHERIT,
};
- public AbsoluteOffset(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public AbsoluteOffset(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, enumeration,
attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- short enumeration, String value) throws PropertyException {
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final short enumeration, final String value)
+ throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -71,16 +73,16 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(FOContext context, byte direction,
- FObj fobj, int dimensionContainingBlock) {
+ public int getValue(final FOContext context, final byte direction,
+ final FObj fobj, final int dimensionContainingBlock) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
+ final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
case Constants.FOVAL_AUTO: {
return Constants.ABSOLUTE_POSITION_AUTO;
}
case Constants.FOVAL_INHERIT: {
- FObj parent = fobj.effectiveParent(context);
+ final FObj parent = fobj.effectiveParent(context);
if (parent == null) {
return getValueNoInstance();
}
@@ -89,17 +91,18 @@
}
}
if (this.value instanceof DtLength) {
- DtLength length = (DtLength) this.value;
+ final DtLength length = (DtLength) this.value;
/*
* The XSL-FO Standard 1.0 does not specify whether negative values
* are allowed or not, but the CSS2 standard says that they are
* allowed.
*/
- int lengthValue = length.getValue(fobj.traitFontSize(context), 0);
+ final int lengthValue = length.getValue(fobj.traitFontSize(context),
+ 0);
return lengthValue;
}
if (this.value instanceof DtPercentage) {
- DtPercentage percent = (DtPercentage) this.value;
+ final DtPercentage percent = (DtPercentage) this.value;
return Math.round(dimensionContainingBlock * percent.getValue()
/ 100);
}
@@ -119,7 +122,7 @@
* @param direction One of the absolute directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyName(int direction) {
+ public static short rawPropertyName(final int direction) {
switch (direction) {
case Constants.DIRECTION_TOP: {
return Constants.FOPROP_TOP;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentAdjust.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -57,15 +57,16 @@
Constants.FOVAL_INHERIT,
};
- public AlignmentAdjust(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public AlignmentAdjust(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -80,9 +81,9 @@
throw unexpectedValue(value, propertyList);
}
- public short traitValue(FOContext context, FObj fobj) {
+ public short traitValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
+ final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
return fobj.effectiveParent(context).traitAlignmentAdjust(
@@ -102,7 +103,8 @@
return traitValueNoInstance();
}
- public int traitValueAmount(FOContext context, FObj fobj, int areaHeight) {
+ public int traitValueAmount(final FOContext context, final FObj fobj,
+ final int areaHeight) {
if (this.value instanceof DtLength) {
return ((DtLength) this.value).getValue(fobj.traitFontSize(context),
0);
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AlignmentBaseline.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -52,25 +52,26 @@
Constants.FOVAL_INHERIT,
};
- public AlignmentBaseline(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public AlignmentBaseline(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
- PropertyValue pv = checkKeywords(value);
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
+ final PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
}
throw unexpectedValue(value, propertyList);
}
- public short traitValue(FOContext context, FObj fobj) {
+ public short traitValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
+ final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
return fobj.effectiveParent(context).traitAlignmentBaseline(
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/AudioDial.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -48,22 +48,22 @@
Constants.FOVAL_INHERIT,
};
- public AudioDial(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public AudioDial(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
}
pv = DtNumber.makeNumberDT(value);
if (pv != null) {
- double number = ((DtNumber) pv).getValue();
+ final double number = ((DtNumber) pv).getValue();
if (number >= 0 && number <= 100) {
return pv;
}
@@ -71,12 +71,12 @@
throw unexpectedValue(value, propertyList);
}
- public double getValue(FOContext context, FObj fobj) {
+ public double getValue(final FOContext context, final FObj fobj) {
if (this.value instanceof DtNumber) {
return ((DtNumber) this.value).getValue();
}
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) this.value).getValue();
+ final short keyword = ((PropertyKeyword) this.value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
return getValueNoInstance(context, fobj, propertyType);
@@ -86,9 +86,9 @@
return 50;
}
- public static double getValueNoInstance(FOContext context, FObj fobj,
- short propertyType) {
- FObj parent = fobj.effectiveParent(context);
+ public static double getValueNoInstance(final FOContext context,
+ final FObj fobj, final short propertyType) {
+ final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
switch (propertyType) {
case Constants.FOPROP_PITCH_RANGE: {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Azimuth.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -57,21 +57,21 @@
/** Set to true if the "behind" keyword is used. */
boolean isBehind = false;
- public Azimuth(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public Azimuth(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
String remainingValue = value;
- StringTokenizer st = new StringTokenizer(value);
+ final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() == 2) {
// One of the tokens should be "behind"
while (st.hasMoreTokens()) {
- String thisToken = st.nextToken();
+ final String thisToken = st.nextToken();
if (thisToken.equals("behind")) {
this.isBehind = true;
} else {
@@ -84,7 +84,7 @@
}
PropertyValue pv = checkKeywords(remainingValue);
if (pv != null) {
- short keyword = ((PropertyKeyword) pv).getValue();
+ final short keyword = ((PropertyKeyword) pv).getValue();
switch (keyword) {
case Constants.FOVAL_LEFTWARDS:
case Constants.FOVAL_RIGHTWARDS:
@@ -106,12 +106,12 @@
throw unexpectedValue(value, propertyList);
}
- public float getValue(FOContext context, FObj fobj) {
+ public float getValue(final FOContext context, final FObj fobj) {
if (this.value instanceof DtAngle) {
return ((DtAngle) this.value).getValue();
}
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) this.value).getValue();
+ final short keyword = ((PropertyKeyword) this.value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
return getValueNoInstance(context, fobj);
@@ -175,8 +175,9 @@
return getValueNoInstance(context, fobj);
}
- public static float getValueNoInstance(FOContext context, FObj fobj) {
- FObj parent = fobj.effectiveParent(context);
+ public static float getValueNoInstance(final FOContext context,
+ final FObj fobj) {
+ final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitAzimuth(context);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Background.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -45,18 +45,19 @@
Constants.FOVAL_INHERIT,
};
- public Background(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public Background(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, propertyFullName,
attributeValue);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String propertyFullName, String value) throws PropertyException {
- PropertyCollection collection = new PropertyCollection();
- PropertyValue pv = checkKeywords(value);
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String propertyFullName, final String value)
+ throws PropertyException {
+ final PropertyCollection collection = new PropertyCollection();
+ final PropertyValue pv = checkKeywords(value);
if (pv != null) {
collection.addItem(new BackgroundColor(propertyList,
Constants.FOPROP_BACKGROUND_COLOR, pv));
@@ -73,18 +74,18 @@
// There are 5 properties supported, one of which can have 2 tokens
final byte MAX_TOKENS = 6;
// Tokenize the input & put the tokens into an ArrayList
- StringTokenizer st = new StringTokenizer(value);
+ final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() < 1 || st.countTokens() > MAX_TOKENS) {
throw unexpectedValue(value, propertyList);
}
- ArrayList tokenList = new ArrayList(st.countTokens());
+ final ArrayList tokenList = new ArrayList(st.countTokens());
while (st.hasMoreTokens()) {
tokenList.add(st.nextToken());
}
// Create an array indicating which property is in each position
- short[] positionArray = new short[tokenList.size()];
+ final short[] positionArray = new short[tokenList.size()];
for (int i = 0; i < tokenList.size(); i++) {
- short contentType = getContentType((String) tokenList.get(i));
+ final short contentType = getContentType((String) tokenList.get(i));
if (contentType < 0) {
throw unexpectedValue(value, propertyList);
}
@@ -137,7 +138,7 @@
if (positionFound) {
throw unexpectedValue(value, propertyList);
}
- String propertyInput = (String) tokenList.get(i);
+ final String propertyInput = (String) tokenList.get(i);
if (i < positionArray.length && positionArray[i + 1]
== Constants.FOPROP_BACKGROUND_POSITION) {
propertyInput.concat(" "
@@ -162,7 +163,7 @@
* BACKGROUND_IMAGE, BACKGROUND_REPEAT, BACKGROUND_ATTACHMENT, or
* BACKGROUND_POSITION, or -1 for invalid input
*/
- private short getContentType(String input) {
+ private short getContentType(final String input) {
if (input.equals("inherit")) {
return -1;
}
@@ -195,19 +196,19 @@
if (keyword > -1) {
return Constants.FOPROP_BACKGROUND_POSITION;
}
- DtColor color = DtColor.makeDtColor(input);
+ final DtColor color = DtColor.makeDtColor(input);
if (color != null) {
return Constants.FOPROP_BACKGROUND_COLOR;
}
- DtURI uri = DtURI.makeUriDT(input);
+ final DtURI uri = DtURI.makeUriDT(input);
if (uri != null) {
return Constants.FOPROP_BACKGROUND_IMAGE;
}
- DtLength length = DtLength.makeLengthDT(input);
+ final DtLength length = DtLength.makeLengthDT(input);
if (length != null) {
return Constants.FOPROP_BACKGROUND_POSITION;
}
- DtPercentage percentage = DtPercentage.makePercentageDT(input);
+ final DtPercentage percentage = DtPercentage.makePercentageDT(input);
if (percentage != null) {
return Constants.FOPROP_BACKGROUND_POSITION;
}
@@ -215,31 +216,31 @@
}
public BackgroundColor getColor() {
- PropertyCollection collection = (PropertyCollection) this.value;
+ final PropertyCollection collection = (PropertyCollection) this.value;
return (BackgroundColor) collection.findProperty
(Constants.FOPROP_BACKGROUND_COLOR);
}
public BackgroundImage getImage() {
- PropertyCollection collection = (PropertyCollection) this.value;
+ final PropertyCollection collection = (PropertyCollection) this.value;
return (BackgroundImage) collection.findProperty
(Constants.FOPROP_BACKGROUND_IMAGE);
}
public Enumerated getRepeat() {
- PropertyCollection collection = (PropertyCollection) this.value;
+ final PropertyCollection collection = (PropertyCollection) this.value;
return (Enumerated) collection.findProperty
(Constants.FOPROP_BACKGROUND_REPEAT);
}
public Enumerated getAttachment() {
- PropertyCollection collection = (PropertyCollection) this.value;
+ final PropertyCollection collection = (PropertyCollection) this.value;
return (Enumerated) collection.findProperty
(Constants.FOPROP_BACKGROUND_ATTACHMENT);
}
public BackgroundPosition getPosition() {
- PropertyCollection collection = (PropertyCollection) this.value;
+ final PropertyCollection collection = (PropertyCollection) this.value;
return (BackgroundPosition) collection.findProperty
(Constants.FOPROP_BACKGROUND_POSITION);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundColor.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -38,15 +38,17 @@
Constants.FOVAL_TRANSPARENT,
};
- public BackgroundColor(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BackgroundColor(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration, propertyFullName, attributeValue);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public BackgroundColor(PropertyList propertyList, short enumeration,
- PropertyValue value) throws PropertyException {
+ public BackgroundColor(final PropertyList propertyList,
+ final short enumeration, final PropertyValue value)
+ throws PropertyException {
super(propertyList, enumeration, value);
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundImage.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -47,20 +47,22 @@
Constants.FOVAL_INHERIT,
};
- public BackgroundImage(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BackgroundImage(final PropertyList propertyList,
+ final short enumeration, final String propertyFullName,
+ final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public BackgroundImage(PropertyList propertyList, short enumeration,
- PropertyValue value) throws PropertyException {
+ public BackgroundImage(final PropertyList propertyList,
+ final short enumeration, final PropertyValue value)
+ throws PropertyException {
super(propertyList, enumeration, value);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -72,12 +74,12 @@
throw unexpectedValue(value, propertyList);
}
- public Graphic getValue(FOContext context, FObj fobj) {
+ public Graphic getValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
+ final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
- FObj parent = fobj.effectiveParent(context);
+ final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
return parent.traitBackgroundImage(context);
}
@@ -91,13 +93,13 @@
if (graphic != null) {
return graphic;
}
- String src = ((DtURI) this.value).getValue();
+ final String src = ((DtURI) this.value).getValue();
Graphic backgroundImage = null;
try {
backgroundImage = fobj.getGraphicServer().makeGraphic(src,
fobj.getFOTreeBuilder().getGraphicSearchPath(),
fobj.getFOTreeBuilder().getCachingGraphics());
- } catch (GraphicException imgex) {
+ } catch (final GraphicException imgex) {
backgroundImage = null;
fobj.getLogger().error("Error creating background image: "
+ imgex.getMessage());
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BackgroundPosition.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -60,8 +60,9 @@
Constants.FOVAL_INHERIT,
};
- public BackgroundPosition(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BackgroundPosition(final PropertyList propertyList,
+ final short enumeration, final String propertyFullName,
+ final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
if (propertyType == Constants.FOPROP_BACKGROUND_POSITION) {
@@ -71,13 +72,14 @@
}
}
- public BackgroundPosition(PropertyList propertyList, short enumeration,
- PropertyValue value) throws PropertyException {
+ public BackgroundPosition(final PropertyList propertyList,
+ final short enumeration, final PropertyValue value)
+ throws PropertyException {
super(propertyList, enumeration, value);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -93,40 +95,42 @@
throw unexpectedValue(value, propertyList);
}
- private PropertyValue createShorthandValue(PropertyList propertyList,
- String value) throws PropertyException {
- PropertyCollection collection = new PropertyCollection();
+ private PropertyValue createShorthandValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
+ final PropertyCollection collection = new PropertyCollection();
PropertyValue pv = checkKeywords(value);
if (pv != null) {
- BackgroundPosition property = new BackgroundPosition
+ final BackgroundPosition property = new BackgroundPosition
(propertyList, propertyType, pv);
collection.addItem(property);
return collection;
}
- StringTokenizer st = new StringTokenizer(value);
+ final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() < 1 || st.countTokens() > 2) {
throw unexpectedValue(value, propertyList);
}
while (st.hasMoreTokens()) {
- String token = st.nextToken();
+ final String token = st.nextToken();
pv = DtPercentage.makePercentageDT(token);
if (pv == null) {
pv = DtLength.makeLengthDT(token);
}
if (pv == null) {
- short keyword = getKeywordIndex(token, validKeywordsHorizontal);
+ final short keyword = getKeywordIndex(token,
+ validKeywordsHorizontal);
if (keyword > 0 && keyword != Constants.FOVAL_INHERIT) {
pv = new PropertyKeyword(keyword);
}
}
if (pv == null) {
- short keyword = getKeywordIndex(token, validKeywordsVertical);
+ final short keyword = getKeywordIndex(token,
+ validKeywordsVertical);
if (keyword > 0 && keyword != Constants.FOVAL_INHERIT) {
pv = new PropertyKeyword(keyword);
}
}
if (pv != null) {
- BackgroundPosition property = new BackgroundPosition
+ final BackgroundPosition property = new BackgroundPosition
(propertyList, propertyType, pv);
collection.addItem(property);
} else {
@@ -137,7 +141,7 @@
return collection;
}
pv = collection.getItem(0).getPropertyValue();
- PropertyValue pv2 = collection.getItem(1).getPropertyValue();
+ final PropertyValue pv2 = collection.getItem(1).getPropertyValue();
/*
* If the first item is a length or percentage, the other needs to be
* also.
@@ -157,8 +161,8 @@
}
}
// The two keywords need to be from each of the two sets.
- short keyword = ((PropertyKeyword) pv).getValue();
- short keyword2 = ((PropertyKeyword) pv2).getValue();
+ final short keyword = ((PropertyKeyword) pv).getValue();
+ final short keyword2 = ((PropertyKeyword) pv2).getValue();
if (keywordInSet(keyword, validKeywordsHorizontal)
&& keywordInSet(keyword2, validKeywordsVertical)) {
return collection;
@@ -175,19 +179,20 @@
return collection;
}
- public int getValue(FOContext context, FObj fobj, byte axis,
- int paddingRectangleDimension, int backgroundImageDimension) {
+ public int getValue(final FOContext context, final FObj fobj,
+ final byte axis, final int paddingRectangleDimension,
+ final int backgroundImageDimension) {
if (this.value instanceof DtLength) {
return ((DtLength) this.value).getValue(fobj.traitFontSize(context),
0);
}
if (this.value instanceof DtPercentage) {
- float percent = ((DtPercentage) this.value).getValue();
+ final float percent = ((DtPercentage) this.value).getValue();
return Math.round(percent/100 * (paddingRectangleDimension
- backgroundImageDimension));
}
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) this.value).getValue();
+ final short keyword = ((PropertyKeyword) this.value).getValue();
switch (keyword) {
case Constants.FOVAL_TOP:
case Constants.FOVAL_LEFT: {
@@ -202,7 +207,7 @@
return paddingRectangleDimension - backgroundImageDimension;
}
case Constants.FOVAL_INHERIT: {
- FObj parent = fobj.effectiveParent(context);
+ final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
switch (axis) {
case Constants.AXIS_HORIZONTAL: {
@@ -223,13 +228,13 @@
return getValueNoInstance();
}
- public int getShorthandValue(FOContext context, FObj fobj,
- byte axis, int paddingRectangleDimension,
- int backgroundImageDimension) {
- PropertyCollection collection = (PropertyCollection) this.value;
- BackgroundPosition bpProperty = (BackgroundPosition) collection
+ public int getShorthandValue(final FOContext context, final FObj fobj,
+ final byte axis, final int paddingRectangleDimension,
+ final int backgroundImageDimension) {
+ final PropertyCollection collection = (PropertyCollection) this.value;
+ final BackgroundPosition bpProperty = (BackgroundPosition) collection
.getItem(0);
- PropertyValue pv = bpProperty.getPropertyValue();
+ final PropertyValue pv = bpProperty.getPropertyValue();
if (collection.getCount() == 1) {
if (pv instanceof DtPercentage || pv instanceof DtLength) {
if (axis == Constants.AXIS_VERTICAL) {
@@ -238,7 +243,7 @@
}
}
if (pv instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) pv).getValue();
+ final short keyword = ((PropertyKeyword) pv).getValue();
if (axis == Constants.AXIS_HORIZONTAL
&& keywordInSet(keyword, validKeywordsVertical)) {
return (int) Math.round(.5 * (paddingRectangleDimension
@@ -260,9 +265,9 @@
* What is left here is the case where there are two properties. The
* only real trick is to make sure we use the right one.
*/
- BackgroundPosition bpProperty2 = (BackgroundPosition) collection
+ final BackgroundPosition bpProperty2 = (BackgroundPosition) collection
.getItem(1);
- PropertyValue pv2 = bpProperty2.getPropertyValue();
+ final PropertyValue pv2 = bpProperty2.getPropertyValue();
BackgroundPosition bpPropertyToUse = null;
if (pv instanceof DtPercentage || pv instanceof DtLength) {
if (axis == Constants.AXIS_HORIZONTAL) {
@@ -275,8 +280,8 @@
/*
* What is left here should just be keywords.
*/
- short keyword = ((PropertyKeyword) pv).getValue();
- short keyword2 = ((PropertyKeyword) pv2).getValue();
+ final short keyword = ((PropertyKeyword) pv).getValue();
+ final short keyword2 = ((PropertyKeyword) pv2).getValue();
boolean horizontalFirst = false;
if (keywordInSet(keyword, validKeywordsHorizontal)) {
horizontalFirst = true;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BaselineShift.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -47,15 +47,16 @@
Constants.FOVAL_INHERIT,
};
- public BaselineShift(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BaselineShift(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -70,10 +71,10 @@
throw unexpectedValue(value, propertyList);
}
- public int traitValue(FOContext context, FObj fobj) {
+ public int traitValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
- FObj effectiveParent = fobj.effectiveParent(context);
+ final short keyword = ((PropertyKeyword) value).getValue();
+ final FObj effectiveParent = fobj.effectiveParent(context);
switch (keyword) {
case Constants.FOVAL_BASELINE: {
return 0;
@@ -81,13 +82,13 @@
case Constants.FOVAL_SUB: {
/* TODO: This is the legacy computation. It needs to be
* rewritten from the spec. */
- int ascender = getAscender(context, effectiveParent);
+ final int ascender = getAscender(context, effectiveParent);
return (int) Math.round(2 * ascender / 3.0);
}
case Constants.FOVAL_SUPER: {
/* TODO: This is the legacy computation. It needs to be
* rewritten from the spec. */
- int ascender = getAscender(context, effectiveParent);
+ final int ascender = getAscender(context, effectiveParent);
return (int) Math.round(-2 * ascender / 3.0);
}
case Constants.FOVAL_INHERIT: {
@@ -104,7 +105,7 @@
}
if (this.value instanceof DtPercentage) {
/* TODO: This base value is almost certainly wrong. */
- int base = fobj.effectiveParent(context)
+ final int base = fobj.effectiveParent(context)
.propertyList.getLineHeight(context, OPTIMUM);
return Math.round(((DtPercentage) this.value).getValue() * base);
}
@@ -116,10 +117,11 @@
* @param effectiveParent
* @return The ascender for the primary font.
*/
- private int getAscender(FOContext context, FObj effectiveParent) {
- FontUse primaryFont = effectiveParent.getPrimaryFont(context);
- int fontSize = effectiveParent.traitFontSize(context);
- int ascender = primaryFont.getFont().getAscender(fontSize);
+ private int getAscender(final FOContext context,
+ final FObj effectiveParent) {
+ final FontUse primaryFont = effectiveParent.getPrimaryFont(context);
+ final int fontSize = effectiveParent.traitFontSize(context);
+ final int ascender = primaryFont.getFont().getAscender(fontSize);
return ascender;
}
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Boolean.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -48,25 +48,25 @@
Constants.FOVAL_INHERIT,
};
- public Boolean(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public Boolean(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
- PropertyValue pv = checkKeywords(value);
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
+ final PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
}
throw unexpectedValue(value, propertyList);
}
- public boolean getValue(FOContext context, FObj fobj) {
+ public boolean getValue(final FOContext context, final FObj fobj) {
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) value).getValue();
+ final short keyword = ((PropertyKeyword) value).getValue();
switch (keyword) {
case Constants.FOVAL_INHERIT: {
return getValueNoInstance(context, fobj, propertyType);
@@ -82,9 +82,9 @@
return false;
}
- public static boolean getValueNoInstance(FOContext context, FObj fobj,
- short propertyType) {
- FObj parent = fobj.effectiveParent(context);
+ public static boolean getValueNoInstance(final FOContext context,
+ final FObj fobj, final short propertyType) {
+ final FObj parent = fobj.effectiveParent(context);
switch (propertyType) {
case Constants.FOPROP_HYPHENATE: {
if (parent != null) {
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/Border.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -47,27 +47,28 @@
Constants.FOVAL_INHERIT,
};
- public Border(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public Border(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, enumeration,
attributeValue);
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- short enumeration, String value) throws PropertyException {
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final short enumeration, final String value)
+ throws PropertyException {
PropertyCollection collection = null;
/*
* Must handle inherit specially, because it essentially propogates
* to style, width, and color.
*/
if (value.equals("inherit")) {
- BorderStyle borderStyle = new BorderStyle(propertyList,
+ final BorderStyle borderStyle = new BorderStyle(propertyList,
Constants.FOPROP_BORDER_STYLE, "border-style", "inherit");
- BorderWidth borderWidth = new BorderWidth(propertyList,
+ final BorderWidth borderWidth = new BorderWidth(propertyList,
Constants.FOPROP_BORDER_WIDTH, "border-width", "inherit");
- BorderColor borderColor = new BorderColor(propertyList,
+ final BorderColor borderColor = new BorderColor(propertyList,
Constants.FOPROP_BORDER_COLOR, "border-color", "inherit");
collection = new PropertyCollection();
collection.addItem(borderStyle);
@@ -75,9 +76,9 @@
collection.addItem(borderColor);
return collection;
}
- StringTokenizer st = new StringTokenizer(value);
+ final StringTokenizer st = new StringTokenizer(value);
while (st.hasMoreTokens()) {
- Property property = parseToken(propertyList, st.nextToken());
+ final Property property = parseToken(propertyList, st.nextToken());
if (property == null) {
throw unexpectedValue(value, propertyList);
}
@@ -92,8 +93,8 @@
throw unexpectedValue(value, propertyList);
}
- public Property parseToken(PropertyList propertyList, String token)
- throws PropertyException {
+ public Property parseToken(final PropertyList propertyList,
+ final String token) throws PropertyException {
// Check style first, since it only has keywords
short keyword = Property.getKeywordIndex(token,
BorderStyle.validKeywords);
@@ -108,13 +109,14 @@
new PropertyKeyword(keyword));
}
// Now check for color keywords
- DtColor dtColor = DtColor.mapNameToColorRGB(token);
+ final DtColor dtColor = DtColor.mapNameToColorRGB(token);
if (dtColor != null) {
return new BorderColor(Constants.FOPROP_BORDER_COLOR,
dtColor);
}
// Now try using the standard parse
- PropertyValue pv = standardParse(propertyList, token, false, false);
+ final PropertyValue pv = standardParse(propertyList, token, false,
+ false);
if (pv instanceof DtLength) {
return new BorderWidth(Constants.FOPROP_BORDER_WIDTH, pv);
}
@@ -124,12 +126,12 @@
return null;
}
- public BorderStyle getBorderStyle(byte absoluteDirection) {
+ public BorderStyle getBorderStyle(final byte absoluteDirection) {
if (! (this.value instanceof PropertyCollection)) {
return null;
}
- PropertyCollection collection = (PropertyCollection) this.value;
- Property property = collection.findProperty(
+ final PropertyCollection collection = (PropertyCollection) this.value;
+ final Property property = collection.findProperty(
Constants.FOPROP_BORDER_STYLE);
if (property instanceof BorderStyle) {
return (BorderStyle) property;
@@ -141,8 +143,8 @@
if (! (this.value instanceof PropertyCollection)) {
return null;
}
- PropertyCollection collection = (PropertyCollection) this.value;
- Property property = collection.findProperty(
+ final PropertyCollection collection = (PropertyCollection) this.value;
+ final Property property = collection.findProperty(
Constants.FOPROP_BORDER_WIDTH);
if (property instanceof BorderWidth) {
return (BorderWidth) property;
@@ -154,8 +156,8 @@
if (! (this.value instanceof PropertyCollection)) {
return null;
}
- PropertyCollection collection = (PropertyCollection) this.value;
- Property property = collection.findProperty(
+ final PropertyCollection collection = (PropertyCollection) this.value;
+ final Property property = collection.findProperty(
Constants.FOPROP_BORDER_COLOR);
if (property instanceof BorderColor) {
return (BorderColor) property;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderColor.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -40,8 +40,8 @@
public class BorderColor extends Property {
- public BorderColor(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BorderColor(final PropertyList propertyList, final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, enumeration,
@@ -53,39 +53,42 @@
* parsing. Specifically, this is used by classes that handle shorthand
* properties.
*/
- protected BorderColor(short enumeration, PropertyValue value) {
+ protected BorderColor(final short enumeration, final PropertyValue value) {
super(null, enumeration);
this.value = value;
}
- public PropertyValue createPropertyValue(PropertyList propertyList,
- short enumeration, String value) throws PropertyException {
- DtColor color = DtColor.makeDtColor(value);
+ public PropertyValue createPropertyValue(final PropertyList propertyList,
+ final short enumeration, final String value)
+ throws PropertyException {
+ final DtColor color = DtColor.makeDtColor(value);
if (color != null) {
return color;
}
- StringTokenizer st = new StringTokenizer(value);
+ final StringTokenizer st = new StringTokenizer(value);
if (st.countTokens() > 1) {
return createShorthandValue(propertyList, st, enumeration, value);
}
return createSimpleValue(propertyList, value);
}
- private PropertyValue createSimpleValue(PropertyList propertyList,
- String value) throws PropertyException {
- PropertyValue pv = standardParse(propertyList, value, false, false);
+ private PropertyValue createSimpleValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
+ final PropertyValue pv = standardParse(propertyList, value, false,
+ false);
if (pv instanceof ExprColor) {
return pv;
}
throw unexpectedValue(value, propertyList);
}
- private PropertyValue createShorthandValue(PropertyList propertyList,
- StringTokenizer st, short enumeration, String value)
+ private PropertyValue createShorthandValue(final PropertyList propertyList,
+ final StringTokenizer st, final short enumeration,
+ final String value)
throws PropertyException {
- PropertyCollection collection = new PropertyCollection();
+ final PropertyCollection collection = new PropertyCollection();
while (st.hasMoreTokens()) {
- BorderColor newBorderColor = new BorderColor(propertyList,
+ final BorderColor newBorderColor = new BorderColor(propertyList,
enumeration, null, st.nextToken());
if (newBorderColor != null) {
collection.addItem(newBorderColor);
@@ -94,7 +97,7 @@
return collection;
}
- public Color getValue(byte direction, FObj fobj) {
+ public Color getValue(final byte direction, final FObj fobj) {
if (this.value instanceof PropertyCollection) {
return getCollectionValue(direction, fobj);
}
@@ -104,11 +107,12 @@
return getValueNoInstance();
}
- private Color getCollectionValue(byte direction, FObj fobj) {
- PropertyCollection collection = (PropertyCollection) this.value;
- int whichElement = collection.whichElementForDirectional(direction);
- Property insideProperty = collection.getItem(whichElement);
- BorderColor borderColorProperty = (BorderColor) insideProperty;
+ private Color getCollectionValue(final byte direction, final FObj fobj) {
+ final PropertyCollection collection = (PropertyCollection) this.value;
+ final int whichElement = collection.whichElementForDirectional(
+ direction);
+ final Property insideProperty = collection.getItem(whichElement);
+ final BorderColor borderColorProperty = (BorderColor) insideProperty;
return borderColorProperty.getValue(direction, fobj);
}
@@ -120,7 +124,7 @@
* @param direction One of the directional constants.
* @return String representation of the raw property name.
*/
- public static short rawPropertyType(int direction) {
+ public static short rawPropertyType(final int direction) {
switch (direction) {
case Constants.DIRECTION_BEFORE: {
return Constants.FOPROP_BORDER_BEFORE_COLOR;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2006-07-23 00:19:17 UTC (rev 7812)
+++ trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderPrecedence.java 2006-07-23 00:55:19 UTC (rev 7813)
@@ -51,15 +51,16 @@
Constants.FOVAL_INHERIT,
};
- public BorderPrecedence(PropertyList propertyList, short enumeration,
- String propertyFullName, String attributeValue)
+ public BorderPrecedence(final PropertyList propertyList,
+ final short enumeration,
+ final String propertyFullName, final String attributeValue)
throws PropertyException {
super(propertyList, enumeration);
this.value = createPropertyValue(propertyList, attributeValue);
}
- private PropertyValue createPropertyValue(PropertyList propertyList,
- String value) throws PropertyException {
+ private PropertyValue createPropertyValue(final PropertyList propertyList,
+ final String value) throws PropertyException {
PropertyValue pv = checkKeywords(value);
if (pv != null) {
return pv;
@@ -71,18 +72,19 @@
throw unexpectedValue(value, propertyList);
}
- public int getValue(FOContext context, FObj fobj, byte direction) {
+ public int getValue(final FOContext context, final FObj fobj,
+ final byte direction) {
if (this.value instanceof DtInteger) {
return ((DtInteger) this.value).getValue();
}
if (this.value instanceof PropertyKeyword) {
- short keyword = ((PropertyKeyword) this.value).getValue();
+ final short keyword = ((PropertyKeyword) this.value).getValue();
switch (keyword) {
case Constants.FOVAL_FORCE: {
return FORCE_VALUE;
}
case Constants.FOVAL_INHERIT: {
- FObj parent = fobj.effectiveParent(context);
+ final FObj parent = fobj.effectiveParent(context);
if (parent != null) {
switch (direction) {
case Constants.DIRECTION_BEFORE: {
@@ -105,7 +107,7 @@
return getValueNoInstance(fobj);
}
- public static int getValueNoInstance(FObj fobj) {
+ public static int getValueNoInstance(final FObj fobj) {
if (fobj instanceof Table) {
return 6;
} else if (fobj instanceof TableCell) {
@@ -128,7 +130,7 @@
return validKeywords;
}
- public static short getPropertyType(byte direction) {
+ public static short getPropertyType(final byte direction) {
switch (direction) {
case Constants.DIRECTION_BEFORE: {
return Constants.FOPROP_BORDER_BEFORE_PRECEDENCE;
Modified: trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java
===================================================================
--- trunk/foray/foray-fotree/src/java/org/foray/fotree/fo/prop/BorderSeparation.java 2006-07-23 00:19:1...
[truncated message content] |