diff options
author | Kenneth Russel <[email protected]> | 2005-08-29 15:40:31 +0000 |
---|---|---|
committer | Kenneth Russel <[email protected]> | 2005-08-29 15:40:31 +0000 |
commit | 8c99f91eeca27b410ac81bcdfc19f46b517bde1c (patch) | |
tree | 72c6c86d0b5f4985c86fdfc22a4a10084ac47640 | |
parent | d8be0742b129cc21589c1963a8dd389519449d55 (diff) |
Added isAnimating() on request of AK77 on JOGL forums
git-svn-id: file:///usr/local/projects/SUN/JOGL/git-svn/svn-server-sync/jogl/branches/JSR-231@355 232f8b59-042b-4e1e-8c03-345bb8c30851
-rw-r--r-- | src/net/java/games/jogl/Animator.java | 8 | ||||
-rwxr-xr-x | src/net/java/games/jogl/FPSAnimator.java | 8 |
2 files changed, 16 insertions, 0 deletions
diff --git a/src/net/java/games/jogl/Animator.java b/src/net/java/games/jogl/Animator.java index ac6248487..c1f311e04 100644 --- a/src/net/java/games/jogl/Animator.java +++ b/src/net/java/games/jogl/Animator.java @@ -213,6 +213,14 @@ public class Animator { thread.start(); } + /** Indicates whether this animator is currently running. This + should only be used as a heuristic to applications because in + some circumstances the Animator may be in the process of + shutting down and this method will still return true. */ + public synchronized boolean isAnimating() { + return (thread != null); + } + /** Stops this animator. In most situations this method blocks until completion, except when called from the animation thread itself or in some cases from an implementation-internal thread like the diff --git a/src/net/java/games/jogl/FPSAnimator.java b/src/net/java/games/jogl/FPSAnimator.java index 311a9b722..9d596fe86 100755 --- a/src/net/java/games/jogl/FPSAnimator.java +++ b/src/net/java/games/jogl/FPSAnimator.java @@ -77,6 +77,14 @@ public class FPSAnimator extends Animator { }, 0, delay); } + /** Indicates whether this FPSAnimator is currently running. This + should only be used as a heuristic to applications because in + some circumstances the FPSAnimator may be in the process of + shutting down and this method will still return true. */ + public synchronized boolean isAnimating() { + return (timer != null); + } + /** Stops this FPSAnimator. Due to the implementation of the FPSAnimator it is not guaranteed that the FPSAnimator will be completely stopped by the time this method returns. */ |