| |
|
| java.lang.Object org.wings.SDimension
SDimension | public class SDimension implements Serializable(Code) | | Holds preferred component sizes (dimensions).
Web browsers support different notations for sizes. Absolute pixel values,
realtive percentages (of the available viewport) and
special CSS values as 'inherit' and 'auto' (Default).
This class if capable of handling all these cases.
|
Field Summary | |
final public static String | AUTO String constant for CSS dimension 'auto'. | final public static SDimension | AUTOAREA | final public static int | AUTO_INT Integer constant for CSS dimension 'auto'. | final public static SDimension | FULLAREA Immutable SDimension constants for a component taking up the full available area. | final public static SDimension | FULLHEIGHT Immutable SDimension constants for a component taking up the full available height. | final public static SDimension | FULLWIDTH Immutable SDimension constants for a component taking up the full available width. | final public static String | INHERIT String for CSS dimension 'inherit'. | final public static int | INHERIT_INT Integer constant for CSS dimension 'inherit'. |
Constructor Summary | |
public | SDimension() | public | SDimension(String width, String height) | public | SDimension(int width, int height) Construct a new dimension with absolute values.
The value is interpreted as absolute pixel values.
Parameters: width - the preferred width in pixel. | public | SDimension(Integer width, Integer height) Construct a new dimension with absolute values.
The value is interpreted as absolute pixel values.
Parameters: width - the preferred width in pixel. |
AUTO | final public static String AUTO(Code) | | String constant for CSS dimension 'auto'.
This is the default width used by wings as well as by CSS capable browsers.
|
AUTOAREA | final public static SDimension AUTOAREA(Code) | | Immutable SDimension constants for a component taking up normal space
|
AUTO_INT | final public static int AUTO_INT(Code) | | Integer constant for CSS dimension 'auto'.
This is the default width used by wings as well as by CSS capable browsers.
|
FULLAREA | final public static SDimension FULLAREA(Code) | | Immutable SDimension constants for a component taking up the full available area.
|
FULLHEIGHT | final public static SDimension FULLHEIGHT(Code) | | Immutable SDimension constants for a component taking up the full available height.
|
FULLWIDTH | final public static SDimension FULLWIDTH(Code) | | Immutable SDimension constants for a component taking up the full available width.
|
INHERIT | final public static String INHERIT(Code) | | String for CSS dimension 'inherit'.
With this value the preferred size is inherited by the surrounding element.
|
INHERIT_INT | final public static int INHERIT_INT(Code) | | Integer constant for CSS dimension 'inherit'.
With this value the preferred size is inherited by the surrounding element.
|
SDimension | public SDimension()(Code) | | |
SDimension | public SDimension(int width, int height)(Code) | | Construct a new dimension with absolute values.
The value is interpreted as absolute pixel values.
Parameters: width - the preferred width in pixel. Use -1 for AUTO. Parameters: height - the preferred height in pixel. Use -1 for AUTO. See Also: SDimension.setSize(int,int) |
SDimension | public SDimension(Integer width, Integer height)(Code) | | Construct a new dimension with absolute values.
The value is interpreted as absolute pixel values.
Parameters: width - the preferred width in pixel. You may pass null . Parameters: height - the preferred height in pixel. You may pass null . See Also: SDimension.setSize(int,int) |
extractNumericValue | protected int extractNumericValue(String value)(Code) | | Extract number from string.
extracted integer. f.e.: "120px" becomes 120 or SDimension.AUTO_INT if null |
getHeight | public String getHeight()(Code) | | The preferred height i.e. like 120px or 80% or auto |
getHeightInt | public int getHeightInt()(Code) | | Get just the height as number without trailing
unit.
|
getIntValue | protected int getIntValue(String sizeString)(Code) | | Extract number from string.
extracted integer. f.e.: "120px" becomes 120 |
getWidth | public String getWidth()(Code) | | The preferred width i.e. like 120px or 80% or auto |
getWidthInt | public int getWidthInt()(Code) | | Get just the width as number without trailing
unit.
|
hashCode | public int hashCode()(Code) | | |
setHeight | public void setHeight(String height)(Code) | | Sets the preferred height via an string. Expects an dimension/unit compount i.e.
"120px" or "80%" but will assume px by default.
Parameters: height - A preferred height. |
setHeight | public void setHeight(int height)(Code) | | Set height in pixel.
This appends "px" to the integer value.
Parameters: height - if -1 set SDimension.heightInt to null |
setWidth | public void setWidth(String width)(Code) | | Sets the preferred width via an string. Expects an dimension/unit compount i.e.
"120px" or "80%" but will assume px by default.
Parameters: width - A preferred witdth. |
setWidth | public void setWidth(int width)(Code) | | Set width in pixel.
This appends "px" to the integer value.
Parameters: width - if -1 set SDimension.widthInt to null |
|
|
|