Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8108696

Dynamically KeyFrame time changing does not work

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • fx1.3
    • fx1.3
    • javafx
    • None

      JavaFX SDK:
      ------------------------------------------
      Product: javafx-1.3dev
      Platform: windows-i586
      Build-Number: 284
      Build-ID: 2010-02-02_18-58-51
      ------------------------------------------


      Steps to reproduce:
      - Run the code
      ------------------------------------------------------------------------------------------------------
      import javafx.stage.*;
      import javafx.scene.*;
      import javafx.scene.layout.*;
      import javafx.scene.shape.*;
      import javafx.scene.paint.*;
      import javafx.scene.input.*;
      import javafx.scene.text.*;
      import javafx.animation.*;


      def N = 3;
      var index = 2;
      var count = 0;
      def font = Font { size: 24 }

      Timeline {
          repeatCount: Timeline.INDEFINITE
          keyFrames: [
              KeyFrame {
                  time: bind Duration.valueOf(index * 200)
                  canSkip: true
                  action: function () {
                      count++;
                  }
              }
          ]
      }.play();

      Stage {
          title: "Application title"
          scene: Scene {
              width: 300
              height: 200
              content: [
                  HBox {
                      content: for (i in [1..N]) [
                              Circle {
                                  radius: 30
                                  fill: Color.ORANGE
                                  onMouseClicked: function (e: MouseEvent): Void {
                                      index = i ;
                                      println("index: {index}");
                                  }
                              }
                              Text {
                                  font: font
                                  content: "{i}"
                              }
                          ]
                  }
                  Text {
                      x: 30
                      y: 80
                      font: font
                      content: bind "{count}"
                  }
              ]
          }
      }
      ------------------------------------------------------------------------------------------------------


      There is the counter on the window.

      - Click on the circle 1
      The counter becomes faster

      - Click on the circle 3
       The counter stops. It should count slowly but not stop.

            bchristi Brent Christian
            alexsch Alexandr Scherbatiy
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: