de.looksgood.ani
Class AniCore

java.lang.Object
  extended by de.looksgood.ani.AniCore
All Implemented Interfaces:
AniConstants
Direct Known Subclasses:
Ani

public class AniCore
extends java.lang.Object
implements AniConstants

The Class AniCore encapsulates the core features for Ani and AniSequence, it's not recommended to use this class standalone!.


Field Summary
 
Fields inherited from interface de.looksgood.ani.AniConstants
ANI_DEBUG_PREFIX, AUTOSTART, BACK_IN, BACK_IN_OUT, BACK_OUT, BACKWARD, BOUNCE_IN, BOUNCE_IN_OUT, BOUNCE_OUT, CIRC_IN, CIRC_IN_OUT, CIRC_OUT, CUBIC_IN, CUBIC_IN_OUT, CUBIC_OUT, ELASTIC_IN, ELASTIC_IN_OUT, ELASTIC_OUT, EXPO_IN, EXPO_IN_OUT, EXPO_OUT, FORWARD, FRAMES, IN, IN_OUT, LINEAR, NO_AUTOSTART, NO_OVERWRITE, ON_DELAY_END, ON_END, ON_START, ON_UPDATE, OUT, OVERWRITE, QUAD_IN, QUAD_IN_OUT, QUAD_OUT, QUART_IN, QUART_IN_OUT, QUART_OUT, QUINT_IN, QUINT_IN_OUT, QUINT_OUT, SECONDS, SINE_IN, SINE_IN_OUT, SINE_OUT, VERSION, YOYO
 
Constructor Summary
AniCore(PApplet thePapplet, java.lang.String theAutostart, java.lang.Object theTargetObject, float theDurationEasing, float theDurationDelay, java.lang.String theTargetObjectFieldName, float theEnd, Easing theEasing, java.lang.String theTimeMode, java.lang.Object theCallbackObject, java.lang.String theCallback)
          Instantiates a new ani core.
 
Method Summary
 void end()
          End the animation.
 float getBegin()
          Gets the begin.
 java.lang.Object getCallbackObject()
          Gets the object to invoke the callback method on
 float getDelay()
          Gets the duration of delay.
 java.lang.String getDirection()
          Gets the direction.
 float getDuration()
          Gets the duration.
 float getDurationTotal()
          Gets the duration: duration easing + duration delay.
 Easing getEasing()
          Gets the easing.
 float getEnd()
          Gets the end.
 java.lang.String getId()
          Gets the id.
 java.lang.String getPlayMode()
          Gets the play mode.
 float getPosition()
          Gets the position.
 int getRepeatCount()
          Gets the repeat count.
 int getRepeatNumber()
          Gets the current repeat number.
 float getSeek()
          Gets the current seek value (start = 0.0 end = 1.0)
 java.lang.String getTimeMode()
          Gets the time mode.
 boolean isDelaying()
          Checks if the animation is delaying.
 boolean isEnded()
          Checks if the animation is ended.
 boolean isPlaying()
          Checks if the animation is playing.
 boolean isRepeating()
          Checks if the animation is repeating.
 void noRepeat()
          Stop any repeating.
 void pause()
          Pause the animation at the current position in time.
 void pre()
          No need to call ever this method.
 void repeat()
          Repeat the animation forever.
 void repeat(int theRepeatCount)
          Sets the repeat count.
 void resume()
          Resume the animation from the current position in time (adjustable with seek).
 void reverse()
          Swap begin end of the animation.
 void seek(float theValue)
          Seek the Animation to any position: start = 0.0 end = 1.0
 boolean setBegin()
          Sets the begin of the animation to the current value of the target.
 void setBegin(float theBegin)
          Sets the begin of the animation to a new value.
 void setCallback(java.lang.String theCallback)
          setup the callback methods: onStart, onEnd, onDelayEnd and onUpdate
 void setCallbackObject(java.lang.Object theCallbackObject)
          Sets the object to invoke the callback method on
 void setDelay(float theDurationDelay)
          Sets the delay duration.
 void setDuration(float theDurationEasing)
          Sets the duration.
 void setEasing(Easing theEasing)
          Sets the easing: LINEAR, QUAD_IN, QUAD_OUT, QUAD_IN_OUT, CUBIC_IN, CUBIC_IN_OUT, CUBIC_OUT, QUART_IN, QUART_OUT, QUART_IN_OUT, QUINT_IN, QUINT_OUT, QUINT_IN_OUT, SINE_IN, SINE_OUT, SINE_IN_OUT, CIRC_IN, CIRC_OUT, CIRC_IN_OUT, EXPO_IN, EXPO_OUT, EXPO_IN_OUT, BACK_IN, BACK_OUT, BACK_IN_OUT, BOUNCE_IN, BOUNCE_OUT, BOUNCE_IN_OUT, ELASTIC_IN, ELASTIC_OUT, ELASTIC_IN_OUT or use a Custom Easing.
 void setEnd(float theEnd)
          Sets the end.
 void setPlayMode(java.lang.String thePlayMode)
          Sets the play mode: FORWARD, BACKWARD, YOYO.
 void setTimeMode(java.lang.String theTimeMode)
          Sets the time mode: SECONDS or FRAMES.
 void start()
          Start the animation.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AniCore

public AniCore(PApplet thePapplet,
               java.lang.String theAutostart,
               java.lang.Object theTargetObject,
               float theDurationEasing,
               float theDurationDelay,
               java.lang.String theTargetObjectFieldName,
               float theEnd,
               Easing theEasing,
               java.lang.String theTimeMode,
               java.lang.Object theCallbackObject,
               java.lang.String theCallback)
