Search in sources :

Example 1 with CornerRadii

use of javafx.scene.layout.CornerRadii 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 2 with CornerRadii

use of javafx.scene.layout.CornerRadii 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 3 with CornerRadii

use of javafx.scene.layout.CornerRadii in project PretendYoureXyzzyReborn by devgianlu.

the class PyxCard method initialize.

@FXML
public void initialize() {
    this.text.setText(card.text);
    this.watermark.setText(card.watermark);
    if (card instanceof BlackCard) {
        // Black card
        setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(8), Insets.EMPTY)));
        this.text.setTextFill(Color.WHITE);
        this.watermark.setTextFill(Color.WHITE);
    } else {
        // White card
        setBackground(new Background(new BackgroundFill(Color.WHITE, new CornerRadii(8), Insets.EMPTY)));
        this.text.setTextFill(Color.BLACK);
        this.watermark.setTextFill(Color.BLACK);
    }
}
Also used : Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) BlackCard(com.gianlu.pyxreborn.Models.BlackCard) CornerRadii(javafx.scene.layout.CornerRadii) FXML(javafx.fxml.FXML)

Example 4 with CornerRadii

use of javafx.scene.layout.CornerRadii in project org.csstudio.display.builder by kasemir.

the class RegionBaseRepresentation method computeAlarmBorder.

private void computeAlarmBorder(final AlarmSeverity severity) {
    // Any change?
    if (current_alarm.getAndSet(severity) == severity)
        return;
    final int[] radii = getBorderRadii();
    if (radii == null)
        // Use common alarm border
        alarm_border = alarm_borders[severity.ordinal()];
    else {
        // Create a custom alarm border
        final int horiz = radii[0], vert = radii[1];
        // There's a bug in CornerRadii:
        // Even though horiz != vert, it considers them all 'uniform'
        // because it _separately_ compares all the horizontal and vertical radii,
        // never checking if horiz == vert.
        // Workaround: Make one of the horiz or vert radii a little different (+0.1).
        // Bug was in at least Java 1.8.0_101.
        final CornerRadii corners = new CornerRadii(horiz, vert, vert, horiz, horiz, vert, vert, horiz + 0.1, false, false, false, false, false, false, false, false);
        alarm_border = createAlarmBorder(severity, corners);
    }
    dirty_border.mark();
    toolkit.scheduleUpdate(this);
}
Also used : CornerRadii(javafx.scene.layout.CornerRadii)

Example 5 with CornerRadii

use of javafx.scene.layout.CornerRadii in project blue by kunstmusik.

the class BSBGroupView method updateBorderColor.

private void updateBorderColor() {
    label.setBackground(new Background(new BackgroundFill(bsbGroup.getBorderColor(), new CornerRadii(4, 4, 0, 0, false), Insets.EMPTY)));
    resizePane.setBorder(new Border(new BorderStroke(bsbGroup.getBorderColor(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1))));
}
Also used : 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) Border(javafx.scene.layout.Border)

Aggregations

CornerRadii (javafx.scene.layout.CornerRadii)25 Background (javafx.scene.layout.Background)20 BackgroundFill (javafx.scene.layout.BackgroundFill)20 Border (javafx.scene.layout.Border)9 BorderStroke (javafx.scene.layout.BorderStroke)9 BorderWidths (javafx.scene.layout.BorderWidths)9 Insets (javafx.geometry.Insets)7 Text (javafx.scene.text.Text)5 Label (javafx.scene.control.Label)4 DropShadow (javafx.scene.effect.DropShadow)3 Pane (javafx.scene.layout.Pane)3 Color (javafx.scene.paint.Color)3 Rectangle (javafx.scene.shape.Rectangle)2 TextFlow (javafx.scene.text.TextFlow)2 BlackCard (com.gianlu.pyxreborn.Models.BlackCard)1 JFXColorPicker (com.jfoenix.controls.JFXColorPicker)1 JFXToggleNode (com.jfoenix.controls.JFXToggleNode)1 ConicalGradient (eu.hansolo.medusa.tools.ConicalGradient)1 Tile (eu.hansolo.tilesfx.Tile)1 ChartData (eu.hansolo.tilesfx.chart.ChartData)1