本文整理汇总了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);
}
示例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);
}
示例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());
}