Java Code Examples for javafx.scene.effect.DropShadow#setHeight()

The following examples show how to use javafx.scene.effect.DropShadow#setHeight() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Toast.java    From ApkToolPlus with Apache License 2.0 6 votes vote down vote up
public Toast(final String msg) {
    label = new Label(msg);
    String style =  "-fx-background-color:black;" +
            "-fx-background-radius:10;" +
            "-fx-font: 16px \"Microsoft YaHei\";" +
            "-fx-text-fill:white;-fx-padding:10;";
    label.setStyle(style);
    DropShadow dropShadow = new DropShadow();
    dropShadow.setBlurType(BlurType.THREE_PASS_BOX);
    dropShadow.setWidth(40);
    dropShadow.setHeight(40);
    dropShadow.setRadius(19.5);
    dropShadow.setOffsetX(0);
    dropShadow.setOffsetY(00);
    dropShadow.setColor(Color.color(0, 0, 0));
    label.setEffect(dropShadow);
}
 
Example 2
Source File: TaskBarIcon.java    From desktoppanefx with Apache License 2.0 5 votes vote down vote up
public TaskBarIcon(TaskBar taskBar, InternalWindow internalWindow) {
    this.taskBar = taskBar;
    this.internalWindow = internalWindow;
    this.icon = internalWindow.getTitleBar().getIcon();
    this.desktopPane = internalWindow.getDesktopPane();

    getStyleClass().add("taskbar-icon");
    setId(internalWindow.getId());
    addEventHandler(MouseEvent.MOUSE_CLICKED, e -> restoreWindow());

    HBox pane = new HBox();
    pane.setStyle("-fx-alignment:center-left");
    pane.setSpacing(10d);
    pane.setPadding(new Insets(0, 10, 0, 10));

    lblTitle = new Label();
    lblTitle.textProperty().bind(internalWindow.getTitleBar().titleProperty());

    btnClose = new Button("", new FontIcon(MaterialDesign.MDI_WINDOW_CLOSE));
    btnClose.visibleProperty().bind(closeVisibleProperty());
    btnClose.managedProperty().bind(closeVisibleProperty());
    btnClose.disableProperty().bind(disableCloseProperty());
    btnClose.getStyleClass().add("taskbar-icon-button");

    //Adding the shadow when the mouse cursor is on
    final DropShadow shadowCloseBtn = new DropShadow();
    shadowCloseBtn.setHeight(10d);
    shadowCloseBtn.setWidth(10d);
    btnClose.addEventHandler(MouseEvent.MOUSE_ENTERED, e -> btnClose.setEffect(shadowCloseBtn));

    //Removing the shadow when the mouse cursor is off
    btnClose.addEventHandler(MouseEvent.MOUSE_EXITED, e -> btnClose.setEffect(null));
    btnClose.addEventHandler(MouseEvent.MOUSE_CLICKED, e -> closeWindow());

    pane.getChildren().addAll(icon, lblTitle, btnClose);
    setContentDisplay(ContentDisplay.GRAPHIC_ONLY);
    setGraphic(pane);
}
 
Example 3
Source File: MainScene.java    From mars-sim with GNU General Public License v3.0 5 votes vote down vote up
public void setGlow(Node node) {
	int depth = 70; //Setting the uniform variable for the glow width and height	 
	borderGlow = new DropShadow();
	borderGlow.setOffsetY(0f);
	borderGlow.setOffsetX(0f);
	if (theme == 7)
		borderGlow.setColor(Color.ORANGE);
	else
		borderGlow.setColor(Color.BLUE);		
	borderGlow.setWidth(depth);
	borderGlow.setHeight(depth); 
	node.setEffect(borderGlow);
}