public ExpandButton() { getStyleClass().add("quickbar-expand-button"); toggle.getStyleClass().addAll("pdfsam-toolbar-button", "quickbar-expand-toggle"); expand.setContent("M0,-5L5,0L0,5Z"); expand.getStyleClass().add("quickbar-button-arrow"); collapse.setContent("M0,-5L-5,0L0,5Z"); collapse.getStyleClass().add("quickbar-button-arrow"); toggle.setGraphic(expand); toggle.selectedProperty().addListener((observable, oldValue, newValue) -> { if (newValue) { toggle.setGraphic(collapse); } else { toggle.setGraphic(expand); } }); HBox.setMargin(toggle, new Insets(0, 7, 0, 7)); getChildren().add(toggle); }
getSkinnable().setGraphic(main);
private void updateToggleButton() { if (expandCollapseButton.isSelected()) { expandCollapseButton.getStyleClass().setAll("collapse-button"); //$NON-NLS-1$ expandCollapseButton.setGraphic(COLLAPSE_IMAGE); } else { expandCollapseButton.getStyleClass().setAll("expand-button"); //$NON-NLS-1$ expandCollapseButton.setGraphic(EXPAND_IMAGE); } }
public ToggleButton createIconToggleButton(GlyphIcons icon, String text, String iconSize, String fontSize, ContentDisplay contentDisplay) { Text label = createIcon(icon, iconSize); ToggleButton button = new ToggleButton(text); button.setStyle("-fx-font-size: " + fontSize); button.setGraphic(label); button.setContentDisplay(contentDisplay); return button; }
pause.disableProperty().bind(play.selectedProperty().not()); play.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/org/copperengine/gui/icon/play.png")))); pause.setGraphic(new ImageView(new Image(getClass().getResourceAsStream("/org/copperengine/gui/icon/pause.png"))));
getSkinnable().setGraphic(main);