本文整理了Java中javafx.scene.shape.Rectangle.setEffect
方法的一些代码示例,展示了Rectangle.setEffect
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Rectangle.setEffect
方法的具体详情如下:
包路径:javafx.scene.shape.Rectangle
类名称:Rectangle
方法名:setEffect
暂无
代码示例来源:origin: stackoverflow.com
public class ChatWindow extends Application {
@Override
public void start(final Stage stage) throws Exception {
stage.initStyle(StageStyle.TRANSPARENT); // here it is
Group rg = new Group();
Scene scene = new Scene(rg, 320, 240, Color.TRANSPARENT);
stage.setScene(scene);
stage.show();
Rectangle r = new Rectangle(5, 5, stage.getWidth() - 10, stage.getHeight() - 10);
r.setFill(Color.STEELBLUE);
r.setEffect(new DropShadow());
rg.getChildren().add(r);
}
public static void main(String[] args) {
launch();
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Set on/off the stage shadow effect
*
* @param b
*/
protected void setShadowFocused(boolean b) {
// Do not change anything while maximized (in case of dialog closing for
// instance)
if (stage.isFullScreen()) {
return;
}
if (maximizeProperty.get()) {
return;
}
if (b) {
shadowRectangle.setEffect(dsFocused);
} else {
shadowRectangle.setEffect(dsNotFocused);
}
}
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Switch the visibility of the window's drop shadow
*/
protected void setShadow(boolean shadow) {
// Already removed?
if (!shadow && shadowRectangle.getEffect() == null) {
return;
}
// From fullscreen to maximize case
if (shadow && maximizeProperty.get()) {
return;
}
if (!shadow) {
shadowRectangle.setEffect(null);
SAVED_SHADOW_WIDTH = SHADOW_WIDTH;
SHADOW_WIDTH = 0;
} else {
shadowRectangle.setEffect(dsFocused);
SHADOW_WIDTH = SAVED_SHADOW_WIDTH;
}
}
代码示例来源:origin: com.github.almasb/fxgl-base
public void setFill(Color color) {
innerBar.setFill(color);
DropShadow ds = new DropShadow(15, color);
ds.setInput(new Glow(0.5));
innerBar.setEffect(ds);
}
代码示例来源:origin: com.github.almasb/fxgl-ui
public void setFill(Color color) {
innerBar.setFill(color);
DropShadow ds = new DropShadow(15, color);
ds.setInput(new Glow(0.5));
innerBar.setEffect(ds);
}
代码示例来源:origin: stackoverflow.com
rectangle.setArcHeight(4);
rectangle.setArcWidth(6);
rectangle.setEffect(new DropShadow());
代码示例来源:origin: com.nexitia.emaginplatform/emagin-jfxcore-engine
/**
* Prepare Stage for dock feedback display
*/
void buildDockFeedbackStage() {
dockFeedbackPopup = new Stage(StageStyle.TRANSPARENT);
dockFeedback = new Rectangle(0, 0, 100, 100);
dockFeedback.setArcHeight(10);
dockFeedback.setArcWidth(10);
dockFeedback.setFill(Color.TRANSPARENT);
dockFeedback.setStroke(Color.BLACK);
dockFeedback.setStrokeWidth(2);
dockFeedback.setCache(true);
dockFeedback.setCacheHint(CacheHint.SPEED);
dockFeedback.setEffect(new DropShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 10, 0.2, 3, 3));
dockFeedback.setMouseTransparent(true);
BorderPane borderpane = new BorderPane();
borderpane.setStyle("-fx-background-color:transparent"); // J8
borderpane.setCenter(dockFeedback);
Scene scene = new Scene(borderpane);
scene.setFill(Color.TRANSPARENT);
dockFeedbackPopup.setScene(scene);
dockFeedbackPopup.sizeToScene();
}
代码示例来源:origin: org.copper-engine/copper-monitoring-client
public static void startValueSetAnimation(final Pane parent) {
final javafx.scene.shape.Rectangle rectangle = new javafx.scene.shape.Rectangle();
Insets margin = BorderPane.getMargin(parent);
if (margin == null) {
margin = new Insets(0);
}
rectangle.widthProperty().bind(parent.widthProperty().subtract(margin.getLeft() + margin.getRight()));
rectangle.heightProperty().bind(parent.heightProperty().subtract(margin.getTop() + margin.getBottom()));
rectangle.setFill(Color.rgb(0, 150, 201));
parent.getChildren().add(rectangle);
BoxBlur bb = new BoxBlur();
bb.setWidth(5);
bb.setHeight(5);
bb.setIterations(3);
rectangle.setEffect(bb);
FadeTransition ft = new FadeTransition(Duration.millis(250), rectangle);
ft.setFromValue(0.2);
ft.setToValue(0.8);
ft.setCycleCount(2);
ft.setAutoReverse(true);
ft.play();
ft.setOnFinished(new EventHandler<ActionEvent>() {
@Override
public void handle(ActionEvent event) {
parent.getChildren().remove(rectangle);
}
});
}
代码示例来源:origin: com.github.almasb/fxgl-ui
ds.setInput(new Glow(0.3));
ds.setWidth(50);
backgroundBar.setEffect(ds);
innerBar.setEffect(ds);
trace.setFill(traceFill);
trace.setOpacity(0.55);
trace.setEffect(new Glow(0.5));
代码示例来源:origin: com.github.almasb/fxgl-base
ds.setInput(new Glow(0.3));
ds.setWidth(50);
backgroundBar.setEffect(ds);
innerBar.setEffect(ds);
trace.setFill(traceFill);
trace.setOpacity(0.55);
trace.setEffect(new Glow(0.5));
内容来源于网络,如有侵权,请联系作者删除!