本文整理汇总了Java中javafx.scene.shape.Circle.setFill方法的典型用法代码示例。如果您正苦于以下问题:Java Circle.setFill方法的具体用法?Java Circle.setFill怎么用?Java Circle.setFill使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Circle
的用法示例。
在下文中一共展示了Circle.setFill方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initializeIcon
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void initializeIcon() {
final Circle circle = (Circle) lookup("#iconBackground");
final FontIcon icon = (FontIcon) lookup("#icon");
component.get().colorProperty().addListener((obs, oldColor, newColor) -> {
circle.setFill(newColor.getColor(component.get().getColorIntensity()));
icon.setFill(newColor.getTextColor(component.get().getColorIntensity()));
});
circle.setFill(component.get().getColor().getColor(component.get().getColorIntensity()));
icon.setFill(component.get().getColor().getTextColor(component.get().getColorIntensity()));
component.get().isMainProperty().addListener((obs, oldIsMain, newIsMain) -> {
if (newIsMain) {
icon.setIconLiteral("gmi-star");
icon.setIconSize(22);
} else {
icon.setIconLiteral("gmi-description");
icon.setIconSize(22);
}
});
}
示例2: CircleSample
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public CircleSample() {
super(180,90);
// Simple red filled circle
Circle circle1 = new Circle(45,45,40, Color.RED);
// Blue stroked circle
Circle circle2 = new Circle(135,45,40);
circle2.setStroke(Color.DODGERBLUE);
circle2.setFill(null);
// Create a group to show all the circles);
getChildren().add(new Group(circle1,circle2));
// REMOVE ME
setControls(
new SimplePropertySheet.PropDesc("Circle 1 Fill", circle1.fillProperty()),
new SimplePropertySheet.PropDesc("Circle 1 Radius", circle1.radiusProperty(), 10d, 40d),
new SimplePropertySheet.PropDesc("Circle 2 Stroke", circle2.strokeProperty()),
new SimplePropertySheet.PropDesc("Circle 2 Stroke Width", circle2.strokeWidthProperty(), 1d, 5d),
new SimplePropertySheet.PropDesc("Circle 2 Radius", circle2.radiusProperty(), 10d, 40d)
);
// END REMOVE ME
}
示例3: lollipop
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public static void lollipop(double x, double y) {
Circle circle = new Circle(x, y, 2);
circle.setFill(randomColor());
FrameController.instance.hover.getChildren().add(circle);
FadeTransition fadeTransition = new FadeTransition(Duration.millis(500), circle);
fadeTransition.setAutoReverse(true);
fadeTransition.setCycleCount(2);
fadeTransition.setFromValue(0.0);
fadeTransition.setToValue(1.0);
ScaleTransition scaleTransition = new ScaleTransition(Duration.millis(1000), circle);
scaleTransition.setToX(10.0);
scaleTransition.setToY(10.0);
scaleTransition.setCycleCount(1);
ParallelTransition parallelTransition = new ParallelTransition(fadeTransition, scaleTransition);
parallelTransition.play();
executorService.schedule(() -> Platform.runLater(() ->
FrameController.instance.hover.getChildren().remove(circle)), 1000, TimeUnit.MILLISECONDS);
}
示例4: moveCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void moveCircle(Circle C) {
double centerX = (scene.getWidth() - maxRadius) * Math.random() + maxRadius;
double centerY = scene.getHeight();
C.setCenterX(centerX);
//C.setTranslateY((scene.getHeight() - maxRadius) * Math.random() + maxRadius);
C.setCenterY(centerY);
double radius = (maxRadius - minRadius) * Math.random() + minRadius;
C.setFill(new Color(Math.random(), Math.random(), Math.random(), 1));
C.setRadius(radius);
Timeline timeline = new Timeline();
double timelength = ((maxTimeLength - minTimeLength) * Math.random() + minTimeLength) * 1000;
timeline.getKeyFrames().add(new KeyFrame(new Duration(timelength), new KeyValue(C.centerYProperty(), 0 - maxRadius, Interpolator.EASE_IN)));
/* SequentialTransition sequence = new SequentialTransition();
for(int i = 0; i < 10; i++) {
sequence.getChildren().add(new KeyFrame(new Duration(timelength / 10), new KeyValue(C.centerXProperty(), centerX - 100)));
sequence.getChildren().add(new KeyFrame(new Duration(timelength / 10), new KeyValue(C.centerXProperty(), centerX + 100)));
}*/
timeline.play();
timeline.setOnFinished(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent actionEvent) {
//moveCircle(C);
newCircle();
}
});
}
示例5: configureHand
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void configureHand() {
Circle circle = new Circle(0, 0, radius / 18);
circle.setFill(color);
Rectangle rectangle1 = new Rectangle(-0.5 - radius / 140, +radius / 7 - radius / 1.08, radius / 70 + 1, radius / 1.08);
Rectangle rectangle2 = new Rectangle(-0.5 - radius / 140, +radius / 3.5 - radius / 7, radius / 70 + 1, radius / 7);
rectangle1.setFill(color);
rectangle2.setFill(Color.BLACK);
hand.getChildren().addAll(circle, rectangle1, rectangle2);
}
示例6: createIconContent
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public static Node createIconContent() {
Circle circle = new Circle(57,57,40);
circle.setStroke(Color.web("#b9c0c5"));
circle.setStrokeWidth(5);
circle.getStrokeDashArray().addAll(15d,15d);
circle.setFill(null);
javafx.scene.effect.InnerShadow effect = new javafx.scene.effect.InnerShadow();
effect.setOffsetX(1);
effect.setOffsetY(1);
effect.setRadius(3);
effect.setColor(Color.rgb(0,0,0,0.6));
circle.setEffect(effect);
return circle;
}
示例7: configureBackground
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void configureBackground() {
ImageView imageView = new ImageView();
Image image = loadImage();
imageView.setImage(image);
Circle circle1 = new Circle();
circle1.setCenterX(140);
circle1.setCenterY(140);
circle1.setRadius(120);
circle1.setFill(Color.TRANSPARENT);
circle1.setStroke(Color.web("#0A0A0A"));
circle1.setStrokeWidth(0.3);
Circle circle2 = new Circle();
circle2.setCenterX(140);
circle2.setCenterY(140);
circle2.setRadius(118);
circle2.setFill(Color.TRANSPARENT);
circle2.setStroke(Color.web("#0A0A0A"));
circle2.setStrokeWidth(0.3);
Circle circle3 = new Circle();
circle3.setCenterX(140);
circle3.setCenterY(140);
circle3.setRadius(140);
circle3.setFill(Color.TRANSPARENT);
circle3.setStroke(Color.web("#818a89"));
circle3.setStrokeWidth(1);
Ellipse ellipse = new Ellipse(140, 95, 180, 95);
Circle ellipseClip = new Circle(140, 140, 140);
ellipse.setFill(Color.web("#535450"));
ellipse.setStrokeWidth(0);
GaussianBlur ellipseEffect = new GaussianBlur();
ellipseEffect.setRadius(10);
ellipse.setEffect(ellipseEffect);
ellipse.setOpacity(0.1);
ellipse.setClip(ellipseClip);
background.getChildren().addAll(imageView, circle1, circle2, circle3, ellipse);
}
示例8: 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;
}
示例9: InteractiveWayPointDot
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public InteractiveWayPointDot(int x, int y) throws FlightZoneException{
wayPointDot = new Circle();
wayPointDot.setRadius(radius);;
wayPointDot.setCenterX(x);
wayPointDot.setCenterY(y);
wayPointDot.setFill(Color.LIGHTSTEELBLUE);
wayPointDot.setStroke(Color.BLACK);
wayPointDot.setStrokeWidth(1);
longitude = DecimalDegreesToXYConverter.getInstance().ConvertXCoordsToDecimalDegrees(x);
latitude = DecimalDegreesToXYConverter.getInstance().ConvertYCoordsToDecimalDegrees(y);
this.x = x;
this.y = y;
}
示例10: CircularDirectionIndicator
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public CircularDirectionIndicator(String name, double radius){
this.name = name;
this.radius = radius;
root = new VBox();
StackPane graphicalData = new StackPane();
graphicalData.setMaxSize(radius * 2, radius * 2);
lineBox = new Canvas();
outerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius);
outerCircle.setFill(Color.TRANSPARENT);
outerCircle.setStroke(Color.BLACK);
/*innerCircle = new Circle(graphicalData.getWidth() * 0.5, graphicalData.getHeight() * 0.5, radius * 0.5);
innerCircle.setFill(Color.TRANSPARENT);
innerCircle.setStroke(Color.BLACK);*/
lineBox.setWidth(radius * 2);
lineBox.setHeight(radius * 2);
graphicalData.getChildren().addAll(outerCircle, lineBox);
valLbl = new Label(name+": 0.0");
valLbl.setMinWidth(radius * 2);
valLbl.setTextAlignment(TextAlignment.CENTER);
HBox labalBox = new HBox();
labalBox.getChildren().add(valLbl);
labalBox.setAlignment(Pos.CENTER);
root.setAlignment(Pos.CENTER);
root.setSpacing(2.0);
root.getChildren().addAll(labalBox, graphicalData);
setValue(0);
}
示例11: 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;
}
示例12: start
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
@Override
public void start(Stage primaryStage) throws Exception {
Group root = new Group();
Line seeSaw = new Line (60,340,340,140);
seeSaw.setStroke(Color.BLACK);
seeSaw.setStrokeWidth(15);
Circle circle = new Circle(70,280,40);
circle.setStroke(Color.GREENYELLOW);
circle.setFill(Color.ORANGE);
circle.setStrokeWidth(5);
Rectangle rect = new Rectangle(240,90,80,70);
rect.setStroke(Color.MEDIUMPURPLE);
rect.setStrokeWidth(5);
rect.setFill(Color.MEDIUMPURPLE);
Line left = new Line (200,240,160,340);
left.setStrokeWidth(5);
Line right = new Line(200,240,240,340);
right.setStrokeWidth(5);
root.getChildren().addAll(seeSaw,rect,circle,left,right);
Scene scene = new Scene(root, 400, 400,Color.WHITE);
primaryStage.setTitle("SeeSaw");
primaryStage.setScene(scene);
primaryStage.show();
}
示例13: preOrder
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
public void preOrder(BinaryTree.TreeNode root, double x, double y, double hPane){
Circle circle = new Circle(x, y, radius);
circle.setFill(Color.WHITE);
Text text = new Text(x - 10, y + 4, root.element + "");
showTree.getChildren().addAll(circle, text);
//展示左节点的权重
if (root.left != null) {
connectLeftChild(showTree, x - hPane, (int)y + vPane, x, (int)y);
preOrder(root.left, x - hPane, y + vPane, hPane / 2);
}
// //展示左节点的元素
// if (root.left == null) {
// Text text1 = new Text(x - 4, y + 2 * radius - 5, root.element + "");
// showTree.getChildren().add(text1);
// }
//展示右节点的权重
if (root.right != null) {
connectRightChild(showTree, x + hPane, (int)y + vPane, x, (int)y);
preOrder(root.right, x + hPane, y +vPane, hPane / 2);
}
//展示右节点的元素
// if (root.right == null) {
// Text text1 = new Text(x - 4, y + 2 * radius - 5, root.element + "");
// showTree.getChildren().add(text1);
// }
}
开发者ID:fankaljead,项目名称:Curriculum-design-of-data-structure,代码行数:32,代码来源:ShowBinaryTreeController.java
示例14: createCircle
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
/**
* Ritorna il cerchio che racchiuderà l'indice del nodo
* @return cerchio che indicherà il nodo.
*/
private Circle createCircle() {
Circle c = new Circle();
c.setFill((Color) currentPane.getBackground().getFills().get(0).getFill());
c.setStroke(Color.BLACK);
c.setStrokeWidth(3);
c.setRadius(Singleton.NODE_RADIUS);
return c;
}
示例15: drawValue
import javafx.scene.shape.Circle; //导入方法依赖的package包/类
private void drawValue(ChartValue radObject, Circle circle, Text text) {
String category = radObject.getCategory();
double value = radObject.getValue();
int index = -1;
double angleOfPoints = 360.0f / categoriesName.length;
double angle = -90;
for (int i = 0; i < categoriesName.length; i++) {
if (categoriesName[i].equals(category)) {
index = i;
break;
}
angle += angleOfPoints;
}
if (index == -1 || linesOfPoints == null || linesOfPoints.length == 0) {
return;
}
if (value >= minValue && value <= maxValue) {
double pos = value / maxValue;
double startX = linesOfPoints[index].getStartX();
double startY = linesOfPoints[index].getStartY();
double rad = angle * Math.PI / 180.0f;
double x = startX + (radius * pos) * Math.cos(rad);
double y = startY + (radius * pos) * Math.sin(rad);
radObject.setX(x);
radObject.setY(y);
circle.setCenterX(x);
circle.setCenterY(y);
circle.setRadius(POINTS_RADIUS);
circle.setFill(Color.RED);
text.setX(x + 5);
text.setY(y);
text.setText(String.valueOf(value));
text.setFont(Font.font(15));
getChildren().addAll(circle, text);
}
}