本文整理汇总了Java中javafx.scene.shape.Circle.setVisible方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.setVisible方法的具体用法?Java Circle.setVisible怎么用?Java Circle.setVisible使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.setVisible方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: buildFragments
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private List<Circle> buildFragments(BubbleType bubbleType) {
List<Circle> fragments = new ArrayList<>(nbFragments);
for (int i = 0; i < nbFragments; i++) {
Circle fragment = new Circle();
fragment.setOpacity(1);
fragment.setRadius(20);
fragment.setVisible(true);
fragment.setCenterX(-100);
fragment.setCenterY(-100);
if (bubbleType == BubbleType.COLOR) {
fragment.setFill(new Color(Math.random(), Math.random(), Math.random(), 1));
} else {
fragment.setFill(new ImagePattern(newPhoto(), 0, 0, 1, 1, true));
}
fragments.add(fragment);
}
return fragments;
}
示例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: MyVertexView
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
* Constructor for VertexView, takes a MyVertex object as reference
* @param myVertex
*/
public MyVertexView(MyVertex myVertex) {
this.myVertex = myVertex;
// Initialize stuff
vertexShape = new Circle(NODE_RADIUS);
vertexShape.setStroke(STROKE);
selectionShape = new Circle(NODE_RADIUS+4);
selectionShape.setStroke(STROKE);
selectionShape.setFill(SELECT);
selectionShape.setVisible(false);
selectionShape.radiusProperty().bind(vertexShape.radiusProperty().add(4));
colourProperty = new SimpleObjectProperty<>(Palette.BrBG);
colourAttribute = new SimpleStringProperty("fix");
// Bind Coordinates to MyVertex
translateXProperty().bindBidirectional(myVertex.xCoordinatesProperty());
translateYProperty().bindBidirectional(myVertex.yCoordinatesProperty());
// Bind actions to the Properties
visibleProperty().bind(myVertex.isHiddenProperty().not());
colourAttribute.addListener((e, o, n) -> refreshColour());
colourProperty.addListener((e, o, n) -> refreshColour());
// Add Layout elements
refreshColour();
addSelectionMarker();
addToolTip();
addLabel();
getChildren().addAll(selectionShape, vertexShape);
//Listen to the isHub-Property of the MyVertex object, make vertexShape thicker if it's a hub
myVertex.isHubProperty().addListener((observable, oldValue, newValue) -> {
if (newValue) {
vertexShape.setStrokeWidth(vertexShape.getStrokeWidth() * 4);
vertexShape.getStrokeDashArray().addAll(3.0,7.0,3.0,7.0);
vertexShape.setStroke(HUBSTROKE);
} else {
vertexShape.setStrokeWidth(vertexShape.getStrokeWidth() / 4);
vertexShape.getStrokeDashArray().clear();
vertexShape.setStroke(STROKE);
vertexShape.setFill(FILL);
}
});
}