|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectrita.RiTextBehavior
public class RiTextBehavior
An abstract superclass for an extensible set of text-behaviors (found in rita.support.behaviors) including a variety of interpolation algorithms for moving, fading, scaling, color-change, etc.
Included in the rita.* package primarily to document callbacks as follows:
public void onRiTaEvent(RiTaEvent re)
{
// do something with the RiText whose behavior has finished
RiText parent = (RiText)re.getSource();
...
// do something with the Behavior directly
RiTextBehavior rtb = (RiTextBehavior)re.getData();
...
}
| Field Summary | |
|---|---|
boolean |
completed
|
float |
duration
|
static java.util.List |
instances
|
float |
startOffset
|
long |
startTime
|
| Fields inherited from interface processing.core.PConstants |
|---|
A, AB, ADD, AG, ALPHA, ALPHA_MASK, ALT, AMBIENT, AR, ARC, ARGB, ARROW, B, BACKSPACE, BASELINE, BEEN_LIT, BEVEL, BLEND, BLUE_MASK, BLUR, BOTTOM, BOX, BURN, CENTER, CENTER_DIAMETER, CENTER_RADIUS, CHATTER, CLOSE, CMYK, CODED, COMPLAINT, CONTROL, CORNER, CORNERS, CROSS, CUSTOM, DA, DARKEST, DB, DEG_TO_RAD, DELETE, DG, DIAMETER, DIFFERENCE, DILATE, DIRECTIONAL, DISABLE_ACCURATE_TEXTURES, DISABLE_DEPTH_SORT, DISABLE_DEPTH_TEST, DISABLE_OPENGL_2X_SMOOTH, DISABLE_OPENGL_ERROR_REPORT, DODGE, DOWN, DR, DXF, EB, EDGE, EG, ELLIPSE, ENABLE_ACCURATE_TEXTURES, ENABLE_DEPTH_SORT, ENABLE_DEPTH_TEST, ENABLE_NATIVE_FONTS, ENABLE_OPENGL_2X_SMOOTH, ENABLE_OPENGL_4X_SMOOTH, ENABLE_OPENGL_ERROR_REPORT, ENTER, EPSILON, ER, ERODE, ERROR_BACKGROUND_IMAGE_FORMAT, ERROR_BACKGROUND_IMAGE_SIZE, ERROR_PUSHMATRIX_OVERFLOW, ERROR_PUSHMATRIX_UNDERFLOW, ERROR_TEXTFONT_NULL_PFONT, ESC, EXCLUSION, G, GIF, GRAY, GREEN_MASK, HALF_PI, HAND, HARD_LIGHT, HINT_COUNT, HSB, IMAGE, INVERT, JAVA2D, JPEG, LEFT, LIGHTEST, LINE, LINES, LINUX, MACOSX, MAX_FLOAT, MAX_INT, MIN_FLOAT, MIN_INT, MITER, MODEL, MULTIPLY, NORMAL, NORMALIZED, NX, NY, NZ, OPAQUE, OPEN, OPENGL, ORTHOGRAPHIC, OTHER, OVERLAY, P2D, P3D, PATH, PDF, PERSPECTIVE, PI, platformNames, POINT, POINTS, POLYGON, POSTERIZE, PROBLEM, PROJECT, QUAD, QUAD_STRIP, QUADS, QUARTER_PI, R, RAD_TO_DEG, RADIUS, RECT, RED_MASK, REPLACE, RETURN, RGB, RIGHT, ROUND, SA, SB, SCREEN, SG, SHAPE, SHIFT, SHINE, SOFT_LIGHT, SPB, SPG, SPHERE, SPOT, SPR, SQUARE, SR, SUBTRACT, SW, TAB, TARGA, THIRD_PI, THRESHOLD, TIFF, TOP, TRIANGLE, TRIANGLE_FAN, TRIANGLE_STRIP, TRIANGLES, TWO_PI, TX, TY, TZ, U, UP, V, VERTEX_FIELD_COUNT, VW, VX, VY, VZ, WAIT, WHITESPACE, WINDOWS, X, Y, Z |
| Constructor Summary | |
|---|---|
RiTextBehavior(RiText riText)
Creates a behavior and assigns it an Id. |
|
RiTextBehavior(RiText riText,
float duration)
Creates a behavior to start immediately |
|
RiTextBehavior(RiText riText,
float startOffsetInSec,
float durationInSeconds)
Creates a behavior to start at startOffsetInSec
seconds in the future |
|
RiTextBehavior(RiText riText,
java.lang.String timerName,
float duration)
Creates a behavior to start immediately |
|
| Method Summary | |
|---|---|
void |
addListener(BehaviorListener bl)
Adds a listener for events fired from this behavior, e.g., completion, upon which it will behaviorCompleted(); |
void |
checkForCompletion()
Checks for completion, and if so, fires the callback |
void |
delete()
Optional method for subclasses needing to clean-up/release resources (Note: implementations should generally call super.delete()) |
static void |
deleteAllFades(RiText rt)
Stops and deletes all the behaviors for the specified RiText that are of type FADE_IN, FADE_OUT or FADE_TO_TEXT. |
static void |
disposeAll()
Calls delete() on all existing behaviors |
static RiTextBehavior |
findById(int id)
|
static RiTextBehavior |
findByName(java.lang.String name)
|
static java.util.List |
findByType(int type)
|
void |
finish()
|
static RiTextBehavior |
getBehaviorById(int id)
Returns the behavior corresponding to the specified 'id'. |
float |
getDuration()
Returns the total duration for the behavior |
int |
getId()
Returns the unique Id for this behavior |
java.lang.String |
getName()
Returns the user-assigned name for this behavior; Will return the class name if not set by the user. |
RiText |
getParent()
Returns the RiText object in which this behavior is operating. |
float |
getStartOffset()
Returns the original startOffset for the behavior |
int |
getType()
Returns the type for the behavior |
float |
getValue()
|
boolean |
isCompleted()
Returns whether this behavior has completed |
boolean |
isPaused()
Returns the paused status for the behavior |
boolean |
isRepeating()
Returns whether the behavior will repeat (indefinately) when finished |
boolean |
isReusable()
|
boolean |
isRunning()
Returns the paused status for the behavior |
boolean |
isWaiting()
|
void |
pause(float pauseTime)
Pauses the behavior for 'pauseTime' seconds |
static void |
pauseAll(boolean paused)
Pauses/un-pauses all existing behaviors |
void |
reset(float durationInSec)
Causes the behavior to be (immediately) repeated with its initial params and the specified 'duration' |
static java.util.List |
selectByType(java.util.List behaviors,
int type)
Returns the sublist of the specified behaviors that is of the specified type, where type is generally one of (MOVE, FADE_IN, FADE_OUT, FADE_TO_TEXT, SCALE_TO, etc.) |
void |
setId(int id)
|
void |
setName(java.lang.String name)
Sets a (user-assigned) name for this behavior. |
void |
setPaused(boolean pausedVal)
Sets the paused status for the behavior |
void |
setRepeating(boolean repeating)
Sets whether the behavior should repeat (indefinately) when finished |
void |
setReusable(boolean reusable)
|
void |
setRunning(boolean b)
|
void |
setType(int type)
|
void |
stop()
|
java.lang.String |
toString()
|
void |
update()
Required method for all subclasses |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static java.util.List instances
public float duration
public float startOffset
public long startTime
public boolean completed
| Constructor Detail |
|---|
public RiTextBehavior(RiText riText,
float duration)
public RiTextBehavior(RiText riText)
public RiTextBehavior(RiText riText,
java.lang.String timerName,
float duration)
public RiTextBehavior(RiText riText,
float startOffsetInSec,
float durationInSeconds)
startOffsetInSec
seconds in the future
| Method Detail |
|---|
public static java.util.List selectByType(java.util.List behaviors,
int type)
public static void deleteAllFades(RiText rt)
public static RiTextBehavior getBehaviorById(int id)
public void update()
public boolean isWaiting()
public RiText getParent()
public void reset(float durationInSec)
Note: ignores startOffset and restarts immediately.
public void finish()
public void stop()
public void setRepeating(boolean repeating)
public void checkForCompletion()
public boolean isCompleted()
public static void pauseAll(boolean paused)
paused - public static void disposeAll()
public void delete()
public float getDuration()
public float getStartOffset()
public int getType()
public boolean isRunning()
public void setPaused(boolean pausedVal)
public void pause(float pauseTime)
public boolean isPaused()
public void addListener(BehaviorListener bl)
public void setType(int type)
public void setRunning(boolean b)
public boolean isRepeating()
public void setName(java.lang.String name)
public java.lang.String getName()
public java.lang.String toString()
toString in class java.lang.Objectpublic void setId(int id)
public int getId()
public float getValue()
public static java.util.List findByType(int type)
public static RiTextBehavior findById(int id)
public static RiTextBehavior findByName(java.lang.String name)
public void setReusable(boolean reusable)
public boolean isReusable()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||