|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnextapp.echo2.webcontainer.propertyrender.ExtentRender
public class ExtentRender
Utility class for rendering nextapp.echo2.app.Extent
properties to CSS.
| Method Summary | |
|---|---|
static boolean |
isZeroLength(Extent extent)
Determines if the given Extent is of zero length. |
static java.lang.String |
renderCssAttributePixelValue(Extent extent)
Attempts to render a given Extent to a pixel CSS attribute
value. |
static java.lang.String |
renderCssAttributeValue(Extent extent)
Renders an Extent property value to a CSS dimensioned
attribute value. |
static java.lang.String |
renderCssAttributeValueHalf(Extent extent)
Renders 1/2 the distance specified by an Extent property
value to a CSS dimensioned attribute. |
static void |
renderToStyle(CssStyle cssStyle,
java.lang.String cssAttribute,
Extent extent)
Renders an Extent property to the given CSS style. |
static java.lang.String |
renderUnits(int units)
Renders the given Extent units constant into a CSS
unit suffix. |
static Extent |
toExtent(java.lang.String extentString)
Creates an Extent from the given CSS dimensioned attribute
value. |
static int |
toPixels(Extent extent,
int defaultPixels)
Attempts to convert a given Extent to a pixel value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static boolean isZeroLength(Extent extent)
Extent is of zero length.
This method interprets null Extents to be of zero
length.
extent - the extent
public static final java.lang.String renderCssAttributePixelValue(Extent extent)
Extent to a pixel CSS attribute
value. Returns null if the the extent can not be represented by a pixel
value.
extent - the property value
public static final java.lang.String renderCssAttributeValue(Extent extent)
Extent property value to a CSS dimensioned
attribute value.
extent - the property value
public static final java.lang.String renderCssAttributeValueHalf(Extent extent)
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.
extent - the property value
public static final void renderToStyle(CssStyle cssStyle,
java.lang.String cssAttribute,
Extent extent)
Extent property to the given CSS style.
Null property values are ignored.
cssStyle - the target CssStylecssAttribute - the CSS attribute name, e.g., "width" or "height".extent - the property valuepublic static final java.lang.String renderUnits(int units)
Extent units constant into a CSS
unit suffix.
units - the Extent units constant value
public static final Extent toExtent(java.lang.String extentString)
Extent from the given CSS dimensioned attribute
value.
extentString - the CSS dimensioned attribute value
Extent, or null if the input
is not valid.
public static final int toPixels(Extent extent,
int defaultPixels)
Extent to a pixel value.
Returns defaultPixels if the conversion is not possible.
extent - the Extent to convertdefaultPixels - the pixel value to return if conversion is
impossible.
extent in pixels
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||