toExtent(String extentString) Creates an Extent from the given CSS dimensioned attribute
value.
final public static int
toPixels(Extent extent, int defaultPixels) Attempts to convert a given Extent to a pixel value.
Method Detail
isZeroLength
public static boolean isZeroLength(Extent extent)(Code)
Determines if the given Extent is of zero length.
This method interprets null Extents to be of zero
length.
Parameters: extent - the extent true if the extent is of zero length
renderCssAttributePixelValue
final public static String renderCssAttributePixelValue(Extent extent)(Code)
Attempts to render a given Extent to a pixel CSS attribute
value. Returns null if the the extent can not be represented by a pixel
value.
Parameters: extent - the property value the CSS attribute value
renderCssAttributePixelValue
final public static String renderCssAttributePixelValue(Extent extent, String invalidValue)(Code)
Attempts to render a given Extent to a pixel CSS attribute
value. Returns the specified invalidValue if the specified
Extent is not valid.
Parameters: extent - the property value the CSS attribute value to return if the provided value is not a validpixel value the CSS attribute value
Renders an Extent property value to a CSS dimensioned
attribute value.
Parameters: extent - the property value the CSS attribute value
renderCssAttributeValueHalf
final public static String renderCssAttributeValueHalf(Extent extent)(Code)
Renders 1/2 the distance specified by an Extent property
value to a CSS dimensioned attribute.
For example, an extent that would normally render as "3px" would be
rendered as "1.5px" by this method.
Parameters: extent - the property value the CSS attribute value
Renders an Extent property to the given CSS style.
Null property values are ignored.
Parameters: cssStyle - the target CssStyle Parameters: cssAttribute - the CSS attribute name, e.g., "width" or "height". Parameters: extent - the property value
renderUnits
final public static String renderUnits(int units)(Code)
Renders the given Extent units constant into a CSS
unit suffix.
Parameters: units - the Extent units constant value the CSS unit suffix
Creates an Extent from the given CSS dimensioned attribute
value.
Parameters: extentString - the CSS dimensioned attribute value an equivalent Extent, or null if the input is not valid.
toPixels
final public static int toPixels(Extent extent, int defaultPixels)(Code)
Attempts to convert a given Extent to a pixel value.
Returns defaultPixels if the conversion is not possible.
Parameters: extent - the Extent to convert Parameters: defaultPixels - the pixel value to return if conversion is impossible. the value of the extent in pixels