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
public abstract class AbstractSVGLength extends java.lang.Object implements org.w3c.dom.svg.SVGLengthDefault 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, thereset()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, therevalidate()method is being called to insure the validity of the value and unit type held by this object.- Version:
- $Id: AbstractSVGLength.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected classAbstractSVGLength.DefaultContextTo resolve the units.
-
Field Summary
Fields Modifier and Type Field Description protected UnitProcessor.ContextcontextThe context used to resolve the units.protected shortdirectionThis length's direction.static shortHORIZONTAL_LENGTHThis constant represents horizontal lengths.static shortOTHER_LENGTHThis constant represents other lengths.protected static java.lang.String[]UNITSThe unit string representations.protected shortunitTypeThe type of this length.protected floatvalueThe value of this length.static shortVERTICAL_LENGTHThis constant represents vertical lengths.
-
Constructor Summary
Constructors Constructor Description AbstractSVGLength(short direction)Creates a new AbstractSVGLength.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description voidconvertToSpecifiedUnits(short unit)DOM: ImplementsSVGLength.convertToSpecifiedUnits(short).protected abstract SVGOMElementgetAssociatedElement()Return the SVGElement associated to this length.shortgetUnitType()DOM: ImplementsSVGLength.getUnitType().floatgetValue()DOM: ImplementsSVGLength.getValue().java.lang.StringgetValueAsString()DOM: ImplementsSVGLength.getValueAsString().floatgetValueInSpecifiedUnits()DOM: ImplementsSVGLength.getValueInSpecifiedUnits().voidnewValueSpecifiedUnits(short unit, float value)DOM: ImplementsSVGLength.newValueSpecifiedUnits(short,float).protected voidparse(java.lang.String s)Parse a String value as a SVGLength.protected voidreset()Callback method after changes made to this length.protected voidrevalidate()Callback method before any value is return from this length.voidsetValue(float value)DOM: ImplementsSVGLength.setValue(float).voidsetValueAsString(java.lang.String value)DOM: ImplementsSVGLength.setValueAsString(String).voidsetValueInSpecifiedUnits(float value)DOM: ImplementsSVGLength.setValueInSpecifiedUnits(float).
-
-
-
Field Detail
-
HORIZONTAL_LENGTH
public static final short HORIZONTAL_LENGTH
This constant represents horizontal lengths.- See Also:
- Constant Field Values
-
VERTICAL_LENGTH
public static final short VERTICAL_LENGTH
This constant represents vertical lengths.- See Also:
- Constant Field Values
-
OTHER_LENGTH
public static final short OTHER_LENGTH
This constant represents other lengths.- See Also:
- Constant Field Values
-
unitType
protected short unitType
The type of this length.
-
value
protected float value
The value of this length.
-
direction
protected short direction
This length's direction.
-
context
protected UnitProcessor.Context context
The context used to resolve the units.
-
UNITS
protected static final java.lang.String[] UNITS
The unit string representations.
-
-
Method Detail
-
getAssociatedElement
protected abstract SVGOMElement getAssociatedElement()
Return the SVGElement associated to this length.
-
getUnitType
public short getUnitType()
DOM: ImplementsSVGLength.getUnitType().- Specified by:
getUnitTypein interfaceorg.w3c.dom.svg.SVGLength
-
getValue
public float getValue()
DOM: ImplementsSVGLength.getValue().- Specified by:
getValuein interfaceorg.w3c.dom.svg.SVGLength
-
setValue
public void setValue(float value) throws org.w3c.dom.DOMExceptionDOM: ImplementsSVGLength.setValue(float).- Specified by:
setValuein interfaceorg.w3c.dom.svg.SVGLength- Throws:
org.w3c.dom.DOMException
-
getValueInSpecifiedUnits
public float getValueInSpecifiedUnits()
DOM: ImplementsSVGLength.getValueInSpecifiedUnits().- Specified by:
getValueInSpecifiedUnitsin interfaceorg.w3c.dom.svg.SVGLength
-
setValueInSpecifiedUnits
public void setValueInSpecifiedUnits(float value) throws org.w3c.dom.DOMExceptionDOM: ImplementsSVGLength.setValueInSpecifiedUnits(float).- Specified by:
setValueInSpecifiedUnitsin interfaceorg.w3c.dom.svg.SVGLength- Throws:
org.w3c.dom.DOMException
-
getValueAsString
public java.lang.String getValueAsString()
DOM: ImplementsSVGLength.getValueAsString().- Specified by:
getValueAsStringin interfaceorg.w3c.dom.svg.SVGLength
-
setValueAsString
public void setValueAsString(java.lang.String value) throws org.w3c.dom.DOMExceptionDOM: ImplementsSVGLength.setValueAsString(String).- Specified by:
setValueAsStringin interfaceorg.w3c.dom.svg.SVGLength- Throws:
org.w3c.dom.DOMException
-
newValueSpecifiedUnits
public void newValueSpecifiedUnits(short unit, float value)DOM: ImplementsSVGLength.newValueSpecifiedUnits(short,float).- Specified by:
newValueSpecifiedUnitsin interfaceorg.w3c.dom.svg.SVGLength
-
convertToSpecifiedUnits
public void convertToSpecifiedUnits(short unit)
DOM: ImplementsSVGLength.convertToSpecifiedUnits(short).- Specified by:
convertToSpecifiedUnitsin 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
protected void parse(java.lang.String s)
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.
-
-