本文整理汇总了Java中javafx.scene.shape.Circle.addEventFilter方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.addEventFilter方法的具体用法?Java Circle.addEventFilter怎么用?Java Circle.addEventFilter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.addEventFilter方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: newCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void newCircle() {
Circle circle = buildCircle();
circle.toBack();
this.getChildren().add(circle);
this.gameContext.resetBordersToFront();
GazeUtils.addEventFilter(circle);
circle.addEventFilter(MouseEvent.ANY, enterEvent);
circle.addEventHandler(GazeEvent.ANY, enterEvent);
moveCircle(circle);
}
示例2: createGridPattern
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public ImagePattern createGridPattern() {
Collections.shuffle(array_sizes);
index = array_sizes.get(0);
size = arraypts[ index ].length;
//size = 10;
indicator = new ProgressIndicator(0);
double w = gridSize;
double h = gridSize;
circle = new Circle();
circle.setRadius(45.0f);
circle.setOpacity(1);
circle.setFill(Color.LIGHTBLUE);
circle.setVisible(true);
canvas.setGridLinesVisible(true);
GazeUtils.addEventFilter(circle);
enterEvent = buildEvent();
circle.addEventFilter(MouseEvent.ANY, enterEvent);
circle.addEventFilter(GazeEvent.ANY, enterEvent);
indicator.setOpacity(0.0);
canvas.add(indicator, arraypts[index][count], arraypts[index][count+1]);
canvas.add(circle,arraypts[index][count], arraypts[index][count+1]);
Image image = canvas.snapshot(new SnapshotParameters(), null);
ImagePattern pattern = new ImagePattern(image, 0, 0, w, h, false);
return pattern;
}
示例3: createGridPattern
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public ImagePattern createGridPattern() {
Collections.shuffle(array_sizes);
index = array_sizes.get(0);
size = arraypts[ index ].length;
//size = 10;
indicator = new ProgressIndicator(0);
double w = gridSize;
double h = gridSize;
circle = new Circle();
circle.setRadius(45.0f);
circle.setOpacity(1);
circle.setFill(Color.BLUE);
circle.setVisible(true);
canvas.setGridLinesVisible(true);
GazeUtils.addEventFilter(circle);
enterEvent = buildEvent();
circle.addEventFilter(MouseEvent.ANY, enterEvent);
circle.addEventFilter(GazeEvent.ANY, enterEvent);
indicator.setOpacity(0.0);
canvas.add(indicator, arraypts[index][count], arraypts[index][count+1]);
canvas.add(circle,arraypts[index][count], arraypts[index][count+1]);
Image image = canvas.snapshot(new SnapshotParameters(), null);
ImagePattern pattern = new ImagePattern(image, 0, 0, w, h, false);
return pattern;
}
示例4: start
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@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());
}
示例5: newCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void newCircle() {
Circle C = new Circle();
this.getChildren().add(C);
GazeUtils.addEventFilter(C);
C.addEventFilter(MouseEvent.ANY, enterEvent);
C.addEventHandler(GazeEvent.ANY, enterEvent);
moveCircle(C);
}