public void initButtonByInventory() { inventoryGroup.getToggles().remove(0, inventoryGroup.getToggles().size()); if (core.getCurrentPlayer() == 0) { inventoryPlayer1.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3)))); inventoryPlayer2.setBorder(Border.EMPTY); inventoryPlayer1.setStyle("-fx-effect: none"); inventoryPlayer2.setStyle("-fx-effect: innershadow(one-pass-box, lightblue, 100, 0.1, 1, 1);"); namePlayer1.setText(core.getPlayers()[0].getName() + " à vous de jouer !"); namePlayer2.setText(core.getPlayers()[1].getName() + " attend !"); } else { inventoryPlayer1.setBorder(Border.EMPTY); inventoryPlayer2.setStyle("-fx-effect: none"); inventoryPlayer1.setStyle("-fx-effect: innershadow(one-pass-box, lightgrey, 100, 0.1, 1, 1);"); inventoryPlayer2.setBorder(new Border(new BorderStroke(Color.GREEN, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3)))); namePlayer1.setText(core.getPlayers()[0].getName() + " attend !"); namePlayer2.setText(core.getPlayers()[1].getName() + " à vous de jouer !"); } initPlayer1Button(); initPlayer2Button(); }
private 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); } } pane = new Pane(); pane.setBorder(new Border(new BorderStroke(getSkinnable().getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(getSkinnable().getBorderWidth())))); pane.setBackground(new Background(new BackgroundFill(getSkinnable().getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); getChildren().setAll(pane); }
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(); }
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); }
private 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); } } pane = new Pane(); 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); }
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); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); barColor = gauge.getBarColor(); valueColor = gauge.getValueColor(); unitColor = gauge.getUnitColor(); sectionsVisible = gauge.getSectionsVisible(); drawBackground(); resizeStaticText(); setBar(gauge.getCurrentValue()); titleText.setText(gauge.getTitle()); titleText.setFill(gauge.getTitleColor()); titleText.relocate((size - titleText.getLayoutBounds().getWidth()) * 0.5, size * 0.22180451); valueBkgText.setFill(Helper.getTranslucentColorFrom(valueColor, 0.1)); valueText.setFill(valueColor); }
private 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); } } node = new Region(); node.getStyleClass().setAll("node"); pane = new Pane(node); 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); }
@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); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); ZonedDateTime time = clock.getTime(); hourColor = clock.getHourColor(); minuteColor = clock.getMinuteColor(); fiveMinuteColor = minuteColor.darker(); secondColor = clock.getSecondColor(); titleColor = clock.getTitleColor(); textColor = clock.getTextColor(); dateColor = clock.getDateColor(); alarmColor = clock.getAlarmColor(); drawBackground(); drawForeground(time); drawHours(time); drawMinutes(time); drawSeconds(time); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / 250 * size)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); colorGradientEnabled = gauge.isGradientBarEnabled(); noOfGradientStops = gauge.getGradientBarStops().size(); sectionsVisible = gauge.getSectionsVisible(); barBackground.setFill(gauge.getBarBackgroundColor()); barBackground.setEffect(gauge.isShadowsEnabled() ? innerShadow : null); setBarColor(gauge.getCurrentValue()); dataBar.setEffect(gauge.isShadowsEnabled() ? innerShadow : null); threshold.setStroke(gauge.getThresholdColor()); double thresholdInnerRadius = 0.3 * height; double thresholdOuterRadius = 0.675 * height; double thresholdAngle = Helper.clamp(90.0, 270.0, (gauge.getThreshold() - minValue) * angleStep + 90.0); threshold.setStartX(centerX + thresholdInnerRadius * Math.sin(-Math.toRadians(thresholdAngle))); threshold.setStartY(centerX + thresholdInnerRadius * Math.cos(-Math.toRadians(thresholdAngle))); threshold.setEndX(centerX + thresholdOuterRadius * Math.sin(-Math.toRadians(thresholdAngle))); threshold.setEndY(centerX + thresholdOuterRadius * Math.cos(-Math.toRadians(thresholdAngle))); redrawText(); }
@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); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); shadowGroup.setEffect(clock.getShadowsEnabled() ? dropShadow : null); // Tick Marks tickCanvas.setCache(false); drawTicks(); tickCanvas.setCache(true); tickCanvas.setCacheHint(CacheHint.QUALITY); needle.setStroke(clock.getHourColor()); ZonedDateTime time = clock.getTime(); updateTime(time); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(clock.getBorderWidth() / 250 * size)))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); secondBackgroundCircle.setStroke(Helper.getTranslucentColorFrom(clock.getSecondColor(), 0.2)); secondArc.setStroke(clock.getSecondColor()); hour.setFill(clock.getHourColor()); minute.setFill(clock.getMinuteColor()); dateText.setFill(clock.getDateColor()); dateNumbers.setFill(clock.getDateColor()); hour.setFill(clock.getHourColor()); minute.setFill(clock.getMinuteColor()); ZonedDateTime time = clock.getTime(); updateTime(time); }
@Override protected void redraw() { 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() / PREFERRED_WIDTH * size)))); locale = gauge.getLocale(); barColor = gauge.getBarColor(); valueColor = gauge.getValueColor(); titleColor = gauge.getTitleColor(); subTitleColor = gauge.getSubTitleColor(); unitColor = gauge.getUnitColor(); sectionsVisible = gauge.getSectionsVisible(); drawBackground(); setBar(gauge.getCurrentValue()); valueBkgText.setFill(Helper.getTranslucentColorFrom(valueColor, 0.1)); valueText.setFill(valueColor); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); locale = gauge.getLocale(); titleText.setText(gauge.getTitle()); minValueText.setText(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getMinValue())); maxValueText.setText(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getMaxValue())); thresholdText.setText(String.format(locale, "%." + gauge.getTickLabelDecimals() + "f", gauge.getThreshold())); resizeStaticText(); barBackground.setStroke(gauge.getBarColor()); thresholdBar.setStroke(gauge.getThresholdColor()); needle.setFill(gauge.getNeedleColor()); titleText.setFill(gauge.getTitleColor()); minValueText.setFill(gauge.getTitleColor()); maxValueText.setFill(gauge.getTitleColor()); thresholdText.setFill(gauge.getTitleColor()); valueText.setFill(gauge.getValueColor()); thresholdText.setVisible(Double.compare(gauge.getThreshold(), gauge.getMinValue()) != 0 && Double.compare(gauge.getThreshold(), gauge.getMaxValue()) != 0); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * width)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); barColor = gauge.getBarColor(); thresholdColor = gauge.getThresholdColor(); barBackgroundColor = gauge.getBarBackgroundColor(); thresholdBackgroundColor = Color.color(thresholdColor.getRed(), thresholdColor.getGreen(), thresholdColor.getBlue(), 0.25); barBackground.setFill(barBackgroundColor); thresholdBar.setFill(thresholdBackgroundColor); dataBar.setFill(barColor); dataBarThreshold.setFill(thresholdColor); titleText.setFill(gauge.getTitleColor()); titleText.setText(gauge.getTitle()); valueText.setFill(gauge.getValueColor()); valueText.setText(formatNumber(gauge.getLocale(), gauge.getFormatString(), gauge.getDecimals(), gauge.getCurrentValue())); valueText.relocate((width - valueText.getLayoutBounds().getWidth()), 0.58064516 * height); unitText.setFill(gauge.getUnitColor()); unitText.setText(gauge.getUnit()); unitText.relocate((width - unitText.getLayoutBounds().getWidth()), 0.79 * height); }
@Override protected void redraw() { locale = gauge.getLocale(); formatString = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f%%").toString(); // Background stroke and fill pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * width)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), CornerRadii.EMPTY, Insets.EMPTY))); fluidBody.setFill(gauge.getBarColor()); fluidTop.setFill(gauge.getBarColor().darker()); valueText.setFill(gauge.getValueColor()); titleText.setFill(gauge.getTitleColor()); resizeText(); setBar(gauge.getCurrentValue()); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); locale = gauge.getLocale(); formatString = new StringBuilder("%.").append(Integer.toString(gauge.getDecimals())).append("f").toString(); colorGradientEnabled = gauge.isGradientBarEnabled(); noOfGradientStops = gauge.getGradientBarStops().size(); barBackground.setStroke(gauge.getBarBackgroundColor()); // Areas, Sections and Tick Marks sectionCanvas.setCache(false); sectionCtx.clearRect(0, 0, size, size); if (gauge.isGradientBarEnabled() && gauge.getGradientLookup() != null) { drawGradientBar(); if (gauge.getMajorTickMarksVisible()) drawTickMarks(); } else if (gauge.getSectionsVisible()) { drawSections(); if (gauge.getMajorTickMarksVisible()) drawTickMarks(); } sectionCanvas.setCache(true); sectionCanvas.setCacheHint(CacheHint.QUALITY); needle.setFill(gauge.getNeedleColor()); }
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); } } for (int i = 0 ; i < 12 ; i++) { Region bar = new Region(); bar.setPrefSize(20, 20 + (i * 4)); bars[i] = bar; } pane = new HBox(bars); pane.setSpacing(PREFERRED_WIDTH * 0.01960784); pane.setAlignment(Pos.BOTTOM_CENTER); pane.setFillHeight(false); pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY))); pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth)))); getChildren().setAll(pane); }
@Override protected void redraw() { colorGradientEnabled = gauge.isGradientBarEnabled(); noOfGradientStops = gauge.getGradientBarStops().size(); sectionsVisible = gauge.getSectionsVisible(); 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() / PREFERRED_WIDTH * size)))); setBarColor(gauge.getCurrentValue()); valueText.setFill(gauge.getValueColor()); unitText.setFill(gauge.getUnitColor()); titleText.setFill(gauge.getTitleColor()); separator.setStroke(gauge.getBorderPaint()); titleText.setText(gauge.getTitle()); resizeTitleText(); unitText.setText(gauge.getUnit()); resizeUnitText(); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(gauge.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(gauge.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(gauge.getBackgroundPaint(), new CornerRadii(1024), Insets.EMPTY))); colorGradientEnabled = gauge.isGradientBarEnabled(); noOfGradientStops = gauge.getGradientBarStops().size(); sectionsVisible = gauge.getSectionsVisible(); titleText.setText(gauge.getTitle()); unitText.setText(gauge.getUnit()); resizeStaticText(); barBackground.setStroke(gauge.getBarBackgroundColor()); setBarColor(gauge.getCurrentValue()); titleText.setFill(gauge.getTitleColor()); valueText.setFill(gauge.getValueColor()); unitText.setFill(gauge.getUnitColor()); }
@Override protected void redraw() { pane.setBorder(new Border(new BorderStroke(clock.getBorderPaint(), BorderStrokeStyle.SOLID, new CornerRadii(size * 0.025), new BorderWidths(clock.getBorderWidth() / PREFERRED_WIDTH * size)))); pane.setBackground(new Background(new BackgroundFill(clock.getBackgroundPaint(), new CornerRadii(size * 0.025), Insets.EMPTY))); shadowGroupHour.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupMinute.setEffect(clock.getShadowsEnabled() ? dropShadow : null); shadowGroupSecond.setEffect(clock.getShadowsEnabled() ? dropShadow : null); // Tick Marks minuteTickMarks.setStroke(clock.getMinuteColor()); hourTickMarks.setStroke(clock.getHourColor()); ZonedDateTime time = clock.getTime(); updateTime(time); resizeText(); title.setFill(clock.getTitleColor()); dateText.setFill(clock.getDateColor()); text.setFill(clock.getTextColor()); amPmText.setFill(clock.getTextColor()); }
private void initGraphics() { bars = new Region[] { createBar(20, "gray-bar"), createBar(24, "gray-bar"), createBar(28, "gray-bar"), createBar(32, "gray-bar"), createBar(36, "gray-bar"), createBar(40, "gray-bar"), createBar(44, "gray-bar"), createBar(48, "gray-bar"), createBar(52, "gray-bar"), createBar(56, "gray-bar"), createBar(60, "gray-bar"), createBar(64, "gray-bar")}; pane = new HBox(bars); pane.setSpacing(PREFERRED_WIDTH * 0.01960784); pane.setAlignment(Pos.BOTTOM_CENTER); pane.setFillHeight(false); pane.setBackground(new Background(new BackgroundFill(backgroundPaint, new CornerRadii(1024), Insets.EMPTY))); pane.setBorder(new Border(new BorderStroke(borderPaint, BorderStrokeStyle.SOLID, new CornerRadii(1024), new BorderWidths(borderWidth)))); getChildren().setAll(pane); }
private void initGraphics() { 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); } } node = new Region(); node.getStyleClass().setAll("node"); pane = new Pane(node); 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); }
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); } } getStyleClass().add("my-region"); pane = new Pane(); 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); }
private void redraw() { 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 / PREFERRED_WIDTH * size)))); segmentPane.setBackground(new Background(new BackgroundFill(getBackgroundColor(), CornerRadii.EMPTY, Insets.EMPTY))); segmentPane.setManaged(isInteractive()); segmentPane.setVisible(isInteractive()); drawChart(); }
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); } } canvas = new Canvas(PREFERRED_WIDTH, PREFERRED_HEIGHT); ctx = canvas.getGraphicsContext2D(); pane = new Pane(canvas); 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); }
public void handleHelp(){ if(core.getState() == Consts.WAIT_FOR_INPUT){ clearHelp(); HelpMove helpMove = core.help(); highlighted.setHelp(helpMove); if (helpMove.isAdd()){ int index; List<Piece> list = core.getCurrentPlayerObj().getInventory(); for (index = 0; index<list.size() && list.get(index).getId() != helpMove.getPieceId(); index++); ToggleButton n = (ToggleButton)((core.getCurrentPlayer() == 0)?inventoryPlayer1:inventoryPlayer2).getChildren().get(index); n.setBorder(new Border(new BorderStroke(Color.RED, BorderStrokeStyle.SOLID, new CornerRadii(10), new BorderWidths(3)))); } } }
public void setXAxisBorderColor(final Paint FILL) { if (Side.BOTTOM == getXAxis().getSide()) { getXAxis().setBorder(new Border( new BorderStroke(FILL, Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.DEFAULT_WIDTHS, Insets.EMPTY))); } else { getXAxis().setBorder(new Border( new BorderStroke(Color.TRANSPARENT, Color.TRANSPARENT, FILL, Color.TRANSPARENT, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.DEFAULT_WIDTHS, Insets.EMPTY))); } }
public void setYAxisBorderColor(final Paint FILL) { if (Side.LEFT == getYAxis().getSide()) { getYAxis().setBorder(new Border( new BorderStroke(Color.TRANSPARENT, FILL, Color.TRANSPARENT, Color.TRANSPARENT, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.DEFAULT_WIDTHS, Insets.EMPTY))); } else { getYAxis().setBorder(new Border( new BorderStroke(Color.TRANSPARENT, Color.TRANSPARENT, Color.TRANSPARENT, FILL, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderStroke.DEFAULT_WIDTHS, Insets.EMPTY))); } }
public void buySellBtnPressed(){ if(buyBtn.isSelected()){ buyBtn.setBorder(new Border(new BorderStroke(Color.web("#1f82b8"), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT))); sellBtn.setBorder(null); } else{ sellBtn.setBorder(new Border(new BorderStroke(Color.web("#1f82b8"), BorderStrokeStyle.SOLID, CornerRadii.EMPTY, BorderWidths.DEFAULT))); buyBtn.setBorder(null); } }
@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(contentBounds.getWidth()); valueUnitFlow.relocate(contentBounds.getX(), contentBounds.getY()); }
@Override protected void initGraphics() { super.initGraphics(); final ZonedDateTime TIME = tile.getTime(); titleText = new Text(MONTH_YEAR_FORMATTER.format(TIME)); titleText.setFill(tile.getTitleColor()); clickHandler = e -> checkClick(e); labels = new ArrayList<>(56); for (int i = 0 ; i < 56 ; i++) { Label label = new Label(); label.setManaged(false); label.setVisible(false); label.setAlignment(Pos.CENTER); label.addEventHandler(MouseEvent.MOUSE_PRESSED, clickHandler); labels.add(label); } weekBorder = new Border(new BorderStroke(Color.TRANSPARENT, Tile.GRAY, Color.TRANSPARENT, Color.TRANSPARENT, BorderStrokeStyle.NONE, BorderStrokeStyle.SOLID, BorderStrokeStyle.NONE, BorderStrokeStyle.NONE, CornerRadii.EMPTY, BorderWidths.DEFAULT, Insets.EMPTY)); text = new Text(DAY_FORMATTER.format(TIME)); text.setFill(tile.getTextColor()); getPane().getChildren().addAll(titleText, text); getPane().getChildren().addAll(labels); }