public abstract class AbstractSVGLength extends java.lang.Object implements org.w3c.dom.svg.SVGLength
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.Modifier and Type | Class and Description |
---|---|
protected class |
AbstractSVGLength.DefaultContext
To resolve the units.
|
Modifier and Type | Field and Description |
---|---|
protected UnitProcessor.Context |
context
The context used to resolve the units.
|
protected short |
direction
This length's direction.
|
static short |
HORIZONTAL_LENGTH
This constant represents horizontal lengths.
|
static short |
OTHER_LENGTH
This constant represents other lengths.
|
protected static java.lang.String[] |
UNITS
The unit string representations.
|
protected short |
unitType
The type of this length.
|
protected float |
value
The value of this length.
|
static short |
VERTICAL_LENGTH
This constant represents vertical lengths.
|
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 and Description |
---|
AbstractSVGLength(short direction)
Creates a new AbstractSVGLength.
|
Modifier and Type | Method and Description |
---|---|
void |
convertToSpecifiedUnits(short unit)
DOM: Implements
SVGLength.convertToSpecifiedUnits(short) . |
protected abstract SVGOMElement |
getAssociatedElement()
Return the SVGElement associated to this length.
|
short |
getUnitType()
DOM: Implements
SVGLength.getUnitType() . |
float |
getValue()
DOM: Implements
SVGLength.getValue() . |
java.lang.String |
getValueAsString()
DOM: Implements
SVGLength.getValueAsString() . |
float |
getValueInSpecifiedUnits()
DOM: Implements
SVGLength.getValueInSpecifiedUnits() . |
void |
newValueSpecifiedUnits(short unit,
float value)
DOM: Implements
SVGLength.newValueSpecifiedUnits(short,float) . |
protected void |
parse(java.lang.String s)
Parse a String value as a SVGLength.
|
protected void |
reset()
Callback method after changes
made to this length.
|
protected void |
revalidate()
Callback method before any value
is return from this length.
|
void |
setValue(float value)
DOM: Implements
SVGLength.setValue(float) . |
void |
setValueAsString(java.lang.String value)
DOM: Implements
SVGLength.setValueAsString(String) . |
void |
setValueInSpecifiedUnits(float value)
DOM: Implements
SVGLength.setValueInSpecifiedUnits(float) . |
public static final short HORIZONTAL_LENGTH
public static final short VERTICAL_LENGTH
public static final short OTHER_LENGTH
protected short unitType
protected float value
protected short direction
protected UnitProcessor.Context context
protected static final java.lang.String[] UNITS
public AbstractSVGLength(short direction)
protected abstract SVGOMElement getAssociatedElement()
public short getUnitType()
SVGLength.getUnitType()
.getUnitType
in interface org.w3c.dom.svg.SVGLength
public float getValue()
SVGLength.getValue()
.getValue
in interface org.w3c.dom.svg.SVGLength
public void setValue(float value) throws DOMException
SVGLength.setValue(float)
.setValue
in interface org.w3c.dom.svg.SVGLength
DOMException
public float getValueInSpecifiedUnits()
SVGLength.getValueInSpecifiedUnits()
.getValueInSpecifiedUnits
in interface org.w3c.dom.svg.SVGLength
public void setValueInSpecifiedUnits(float value) throws DOMException
SVGLength.setValueInSpecifiedUnits(float)
.setValueInSpecifiedUnits
in interface org.w3c.dom.svg.SVGLength
DOMException
public java.lang.String getValueAsString()
SVGLength.getValueAsString()
.getValueAsString
in interface org.w3c.dom.svg.SVGLength
public void setValueAsString(java.lang.String value) throws DOMException
SVGLength.setValueAsString(String)
.setValueAsString
in interface org.w3c.dom.svg.SVGLength
DOMException
public void newValueSpecifiedUnits(short unit, float value)
SVGLength.newValueSpecifiedUnits(short,float)
.newValueSpecifiedUnits
in interface org.w3c.dom.svg.SVGLength
public void convertToSpecifiedUnits(short unit)
SVGLength.convertToSpecifiedUnits(short)
.convertToSpecifiedUnits
in interface org.w3c.dom.svg.SVGLength
protected void reset()
protected void revalidate()
protected void parse(java.lang.String s)
s
- String representation of a SVGlength.Copyright © 2022 Apache Software Foundation. All Rights Reserved.