本文整理汇总了Java中javafx.scene.shape.Ellipse.setEffect方法的典型用法代码示例。如果您正苦于以下问题:Java Ellipse.setEffect方法的具体用法?Java Ellipse.setEffect怎么用?Java Ellipse.setEffect使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类javafx.scene.shape.Ellipse
的用法示例。
在下文中一共展示了Ellipse.setEffect方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureBackground
import javafx.scene.shape.Ellipse; //导入方法依赖的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);
}
示例2: createIconContent
import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
public static Node createIconContent() {
Ellipse ellipse = new Ellipse(57,57, 20,40);
ellipse.setStroke(Color.web("#b9c0c5"));
ellipse.setStrokeWidth(5);
ellipse.getStrokeDashArray().addAll(15d,15d);
ellipse.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));
ellipse.setEffect(effect);
return ellipse;
}
示例3: draw
import javafx.scene.shape.Ellipse; //导入方法依赖的package包/类
@Override
public void draw(Group g) {
DropShadow ds = new DropShadow();
ds.setOffsetY(3.0);
ds.setColor(Color.color(0.4, 0.4, 0.4));
Ellipse ellipse = new Ellipse();
ellipse.setCenterX(50.0f);
ellipse.setCenterY(50.0f);
ellipse.setRadiusX(50.0f);
ellipse.setRadiusY(25.0f);
ellipse.setFill(Color.RED);
ellipse.setStroke(Color.BLACK);
ellipse.setEffect(ds);
g.getChildren().add(ellipse);
g.addEventHandler(MouseEvent.MOUSE_CLICKED, ev -> {
if (ev.getClickCount() == 2 && MouseButton.PRIMARY == ev.getButton()) {
if (ev.isConsumed())
return;
if (ellipse.getUserData() != null)
return;
JFXColorPicker picker = new JFXColorPicker();
picker.setValue((Color) ellipse.getFill());
picker.valueProperty().addListener(new ChangeListener<Color>() {
@Override
public void changed(ObservableValue<? extends Color> observable, Color oldValue, Color newValue) {
ellipse.setFill(newValue);
}
});
FxUtil.createStageAndShow(" select color ", picker, stage -> {
ellipse.setUserData(new Object());
stage.setAlwaysOnTop(true);
stage.setOnCloseRequest(se -> {
ellipse.setUserData(null);
});
});
ev.consume();
}
});
}