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)));
}
});
}
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);
}
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);
}
}
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);
}
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))));
}
Aggregations