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
An SVG paint value in the animation system.
- Version:
- $Id: AnimatablePaintValue.java 1733416 2016-03-03 07:07:13Z gadams $
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
static final int
static final int
static final int
static final int
static final int
static final int
static final int
protected int
The type of paint.protected String
The 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
ConstructorsModifierConstructorDescriptionprotected
AnimatablePaintValue
(AnimationTarget target) Creates a new, uninitialized AnimatablePaintValue.protected
AnimatablePaintValue
(AnimationTarget target, float r, float g, float b) Creates a new AnimatablePaintValue. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canPace()
Returns whether two values of this type can have their distance computed, as needed by paced animation.static AnimatablePaintValue
createColorPaintValue
(AnimationTarget target, float r, float g, float b) Creates a new AnimatablePaintValue for a color value.static AnimatablePaintValue
Creates a new AnimatablePaintValue for a 'currentColor' value.static AnimatablePaintValue
Creates a new AnimatablePaintValue for a 'inherit' value.static AnimatablePaintValue
createNonePaintValue
(AnimationTarget target) Creates a new AnimatablePaintValue for a 'none' value.static AnimatablePaintValue
createURIColorPaintValue
(AnimationTarget target, String uri, float r, float g, float b) Creates a new AnimatablePaintValue for a URI reference with a color fallback.static AnimatablePaintValue
createURICurrentColorPaintValue
(AnimationTarget target, String uri) Creates a new AnimatablePaintValue for a URI reference with a 'currentColor' fallback.static AnimatablePaintValue
createURINonePaintValue
(AnimationTarget target, String uri) Creates a new AnimatablePaintValue for a URI reference with a 'none' fallback.static AnimatablePaintValue
createURIPaintValue
(AnimationTarget target, String uri) Creates a new AnimatablePaintValue for a URI reference.float
distanceTo
(AnimatableValue other) Returns the absolute distance between this value and the specified other value.Returns the CSS text representation of the value.int
Returns the type of paint this value represents.getURI()
Returns the paint server URI.Returns a zero value of this AnimatableValue's type.interpolate
(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 Details
-
PAINT_NONE
public static final int PAINT_NONE- See Also:
-
PAINT_CURRENT_COLOR
public static final int PAINT_CURRENT_COLOR- See Also:
-
PAINT_COLOR
public static final int PAINT_COLOR- See Also:
-
PAINT_URI
public static final int PAINT_URI- See Also:
-
PAINT_URI_NONE
public static final int PAINT_URI_NONE- See Also:
-
PAINT_URI_CURRENT_COLOR
public static final int PAINT_URI_CURRENT_COLOR- See Also:
-
PAINT_URI_COLOR
public static final int PAINT_URI_COLOR- See Also:
-
PAINT_INHERIT
public static final int PAINT_INHERIT- See Also:
-
paintType
protected int paintTypeThe type of paint. -
uri
The URI of the referenced paint server.
-
-
Constructor Details
-
AnimatablePaintValue
Creates a new, uninitialized AnimatablePaintValue. -
AnimatablePaintValue
Creates a new AnimatablePaintValue.
-
-
Method Details
-
createNonePaintValue
Creates a new AnimatablePaintValue for a 'none' value. -
createCurrentColorPaintValue
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
Creates a new AnimatablePaintValue for a URI reference. -
createURINonePaintValue
Creates a new AnimatablePaintValue for a URI reference with a 'none' fallback. -
createURICurrentColorPaintValue
public static AnimatablePaintValue createURICurrentColorPaintValue(AnimationTarget target, String uri) Creates a new AnimatablePaintValue for a URI reference with a 'currentColor' fallback. -
createURIColorPaintValue
public static AnimatablePaintValue createURIColorPaintValue(AnimationTarget target, String uri, float r, float g, float b) Creates a new AnimatablePaintValue for a URI reference with a color fallback. -
createInheritPaintValue
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:
interpolate
in 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
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:
canPace
in classAnimatableColorValue
-
distanceTo
Returns the absolute distance between this value and the specified other value.- Overrides:
distanceTo
in classAnimatableColorValue
-
getZeroValue
Returns a zero value of this AnimatableValue's type.- Overrides:
getZeroValue
in classAnimatableColorValue
-
getCssText
Returns the CSS text representation of the value.- Overrides:
getCssText
in classAnimatableColorValue
-