All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class improv.actor.behavior.Layer

java.lang.Object
   |
   +----improv.actor.behavior.Layer

public final class Layer
extends Object
implements Compositable

Variable Index

 o hasChannels
 o isHidden

Constructor Index

 o Layer(String)
 o Layer(String, Actor)
 o Layer(String, Actor, float, int)

Method Index

 o addBehavior(Behavior)
Add a previously defined behavior to a layer
 o addSequence(String)
Create a new Sequence with the default values and add it to the Layer
 o addSequence(String, double, Curve, boolean, double, boolean)
Create a new Sequence and add it to the Layer
 o addState(String)
Create a new State with the default values and add it to the Layer
 o addState(String, double, Curve, double, Curve, boolean, double, int, boolean)
Create a State and add it to layer
 o deleteBehavior(Behavior)
 o deleteBehavior(int)
 o deleteBehavior(String)
 o doFrame(double)
 o finishLayer()
Called by the Actor class
 o getActiveBehavior()
Returns the Behavior object representing the currently active behavior (state or sequence) in this layer.
 o getActor()
 o getBehavior(int)
Returns the Behavior (i.e.
 o getBehavior(String)
Returns the Behavior object with the given name in this layer, or null if no behavior with that name exists.
 o getComposite()
 o getName()
 o getNumberOfBehaviors()
Returns the number of behaviors managed by this layer.
 o getOpacity()
 o getTimeChannel()
 o getTimeScale()
 o hasBehavior(String)
 o inheritComposite()
 o isHidden()
 o renameBehavior(Behavior, String)
Changes the name of a behavior to the given string. Deprecated.
 o setActiveBehavior(Behavior)
Sets the active behavior in the layer to the given Behavior object.
 o setActiveBehavior(Behavior, double, boolean)
Sets the active behavior in the layer to given behavior object.
 o setActiveBehavior(int)
Sets the active behavior in the layer to the behavior at the given position.
 o setActiveBehavior(int, double, boolean)
Sets the active behavior in the layer to the behavior at the given position.
 o setActiveBehavior(String)
Sets the active behavior in the layer to the behavior with the given name
 o setActiveBehavior(String, double, boolean)
Sets the active behavior in the layer to the behavior with the given name.
 o setActor(Actor)
 o setBackground(Behavior)
 o setBackground(String)
 o setComposite(int)
 o setComposite(String)
 o setHidden(boolean)
 o setName(String)
 o setOpacity(float)
 o startLayer()
Called by the Actor class

Variables

 o hasChannels
 public boolean hasChannels
 o isHidden
 public boolean isHidden

Constructors

 o Layer
 public Layer(String name,
              Actor actor)
 o Layer
 public Layer(String name)
 o Layer
 public Layer(String name,
              Actor actor,
              float opacity,
              int composite)

Methods

 o addBehavior
 public void addBehavior(Behavior behavior)
Add a previously defined behavior to a layer

 o addState
 public State addState(String name,
                       double transitionTime,
                       Curve transitionCurve,
                       double timeScale,
                       Curve timeScaleCurve,
                       boolean localClock,
                       double duration,
                       int composite,
                       boolean momentary)
Create a State and add it to layer

Parameters:
name - the name of the State
transitionTime - the default transition time
transitionCurve - the default transition curve
timeScale - the time scale of the State. Used in synchronizing differently phased animations.
timeScaleCurve - the time scale curve.
localClock - if TRUE, clock is based on start time of the state, otherwise clock is based on the clock of the previous state.
duration - the default duration of the State
composite - the compositing behavior of this State, possible values are ADD, SUBTRACT, MULTIPLY, DIVIDE, MIN, MAX, and POW.
momentary - if TRUE, the State active immediately preceding this State will be activated at the end of this states's duration, if FALSE, the default State for this layer will be activated.
Returns:
the added State
 o addState
 public State addState(String name)
Create a new State with the default values and add it to the Layer

Parameters:
name - the name of the State
Returns:
the added State
 o addSequence
 public Sequence addSequence(String name,
                             double timeScale,
                             Curve timeScaleCurve,
                             boolean localClock,
                             double duration,
                             boolean momentary)
Create a new Sequence and add it to the Layer

Parameters:
name - the name of the sequence
timeScale - the time scale of the sequence
timeScaleCurve - the time scale curve of the sequence
localClock - if TRUE, the clock for this sequence is based on the start time of the Sequence, otherwise it is based on the clock of the immediately preceding Sequence.
duration - the default duration of the Sequence.
momentary - if TRUE, the State active immediately preceding this State will be activated at the end of this states's duration, if FALSE, the default State for this layer will be activated.
Returns:
the added Sequence
 o addSequence
 public Sequence addSequence(String name)
Create a new Sequence with the default values and add it to the Layer

Returns:
the added Sequence
 o hasBehavior
 public boolean hasBehavior(String behaviorName)
Returns:
TRUE if the Layer contains the State or Sequence, otherwise FALSE.
 o setHidden
 public void setHidden(boolean b)
 o isHidden
 public boolean isHidden()
 o setName
 public void setName(String name)
 o getName
 public String getName()
 o getActor
 public Actor getActor()
 o setActor
 public void setActor(Actor actor)
 o startLayer
 public void startLayer()
Called by the Actor class

 o finishLayer
 public void finishLayer()
Called by the Actor class

 o deleteBehavior
 public void deleteBehavior(int position)
 o deleteBehavior
 public void deleteBehavior(String behaviorName)
 o deleteBehavior
 public void deleteBehavior(Behavior behavior)
 o setBackground
 public void setBackground(String behaviorName)
 o setBackground
 public void setBackground(Behavior behavior)
 o renameBehavior
 public void renameBehavior(Behavior b,
                            String s)
Note: renameBehavior() is deprecated. The Behavior.setName() method now does this automatically, so this method is now obsolete.

Changes the name of a behavior to the given string.

See Also:
setName
 o setActiveBehavior
 public void setActiveBehavior(int i)
Sets the active behavior in the layer to the behavior at the given position.

 o setActiveBehavior
 public void setActiveBehavior(String s)
Sets the active behavior in the layer to the behavior with the given name

 o setActiveBehavior
 public void setActiveBehavior(Behavior b)
Sets the active behavior in the layer to the given Behavior object.

 o setActiveBehavior
 public void setActiveBehavior(int i,
                               double dur,
                               boolean mom)
Sets the active behavior in the layer to the behavior at the given position.

Parameters:
dur - - for momentary behaviors, this is the duration for the behavior in seconds. Use -1 to indicate that the behavior should run indefinately.
mom - - if this is true, the behavior is activated momentarily, and -dur- indicates the duration for the momentary behavior.
 o setActiveBehavior
 public void setActiveBehavior(String s,
                               double dur,
                               boolean mom)
Sets the active behavior in the layer to the behavior with the given name.

Parameters:
dur - - for momentary behaviors, this is the duration for the behavior in seconds. Use -1 to indicate that the behavior should run indefinately.
mom - - if this is true, the behavior is activated momentarily, and -dur- indicates the duration for the momentary behavior.
 o setActiveBehavior
 public void setActiveBehavior(Behavior behavior,
                               double dur,
                               boolean mom)
Sets the active behavior in the layer to given behavior object.

Parameters:
dur - - for momentary behaviors, this is the duration for the behavior in seconds. Use -1 to indicate that the behavior should run indefinately.
mom - - if this is true, the behavior is activated momentarily, and -dur- indicates the duration for the momentary behavior.
 o getActiveBehavior
 public Behavior getActiveBehavior()
Returns the Behavior object representing the currently active behavior (state or sequence) in this layer.

 o getBehavior
 public Behavior getBehavior(int i)
Returns the Behavior (i.e. State or Sequence) object at the given index in the list of behaviors of this Layer.

 o getBehavior
 public Behavior getBehavior(String s)
Returns the Behavior object with the given name in this layer, or null if no behavior with that name exists.

 o getNumberOfBehaviors
 public int getNumberOfBehaviors()
Returns the number of behaviors managed by this layer.

 o getTimeChannel
 public SFFloatChannel getTimeChannel()
 o getTimeScale
 public float getTimeScale()
 o setOpacity
 public void setOpacity(float f)
 o getOpacity
 public float getOpacity()
 o doFrame
 public void doFrame(double time)
 o setComposite
 public void setComposite(int c)
 o setComposite
 public void setComposite(String s)
 o getComposite
 public int getComposite()
 o inheritComposite
 public boolean inheritComposite()

All Packages  Class Hierarchy  This Package  Previous  Next  Index