Package org.apache.batik.anim.dom
Class AbstractSVGLength
java.lang.Object
org.apache.batik.anim.dom.AbstractSVGLength
- All Implemented Interfaces:
org.w3c.dom.svg.SVGLength
- Direct Known Subclasses:
AbstractSVGAnimatedLength.AnimSVGLength
,AbstractSVGAnimatedLength.BaseSVGLength
,AbstractSVGLengthList.SVGLengthItem
,SVGOMLength
Default implementation for SVGLength.
This implementation provides the basic
functionalities of SVGLength. To have
a complete implementation, an element is
required to resolve the units.
According to the usage of this AbstractSVGLength,
the
reset()
method is after
changes being made to the unitType or the value
of this length. Before any values are return
to the user of the AbstractSVGLength, the
revalidate()
method is being called
to insure the validity of the value and unit type
held by this object.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected class
To resolve the units. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected UnitProcessor.Context
The context used to resolve the units.protected short
This length's direction.static final short
This constant represents horizontal lengths.static final short
This constant represents other lengths.protected static final String[]
The unit string representations.protected short
The type of this length.protected float
The value of this length.static final short
This constant represents vertical lengths.Fields inherited from interface org.w3c.dom.svg.SVGLength
SVG_LENGTHTYPE_CM, SVG_LENGTHTYPE_EMS, SVG_LENGTHTYPE_EXS, SVG_LENGTHTYPE_IN, SVG_LENGTHTYPE_MM, SVG_LENGTHTYPE_NUMBER, SVG_LENGTHTYPE_PC, SVG_LENGTHTYPE_PERCENTAGE, SVG_LENGTHTYPE_PT, SVG_LENGTHTYPE_PX, SVG_LENGTHTYPE_UNKNOWN
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
convertToSpecifiedUnits
(short unit) DOM: ImplementsSVGLength.convertToSpecifiedUnits(short)
.protected abstract SVGOMElement
Return the SVGElement associated to this length.short
DOM: ImplementsSVGLength.getUnitType()
.float
getValue()
DOM: ImplementsSVGLength.getValue()
.DOM: ImplementsSVGLength.getValueAsString()
.float
DOM: ImplementsSVGLength.getValueInSpecifiedUnits()
.void
newValueSpecifiedUnits
(short unit, float value) DOM: ImplementsSVGLength.newValueSpecifiedUnits(short,float)
.protected void
Parse a String value as a SVGLength.protected void
reset()
Callback method after changes made to this length.protected void
Callback method before any value is return from this length.void
setValue
(float value) DOM: ImplementsSVGLength.setValue(float)
.void
setValueAsString
(String value) DOM: ImplementsSVGLength.setValueAsString(String)
.void
setValueInSpecifiedUnits
(float value) DOM: ImplementsSVGLength.setValueInSpecifiedUnits(float)
.
-
Field Details
-
HORIZONTAL_LENGTH
public static final short HORIZONTAL_LENGTHThis constant represents horizontal lengths.- See Also:
-
VERTICAL_LENGTH
public static final short VERTICAL_LENGTHThis constant represents vertical lengths.- See Also:
-
OTHER_LENGTH
public static final short OTHER_LENGTHThis constant represents other lengths.- See Also:
-
unitType
protected short unitTypeThe type of this length. -
value
protected float valueThe value of this length. -
direction
protected short directionThis length's direction. -
context
The context used to resolve the units. -
UNITS
The unit string representations.
-
-
Constructor Details
-
AbstractSVGLength
public AbstractSVGLength(short direction) Creates a new AbstractSVGLength.
-
-
Method Details
-
getAssociatedElement
Return the SVGElement associated to this length. -
getUnitType
public short getUnitType()DOM: ImplementsSVGLength.getUnitType()
.- Specified by:
getUnitType
in interfaceorg.w3c.dom.svg.SVGLength
-
getValue
public float getValue()DOM: ImplementsSVGLength.getValue()
.- Specified by:
getValue
in interfaceorg.w3c.dom.svg.SVGLength
-
setValue
DOM: ImplementsSVGLength.setValue(float)
.- Specified by:
setValue
in interfaceorg.w3c.dom.svg.SVGLength
- Throws:
DOMException
-
getValueInSpecifiedUnits
public float getValueInSpecifiedUnits()DOM: ImplementsSVGLength.getValueInSpecifiedUnits()
.- Specified by:
getValueInSpecifiedUnits
in interfaceorg.w3c.dom.svg.SVGLength
-
setValueInSpecifiedUnits
DOM: ImplementsSVGLength.setValueInSpecifiedUnits(float)
.- Specified by:
setValueInSpecifiedUnits
in interfaceorg.w3c.dom.svg.SVGLength
- Throws:
DOMException
-
getValueAsString
DOM: ImplementsSVGLength.getValueAsString()
.- Specified by:
getValueAsString
in interfaceorg.w3c.dom.svg.SVGLength
-
setValueAsString
DOM: ImplementsSVGLength.setValueAsString(String)
.- Specified by:
setValueAsString
in interfaceorg.w3c.dom.svg.SVGLength
- Throws:
DOMException
-
newValueSpecifiedUnits
public void newValueSpecifiedUnits(short unit, float value) DOM: ImplementsSVGLength.newValueSpecifiedUnits(short,float)
.- Specified by:
newValueSpecifiedUnits
in interfaceorg.w3c.dom.svg.SVGLength
-
convertToSpecifiedUnits
public void convertToSpecifiedUnits(short unit) DOM: ImplementsSVGLength.convertToSpecifiedUnits(short)
.- Specified by:
convertToSpecifiedUnits
in interfaceorg.w3c.dom.svg.SVGLength
-
reset
protected void reset()Callback method after changes made to this length. The default implementation does nothing. -
revalidate
protected void revalidate()Callback method before any value is return from this length. The default implementation does nothing. -
parse
Parse a String value as a SVGLength. Initialize this length with the result of the parsing of this value.- Parameters:
s
- String representation of a SVGlength.
-