Instantiates a new ani core.

Parameters:
thePapplet - the papplet
theAutostart - the autostart
theTargetObject - the target object
theDurationEasing - the duration easing
theDurationDelay - the duration delay
theTargetObjectFieldName - the target object field name
theEnd - the end
theEasing - the easing
theTimeMode - the time mode
theCallbackObject - the object to call the callback method upon
theCallback - the callback
Method Detail

setBegin

public boolean setBegin()
Sets the begin of the animation to the current value of the target.

Returns:
true, if successful

setBegin

public void setBegin(float theBegin)
Sets the begin of the animation to a new value.

Parameters:
theBegin - the new begin

getCallbackObject

public java.lang.Object getCallbackObject()
Gets the object to invoke the callback method on

Returns:
theCallbackObject the object whose callback methods are called

setCallbackObject

public void setCallbackObject(java.lang.Object theCallbackObject)
Sets the object to invoke the callback method on

Parameters:
theCallbackObject - the object whose callback methods are called

setCallback

public void setCallback(java.lang.String theCallback)
setup the callback methods: onStart, onEnd, onDelayEnd and onUpdate

Parameters:
theCallback - the names of the callbacks for onStart, onEnd, onDelayEnd and onUpdate

pre

public void pre()
No need to call ever this method. Only public to use the registerMethod() mechanism


start

public void start()
Start the animation.


end

public void end()
End the animation.


pause

public void pause()
Pause the animation at the current position in time.


resume

public void resume()
Resume the animation from the current position in time (adjustable with seek).


seek

public void seek(float theValue)
Seek the Animation to any position: start = 0.0 end = 1.0

Parameters:
theValue - seek value

getSeek

public float getSeek()
Gets the current seek value (start = 0.0 end = 1.0)

Returns:
theValue seek value

reverse

public void reverse()
Swap begin end of the animation.


getTimeMode

public java.lang.String getTimeMode()
Gets the time mode.

Returns:
the time mode

setTimeMode

public void setTimeMode(java.lang.String theTimeMode)
Sets the time mode: SECONDS or FRAMES.

Parameters:
theTimeMode - the new time mode

getEasing

public Easing getEasing()
Gets the easing.

Returns:
the easing name

setEasing

public void setEasing(Easing theEasing)
Sets the easing: LINEAR, QUAD_IN, QUAD_OUT, QUAD_IN_OUT, CUBIC_IN, CUBIC_IN_OUT, CUBIC_OUT, QUART_IN, QUART_OUT, QUART_IN_OUT, QUINT_IN, QUINT_OUT, QUINT_IN_OUT, SINE_IN, SINE_OUT, SINE_IN_OUT, CIRC_IN, CIRC_OUT, CIRC_IN_OUT, EXPO_IN, EXPO_OUT, EXPO_IN_OUT, BACK_IN, BACK_OUT, BACK_IN_OUT, BOUNCE_IN, BOUNCE_OUT, BOUNCE_IN_OUT, ELASTIC_IN, ELASTIC_OUT, ELASTIC_IN_OUT or use a Custom Easing.

Parameters:
theEasing -

getPlayMode

public java.lang.String getPlayMode()
Gets the play mode.

Returns:
the play mode

setPlayMode

public void setPlayMode(java.lang.String thePlayMode)
Sets the play mode: FORWARD, BACKWARD, YOYO.

Parameters:
thePlayMode - the new play mode

repeat

public void repeat()
Repeat the animation forever.


noRepeat

public void noRepeat()
Stop any repeating.


repeat

public void repeat(int theRepeatCount)
Sets the repeat count.

Parameters:
theRepeatCount - the new repeat count

getRepeatCount

public int getRepeatCount()
Gets the repeat count.

Returns:
the repeat count

getRepeatNumber

public int getRepeatNumber()
Gets the current repeat number.

Returns:
the repeat count

getDirection

public java.lang.String getDirection()
Gets the direction.

Returns:
the direction

getPosition

public float getPosition()
Gets the position.

Returns:
the position

getBegin

public float getBegin()
Gets the begin.

Returns:
the begin

setEnd

public void setEnd(float theEnd)
Sets the end.

Parameters:
theEnd - the new end

getEnd

public float getEnd()
Gets the end.

Returns:
the end

getDurationTotal

public float getDurationTotal()
Gets the duration: duration easing + duration delay.

Returns:
the duration total

getDelay

public float getDelay()
Gets the duration of delay.

Returns:
the delay

setDelay

public void setDelay(float theDurationDelay)
Sets the delay duration.

Parameters:
theDurationDelay - the new delay duration

getDuration

public float getDuration()
Gets the duration.

Returns:
the duration

setDuration

public void setDuration(float theDurationEasing)
Sets the duration.

Parameters:
theDurationEasing - the new duration

getId

public java.lang.String getId()
Gets the id.

Returns:
the id

isEnded

public boolean isEnded()
Checks if the animation is ended.

Returns:
true, if the animation is ended

isRepeating

public boolean isRepeating()
Checks if the animation is repeating.

Returns:
true, if the animation is repeating

isDelaying

public boolean isDelaying()
Checks if the animation is delaying.

Returns:
true, if the animation is delaying

isPlaying

public boolean isPlaying()
Checks if the animation is playing.

Returns:
true, if the animation is playing


processing library Ani by Benedikt Gross. (c) 2015