モジュール javafx.graphics
パッケージ javafx.animation

クラスStrokeTransition


  • public final class StrokeTransition
    extends Transition
    このTransitionでは、duration全体にわたって図形のストロークの色を変化させるアニメーションを作成します。 このことは、shapestroke変数を一定の間隔で更新することによって行います。

    fromValueが指定されている場合はそこから開始され、それ以外の場合はshapestroke値が使用されます (この場合、stroke値はColorにする必要があります)。

    toValue値で停止されます。

    コード・セグメントの例:

     
     import javafx.scene.shape.*;
     import javafx.animation.*;
    
     ...
    
         Rectangle rect = new Rectangle (100, 40, 100, 100);
         rect.setArcHeight(50);
         rect.setArcWidth(50);
         rect.setFill(null);
    
         StrokeTransition st = new StrokeTransition(Duration.millis(3000), rect, Color.RED, Color.BLUE);
         st.setCycleCount(4);
         st.setAutoReverse(true);
    
         st.play();
    
     ...
    
     
     
    導入されたバージョン:
    JavaFX 2.0
    関連項目:
    Transition, Animation
    • プロパティの詳細

      • shape

        public final ObjectProperty<Shape> shapeProperty
        このStrokeTransitionのターゲット図形。

        実行中のStrokeTransitionのターゲットshapeは変更できません。 実行中のStrokeTransitionshapeの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        関連項目:
        getShape(), setShape(Shape)
      • duration

        public final ObjectProperty<Duration> durationProperty
        このStrokeTransitionの期間。

        実行中のStrokeTransitiondurationは変更できません。 実行中のStrokeTransitiondurationの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        注意: durationの単位はミリ秒ですが、粒度は基礎となるオペレーティング・システムによって異なり、一般的には大きくなります。 たとえば、デスクトップ・システム上のアニメーションは、通常、最大60fpsで実行され、その粒度は最大17ミリ秒になります。 durationをDuration.ZEROよりも小さい値に設定すると、IllegalArgumentExceptionが発生します。

        デフォルト値:
        400ms
        関連項目:
        getDuration(), setDuration(Duration)
      • fromValue

        public final ObjectProperty<Color> fromValueProperty
        このStrokeTransitionの開始色値を指定します。

        実行中のStrokeTransitionfromValueは変更できません。 実行中のStrokeTransitionfromValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
        関連項目:
        getFromValue(), setFromValue(Color)
      • toValue

        public final ObjectProperty<Color> toValueProperty
        このStrokeTransitionの停止色値を指定します。

        実行中のStrokeTransitiontoValueは変更できません。 実行中のStrokeTransitiontoValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
        関連項目:
        getToValue(), setToValue(Color)
    • コンストラクタの詳細

      • StrokeTransition

        public StrokeTransition​(Duration duration,
                                Shape shape,
                                Color fromValue,
                                Color toValue)
        StrokeTransitionのコンストラクタ
        パラメータ:
        duration - StrokeTransitionの期間
        shape - 塗りつぶしがアニメーション化されるshape
        fromValue - カラーアニメーションの開始値
        toValue - カラーアニメーションの終了値
      • StrokeTransition

        public StrokeTransition​(Duration duration,
                                Color fromValue,
                                Color toValue)
        StrokeTransitionのコンストラクタ
        パラメータ:
        duration - StrokeTransitionの期間
        fromValue - カラーアニメーションの開始値
        toValue - カラーアニメーションの終了値
      • StrokeTransition

        public StrokeTransition​(Duration duration,
                                Shape shape)
        StrokeTransitionのコンストラクタ
        パラメータ:
        duration - StrokeTransitionの期間
        shape - ストローク・ペイントがアニメーション化されるshape
      • StrokeTransition

        public StrokeTransition​(Duration duration)
        StrokeTransitionのコンストラクタ
        パラメータ:
        duration - StrokeTransitionの期間
      • StrokeTransition

        public StrokeTransition()
        StrokeTransitionのコンストラクタ
    • メソッドの詳細

      • setShape

        public final void setShape​(Shape value)
        プロパティshapeの値を設定します。
        プロパティの説明:
        このStrokeTransitionのターゲット図形。

        実行中のStrokeTransitionのターゲットshapeは変更できません。 実行中のStrokeTransitionshapeの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

      • getShape

        public final Shape getShape()
        プロパティshapeの値を取得します。
        プロパティの説明:
        このStrokeTransitionのターゲット図形。

        実行中のStrokeTransitionのターゲットshapeは変更できません。 実行中のStrokeTransitionshapeの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

      • shapeProperty

        public final ObjectProperty<Shape> shapeProperty()
        このStrokeTransitionのターゲット図形。

        実行中のStrokeTransitionのターゲットshapeは変更できません。 実行中のStrokeTransitionshapeの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        関連項目:
        getShape(), setShape(Shape)
      • setDuration

        public final void setDuration​(Duration value)
        プロパティdurationの値を設定します。
        プロパティの説明:
        このStrokeTransitionの期間。

        実行中のStrokeTransitiondurationは変更できません。 実行中のStrokeTransitiondurationの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        注意: durationの単位はミリ秒ですが、粒度は基礎となるオペレーティング・システムによって異なり、一般的には大きくなります。 たとえば、デスクトップ・システム上のアニメーションは、通常、最大60fpsで実行され、その粒度は最大17ミリ秒になります。 durationをDuration.ZEROよりも小さい値に設定すると、IllegalArgumentExceptionが発生します。

        デフォルト値:
        400ms
      • getDuration

        public final Duration getDuration()
        プロパティdurationの値を取得します。
        プロパティの説明:
        このStrokeTransitionの期間。

        実行中のStrokeTransitiondurationは変更できません。 実行中のStrokeTransitiondurationの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        注意: durationの単位はミリ秒ですが、粒度は基礎となるオペレーティング・システムによって異なり、一般的には大きくなります。 たとえば、デスクトップ・システム上のアニメーションは、通常、最大60fpsで実行され、その粒度は最大17ミリ秒になります。 durationをDuration.ZEROよりも小さい値に設定すると、IllegalArgumentExceptionが発生します。

        デフォルト値:
        400ms
      • durationProperty

        public final ObjectProperty<Duration> durationProperty()
        このStrokeTransitionの期間。

        実行中のStrokeTransitiondurationは変更できません。 実行中のStrokeTransitiondurationの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        注意: durationの単位はミリ秒ですが、粒度は基礎となるオペレーティング・システムによって異なり、一般的には大きくなります。 たとえば、デスクトップ・システム上のアニメーションは、通常、最大60fpsで実行され、その粒度は最大17ミリ秒になります。 durationをDuration.ZEROよりも小さい値に設定すると、IllegalArgumentExceptionが発生します。

        デフォルト値:
        400ms
        関連項目:
        getDuration(), setDuration(Duration)
      • setFromValue

        public final void setFromValue​(Color value)
        プロパティfromValueの値を設定します。
        プロパティの説明:
        このStrokeTransitionの開始色値を指定します。

        実行中のStrokeTransitionfromValueは変更できません。 実行中のStrokeTransitionfromValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
      • getFromValue

        public final Color getFromValue()
        プロパティfromValueの値を取得します。
        プロパティの説明:
        このStrokeTransitionの開始色値を指定します。

        実行中のStrokeTransitionfromValueは変更できません。 実行中のStrokeTransitionfromValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
      • fromValueProperty

        public final ObjectProperty<Color> fromValueProperty()
        このStrokeTransitionの開始色値を指定します。

        実行中のStrokeTransitionfromValueは変更できません。 実行中のStrokeTransitionfromValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
        関連項目:
        getFromValue(), setFromValue(Color)
      • setToValue

        public final void setToValue​(Color value)
        プロパティtoValueの値を設定します。
        プロパティの説明:
        このStrokeTransitionの停止色値を指定します。

        実行中のStrokeTransitiontoValueは変更できません。 実行中のStrokeTransitiontoValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
      • getToValue

        public final Color getToValue()
        プロパティtoValueの値を取得します。
        プロパティの説明:
        このStrokeTransitionの停止色値を指定します。

        実行中のStrokeTransitiontoValueは変更できません。 実行中のStrokeTransitiontoValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
      • toValueProperty

        public final ObjectProperty<Color> toValueProperty()
        このStrokeTransitionの停止色値を指定します。

        実行中のStrokeTransitiontoValueは変更できません。 実行中のStrokeTransitiontoValueの値が変更された場合、新しい値を反映するには、アニメーションを停止し、再度開始する必要があります。

        デフォルト値:
        null
        関連項目:
        getToValue(), setToValue(Color)