Search in sources :

Example 1 with Background

use of javafx.scene.layout.Background in project cryptomator by cryptomator.

the class PasswordStrengthUtil method getBackgroundWithStrengthColor.

public Background getBackgroundWithStrengthColor(Number score) {
    Color c = this.getStrengthColor(score);
    BackgroundFill fill = new BackgroundFill(c, CornerRadii.EMPTY, Insets.EMPTY);
    return new Background(fill);
}
Also used : Background(javafx.scene.layout.Background) Color(javafx.scene.paint.Color) BackgroundFill(javafx.scene.layout.BackgroundFill)

Example 2 with Background

use of javafx.scene.layout.Background in project JFoenix by jfoenixadmin.

the class JFXSliderSkin method initializeVariables.

private void initializeVariables() {
    shifting = 30 + thumb.getWidth();
    if (getSkinnable().getOrientation() != Orientation.HORIZONTAL)
        horizontalRotation = -90;
    if (((JFXSlider) getSkinnable()).getIndicatorPosition() != IndicatorPosition.LEFT) {
        indicatorRotation = 180;
        shifting = -shifting;
    }
    sliderValue.setRotate(rotationAngle + indicatorRotation + 3 * horizontalRotation);
    animatedThumb.setRotate(-rotationAngle + indicatorRotation + horizontalRotation);
    thumb.backgroundProperty().addListener((o, oldVal, newVal) -> {
        if (animatedThumb.getBackground() != null) {
            animatedThumb.setBackground(new Background(new BackgroundFill(newVal.getFills().get(0).getFill(), animatedThumb.getBackground().getFills().get(0).getRadii(), animatedThumb.getBackground().getFills().get(0).getInsets())));
        } else {
            animatedThumb.setBackground(new Background(new BackgroundFill(newVal.getFills().get(0).getFill(), new CornerRadii(50, 50, 50, 0, true), null)));
        }
    });
}
Also used : Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) CornerRadii(javafx.scene.layout.CornerRadii)

Example 3 with Background

use of javafx.scene.layout.Background in project JFoenix by jfoenixadmin.

the class JFXSliderSkinOLD method initializeVariables.

private void initializeVariables() {
    double stroke = thumb.getStrokeWidth();
    double radius = thumb.getRadius();
    thumbRadius = stroke > radius ? stroke : radius;
    trackColor = (Color) track.getStroke();
    thumbColor = (Color) thumb.getStroke();
    track.strokeProperty().addListener((o, oldVal, newVal) -> {
        // prevent internal color change
        if (!internalChange)
            trackColor = newVal;
    });
    thumb.strokeProperty().addListener((o, oldVal, newVal) -> {
        // prevent internal color change
        if (!internalChange) {
            thumbColor = newVal;
            if (getSkinnable().getValue() == 0) {
                internalChange = true;
                thumb.setFill(trackColor);
                thumb.setStroke(trackColor);
                internalChange = false;
            }
        }
    });
    shifting = 30 + thumbRadius;
    if (!isHorizontal) {
        horizontalRotation = -90;
    }
    if (!isIndicatorLeft) {
        indicatorRotation = 180;
        shifting = -shifting;
    }
    sliderValue.setRotate(rotationAngle + indicatorRotation + 3 * horizontalRotation);
    animatedThumb.resize(30, 30);
    animatedThumb.setRotate(-rotationAngle + indicatorRotation + horizontalRotation);
    animatedThumb.backgroundProperty().bind(Bindings.createObjectBinding(() -> new Background(new BackgroundFill(thumb.getStroke(), new CornerRadii(50, 50, 50, 0, true), null)), thumb.strokeProperty()));
    animatedThumb.setScaleX(0);
    animatedThumb.setScaleY(0);
}
Also used : Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) CornerRadii(javafx.scene.layout.CornerRadii)

Example 4 with Background

use of javafx.scene.layout.Background in project JFoenix by jfoenixadmin.

the class JFXTimePicker method initialize.

private void initialize() {
    getStyleClass().add(DEFAULT_STYLE_CLASS);
    setAccessibleRole(AccessibleRole.DATE_PICKER);
    setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, CornerRadii.EMPTY, Insets.EMPTY)));
    setEditable(true);
}
Also used : Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill)

Example 5 with Background

use of javafx.scene.layout.Background in project Smartcity-Smarthouse by TechnionYP5777.

the class TempDashboard method start.

@Override
public void start(Stage stage) throws Exception {
    pane = new FlowPane(Orientation.HORIZONTAL, 1, 1, textTile);
    pane.setPadding(new Insets(5));
    pane.setPrefSize(150, 150);
    pane.setBackground(new Background(new BackgroundFill(Tile.BACKGROUND.darker(), CornerRadii.EMPTY, Insets.EMPTY)));
    Scene scene = new Scene(pane);
    stage.setTitle("Dashboard Configuration in Action");
    stage.setScene(scene);
    stage.show();
}
Also used : Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) FlowPane(javafx.scene.layout.FlowPane) Scene(javafx.scene.Scene)

Aggregations

Background (javafx.scene.layout.Background)86 BackgroundFill (javafx.scene.layout.BackgroundFill)82 Insets (javafx.geometry.Insets)30 CornerRadii (javafx.scene.layout.CornerRadii)24 Scene (javafx.scene.Scene)18 StackPane (javafx.scene.layout.StackPane)15 Color (javafx.scene.paint.Color)15 Label (javafx.scene.control.Label)14 Border (javafx.scene.layout.Border)14 BorderStroke (javafx.scene.layout.BorderStroke)14 BorderWidths (javafx.scene.layout.BorderWidths)12 Pane (javafx.scene.layout.Pane)11 Text (javafx.scene.text.Text)9 BorderPane (javafx.scene.layout.BorderPane)8 Region (javafx.scene.layout.Region)8 HBox (javafx.scene.layout.HBox)7 ArrayList (java.util.ArrayList)6 MouseEvent (javafx.scene.input.MouseEvent)6 VBox (javafx.scene.layout.VBox)6 Rectangle (javafx.scene.shape.Rectangle)5