| org.w3c.dom.css.CSS2BackgroundPosition
CSS2BackgroundPosition | public interface CSS2BackgroundPosition extends CSSValue(Code) | | The CSS2BackgroundPosition interface represents the
background-position 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 |
Method Summary | |
public String | getHorizontalIdentifier() If horizontalType is CSS_IDENT or
CSS_INHERIT , this attribute contains the string
representation of the ident, otherwise it contains an empty string. | public float | getHorizontalPosition(float hType) This method is used to get the float value in a specified unit if the
horizontalPosition represents a length or a percentage. | public short | getHorizontalType() A code defining the type of the horizontal value. | public String | getVerticalIdentifier() If verticalType is CSS_IDENT or
CSS_INHERIT , this attribute contains the string
representation of the ident, otherwise it contains an empty string. | public float | getVerticalPosition(float vType) This method is used to get the float value in a specified unit if the
verticalPosition represents a length or a percentage. | public short | getVerticalType() A code defining the type of the horizontal value. | public void | setHorizontalPosition(short hType, float value) This method is used to set the horizontal position with a specified
unit. | public void | setPositionIdentifier(String hIdentifier, String vIdentifier) Sets the identifiers. | public void | setVerticalPosition(short vType, float value) This method is used to set the vertical position with a specified
unit. |
getHorizontalIdentifier | public String getHorizontalIdentifier()(Code) | | If horizontalType is CSS_IDENT or
CSS_INHERIT , this attribute contains the string
representation of the ident, otherwise it contains an empty string.
|
getHorizontalPosition | public float getHorizontalPosition(float hType) throws DOMException(Code) | | This method is used to get the float value in a specified unit if the
horizontalPosition represents a length or a percentage. 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. The float value. exception: DOMException - INVALID_ACCESS_ERR: Raised if the property doesn't contain a float or the value can't be converted. |
getHorizontalType | public short getHorizontalType()(Code) | | A code defining the type of the horizontal value. It would be one of
CSS_PERCENTAGE , CSS_EMS ,
CSS_EXS , CSS_PX , CSS_CM ,
CSS_MM , CSS_IN , CSS_PT ,
CSS_PC or CSS_IDENT . If one of horizontal or
vertical is CSS_IDENT , it's guaranteed that the other is
the same.
|
getVerticalIdentifier | public String getVerticalIdentifier()(Code) | | If verticalType is CSS_IDENT or
CSS_INHERIT , this attribute contains the string
representation of the ident, otherwise it contains an empty string. The
value is "center" if only the horizontalIdentifier has
been set.
|
getVerticalPosition | public float getVerticalPosition(float vType) throws DOMException(Code) | | This method is used to get the float value in a specified unit if the
verticalPosition represents a length or a percentage. 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
50% if only the horizontal value has been specified.
Parameters: vType - The vertical unit. The float value. exception: DOMException - INVALID_ACCESS_ERR: Raised if the property doesn't contain a float or the value can't be converted. |
getVerticalType | public short getVerticalType()(Code) | | A code defining the type of the horizontal value. The code can be one
of the following units : CSS_PERCENTAGE ,
CSS_EMS , CSS_EXS , CSS_PX ,
CSS_CM , CSS_MM , CSS_IN ,
CSS_PT , CSS_PC , CSS_IDENT ,
CSS_INHERIT . If one of horizontal or vertical is
CSS_IDENT or CSS_INHERIT , it's guaranteed
that the other is the same.
|
setHorizontalPosition | public void setHorizontalPosition(short hType, float value) throws DOMException(Code) | | This method is used to set the horizontal position with a specified
unit. If the vertical value is not a percentage or a length, it sets
the vertical position to 50% .
Parameters: hType - The specified unit (a length or a percentage). Parameters: value - The new value. exception: 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. |
setPositionIdentifier | public void setPositionIdentifier(String hIdentifier, String vIdentifier) throws DOMException(Code) | | Sets the identifiers. If the second identifier is the empty string,
the vertical identifier is set to its default value (
"center" ).
Parameters: hIdentifier - The new horizontal identifier. Parameters: vIdentifier - The new vertical identifier. exception: DOMException - SYNTAX_ERR: Raised if the identifiers have a syntax error and are unparsable. NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly. |
setVerticalPosition | public void setVerticalPosition(short vType, float value) throws DOMException(Code) | | This method is used to set the vertical position with a specified
unit. If the horizontal value is not a percentage or a length, it sets
the vertical position to 50% .
Parameters: vType - The specified unit (a length or a percentage). Parameters: value - The new value. exception: 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. |
|
|