pbwest 2002/11/29 08:33:17
Modified: src/org/apache/fop/fo/properties Tag: FOP_0-20-0_Alt-Design
BorderWidth.java
Log:
Added MAPPED_LENGTH to dataTypes.
Added getMappedLength().
Revision Changes Path
No revision
No revision
1.1.2.6 +27 -1 xml-fop/src/org/apache/fop/fo/properties/Attic/BorderWidth.java
Index: BorderWidth.java
===================================================================
RCS file: /home/cvs/xml-fop/src/org/apache/fop/fo/properties/Attic/BorderWidth.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- BorderWidth.java 13 Nov 2002 03:48:32 -0000 1.1.2.5
+++ BorderWidth.java 29 Nov 2002 16:33:17 -0000 1.1.2.6
@@ -14,7 +14,10 @@
import java.util.Iterator;
public class BorderWidth extends BorderCommonWidth {
- public static final int dataTypes = SHORTHAND;
+ // Below is a special case defying the general rule that shorthands do
+ // not require specific data type settings. This one is neded for the
+ // MappedNumeric generataion in checkBorderWidth().
+ public static final int dataTypes = MAPPED_LENGTH | SHORTHAND;
public static final int traitMapping = SHORTHAND_MAP;
public static final int initialValueType = NOTYPE_IT;
public static final int inherited = NO;
@@ -142,6 +145,14 @@
}
}
+ /**
+ * Attempt to convert the <tt>PropertyValue</tt> into a length.
+ * This may not be necessary, as it may be possible to pass
+ * unconverted values directly to the <i>refineExpansionList()</i>
+ * method.
+ * @param property the property idex.
+ * @param value the property value being converted.
+ */
private Numeric checkBorderWidth(int property, PropertyValue value)
throws PropertyException
{
@@ -159,5 +170,20 @@
}
throw new PropertyException("Invalid border-width value: " + value);
}
+
+ /**
+ * Get mapped numeric length. This may not be necessary. It may be
+ * feasible to simply pass the unrefined values to
+ * <i>refineExpansionList()</i>.
+ * @param node the node for which the mapped length is being
+ * derived.
+ * @param enum the enum value which is being mapped to a length.
+ */
+ public Numeric getMappedLength(FONode node, int enum)
+ throws PropertyException
+ {
+ return getMappedLength(node, PropNames.BORDER_WIDTH, enum);
+ }
+
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]