com.mxgraph.swing.util
Class mxAnimation
- java.lang.Object
-
- com.mxgraph.util.mxEventSource
-
- com.mxgraph.swing.util.mxAnimation
-
- Direct Known Subclasses:
- mxMorphing
public class mxAnimation extends mxEventSource
Baseclass for all timer-based animations. Fires mxEvent.DONE when the stopAnimation method is called. Implement updateAnimation for the actual animation or listen to mxEvent.EXECUTE.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.mxgraph.util.mxEventSource
mxEventSource.mxIEventListener
-
-
Field Summary
Fields Modifier and Type Field and Description static intDEFAULT_DELAYSpecifies the default delay for animations in ms.
-
Constructor Summary
Constructors Constructor and Description mxAnimation()Constructs a new animation instance with the given repaint delay.mxAnimation(int delay)Constructs a new animation instance with the given repaint delay.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetDelay()Returns the delay for the animation.booleanisRunning()Returns true if the animation is running.voidsetDelay(int value)Sets the delay for the animation.voidstartAnimation()Starts the animation by repeatedly invoking updateAnimation.voidstopAnimation()Stops the animation by deleting the timer and fires mxEvent.DONE.voidupdateAnimation()Hook for subclassers to implement the animation.-
Methods inherited from class com.mxgraph.util.mxEventSource
addListener, fireEvent, fireEvent, getEventSource, isEventsEnabled, removeListener, removeListener, setEventsEnabled, setEventSource
-
-
-
-
Field Detail
-
DEFAULT_DELAY
public static int DEFAULT_DELAY
Specifies the default delay for animations in ms. Default is 20.
-
-
Constructor Detail
-
mxAnimation
public mxAnimation()
Constructs a new animation instance with the given repaint delay.
-
mxAnimation
public mxAnimation(int delay)
Constructs a new animation instance with the given repaint delay.
-
-
Method Detail
-
getDelay
public int getDelay()
Returns the delay for the animation.
-
setDelay
public void setDelay(int value)
Sets the delay for the animation.
-
isRunning
public boolean isRunning()
Returns true if the animation is running.
-
startAnimation
public void startAnimation()
Starts the animation by repeatedly invoking updateAnimation.
-
updateAnimation
public void updateAnimation()
Hook for subclassers to implement the animation. Invoke stopAnimation when finished, startAnimation to resume. This is called whenever the timer fires and fires an mxEvent.EXECUTE event with no properties.
-
stopAnimation
public void stopAnimation()
Stops the animation by deleting the timer and fires mxEvent.DONE.
-
-
DataMelt 3.0 © DataMelt by jWork.ORG