Search in sources :

Example 1 with NotifyRegion

use of eu.hansolo.tilesfx.tools.NotifyRegion in project tilesfx by HanSolo.

the class TileSkin method initGraphics.

// ******************** Initialization ************************************
protected void initGraphics() {
    // Set initial size
    if (Double.compare(tile.getPrefWidth(), 0.0) <= 0 || Double.compare(tile.getPrefHeight(), 0.0) <= 0 || Double.compare(tile.getWidth(), 0.0) <= 0 || Double.compare(tile.getHeight(), 0.0) <= 0) {
        if (tile.getPrefWidth() > 0 && tile.getPrefHeight() > 0) {
            tile.setPrefSize(tile.getPrefWidth(), tile.getPrefHeight());
        } else {
            tile.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
        }
    }
    shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 3, 0, 0, 0);
    notifyRegion = new NotifyRegion();
    enableNode(notifyRegion, false);
    pane = new Pane(notifyRegion);
    pane.setBorder(new Border(new BorderStroke(tile.getBorderColor(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(tile.getBorderWidth()))));
    pane.setBackground(new Background(new BackgroundFill(tile.getBackgroundColor(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY)));
    getChildren().setAll(pane);
}
Also used : NotifyRegion(eu.hansolo.tilesfx.tools.NotifyRegion) Background(javafx.scene.layout.Background) BorderWidths(javafx.scene.layout.BorderWidths) BackgroundFill(javafx.scene.layout.BackgroundFill) BorderStroke(javafx.scene.layout.BorderStroke) CornerRadii(javafx.scene.layout.CornerRadii) Pane(javafx.scene.layout.Pane) Border(javafx.scene.layout.Border) DropShadow(javafx.scene.effect.DropShadow)

Aggregations

NotifyRegion (eu.hansolo.tilesfx.tools.NotifyRegion)1 DropShadow (javafx.scene.effect.DropShadow)1 Background (javafx.scene.layout.Background)1 BackgroundFill (javafx.scene.layout.BackgroundFill)1 Border (javafx.scene.layout.Border)1 BorderStroke (javafx.scene.layout.BorderStroke)1 BorderWidths (javafx.scene.layout.BorderWidths)1 CornerRadii (javafx.scene.layout.CornerRadii)1 Pane (javafx.scene.layout.Pane)1