org.w3c.dom.css
Interface CSS2PageSize

All Superinterfaces:
CSSValue

public interface CSS2PageSize
extends CSSValue

The CSS2PageSize interface represents the size CSS Level 2 descriptor.

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 getHeightSize(float hType)
          This method is used to get the float value in a specified unit if the heightType represents a length.
 short getHeightType()
          A code defining the type of the height of the page.
 java.lang.String getIdentifier()
          If width is CSS_IDENT , this attribute contains the string representation of the ident, otherwise it contains an empty string.
 float getWidth(float wType)
          This method is used to get the float value in a specified unit if the widthType represents a length.
 short getWidthType()
          A code defining the type of the width of the page.
 void setHeightSize(short hType, float value)
          This method is used to set the height position with a specified unit.
 void setIdentifier(java.lang.String ident)
          Sets the identifier.
 void setWidthSize(short wType, float value)
          This method is used to set the width position with a specified unit.
 
Methods inherited from interface org.w3c.dom.css.CSSValue
getCssText, getCssValueType, setCssText
 

Method Detail

getWidthType

public short getWidthType()
A code defining the type of the width of the page. It would be one of CSS_EMS , CSS_EXS , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT , CSS_PC or CSS_IDENT .

getHeightType

public short getHeightType()
A code defining the type of the height of the page. It would be one of CSS_EMS , CSS_EXS , CSS_PX , CSS_CM , CSS_MM , CSS_IN , CSS_PT , CSS_PC or CSS_IDENT . If one of width or height is CSS_IDENT , it's guaranteed that the other is the same.

getIdentifier

public java.lang.String getIdentifier()
If width is CSS_IDENT , this attribute contains the string representation of the ident, otherwise it contains an empty string.

getWidth

public float getWidth(float wType)
               throws DOMException
This method is used to get the float value in a specified unit if the widthType 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:
wType - The width 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.

getHeightSize

public float getHeightSize(float hType)
                    throws DOMException
This method is used to get the float value in a specified unit if the heightType 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. If only the width value has been specified, the height value is the same.
Parameters:
hType - The height 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.

setWidthSize

public void setWidthSize(short wType,
                         float value)
                  throws DOMException
This method is used to set the width position with a specified unit. If the heightType is not a length, it sets the height position to the same value.
Parameters:
wType - The width 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.

setHeightSize

public void setHeightSize(short hType,
                          float value)
                   throws DOMException
This method is used to set the height position with a specified unit. If the widthType is not a length, it sets the width position to the same value.
Parameters:
hType - The height 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.

setIdentifier

public void setIdentifier(java.lang.String ident)
                   throws DOMException
Sets the identifier.
Parameters:
ident - The new identifier.
Throws:
DOMException - SYNTAX_ERR: Raised if the identifier has a syntax error and is unparsable.
NO_MODIFICATION_ALLOWED_ERR: Raised if this property is readonly.

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