use of javafx.scene.layout.BorderWidths in project tilesfx by HanSolo.
the class SunburstChart method initGraphics.
// ******************** Initialization ************************************
private void initGraphics() {
if (Double.compare(getPrefWidth(), 0.0) <= 0 || Double.compare(getPrefHeight(), 0.0) <= 0 || Double.compare(getWidth(), 0.0) <= 0 || Double.compare(getHeight(), 0.0) <= 0) {
if (getPrefWidth() > 0 && getPrefHeight() > 0) {
setPrefSize(getPrefWidth(), getPrefHeight());
} else {
setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT);
}
}
segmentPane = new Pane();
chartCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT);
chartCanvas.setMouseTransparent(true);
chartCtx = chartCanvas.getGraphicsContext2D();
pane = new Pane(segmentPane, chartCanvas);
pane.setBackground(new Background(new BackgroundFill(backgroundPaint, CornerRadii.EMPTY, Insets.EMPTY)));
pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(borderWidth))));
getChildren().setAll(pane);
prepareData();
}
use of javafx.scene.layout.BorderWidths in project tilesfx by HanSolo.
the class PlusMinusTileSkin method decrement.
private void decrement() {
minusLabel.setTextFill(tile.getActiveColor());
minusLabel.setBorder(new Border(new BorderStroke(tile.getActiveColor(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(size * 0.01))));
double newValue = clamp(minValue, maxValue, tile.getValue() - tile.getIncrement());
tile.setValue(newValue);
}
use of javafx.scene.layout.BorderWidths in project tilesfx by HanSolo.
the class PlusMinusTileSkin method resize.
@Override
protected void resize() {
super.resize();
description.setPrefSize(width - size * 0.1, size * 0.43);
description.relocate(size * 0.05, titleText.isVisible() ? height * 0.42 : height * 0.32);
double buttonSize = size * 0.18;
minusLabel.setFont(Fonts.latoBold(size * 0.2));
minusLabel.setPrefSize(buttonSize, buttonSize);
minusLabel.setMinSize(buttonSize, buttonSize);
minusLabel.setMaxSize(buttonSize, buttonSize);
// minusLabel.setPadding(new Insets(-0.055 * size, 0, 0, 0));
minusLabel.setPadding(new Insets(-0.0625 * size, 0, 0, 0));
minusLabel.setBorder(new Border(new BorderStroke(tile.getForegroundColor(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(size * 0.01))));
minusLabel.relocate(size * 0.05, height - size * 0.20 - buttonSize);
plusLabel.setFont(Fonts.latoBold(size * 0.2));
plusLabel.setPrefSize(buttonSize, buttonSize);
plusLabel.setMinSize(buttonSize, buttonSize);
plusLabel.setMaxSize(buttonSize, buttonSize);
plusLabel.setPadding(new Insets(-0.05 * size, 0, 0, 0));
plusLabel.setBorder(new Border(new BorderStroke(tile.getForegroundColor(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(size * 0.01))));
plusLabel.relocate(width - size * 0.05 - buttonSize, height - size * 0.20 - buttonSize);
valueUnitFlow.setPrefWidth(width - size * 0.1);
valueUnitFlow.relocate(size * 0.05, contentBounds.getY());
valueUnitFlow.setMaxHeight(valueText.getFont().getSize());
fractionLine.setStartX(width - 0.17 * size);
fractionLine.setStartY(tile.getTitle().isEmpty() ? size * 0.2 : size * 0.3);
fractionLine.setEndX(width - 0.05 * size);
fractionLine.setEndY(tile.getTitle().isEmpty() ? size * 0.2 : size * 0.3);
fractionLine.setStroke(tile.getUnitColor());
fractionLine.setStrokeWidth(size * 0.005);
unitFlow.setTranslateY(-size * 0.005);
}
use of javafx.scene.layout.BorderWidths in project TestFX by TestFX.
the class BoundsQueryUtilsTest method setupRegion.
private static void setupRegion() {
region = new Region();
region.setMaxSize(0, 0);
region.setBackground(new Background(new BackgroundFill(Color.RED, null, null)));
// nodeBounds(), nodeBoundsInLocal()
region.setPadding(new Insets(0, 0, 0, PADDING_LEFT));
region.setBorder(new Border(new BorderStroke(Color.BLUE, BorderStrokeStyle.SOLID, null, // nodeBounds(), nodeBoundsInLocal()
new BorderWidths(0, 0, 0, BORDER_LEFT))));
// nodeBoundsInParent()
StackPane.setMargin(region, new Insets(0, 0, 0, MARGIN_LEFT));
}
use of javafx.scene.layout.BorderWidths in project phoebus by ControlSystemStudio.
the class RegionBaseRepresentation method custom_border_changed.
private void custom_border_changed(final WidgetProperty<?> property, final Object old_value, final Object new_value) {
final Integer width = border_width_prop.getValue();
if (width <= 0)
custom_border = null;
else {
final Color color = JFXUtil.convert(border_color_prop.getValue());
final CornerRadii corners = computeCornerRadii();
custom_border = new Border(new BorderStroke(color, solid, corners, new BorderWidths(width)));
}
dirty_border.mark();
toolkit.scheduleUpdate(this);
}
Aggregations