org.vectomatic.dom.svg
Class OMSVGLength

java.lang.Object
  extended by com.google.gwt.core.client.JavaScriptObject
      extended by org.vectomatic.dom.svg.OMSVGLength

public class OMSVGLength
extends com.google.gwt.core.client.JavaScriptObject

The OMSVGLength interface corresponds to the <length> basic data type.

An OMSVGLength object can be designated as read only, which means that attempts to modify the object will result in an exception being thrown, as described below.


Field Summary
static short SVG_LENGTHTYPE_CM
          A value was specified using the cm units defined in CSS2.
static short SVG_LENGTHTYPE_EMS
          A value was specified using the em units defined in CSS2.
static short SVG_LENGTHTYPE_EXS
          A value was specified using the ex units defined in CSS2.
static short SVG_LENGTHTYPE_IN
          A value was specified using the in units defined in CSS2.
static short SVG_LENGTHTYPE_MM
          A value was specified using the mm units defined in CSS2.
static short SVG_LENGTHTYPE_NUMBER
          No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units.
static short SVG_LENGTHTYPE_PC
          A value was specified using the pc units defined in CSS2.
static short SVG_LENGTHTYPE_PERCENTAGE
          A percentage value was specified.
static short SVG_LENGTHTYPE_PT
          A value was specified using the pt units defined in CSS2.
static short SVG_LENGTHTYPE_PX
          A value was specified using the px units defined in CSS2.
static short SVG_LENGTHTYPE_UNKNOWN
          The unit type is not one of predefined unit types.
 
Constructor Summary
protected OMSVGLength()
           
 
Method Summary
static com.google.gwt.dom.client.Style.Unit codeToUnit(short unit)
          Converts an SVG length constant to a Style.Unit enum.
 void convertToSpecifiedUnits(short unitType)
          Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType.
 void convertToSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType)
          Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType.
 com.google.gwt.dom.client.Style.Unit getUnit()
          Returns the type of the value as defined by the Style.Unit enum.
 short getUnitType()
          The type of the value as specified by one of the SVG_LENGTHTYPE_ constants defined on this interface.
 float getValue()
          The value as a floating point value, in user units.
 String getValueAsString()
          The value as a string value, in the units expressed by getUnitType().
 float getValueInSpecifiedUnits()
          The value as a floating point value, in the units expressed by getUnitType().
 float getValueInSpecifiedUnits(short unitType)
          The value as a floating point value, in the units expressed by the given unitType.
 float getValueInSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType)
          The value as a floating point value, in the units expressed by the given unitType.
 void newValueSpecifiedUnits(short unitType, float valueInSpecifiedUnits)
          Reset the value as a number with an associated getUnitType(), thereby replacing the values for all of the attributes on the object.
 void newValueSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType, float valueInSpecifiedUnits)
          Reset the value as a number with an associated getUnitType(), thereby replacing the values for all of the attributes on the object.
 void setValue(float value)
          The value as a floating point value, in user units.
 void setValueAsString(String value)
          The value as a string value, in the units expressed by getUnitType().
 void setValueInSpecifiedUnits(float value)
          The value as a floating point value, in the units expressed by getUnitType().
static short unitToCode(com.google.gwt.dom.client.Style.Unit unit)
          Converts a Style.Unit enum to an SVG length constant.
 
Methods inherited from class com.google.gwt.core.client.JavaScriptObject
cast, createArray, createFunction, createObject, equals, hashCode, toSource, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

SVG_LENGTHTYPE_UNKNOWN

public static final short SVG_LENGTHTYPE_UNKNOWN
The unit type is not one of predefined unit types. It is invalid to attempt to define a new value of this type or to attempt to switch an existing value to this type.

See Also:
Constant Field Values

SVG_LENGTHTYPE_NUMBER

public static final short SVG_LENGTHTYPE_NUMBER
No unit type was provided (i.e., a unitless value was specified), which indicates a value in user units.

See Also:
Constant Field Values

SVG_LENGTHTYPE_PERCENTAGE

public static final short SVG_LENGTHTYPE_PERCENTAGE
A percentage value was specified.

See Also:
Constant Field Values

SVG_LENGTHTYPE_EMS

public static final short SVG_LENGTHTYPE_EMS
A value was specified using the em units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_EXS

public static final short SVG_LENGTHTYPE_EXS
A value was specified using the ex units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_PX

public static final short SVG_LENGTHTYPE_PX
A value was specified using the px units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_CM

public static final short SVG_LENGTHTYPE_CM
A value was specified using the cm units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_MM

public static final short SVG_LENGTHTYPE_MM
A value was specified using the mm units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_IN

public static final short SVG_LENGTHTYPE_IN
A value was specified using the in units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_PT

public static final short SVG_LENGTHTYPE_PT
A value was specified using the pt units defined in CSS2.

See Also:
Constant Field Values

SVG_LENGTHTYPE_PC

public static final short SVG_LENGTHTYPE_PC
A value was specified using the pc units defined in CSS2.

See Also:
Constant Field Values
Constructor Detail

OMSVGLength

protected OMSVGLength()
Method Detail

getUnitType

public final short getUnitType()
The type of the value as specified by one of the SVG_LENGTHTYPE_ constants defined on this interface.


getValue

public final float getValue()
The value as a floating point value, in user units. Setting this attribute will cause getValueInSpecifiedUnits() and getValueAsString() to be updated automatically to reflect this setting.


