public final class Timeline extends Animation
Timelineを使用すると、すべてのJavaFXプロパティなど、あらゆるWritableValueの自由形式アニメーションを定義できます。
Timelineは、1つ以上のKeyFrameで定義し、個々のKeyFrameをKeyFrame.timeで指定した順序で順番に処理するために使用します。 アニメーション化されるプロパティは、KeyFrame.valuesでキー値として定義し、Timelineの初期位置(Timelineの方向によって異なる)を基準にしてKeyFrameの指定時間にターゲット・キー値に(またはターゲット・キー値から)補間されます。
Timelineでは、個々のKeyFrameは指定された時間間隔が経過した時点以降に処理され、KeyFrameの処理タイミングは保証されません。
Animation.cycleDurationProperty()は、TimelineのKeyFrameの最大時間値に設定されます。
time==0sの瞬間にKeyFrameが指定されていない場合は、Animation.play()またはAnimation.playFromStart()の呼出し時点における最新のターゲット値を使用して合成されます。
実行中のTimelineのkeyFramesは変更できません。 実行中のTimelineのkeyFramesの値が変更された場合、新しい値を反映するには、停止して再度開始する必要があります。
単純なTimelineの作成例を次に示します。
final Timeline timeline = new Timeline();
timeline.setCycleCount(2);
timeline.setAutoReverse(true);
timeline.getKeyFrames().add(new KeyFrame(Duration.millis(5000),
new KeyValue (node.translateXProperty(), 25)));
timeline.play();
このTimelineは10秒間実行され、ノードはx軸に沿って値25までアニメーション化され、2回目のサイクルに0まで戻ります。
警告: 実行中のTimelineはFXランタイムから参照されます。 Timelineを無限にした場合、適切に停止しないと、メモリー・リークが発生する可能性があります。 アニメーション化されるプロパティを持つすべてのオブジェクトがガベージ・コレクションの対象となるわけではありません。
autoReverse, currentRate, currentTime, cycleCount, cycleDuration, delay, onFinished, rate, status, totalDurationAnimation.StatusINDEFINITE| コンストラクタと説明 |
|---|
Timeline()
Timelineのコンストラクタ。 |
Timeline(double targetFramerate)
Timelineのコンストラクタ。 |
Timeline(double targetFramerate, KeyFrame... keyFrames)
Timelineのコンストラクタ。 |
Timeline(KeyFrame... keyFrames)
Timelineのコンストラクタ。 |
| 修飾子と型 | メソッドと説明 |
|---|---|
ObservableList<KeyFrame> |
getKeyFrames()
この
TimelineのKeyFramesを返します。 |
void |
stop()
アニメーションを停止し、再生ヘッドを初期位置にリセットします。
|
autoReverseProperty, currentRateProperty, currentTimeProperty, cycleCountProperty, cycleDurationProperty, delayProperty, getCuePoints, getCurrentRate, getCurrentTime, getCycleCount, getCycleDuration, getDelay, getOnFinished, getRate, getStatus, getTargetFramerate, getTotalDuration, isAutoReverse, jumpTo, jumpTo, onFinishedProperty, pause, play, playFrom, playFrom, playFromStart, rateProperty, setAutoReverse, setCycleCount, setCycleDuration, setDelay, setOnFinished, setRate, setStatus, statusProperty, totalDurationPropertypublic Timeline(double targetFramerate,
KeyFrame... keyFrames)
Timelineのコンストラクタ。 このコンストラクタでは、Animation.targetFramerateを定義できます。 targetFramerate - このTimelineのカスタム・ターゲット・フレームレートkeyFrames - このTimelineのキー・フレームpublic Timeline(KeyFrame... keyFrames)
Timelineのコンストラクタ。keyFrames - このTimelineのキー・フレームpublic Timeline(double targetFramerate)
Timelineのコンストラクタ。 このコンストラクタでは、Animation.targetFramerateを定義できます。 targetFramerate - このTimelineのカスタム・ターゲット・フレームレートpublic Timeline()
Timelineのコンストラクタ。public final ObservableList<KeyFrame> getKeyFrames()
TimelineのKeyFramesを返します。Copyright (c) 2008, 2015, Oracle and/or its affiliates. All rights reserved.