public abstract class AnimationTimer extends Object
AnimationTimer
を使用すると、アクティブになっている間に各フレームで呼び出されるタイマーを作成できます。拡張クラスを使用してメソッドhandle(long)
をオーバーライドし、各フレームで呼び出されるようにする必要があります。start()
とstop()
の各メソッドを使用して、タイマーを開始および停止できます。コンストラクタと説明 |
---|
AnimationTimer()
新しいタイマーを作成します。
|
public abstract void handle(long now)
AnimationTimer
がアクティブになっている間、各フレームで呼び出されます。now
- 現在のフレームのタイムスタンプ(ナノ秒)。この値は、1フレームで呼び出されるすべてのAnimationTimers
に対して同じになります。public void start()
AnimationTimers
を開始します。AnimationTimers
を開始すると、そのhandle(long)
メソッドが各フレームで呼び出されるようになります。AnimationTimers
を停止するには、stop()
を呼び出します。public void stop()
AnimationTimers
を停止します。再びアクティブ化するには、start()
を呼び出します。Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.