setValue

public final void setValue(float value)
                    throws com.google.gwt.core.client.JavaScriptException
The value as a floating point value, in user units. Setting this attribute will cause getValueInSpecifiedUnits() and getValueAsString() to be updated automatically to reflect this setting.

Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

getValueInSpecifiedUnits

public final float getValueInSpecifiedUnits()
The value as a floating point value, in the units expressed by getUnitType(). Setting this attribute will cause getValue() and getValueAsString() to be updated automatically to reflect this setting.


setValueInSpecifiedUnits

public final void setValueInSpecifiedUnits(float value)
                                    throws com.google.gwt.core.client.JavaScriptException
The value as a floating point value, in the units expressed by getUnitType(). Setting this attribute will cause getValue() and getValueAsString() to be updated automatically to reflect this setting.

Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
com.google.gwt.core.client.JavaScriptException

getValueAsString

public final String getValueAsString()
The value as a string value, in the units expressed by getUnitType(). Setting this attribute will cause getValue(), getValueInSpecifiedUnits() and getUnitType() to be updated automatically to reflect this setting.


setValueAsString

public final void setValueAsString(String value)
                            throws com.google.gwt.core.client.JavaScriptException
The value as a string value, in the units expressed by getUnitType(). Setting this attribute will cause getValue(), getValueInSpecifiedUnits() and getUnitType() to be updated automatically to reflect this setting.

Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
DOMException(SYNTAX_ERR) - Raised if the assigned string cannot be parsed as a valid <length>.
com.google.gwt.core.client.JavaScriptException

newValueSpecifiedUnits

public final void newValueSpecifiedUnits(short unitType,
                                         float valueInSpecifiedUnits)
                                  throws com.google.gwt.core.client.JavaScriptException
Reset the value as a number with an associated getUnitType(), thereby replacing the values for all of the attributes on the object.

Parameters:
unitType - The unit type for the value (e.g., SVG_LENGTHTYPE_MM).
valueInSpecifiedUnits - The new value.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
DOMException(NOT_SUPPORTED_ERR) - Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_ constants defined on this interface).
com.google.gwt.core.client.JavaScriptException

convertToSpecifiedUnits

public final void convertToSpecifiedUnits(short unitType)
                                   throws com.google.gwt.core.client.JavaScriptException
Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes getUnitType(), getValueInSpecifiedUnits() and getValueAsString() might be modified as a result of this method. For example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the getUnitType() would be changed to SVG_LENGTHTYPE_MM, getValueInSpecifiedUnits() would be changed to the numeric value 5 and getValueAsString() would be changed to "5mm".

Parameters:
unitType - The unit type to switch to (e.g., SVG_LENGTHTYPE_MM).
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
DOMException(NOT_SUPPORTED_ERR) - Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_ constants defined on this interface).
com.google.gwt.core.client.JavaScriptException

unitToCode

public static final short unitToCode(com.google.gwt.dom.client.Style.Unit unit)
Converts a Style.Unit enum to an SVG length constant.

Returns:
an SVG length constant.

codeToUnit

public static final com.google.gwt.dom.client.Style.Unit codeToUnit(short unit)
Converts an SVG length constant to a Style.Unit enum.

Returns:
a Style.Unit enum.

getUnit

public final com.google.gwt.dom.client.Style.Unit getUnit()
Returns the type of the value as defined by the Style.Unit enum.


newValueSpecifiedUnits

public final void newValueSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType,
                                         float valueInSpecifiedUnits)
                                  throws com.google.gwt.core.client.JavaScriptException
Reset the value as a number with an associated getUnitType(), thereby replacing the values for all of the attributes on the object.

Parameters:
unitType - The unit type for the value.
valueInSpecifiedUnits - The new value.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
DOMException(NOT_SUPPORTED_ERR) - Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_ constants defined on this interface).
com.google.gwt.core.client.JavaScriptException

convertToSpecifiedUnits

public final void convertToSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType)
                                   throws com.google.gwt.core.client.JavaScriptException
Preserve the same underlying stored value, but reset the stored unit identifier to the given unitType. Object attributes getUnitType(), getValueInSpecifiedUnits() and getValueAsString() might be modified as a result of this method. For example, if the original value were "0.5cm" and the method was invoked to convert to millimeters, then the getUnitType() would be changed to SVG_LENGTHTYPE_MM, getValueInSpecifiedUnits() would be changed to the numeric value 5 and getValueAsString() would be changed to "5mm".

Parameters:
unitType - The unit type to switch to.
Throws:
DOMException(NO_MODIFICATION_ALLOWED_ERR) - Raised when the length corresponds to a read only attribute or when the object itself is read only.
DOMException(NOT_SUPPORTED_ERR) - Raised if unitType is SVG_LENGTHTYPE_UNKNOWN or not a valid unit type constant (one of the other SVG_LENGTHTYPE_ constants defined on this interface).
com.google.gwt.core.client.JavaScriptException

getValueInSpecifiedUnits

public final float getValueInSpecifiedUnits(com.google.gwt.dom.client.Style.Unit unitType)
The value as a floating point value, in the units expressed by the given unitType.

Parameters:
unitType - The unit type to use to express the value.

getValueInSpecifiedUnits

public final float getValueInSpecifiedUnits(short unitType)
The value as a floating point value, in the units expressed by the given unitType.

Parameters:
unitType - The unit type to use to express the value.


Copyright © 2012. All Rights Reserved.