コード例 #1
0
ファイル: PlayingVideo.java プロジェクト: weijiancai/reserve
 private Node createCloseButton(Scene scene) {
   // close button
   final Group closeApp = new Group();
   Circle closeButton =
       CircleBuilder.create()
           .centerX(5)
           .centerY(0)
           .radius(7)
           .fill(Color.rgb(255, 255, 255, .80))
           .build();
   Text closeXmark = new Text(2, 4, "X");
   closeApp.translateXProperty().bind(scene.widthProperty().subtract(15));
   closeApp.setTranslateY(10);
   closeApp.getChildren().addAll(closeButton, closeXmark);
   closeApp.setOnMouseClicked(
       new EventHandler<MouseEvent>() {
         @Override
         public void handle(MouseEvent event) {
           Platform.exit();
         }
       });
   return closeApp;
 }
コード例 #2
0
ファイル: PlayingVideo.java プロジェクト: weijiancai/reserve
 private Node createPauseControl() {
   // pause control
   final Group pause = new Group();
   final Circle pauseButton =
       CircleBuilder.create()
           .centerX(12)
           .centerY(16)
           .radius(10)
           .stroke(new Color(1, 1, 1, .90))
           .translateX(30)
           .build();
   final Line firstLine =
       LineBuilder.create()
           .startX(6)
           .startY(16 - 10)
           .endX(6)
           .endY(16 - 2)
           .strokeWidth(3)
           .translateX(34)
           .translateY(6)
           .stroke(new Color(1, 1, 1, .90))
           .build();
   final Line secondLine =
       LineBuilder.create()
           .startX(6)
           .startY(16 - 10)
           .endX(6)
           .endY(16 - 2)
           .strokeWidth(3)
           .translateX(38)
           .translateY(6)
           .stroke(new Color(1, 1, 1, .90))
           .build();
   pause.getChildren().addAll(pauseButton, firstLine, secondLine);
   return pause;
 }