@DOMObjectAttribute @DOMNameAttribute(name="CSSPrimitiveValue") public abstract class CSSPrimitiveValue extends CSSValue
The CSSPrimitiveValue interface represents a single CSS value. This interface may be used to determine the value of a specific style property currently set in a block or to set a specific style property explicitly within the block. An instance of this interface might be obtained from the getPropertyCSSValue method of the CSSStyleDeclaration interface. A CSSPrimitiveValue object only occurs in a context of a CSS property.
Modifier and Type | Field and Description |
---|---|
static int |
CSS_ATTR
The value is a attribute function.
|
static int |
CSS_CH
The value is a length (ch).
|
static int |
CSS_CM
The value is a length (cm).
|
static int |
CSS_COUNTER
The value is a counter or counters function.
|
static int |
CSS_DEG
The value is an angle (deg).
|
static int |
CSS_DIMENSION
The value is a number with an unknown dimension.
|
static int |
CSS_DPCM
The value is a dots per centimeter (dpcm).
|
static int |
CSS_DPI
The value is a dots per inch (dpi).
|
static int |
CSS_DPPX
The value is a dots per ‘px’ unit (dppx).
|
static int |
CSS_EMS
The value is a length (ems).
|
static int |
CSS_EXS
The value is a length (exs).
|
static int |
CSS_GRAD
The value is an angle (grad).
|
static int |
CSS_HZ
The value is a frequency (Hz).
|
static int |
CSS_IDENT
The value is an identifier.
|
static int |
CSS_IN
The value is a length (in).
|
static int |
CSS_KHZ
The value is a frequency (kHz).
|
static int |
CSS_MM
The value is a length (mm).
|
static int |
CSS_MS
The value is a time (ms).
|
static int |
CSS_NUMBER
The value is a simple number.
|
static int |
CSS_PC
The value is a length (pc).
|
static int |
CSS_PERCENTAGE
The value is a percentage.
|
static int |
CSS_PT
The value is a length (pt).
|
static int |
CSS_PX
The value is a length (px).
|
static int |
CSS_RAD
The value is an angle (rad).
|
static int |
CSS_RECT
The value is a rect function.
|
static int |
CSS_REM
The value is a length (rem).
|
static int |
CSS_RGBCOLOR
The value is a RGB color.
|
static int |
CSS_S
The value is a time (s).
|
static int |
CSS_STRING
The value is a STRING.
|
static int |
CSS_UNKNOWN
The value is not a recognized CSS2 value.
|
static int |
CSS_URI
The value is a URI.
|
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST
PropertyChanged
Modifier and Type | Method and Description |
---|---|
abstract Counter |
getCounterValue()
This method is used to get the Counter value.
|
abstract float |
getFloatValue(int unitType)
This method is used to get a float value in a specified unit.
|
abstract int |
getIntValue(int unitType)
This method is used to get an int value in a specified unit.
|
int |
getPrimitiveType()
The type of the value as defined by the constants specified above.
|
abstract Rect |
getRectValue()
This method is used to get the Rect value.
|
abstract RGBColor |
getRGBColorValue()
This method is used to get the RGB color.
|
abstract String |
getStringValue()
This method is used to get the string value.
|
abstract void |
setFloatValue(int unitType,
float floatValue)
A method to set the float value with a specified unit.
|
abstract void |
setIntValue(int unitType,
int intValue)
A method to set the int value with a specified unit.
|
abstract void |
setStringValue(int stringType,
String stringValue)
A method to set the string value with the specified unit.
|
equals, getCSSText, getCSSValueType, hashCode, op_Equality, op_Inequality, setCSSText, toString
fireNotifyPropertyChanged, getCurrentValues, getRuntimesBinding, setCurrentValues, setField, setRuntimesBinding
public static final int CSS_UNKNOWN
The value is not a recognized CSS2 value. The value can only be obtained by using the cssText attribute.
public static final int CSS_NUMBER
The value is a simple number. The value can be obtained by using the getFloatValue method.
public static final int CSS_PERCENTAGE
The value is a percentage. The value can be obtained by using the getFloatValue method.
public static final int CSS_EMS
The value is a length (ems). The value can be obtained by using the getFloatValue method.
public static final int CSS_EXS
The value is a length (exs). The value can be obtained by using the getFloatValue method.
public static final int CSS_PX
The value is a length (px). The value can be obtained by using the getFloatValue method.
public static final int CSS_CM
The value is a length (cm). The value can be obtained by using the getFloatValue method.
public static final int CSS_MM
The value is a length (mm). The value can be obtained by using the getFloatValue method.
public static final int CSS_IN
The value is a length (in). The value can be obtained by using the getFloatValue method.
public static final int CSS_PT
The value is a length (pt). The value can be obtained by using the getFloatValue method.
public static final int CSS_PC
The value is a length (pc). The value can be obtained by using the getFloatValue method.
public static final int CSS_DEG
The value is an angle (deg). The value can be obtained by using the getFloatValue method.
public static final int CSS_RAD
The value is an angle (rad). The value can be obtained by using the getFloatValue method.
public static final int CSS_GRAD
The value is an angle (grad). The value can be obtained by using the getFloatValue method.
public static final int CSS_MS
The value is a time (ms). The value can be obtained by using the getFloatValue method.
public static final int CSS_S
The value is a time (s). The value can be obtained by using the getFloatValue method.
public static final int CSS_HZ
The value is a frequency (Hz). The value can be obtained by using the getFloatValue method.
public static final int CSS_KHZ
The value is a frequency (kHz). The value can be obtained by using the getFloatValue method.
public static final int CSS_DIMENSION
The value is a number with an unknown dimension. The value can be obtained by using the getFloatValue method.
public static final int CSS_REM
The value is a length (rem). The value can be obtained by using the getFloatValue method.
public static final int CSS_CH
The value is a length (ch). The value can be obtained by using the getFloatValue method.
public static final int CSS_STRING
The value is a STRING. The value can be obtained by using the getStringValue method.
public static final int CSS_URI
The value is a URI. The value can be obtained by using the getStringValue method.
public static final int CSS_IDENT
The value is an identifier. The value can be obtained by using the getStringValue method.
public static final int CSS_ATTR
The value is a attribute function. The value can be obtained by using the getStringValue method.
public static final int CSS_COUNTER
The value is a counter or counters function. The value can be obtained by using the GetCounterValue method.
public static final int CSS_RECT
The value is a rect function. The value can be obtained by using the GetRectValue method.
public static final int CSS_RGBCOLOR
The value is a RGB color. The value can be obtained by using the GetRGBColorValue method.
public static final int CSS_DPI
The value is a dots per inch (dpi).
public static final int CSS_DPCM
The value is a dots per centimeter (dpcm).
public static final int CSS_DPPX
The value is a dots per ‘px’ unit (dppx).
@DOMNameAttribute(name="primitiveType") public int getPrimitiveType()
The type of the value as defined by the constants specified above.
Value: The type of the primitive.@DOMNameAttribute(name="setFloatValue") public abstract void setFloatValue(int unitType, float floatValue)
A method to set the float value with a specified unit. If the property attached with this value can not accept the specified unit or the float value, the value will be unchanged and a DOMException will be raised.
unitType
- Type of the unit.floatValue
- The float value.@DOMNameAttribute(name="getFloatValue") public abstract float getFloatValue(int unitType)
This method is used to get a float value in a specified unit. If this CSS value doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised.
unitType
- Type of the unit.public abstract void setIntValue(int unitType, int intValue)
A method to set the int value with a specified unit. If the property attached with this value can not accept the specified unit or the int value, the value will be unchanged and a DOMException will be raised.
unitType
- Type of the unit.intValue
- The int value.public abstract int getIntValue(int unitType)
This method is used to get an int value in a specified unit. If this CSS value doesn't contain an int value or can't be converted into the specified unit, a DOMException is raised.
unitType
- Type of the unit.@DOMNameAttribute(name="setStringValue") public abstract void setStringValue(int stringType, String stringValue)
A method to set the string value with the specified unit. If the property attached to this value can't accept the specified unit or the string value, the value will be unchanged and a DOMException will be raised.
stringType
- Type of the string.stringValue
- The string value.@DOMNameAttribute(name="getStringValue") public abstract String getStringValue()
This method is used to get the string value. If the CSS value doesn't contain a string value, a DOMException is raised.
@DOMNameAttribute(name="getCounterValue") public abstract Counter getCounterValue()
This method is used to get the Counter value. If this CSS value doesn't contain a counter value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Counter interface.
@DOMNameAttribute(name="getRectValue") public abstract Rect getRectValue()
This method is used to get the Rect value. If this CSS value doesn't contain a rect value, a DOMException is raised. Modification to the corresponding style property can be achieved using the Rect interface.
@DOMNameAttribute(name="getRGBColorValue") public abstract RGBColor getRGBColorValue()
This method is used to get the RGB color. If this CSS value doesn't contain a RGB color value, a DOMException is raised. Modification to the corresponding style property can be achieved using the RGBColor interface.