Package org.apache.batik.anim.values
Class AnimatablePaintValue
- java.lang.Object
-
- org.apache.batik.anim.values.AnimatableValue
-
- org.apache.batik.anim.values.AnimatableColorValue
-
- org.apache.batik.anim.values.AnimatablePaintValue
-
public class AnimatablePaintValue extends AnimatableColorValue
An SVG paint value in the animation system.- Version:
- $Id: AnimatablePaintValue.java 1733416 2016-03-03 07:07:13Z gadams $
-
-
Field Summary
Fields Modifier and Type Field Description static intPAINT_COLORstatic intPAINT_CURRENT_COLORstatic intPAINT_INHERITstatic intPAINT_NONEstatic intPAINT_URIstatic intPAINT_URI_COLORstatic intPAINT_URI_CURRENT_COLORstatic intPAINT_URI_NONEprotected intpaintTypeThe type of paint.protected java.lang.StringuriThe URI of the referenced paint server.-
Fields inherited from class org.apache.batik.anim.values.AnimatableColorValue
blue, green, red
-
Fields inherited from class org.apache.batik.anim.values.AnimatableValue
decimalFormat, hasChanged, target
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAnimatablePaintValue(AnimationTarget target)Creates a new, uninitialized AnimatablePaintValue.protectedAnimatablePaintValue(AnimationTarget target, float r, float g, float b)Creates a new AnimatablePaintValue.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancanPace()Returns whether two values of this type can have their distance computed, as needed by paced animation.static AnimatablePaintValuecreateColorPaintValue(AnimationTarget target, float r, float g, float b)Creates a new AnimatablePaintValue for a color value.static AnimatablePaintValuecreateCurrentColorPaintValue(AnimationTarget target)Creates a new AnimatablePaintValue for a 'currentColor' value.static AnimatablePaintValuecreateInheritPaintValue(AnimationTarget target)Creates a new AnimatablePaintValue for a 'inherit' value.static AnimatablePaintValuecreateNonePaintValue(AnimationTarget target)Creates a new AnimatablePaintValue for a 'none' value.static AnimatablePaintValuecreateURIColorPaintValue(AnimationTarget target, java.lang.String uri, float r, float g, float b)Creates a new AnimatablePaintValue for a URI reference with a color fallback.static AnimatablePaintValuecreateURICurrentColorPaintValue(AnimationTarget target, java.lang.String uri)Creates a new AnimatablePaintValue for a URI reference with a 'currentColor' fallback.static AnimatablePaintValuecreateURINonePaintValue(AnimationTarget target, java.lang.String uri)Creates a new AnimatablePaintValue for a URI reference with a 'none' fallback.static AnimatablePaintValuecreateURIPaintValue(AnimationTarget target, java.lang.String uri)Creates a new AnimatablePaintValue for a URI reference.floatdistanceTo(AnimatableValue other)Returns the absolute distance between this value and the specified other value.java.lang.StringgetCssText()Returns the CSS text representation of the value.intgetPaintType()Returns the type of paint this value represents.java.lang.StringgetURI()Returns the paint server URI.AnimatableValuegetZeroValue()Returns a zero value of this AnimatableValue's type.AnimatableValueinterpolate(AnimatableValue result, AnimatableValue to, float interpolation, AnimatableValue accumulation, int multiplier)Performs interpolation to the given value.-
Methods inherited from class org.apache.batik.anim.values.AnimatableValue
formatNumber, hasChanged, toString, toStringRep
-
-
-
-
Field Detail
-
PAINT_NONE
public static final int PAINT_NONE
- See Also:
- Constant Field Values
-
PAINT_CURRENT_COLOR
public static final int PAINT_CURRENT_COLOR
- See Also:
- Constant Field Values
-
PAINT_COLOR
public static final int PAINT_COLOR
- See Also:
- Constant Field Values
-
PAINT_URI
public static final int PAINT_URI
- See Also:
- Constant Field Values
-
PAINT_URI_NONE
public static final int PAINT_URI_NONE
- See Also:
- Constant Field Values
-
PAINT_URI_CURRENT_COLOR
public static final int PAINT_URI_CURRENT_COLOR
- See Also:
- Constant Field Values
-
PAINT_URI_COLOR
public static final int PAINT_URI_COLOR
- See Also:
- Constant Field Values
-
PAINT_INHERIT
public static final int PAINT_INHERIT
- See Also:
- Constant Field Values
-
paintType
protected int paintType
The type of paint.
-
uri
protected java.lang.String uri
The URI of the referenced paint server.
-
-
Constructor Detail
-
AnimatablePaintValue
protected AnimatablePaintValue(AnimationTarget target)
Creates a new, uninitialized AnimatablePaintValue.
-
AnimatablePaintValue
protected AnimatablePaintValue(AnimationTarget target, float r, float g, float b)
Creates a new AnimatablePaintValue.
-
-
Method Detail
-
createNonePaintValue
public static AnimatablePaintValue createNonePaintValue(AnimationTarget target)
Creates a new AnimatablePaintValue for a 'none' value.
-
createCurrentColorPaintValue
public static AnimatablePaintValue createCurrentColorPaintValue(AnimationTarget target)
Creates a new AnimatablePaintValue for a 'currentColor' value.
-
createColorPaintValue
public static AnimatablePaintValue createColorPaintValue(AnimationTarget target, float r, float g, float b)
Creates a new AnimatablePaintValue for a color value.
-
createURIPaintValue
public static AnimatablePaintValue createURIPaintValue(AnimationTarget target, java.lang.String uri)
Creates a new AnimatablePaintValue for a URI reference.
-
createURINonePaintValue
public static AnimatablePaintValue createURINonePaintValue(AnimationTarget target, java.lang.String uri)
Creates a new AnimatablePaintValue for a URI reference with a 'none' fallback.
-
createURICurrentColorPaintValue
public static AnimatablePaintValue createURICurrentColorPaintValue(AnimationTarget target, java.lang.String uri)
Creates a new AnimatablePaintValue for a URI reference with a 'currentColor' fallback.
-
createURIColorPaintValue
public static AnimatablePaintValue createURIColorPaintValue(AnimationTarget target, java.lang.String uri, float r, float g, float b)
Creates a new AnimatablePaintValue for a URI reference with a color fallback.
-
createInheritPaintValue
public static AnimatablePaintValue createInheritPaintValue(AnimationTarget target)
Creates a new AnimatablePaintValue for a 'inherit' value.
-
interpolate
public AnimatableValue interpolate(AnimatableValue result, AnimatableValue to, float interpolation, AnimatableValue accumulation, int multiplier)
Performs interpolation to the given value.- Overrides:
interpolatein classAnimatableColorValue- Parameters:
result- the object in which to store the result of the interpolation, or null if a new object should be createdto- the value this value should be interpolated towards, or null if no actual interpolation should be performedinterpolation- the interpolation distance, 0 <= interpolation <= 1accumulation- an accumulation to add to the interpolated valuemultiplier- an amount the accumulation values should be multiplied by before being added to the interpolated value
-
getPaintType
public int getPaintType()
Returns the type of paint this value represents.
-
getURI
public java.lang.String getURI()
Returns the paint server URI.
-
canPace
public boolean canPace()
Returns whether two values of this type can have their distance computed, as needed by paced animation.- Overrides:
canPacein classAnimatableColorValue
-
distanceTo
public float distanceTo(AnimatableValue other)
Returns the absolute distance between this value and the specified other value.- Overrides:
distanceToin classAnimatableColorValue
-
getZeroValue
public AnimatableValue getZeroValue()
Returns a zero value of this AnimatableValue's type.- Overrides:
getZeroValuein classAnimatableColorValue
-
getCssText
public java.lang.String getCssText()
Returns the CSS text representation of the value.- Overrides:
getCssTextin classAnimatableColorValue
-
-