Java Code Examples for javafx.scene.layout.Pane#setBorder()
The following examples show how to use
javafx.scene.layout.Pane#setBorder() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: SunburstChart.java From OEE-Designer with MIT License | 6 votes |
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(); }
Example 2
Source File: TextClockSkin.java From Medusa with Apache License 2.0 | 6 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } timeText = new Text(); timeText.setTextOrigin(VPos.CENTER); timeText.setFill(textColor); dateText = new Text(); dateText.setTextOrigin(VPos.CENTER); dateText.setFill(dateColor); pane = new Pane(timeText, dateText); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
Example 3
Source File: DigitalClockSkin.java From Medusa with Apache License 2.0 | 6 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); ctx = canvas.getGraphicsContext2D(); pane = new Pane(canvas); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
Example 4
Source File: CustomGaugeSkin.java From medusademo with Apache License 2.0 | 6 votes |
private void initGraphics() { backgroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); backgroundCtx = backgroundCanvas.getGraphicsContext2D(); foregroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); foregroundCtx = foregroundCanvas.getGraphicsContext2D(); ledInnerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.BLACK, 0.2 * PREFERRED_WIDTH, 0, 0, 0); ledDropShadow = new DropShadow(BlurType.TWO_PASS_BOX, getSkinnable().getBarColor(), 0.3 * PREFERRED_WIDTH, 0, 0, 0); pane = new Pane(backgroundCanvas, foregroundCanvas); pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
Example 5
Source File: SunburstChart.java From tilesfx with Apache License 2.0 | 6 votes |
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(); }
Example 6
Source File: SunburstChart.java From charts with Apache License 2.0 | 6 votes |
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(); }
Example 7
Source File: TileSkin.java From OEE-Designer with MIT License | 6 votes |
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); }
Example 8
Source File: BatterySkin.java From Medusa with Apache License 2.0 | 5 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } batteryBackground = new Path(); batteryBackground.setFillRule(FillRule.EVEN_ODD); batteryBackground.setStroke(null); battery = new Path(); battery.setFillRule(FillRule.EVEN_ODD); battery.setStroke(null); valueText = new Text(String.format(locale, "%.0f%%", gauge.getCurrentValue())); valueText.setVisible(gauge.isValueVisible()); valueText.setManaged(gauge.isValueVisible()); // Add all nodes pane = new Pane(); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(1)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); pane.getChildren().setAll(batteryBackground, battery, valueText); getChildren().setAll(pane); }
Example 9
Source File: DigitalSkin.java From Medusa with Apache License 2.0 | 5 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } backgroundCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); backgroundCtx = backgroundCanvas.getGraphicsContext2D(); barCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); barCtx = barCanvas.getGraphicsContext2D(); valueBkgText = new Text(); valueBkgText.setStroke(null); valueBkgText.setFill(Helper.getTranslucentColorFrom(valueColor, 0.1)); valueText = new Text(); valueText.setStroke(null); valueText.setFill(valueColor); Helper.enableNode(valueText, gauge.isValueVisible()); pane = new Pane(backgroundCanvas, barCanvas, valueBkgText, valueText); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); getChildren().setAll(pane); }
Example 10
Source File: SlimSkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48590226, PREFERRED_HEIGHT * 0.48590226, 90, 360); barBackground.setType(ArcType.OPEN); barBackground.setStroke(gauge.getBarBackgroundColor()); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2); barBackground.setStrokeLineCap(StrokeLineCap.ROUND); barBackground.setFill(null); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48590226, PREFERRED_HEIGHT * 0.48590226, 90, 0); bar.setType(ArcType.OPEN); bar.setStroke(gauge.getBarColor()); bar.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2); bar.setStrokeLineCap(StrokeLineCap.ROUND); bar.setFill(null); titleText = new Text(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(gauge.getUnit()); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); pane = new Pane(barBackground, bar, titleText, valueText, unitText); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }
Example 11
Source File: Slim1Skin.java From medusademo with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48590226, PREFERRED_HEIGHT * 0.48590226, 90, 360); barBackground.setType(ArcType.OPEN); barBackground.setStroke(gauge.getBarBackgroundColor()); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2); barBackground.setStrokeLineCap(StrokeLineCap.ROUND); barBackground.setFill(null); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48590226, PREFERRED_HEIGHT * 0.48590226, 90, 0); bar.setType(ArcType.OPEN); bar.setStroke(gauge.getBarColor()); bar.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2); bar.setStrokeLineCap(StrokeLineCap.ROUND); bar.setFill(null); titleText = new Text(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(gauge.getUnit()); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); pane = new Pane(barBackground, bar, titleText, valueText, unitText); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }
Example 12
Source File: BulletChartSkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(preferredWidth, preferredHeight); } } orientation = gauge.getOrientation(); aspectRatio = preferredHeight / preferredWidth; titleText = new Text(gauge.getTitle()); titleText.setTextOrigin(VPos.CENTER); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); unitText = new Text(gauge.getUnit()); unitText.setTextOrigin(VPos.CENTER); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); tickMarkCanvas = new Canvas(0.79699248 * preferredWidth, 0.08333333 * preferredHeight); tickMarksCtx = tickMarkCanvas.getGraphicsContext2D(); sectionsCanvas = new Canvas(0.79699248 * preferredWidth, 0.5 * preferredHeight); sectionsCtx = sectionsCanvas.getGraphicsContext2D(); barRect = new Rectangle(); Tooltip.install(barRect, barTooltip); thresholdRect = new Rectangle(); Tooltip.install(thresholdRect, thresholdTooltip); pane = new Pane(titleText, unitText, tickMarkCanvas, sectionsCanvas, barRect, thresholdRect); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
Example 13
Source File: WhiteSkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } shadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 12, 0, 3, 3); textShadow = new DropShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.65), 4, 0, 2, 2); valueText = new Text(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.setFill(Color.WHITE); valueText.setFont(Fonts.robotoBold(PREFERRED_WIDTH * 0.20625)); valueText.setTextOrigin(VPos.CENTER); valueText.relocate(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.46875); valueText.setEffect(textShadow); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(gauge.getUnit()); unitText.setFill(Color.WHITE); unitText.setFont(Fonts.robotoBold(PREFERRED_WIDTH * 0.0875)); unitText.setTextOrigin(VPos.CENTER); unitText.relocate(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.65625); unitText.setEffect(textShadow); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); backgroundRing = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.43125, PREFERRED_HEIGHT * 0.43125, 0, 360); backgroundRing.setFill(null); backgroundRing.setStroke(Color.rgb(255, 255, 255, 0.9)); backgroundRing.setStrokeLineCap(StrokeLineCap.BUTT); backgroundRing.setStrokeWidth(PREFERRED_WIDTH * 0.1375); backgroundRing.setEffect(shadow); barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.43125, PREFERRED_HEIGHT * 0.43125, 0, 360); barBackground.setFill(null); barBackground.setStroke(Color.rgb(255, 255, 255, 0.4)); barBackground.setStrokeLineCap(StrokeLineCap.BUTT); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.1375); bar = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.43125, PREFERRED_HEIGHT * 0.43125, 90, -gauge.getAngleStep() * gauge.getValue()); bar.setFill(null); bar.setStroke(Color.WHITE); bar.setStrokeWidth(PREFERRED_WIDTH * 0.1375); bar.setStrokeLineCap(StrokeLineCap.BUTT); pane = new Pane(valueText, unitText, backgroundRing, barBackground, bar); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); getChildren().setAll(pane); }
Example 14
Source File: DBClockSkin.java From Medusa with Apache License 2.0 | 4 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D(); tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); tickCtx = tickCanvas.getGraphicsContext2D(); alarmPane = new Pane(); hour = new Rectangle(3, 60); hour.setArcHeight(3); hour.setArcWidth(3); hour.setStroke(null); hour.setFill(clock.getHourColor()); hour.getTransforms().setAll(hourRotate); minute = new Rectangle(3, 96); minute.setArcHeight(3); minute.setArcWidth(3); minute.setStroke(null); minute.setFill(clock.getMinuteColor()); minute.getTransforms().setAll(minuteRotate); second = new Path(); second.setFillRule(FillRule.EVEN_ODD); second.setStroke(null); second.setFill(clock.getSecondColor()); second.getTransforms().setAll(secondRotate); enableNode(second, clock.isSecondsVisible()); dropShadow = new DropShadow(); dropShadow.setColor(Color.rgb(0, 0, 0, 0.25)); dropShadow.setBlurType(BlurType.TWO_PASS_BOX); dropShadow.setRadius(0.015 * PREFERRED_WIDTH); dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH); knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5); knob.setStroke(null); knob.setFill(clock.getKnobColor()); knob.setEffect(dropShadow); shadowGroupHour = new Group(hour); shadowGroupMinute = new Group(minute); shadowGroupSecond = new Group(second); shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null); title = new Text(""); title.setVisible(clock.isTitleVisible()); title.setManaged(clock.isTitleVisible()); text = new Text(""); text.setVisible(clock.isTextVisible()); text.setManaged(clock.isTextVisible()); pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond, knob); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }
Example 15
Source File: TileSparklineSkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } graphBounds = new Rectangle(PREFERRED_WIDTH * 0.05, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.9, PREFERRED_HEIGHT * 0.45); titleText = new Text(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(String.format(locale, formatString, gauge.getValue())); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); unitText = new Text(gauge.getUnit()); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); averageText = new Text(String.format(locale, formatString, gauge.getAverage())); averageText.setFill(gauge.getAverageColor()); Helper.enableNode(averageText, gauge.isAverageVisible()); highText = new Text(); highText.setTextOrigin(VPos.BOTTOM); highText.setFill(gauge.getValueColor()); lowText = new Text(); lowText.setTextOrigin(VPos.TOP); lowText.setFill(gauge.getValueColor()); subTitleText = new Text(gauge.getSubTitle()); subTitleText.setTextOrigin(VPos.TOP); subTitleText.setFill(gauge.getSubTitleColor()); stdDeviationArea = new Rectangle(); Helper.enableNode(stdDeviationArea, gauge.isAverageVisible()); averageLine = new Line(); averageLine.setStroke(gauge.getAverageColor()); averageLine.getStrokeDashArray().addAll(PREFERRED_WIDTH * 0.005, PREFERRED_WIDTH * 0.005); Helper.enableNode(averageLine, gauge.isAverageVisible()); pathElements = new ArrayList<>(noOfDatapoints); pathElements.add(0, new MoveTo()); for (int i = 1 ; i < noOfDatapoints ; i++) { pathElements.add(i, new LineTo()); } sparkLine = new Path(); sparkLine.getElements().addAll(pathElements); sparkLine.setFill(null); sparkLine.setStroke(gauge.getBarColor()); sparkLine.setStrokeWidth(PREFERRED_WIDTH * 0.0075); sparkLine.setStrokeLineCap(StrokeLineCap.ROUND); sparkLine.setStrokeLineJoin(StrokeLineJoin.ROUND); dot = new Circle(); dot.setFill(gauge.getBarColor()); pane = new Pane(titleText, valueText, unitText, stdDeviationArea, averageLine, sparkLine, dot, averageText, highText, lowText, subTitleText); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY))); getChildren().setAll(pane); }
Example 16
Source File: ClockSkin.java From Medusa with Apache License 2.0 | 4 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(getSkinnable().getPrefWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getPrefHeight(), 0.0) <= 0 || Double.compare(getSkinnable().getWidth(), 0.0) <= 0 || Double.compare(getSkinnable().getHeight(), 0.0) <= 0) { if (getSkinnable().getPrefWidth() > 0 && getSkinnable().getPrefHeight() > 0) { getSkinnable().setPrefSize(getSkinnable().getPrefWidth(), getSkinnable().getPrefHeight()); } else { getSkinnable().setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } sectionsAndAreasCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); sectionsAndAreasCtx = sectionsAndAreasCanvas.getGraphicsContext2D(); tickCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); tickCtx = tickCanvas.getGraphicsContext2D(); alarmPane = new Pane(); hour = new Rectangle(3, 60); hour.setArcHeight(3); hour.setArcWidth(3); hour.setStroke(getSkinnable().getHourColor()); hour.getTransforms().setAll(hourRotate); minute = new Rectangle(3, 96); minute.setArcHeight(3); minute.setArcWidth(3); minute.setStroke(getSkinnable().getMinuteColor()); minute.getTransforms().setAll(minuteRotate); second = new Rectangle(1, 96); second.setArcHeight(1); second.setArcWidth(1); second.setStroke(getSkinnable().getSecondColor()); second.getTransforms().setAll(secondRotate); second.setVisible(getSkinnable().isSecondsVisible()); second.setManaged(getSkinnable().isSecondsVisible()); knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5); knob.setStroke(Color.web("#282a3280")); dropShadow = new DropShadow(); dropShadow.setColor(Color.rgb(0, 0, 0, 0.25)); dropShadow.setBlurType(BlurType.TWO_PASS_BOX); dropShadow.setRadius(0.015 * PREFERRED_WIDTH); dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH); shadowGroupHour = new Group(hour); shadowGroupMinute = new Group(minute); shadowGroupSecond = new Group(second, knob); shadowGroupHour.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null); shadowGroupMinute.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null); shadowGroupSecond.setEffect(getSkinnable().getShadowsEnabled() ? dropShadow : null); title = new Text(""); title.setVisible(getSkinnable().isTitleVisible()); title.setManaged(getSkinnable().isTitleVisible()); dateText = new Text(""); dateText.setVisible(getSkinnable().isDateVisible()); dateText.setManaged(getSkinnable().isDateVisible()); text = new Text(""); text.setVisible(getSkinnable().isTextVisible()); text.setManaged(getSkinnable().isTextVisible()); pane = new Pane(sectionsAndAreasCanvas, tickCanvas, alarmPane, title, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond); pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(getSkinnable().getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }
Example 17
Source File: SlimClockSkin.java From Medusa with Apache License 2.0 | 4 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } ZonedDateTime time = clock.getTime(); secondBackgroundCircle = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.48); secondBackgroundCircle.setStrokeWidth(PREFERRED_WIDTH * 0.008); secondBackgroundCircle.setStrokeType(StrokeType.CENTERED); secondBackgroundCircle.setStrokeLineCap(StrokeLineCap.ROUND); secondBackgroundCircle.setFill(null); secondBackgroundCircle.setStroke(Helper.getTranslucentColorFrom(clock.getSecondColor(), 0.2)); secondBackgroundCircle.setVisible(clock.isSecondsVisible()); secondBackgroundCircle.setManaged(clock.isSecondsVisible()); dateText = new Text(dateTextFormatter.format(time)); dateText.setVisible(clock.isDayVisible()); dateText.setManaged(clock.isDayVisible()); dateNumbers = new Text(dateNumberFormatter.format(time)); dateNumbers.setVisible(clock.isDateVisible()); dateNumbers.setManaged(clock.isDateVisible()); hour = new Text(HOUR_FORMATTER.format(time)); hour.setFill(clock.getHourColor()); minute = new Text(MINUTE_FORMATTER.format(time)); minute.setFill(clock.getMinuteColor()); secondArc = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, PREFERRED_WIDTH * 0.96, PREFERRED_WIDTH * 0.48, 90, (-6 * clock.getTime().getSecond())); secondArc.setStrokeWidth(PREFERRED_WIDTH * 0.008); secondArc.setStrokeType(StrokeType.CENTERED); secondArc.setStrokeLineCap(StrokeLineCap.ROUND); secondArc.setFill(null); secondArc.setStroke(clock.getSecondColor()); secondArc.setVisible(clock.isSecondsVisible()); secondArc.setManaged(clock.isSecondsVisible()); pane = new Pane(secondBackgroundCircle, dateText, dateNumbers, hour, minute, secondArc); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }
Example 18
Source File: DashboardSkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } unitText = new Text(gauge.getUnit()); unitText.setTextOrigin(VPos.CENTER); unitText.setFill(gauge.getUnitColor()); Helper.enableNode(unitText, !gauge.getUnit().isEmpty()); titleText = new Text(gauge.getTitle()); titleText.setTextOrigin(VPos.CENTER); titleText.setFill(gauge.getTitleColor()); Helper.enableNode(titleText, !gauge.getTitle().isEmpty()); valueText = new Text(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.setTextOrigin(VPos.CENTER); valueText.setFill(gauge.getValueColor()); Helper.enableNode(valueText, gauge.isValueVisible()); minValue = gauge.getMinValue(); minText = new Text(String.format(locale, otherFormatString, minValue)); minText.setTextOrigin(VPos.CENTER); minText.setFill(gauge.getValueColor()); maxText = new Text(String.format(locale, otherFormatString, gauge.getMaxValue())); maxText.setTextOrigin(VPos.CENTER); maxText.setFill(gauge.getValueColor()); boolean tickLabelsVisible = gauge.getTickLabelsVisible(); Helper.enableNode(minText, tickLabelsVisible); Helper.enableNode(maxText, tickLabelsVisible); innerShadow = new InnerShadow(BlurType.TWO_PASS_BOX, Color.rgb(0, 0, 0, 0.3), 30.0, 0.0, 0.0, 10.0); barBackgroundStart = new MoveTo(0, 0.675 * PREFERRED_HEIGHT); barBackgroundOuterArc = new ArcTo(0.675 * PREFERRED_HEIGHT, 0.675 * PREFERRED_HEIGHT, 0, PREFERRED_WIDTH, 0.675 * PREFERRED_HEIGHT, true, true); barBackgroundLineToInnerArc = new LineTo(0.72222 * PREFERRED_WIDTH, 0.675 * PREFERRED_HEIGHT); barBackgroundInnerArc = new ArcTo(0.3 * PREFERRED_HEIGHT, 0.3 * PREFERRED_HEIGHT, 0, 0.27778 * PREFERRED_WIDTH, 0.675 * PREFERRED_HEIGHT, false, false); barBackground = new Path(); barBackground.setFillRule(FillRule.EVEN_ODD); barBackground.getElements().add(barBackgroundStart); barBackground.getElements().add(barBackgroundOuterArc); barBackground.getElements().add(barBackgroundLineToInnerArc); barBackground.getElements().add(barBackgroundInnerArc); barBackground.getElements().add(new ClosePath()); barBackground.setFill(gauge.getBarBackgroundColor()); barBackground.setStroke(gauge.getBorderPaint()); barBackground.setEffect(gauge.isShadowsEnabled() ? innerShadow : null); dataBarStart = new MoveTo(0, 0.675 * PREFERRED_HEIGHT); dataBarOuterArc = new ArcTo(0.675 * PREFERRED_HEIGHT, 0.675 * PREFERRED_HEIGHT, 0, 0, 0, false, true); dataBarLineToInnerArc = new LineTo(0.27778 * PREFERRED_WIDTH, 0.675 * PREFERRED_HEIGHT); dataBarInnerArc = new ArcTo(0.3 * PREFERRED_HEIGHT, 0.3 * PREFERRED_HEIGHT, 0, 0, 0, false, false); dataBar = new Path(); dataBar.setFillRule(FillRule.EVEN_ODD); dataBar.getElements().add(dataBarStart); dataBar.getElements().add(dataBarOuterArc); dataBar.getElements().add(dataBarLineToInnerArc); dataBar.getElements().add(dataBarInnerArc); dataBar.getElements().add(new ClosePath()); dataBar.setFill(gauge.getBarColor()); dataBar.setStroke(gauge.getBorderPaint()); dataBar.setEffect(gauge.isShadowsEnabled() ? innerShadow : null); threshold = new Line(); threshold.setStrokeLineCap(StrokeLineCap.BUTT); Helper.enableNode(threshold, gauge.isThresholdVisible()); thresholdText = new Text(String.format(locale, formatString, gauge.getThreshold())); Helper.enableNode(thresholdText, gauge.isThresholdVisible()); pane = new Pane(unitText, titleText, valueText, minText, maxText, barBackground, dataBar, threshold, thresholdText); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
Example 19
Source File: TileClockSkin.java From Medusa with Apache License 2.0 | 4 votes |
@Override protected void initGraphics() { // Set initial size if (Double.compare(clock.getPrefWidth(), 0.0) <= 0 || Double.compare(clock.getPrefHeight(), 0.0) <= 0 || Double.compare(clock.getWidth(), 0.0) <= 0 || Double.compare(clock.getHeight(), 0.0) <= 0) { if (clock.getPrefWidth() > 0 && clock.getPrefHeight() > 0) { clock.setPrefSize(clock.getPrefWidth(), clock.getPrefHeight()); } else { clock.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } minuteTickMarks = new Path(); minuteTickMarks.setFillRule(FillRule.EVEN_ODD); minuteTickMarks.setFill(null); minuteTickMarks.setStroke(clock.getMinuteColor()); minuteTickMarks.setStrokeLineCap(StrokeLineCap.ROUND); hourTickMarks = new Path(); hourTickMarks.setFillRule(FillRule.EVEN_ODD); hourTickMarks.setFill(null); hourTickMarks.setStroke(clock.getHourColor()); hourTickMarks.setStrokeLineCap(StrokeLineCap.ROUND); hour = new Rectangle(3, 60); hour.setArcHeight(3); hour.setArcWidth(3); hour.setStroke(clock.getHourColor()); hour.getTransforms().setAll(hourRotate); minute = new Rectangle(3, 96); minute.setArcHeight(3); minute.setArcWidth(3); minute.setStroke(clock.getMinuteColor()); minute.getTransforms().setAll(minuteRotate); second = new Rectangle(1, 96); second.setArcHeight(1); second.setArcWidth(1); second.setStroke(clock.getSecondColor()); second.getTransforms().setAll(secondRotate); second.setVisible(clock.isSecondsVisible()); second.setManaged(clock.isSecondsVisible()); knob = new Circle(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.5, 4.5); knob.setStroke(Color.web("#282a3280")); dropShadow = new DropShadow(); dropShadow.setColor(Color.rgb(0, 0, 0, 0.25)); dropShadow.setBlurType(BlurType.TWO_PASS_BOX); dropShadow.setRadius(0.015 * PREFERRED_WIDTH); dropShadow.setOffsetY(0.015 * PREFERRED_WIDTH); shadowGroupHour = new Group(hour); shadowGroupMinute = new Group(minute); shadowGroupSecond = new Group(second, knob); shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null); title = new Text(""); title.setTextOrigin(VPos.TOP); Helper.enableNode(title, clock.isTitleVisible()); amPmText = new Text(clock.getTime().get(ChronoField.AMPM_OF_DAY) == 0 ? "AM" : "PM"); dateText = new Text(""); Helper.enableNode(dateText, clock.isDateVisible()); text = new Text(""); Helper.enableNode(text, clock.isTextVisible()); pane = new Pane(hourTickMarks, minuteTickMarks, title, amPmText, dateText, text, shadowGroupHour, shadowGroupMinute, shadowGroupSecond); pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(PREFERRED_WIDTH * 0.025), new BorderWidths(clock.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(PREFERRED_WIDTH * 0.025), Insets.EMPTY))); getChildren().setAll(pane); }
Example 20
Source File: TinySkin.java From Medusa with Apache License 2.0 | 4 votes |
private void initGraphics() { // Set initial size if (Double.compare(gauge.getPrefWidth(), 0.0) <= 0 || Double.compare(gauge.getPrefHeight(), 0.0) <= 0 || Double.compare(gauge.getWidth(), 0.0) <= 0 || Double.compare(gauge.getHeight(), 0.0) <= 0) { if (gauge.getPrefWidth() > 0 && gauge.getPrefHeight() > 0) { gauge.setPrefSize(gauge.getPrefWidth(), gauge.getPrefHeight()); } else { gauge.setPrefSize(PREFERRED_WIDTH, PREFERRED_HEIGHT); } } barBackground = new Arc(PREFERRED_WIDTH * 0.5, PREFERRED_HEIGHT * 0.696, PREFERRED_WIDTH * 0.275, PREFERRED_WIDTH * 0.275, ANGLE_RANGE * 0.5 + 90, -ANGLE_RANGE); barBackground.setType(ArcType.OPEN); barBackground.setStroke(gauge.getBarBackgroundColor()); barBackground.setStrokeWidth(PREFERRED_WIDTH * 0.02819549 * 2); barBackground.setStrokeLineCap(StrokeLineCap.BUTT); barBackground.setFill(null); sectionCanvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); sectionCtx = sectionCanvas.getGraphicsContext2D(); needleRotate = new Rotate((gauge.getValue() - oldValue - minValue) * angleStep); needleMoveTo1 = new MoveTo(); needleCubicCurveTo2 = new CubicCurveTo(); needleCubicCurveTo3 = new CubicCurveTo(); needleCubicCurveTo4 = new CubicCurveTo(); needleCubicCurveTo5 = new CubicCurveTo(); needleClosePath6 = new ClosePath(); needleMoveTo7 = new MoveTo(); needleCubicCurveTo8 = new CubicCurveTo(); needleCubicCurveTo9 = new CubicCurveTo(); needleCubicCurveTo10 = new CubicCurveTo(); needleCubicCurveTo11 = new CubicCurveTo(); needleClosePath12 = new ClosePath(); needle = new Path(needleMoveTo1, needleCubicCurveTo2, needleCubicCurveTo3, needleCubicCurveTo4, needleCubicCurveTo5, needleClosePath6, needleMoveTo7, needleCubicCurveTo8, needleCubicCurveTo9, needleCubicCurveTo10, needleCubicCurveTo11, needleClosePath12); needle.setFillRule(FillRule.EVEN_ODD); needle.getTransforms().setAll(needleRotate); needle.setFill(gauge.getNeedleColor()); needle.setStrokeType(StrokeType.INSIDE); needle.setStrokeWidth(1); needle.setStroke(gauge.getBackgroundPaint()); needleTooltip = new Tooltip(String.format(locale, formatString, gauge.getValue())); needleTooltip.setTextAlignment(TextAlignment.CENTER); Tooltip.install(needle, needleTooltip); pane = new Pane(barBackground, sectionCanvas, needle); pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); getChildren().setAll(pane); }