/** * init fxml when loaded. */ @PostConstruct public void init() throws Exception { final Stage stage = (Stage) context.getRegisteredObject("Stage"); glyphDetailViewer = new GlyphDetailViewer(); detailsContainer.getChildren().add(glyphDetailViewer); ScrollPane scrollableGlyphs = allGlyphs(); scrollableGlyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().add(scrollableGlyphs); browseFont.setOnAction((action) -> { FileChooser fileChooser = new FileChooser(); FileChooser.ExtensionFilter extFilter = new FileChooser.ExtensionFilter("SVG files (*.svg)", "*.svg"); fileChooser.getExtensionFilters().add(extFilter); File file = fileChooser.showOpenDialog(stage); if (file != null) { SVGGlyphLoader.clear(); try { SVGGlyphLoader.loadGlyphsFont(new FileInputStream(file), file.getName()); ScrollPane newglyphs = allGlyphs(); newglyphs.setStyle(FX_BACKGROUND_INSETS_0); iconsContainer.getChildren().clear(); iconsContainer.getChildren().add(newglyphs); } catch (IOException ioExc) { ioExc.printStackTrace(); } } }); }
centerButton.setOnAction(action -> { dialog.setTransitionType(DialogTransition.CENTER); dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE)); }); topButton.setOnAction(action -> { dialog.setTransitionType(DialogTransition.TOP); dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE)); }); rightButton.setOnAction(action -> { dialog.setTransitionType(DialogTransition.RIGHT); dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE)); }); bottomButton.setOnAction(action -> { dialog.setTransitionType(DialogTransition.BOTTOM); dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE)); }); leftButton.setOnAction(action -> { dialog.setTransitionType(DialogTransition.LEFT); dialog.show((StackPane) context.getRegisteredObject(CONTENT_PANE)); }); acceptButton.setOnAction(action -> dialog.close()); alertButton.setOnAction(action -> { JFXAlert alert = new JFXAlert((Stage) alertButton.getScene().getWindow());
btnFull.getStyleClass().add("jfx-decorator-button"); btnFull.setCursor(Cursor.HAND); btnFull.setOnAction((action) -> primaryStage.setFullScreen(!primaryStage.isFullScreen())); btnFull.setGraphic(full); btnFull.setTranslateX(-30); btnClose.getStyleClass().add("jfx-decorator-button"); btnClose.setCursor(Cursor.HAND); btnClose.setOnAction((action) -> onCloseButtonAction.get().run()); btnClose.setGraphic(close); btnClose.setRipplerFill(Color.WHITE); btnMin.getStyleClass().add("jfx-decorator-button"); btnMin.setCursor(Cursor.HAND); btnMin.setOnAction((action) -> primaryStage.setIconified(true)); btnMin.setGraphic(minus); btnMin.setRipplerFill(Color.WHITE); btnMax.setCursor(Cursor.HAND); btnMax.setRipplerFill(Color.WHITE); btnMax.setOnAction((action) -> maximize(resizeMin, resizeMax)); btnMax.setGraphic(resizeMax);
button.setOnAction(event -> { if (lastClicked != null) { lastClicked.setBackground(new Background(new BackgroundFill(Color.TRANSPARENT, lastClicked.getBackground().getFills().get(0).getRadii(), null)));
groupButton.setOnAction((action) -> new Thread(() -> treeView.group(empColumn)).start()); main.getChildren().add(groupButton); unGroupButton.setOnAction((action) -> treeView.unGroup(empColumn)); main.getChildren().add(unGroupButton);
public JFXDefaultChip(JFXChipView<T> view, T item) { super(view, item); JFXButton closeButton = new JFXButton(null, new SVGGlyph()); closeButton.getStyleClass().add("close-button"); closeButton.setOnAction((event) -> view.getChips().remove(item)); String tagString = null; if (getItem() instanceof String) { tagString = (String) getItem(); } else { tagString = view.getConverter().toString(getItem()); } Label label = new Label(tagString); label.setWrapText(true); root = new HBox(label, closeButton); getChildren().setAll(root); label.setMaxWidth(100); } }
action = new JFXButton(); action.setText(actionText); action.setOnAction(actionHandler); action.setMinWidth(Control.USE_PREF_SIZE); action.setButtonType(JFXButton.ButtonType.FLAT); action.setOnAction(actionHandler); } else { actionContainer.setVisible(false);
if (count % 4 == 0) { JFXButton button = new JFXButton("CLOSE"); button.setOnAction(action -> snackbar.close()); snackbar.fireEvent(new SnackbarEvent( new JFXSnackbarLayout("Snackbar Message Persistent " + count, "CLOSE", action -> snackbar.close()),
backMonthButton.setGraphic(leftChevron); backMonthButton.setRipplerFill(this.datePicker.getDefaultColor()); backMonthButton.setOnAction(t -> forward(-1, MONTHS, false, true)); forwardMonthButton.setGraphic(rightChevron); forwardMonthButton.setRipplerFill(this.datePicker.getDefaultColor()); forwardMonthButton.setOnAction(t -> forward(1, MONTHS, false, true));
customColorLink.setAlignment(Pos.CENTER); customColorLink.setFocusTraversable(true); customColorLink.setOnAction(ev -> { if (customColorDialog == null) { customColorDialog = new JFXCustomColorPickerDialog(popupControl);
buttonYes.setOnMouseClicked(ev); buttonNo.setOnMouseClicked(ev); buttonYes.setOnAction(t -> dialog.close()); buttonNo.setOnAction(t -> dialog.close()); dialog.show();
btnFull.getStyleClass().add("jfx-decorator-button"); btnFull.setCursor(Cursor.HAND); btnFull.setOnAction((action) -> primaryStage.setFullScreen(!primaryStage.isFullScreen())); btnFull.setGraphic(full); btnFull.setTranslateX(-30); btnClose.getStyleClass().add("jfx-decorator-button"); btnClose.setCursor(Cursor.HAND); btnClose.setOnAction((action) -> onCloseButtonAction.get().run()); btnClose.setGraphic(close); btnClose.setRipplerFill(Color.WHITE); btnMin.getStyleClass().add("jfx-decorator-button"); btnMin.setCursor(Cursor.HAND); btnMin.setOnAction((action) -> primaryStage.setIconified(true)); btnMin.setGraphic(minus); btnMin.setRipplerFill(Color.WHITE); btnMax.setCursor(Cursor.HAND); btnMax.setRipplerFill(Color.WHITE); btnMax.setOnAction((action) -> maximize(resizeMin, resizeMax)); btnMax.setGraphic(resizeMax);
public JFXDefaultChip(JFXChipView<T> view, T item) { super(view, item); JFXButton closeButton = new JFXButton(null, new SVGGlyph()); closeButton.getStyleClass().add("close-button"); closeButton.setOnAction((event) -> view.getChips().remove(item)); String tagString = null; if (getItem() instanceof String) { tagString = (String) getItem(); } else { tagString = view.getConverter().toString(getItem()); } Label label = new Label(tagString); label.setWrapText(true); root = new HBox(label, closeButton); getChildren().setAll(root); label.setMaxWidth(100); } }
action = new JFXButton(); action.setText(actionText); action.setOnAction(actionHandler); action.setMinWidth(Control.USE_PREF_SIZE); action.setButtonType(JFXButton.ButtonType.FLAT); action.setOnAction(actionHandler); } else { actionContainer.setVisible(false);
backMonthButton.setGraphic(leftChevron); backMonthButton.setRipplerFill(this.datePicker.getDefaultColor()); backMonthButton.setOnAction(t -> forward(-1, MONTHS, false, true)); forwardMonthButton.setGraphic(rightChevron); forwardMonthButton.setRipplerFill(this.datePicker.getDefaultColor()); forwardMonthButton.setOnAction(t -> forward(1, MONTHS, false, true));
private void initButtons() { // START AND STOP this.startButton.setOnMouseClicked(e -> { if (e.getButton().equals(MouseButton.SECONDARY)) { this.elevationPopup.show(this.startButton); } else { if (this.recognizer.state()) { this.stopSensor(); this.startButton.setTooltip(new Tooltip("Start the sensor")); this.startButton.setGraphic(ViewUtilities.iconSetter(Material.VISIBILITY, IconDim.MEDIUM)); } else { this.startSensor(); this.startButton.setTooltip(new Tooltip("Start the sensor")); this.startButton.setGraphic(ViewUtilities.iconSetter(Material.VISIBILITY_OFF, IconDim.MEDIUM)); } } }); // SAVE BUTTON this.saveSettingsButton.setGraphic(ViewUtilities.iconSetter(Material.SAVE, IconDim.MEDIUM)); JFXDepthManager.setDepth(this.saveSettingsButton, 4); this.saveSettingsButton.setOnAction(t -> this.saveSettings()); }
customColorLink.setAlignment(Pos.CENTER); customColorLink.setFocusTraversable(true); customColorLink.setOnAction(ev -> { if (customColorDialog == null) { customColorDialog = new JFXCustomColorPickerDialog(popupControl);