當前位置: 首頁>>代碼示例>>Java>>正文


Java Color.WHITESMOKE屬性代碼示例

本文整理匯總了Java中javafx.scene.paint.Color.WHITESMOKE屬性的典型用法代碼示例。如果您正苦於以下問題:Java Color.WHITESMOKE屬性的具體用法?Java Color.WHITESMOKE怎麽用?Java Color.WHITESMOKE使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在javafx.scene.paint.Color的用法示例。


在下文中一共展示了Color.WHITESMOKE屬性的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: RadialGradientSample

public RadialGradientSample() {
    //create simple radial gradient
    RadialGradient gradient1 = new RadialGradient(0, 0, 0.5, 0.5, 1, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0, Color.DODGERBLUE),
        new Stop(1, Color.BLACK)
    });
    Circle circle1 = new Circle(45, 45, 40, gradient1);

    //create complex radial gradient
    RadialGradient gradient2 = new RadialGradient(20, 1, 0.5, 0.5, 0.6, true, CycleMethod.NO_CYCLE, new Stop[] {
        new Stop(0,  Color.TRANSPARENT),
        new Stop(0.5,  Color.DARKGRAY),
        new Stop(0.64, Color.WHITESMOKE),
        new Stop(0.65, Color.YELLOW),
        new Stop(1, Color.GOLD)
    });
    Circle circle2 = new Circle(145, 45, 40, gradient2);

    HBox hb = new HBox(10);
    hb.getChildren().addAll(circle1, circle2);
    
    // show the circles
    getChildren().addAll(hb);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:24,代碼來源:RadialGradientSample.java

示例2: MyEnsembleNode

public MyEnsembleNode(String name) {
  text = new Text(name);
  text.setTextOrigin(VPos.TOP);
  text.setLayoutX(4);
  text.setLayoutY(2);
  rectangle = new Rectangle(50, 20, Color.WHITESMOKE);
  rectangle.setStroke(Color.BLACK);
  //add nodes as childrens, order matters, first is on the bottom
  getChildren().addAll(rectangle, text);
}
 
開發者ID:jalian-systems,項目名稱:marathonv5,代碼行數:10,代碼來源:CustomNodeSample.java

示例3: start

@Override
public void start(Stage primaryStage) {
    primaryStage.setTitle("TestGaze");
    Group root = new Group();
    Scene scene = new Scene(root, 1200, 700, Color.BLACK);

    Circle c = new Circle(300, 300, 100, Color.WHITESMOKE);

    root.getChildren().add(c);

    c.addEventFilter(GazeEvent.GAZE_ENTERED, event -> log.info("Field filtered strike: " + event.getEventType()));

    c.addEventHandler(GazeEvent.GAZE_ENTERED, event -> log.info("Field handled strike: " + event.getEventType()));

    primaryStage.setScene(scene);
    primaryStage.show();

    c.fireEvent(new GazeEvent());

}
 
開發者ID:schwabdidier,項目名稱:GazePlay,代碼行數:20,代碼來源:TestGaze.java


注:本文中的javafx.scene.paint.Color.WHITESMOKE屬性示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。