org.w3c.dom.css
Interface CSS2BorderSpacing

All Superinterfaces:
CSSValue

public interface CSS2BorderSpacing
extends CSSValue

The CSS2BorderSpacing interface represents the border-spacing CSS Level 2 property.

For this extension of the CSSValue interface, the valueType attribute of the underlying CSSValue interface shall be CSS_CUSTOM .

See also the Document Object Model (DOM) Level 2 Specification.

Since:
DOM Level 2

Fields inherited from interface org.w3c.dom.css.CSSValue
CSS_CUSTOM, CSS_INHERIT, CSS_PRIMITIVE_VALUE, CSS_VALUE_LIST
 
Method Summary
 float getHorizontalSpacing(float hType)
          This method is used to get the float value in a specified unit if the horizontalSpacing represents a length.
 short getHorizontalType()
          The A code defining the type of the value as defined in CSSValue .
 float getVerticalSpacing(float vType)
          This method is used to get the float value in a specified unit if the verticalSpacing represents a length.
 short getVerticalType()
          The A code defining the type of the value as defined in CSSValue .
 void setHorizontalSpacing(short hType, float value)
          This method is used to set the horizontal spacing with a specified unit.
 void setVerticalSpacing(short vType, float value)
          This method is used to set the vertical spacing with a specified unit.
 
Methods inherited from interface org.w3c.dom.css.CSSValue
getCssText, getCssValueType, setCssText
 

Method Detail

getHorizontalType

public short getHorizontalType()
The A code defining the type of the value as defined in CSSValue . It would be one of CSS_EMS , CSS_EXS , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT or CSS_PC .

getVerticalType

public short getVerticalType()
The A code defining the type of the value as defined in CSSValue . It would be one of CSS_EMS , CSS_EXS , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT , CSS_PC or CSS_INHERIT .

getHorizontalSpacing

public float getHorizontalSpacing(float hType)
                           throws DOMException
This method is used to get the float value in a specified unit if the horizontalSpacing represents a length. If the float doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised.
Parameters:
hType - The horizontal unit.
Returns:
The float value.
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the property doesn't contain a float or the value can't be converted.

getVerticalSpacing

public float getVerticalSpacing(float vType)
                         throws DOMException
This method is used to get the float value in a specified unit if the verticalSpacing represents a length. If the float doesn't contain a float value or can't be converted into the specified unit, a DOMException is raised. The value is 0 if only the horizontal value has been specified.
Parameters:
vType - The vertical unit.
Returns:
The float value.
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the property doesn't contain a float or the value can't be converted.

setHorizontalSpacing

public void setHorizontalSpacing(short hType,
                                 float value)
                          throws DOMException
This method is used to set the horizontal spacing with a specified unit. If the vertical value is a length, it sets the vertical spacing to 0 .
Parameters:
hType - The horizontal unit.
value - The new value.
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the specified unit is not a length.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

setVerticalSpacing

public void setVerticalSpacing(short vType,
                               float value)
                        throws DOMException
This method is used to set the vertical spacing with a specified unit. If the horizontal value is not a length, it sets the vertical spacing to 0 .
Parameters:
vType - The vertical unit.
value - The new value.
Throws:
DOMException - INVALID_ACCESS_ERR: Raised if the specified unit is not a length or a percentage.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

Source code is GPL'd at http://xmlconf.sourceforge.net.