fi.hut.tml.xsmiles.mlfc.smil.extension
Class AnimatedColorValue

java.lang.Object
  extended byfi.hut.tml.xsmiles.mlfc.smil.extension.AnimatedColorValue
All Implemented Interfaces:
AnimatedValue

public class AnimatedColorValue
extends java.lang.Object
implements AnimatedValue

Animated Color Value, animates values in format "rgb(16,16,16)" or "#101010"


Constructor Summary
AnimatedColorValue(float dummy)
           
AnimatedColorValue(float r, float g, float b)
           
AnimatedColorValue(java.lang.String str)
           
 
Method Summary
 AnimatedValue add(AnimatedValue val)
          Add val to this.
 void clampValue()
           
 float distance(AnimatedValue val)
          Calculates the distance between this and val.
 float getBlue()
           
 float getGreen()
           
 float getRed()
           
 AnimatedValue interpolate(AnimatedValue val, float t)
          Interpolate between this and val by t, where t is [0,1].
 AnimatedValue mult(int integer)
          Multiply this by integer value.
static AnimatedColorValue parse(java.lang.String str)
          Parse this string into value.
 java.lang.String toString()
          Parse this string into value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AnimatedColorValue

public AnimatedColorValue(float dummy)

AnimatedColorValue

public AnimatedColorValue(float r,
                          float g,
                          float b)

AnimatedColorValue

public AnimatedColorValue(java.lang.String str)
Method Detail

parse

public static AnimatedColorValue parse(java.lang.String str)
Parse this string into value. Throws NumberFormatException, if cannot parse.

Parameters:
str - String to be parsed
Returns:
Parsed AnimatedValue

getRed

public float getRed()

getGreen

public float getGreen()

getBlue

public float getBlue()

toString

public java.lang.String toString()
Description copied from interface: AnimatedValue
Parse this string into value. Throws NumberFormatException, if cannot parse.

Specified by:
toString in interface AnimatedValue

clampValue

public void clampValue()
Specified by:
clampValue in interface AnimatedValue

add

public AnimatedValue add(AnimatedValue val)
Add val to this.

Specified by:
add in interface AnimatedValue
Parameters:
val - Val to be added to this.
Returns:
Returns val+this.

mult

public AnimatedValue mult(int integer)
Multiply this by integer value.

Specified by:
mult in interface AnimatedValue
Parameters:
integer - Integer value
Returns:
Returns this * integer.

interpolate

public AnimatedValue interpolate(AnimatedValue val,
                                 float t)
Interpolate between this and val by t, where t is [0,1]. For integers: (val-this)*t.

Specified by:
interpolate in interface AnimatedValue
Parameters:
val - AnimatedColorValue
Returns:
Returns this * integer.

distance

public float distance(AnimatedValue val)
Calculates the distance between this and val. (for one dimension: abs(this-val) )

Specified by:
distance in interface AnimatedValue
Parameters:
val - AnimatedColorValue
Returns:
Returns distance between this nad val..


X-Smiles 1.2