@Override protected Node getMask() { Region clip = new Region(); JFXNodeUtils.updateBackground(JFXListCell.this.getBackground(), clip); double width = control.getLayoutBounds().getWidth(); double height = control.getLayoutBounds().getHeight(); clip.resize(width, height); return clip; }
@Override protected Node getMask() { Region clip = new Region(); JFXNodeUtils.updateBackground(JFXTreeCell.this.getBackground(), clip); double width = control.getLayoutBounds().getWidth(); double height = control.getLayoutBounds().getHeight(); clip.resize(width, height); return clip; }
public void initialize() { track = new StackPane(); track.getStyleClass().setAll("track"); bar = new StackPane(); bar.getStyleClass().setAll("bar"); secondaryBar = new StackPane(); secondaryBar.getStyleClass().setAll("secondary-bar"); clip = new Region(); clip.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY))); bar.backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(bar.getBackground(), clip)); getChildren().setAll(track, secondaryBar, bar); }
break; case FIT: mask = new Region(); if(control instanceof Shape){ ((Region) mask).setShape((Shape) control);
colorBox.setManaged(false); pickerColorClip = new Region(); pickerColorClip.backgroundProperty().bind(Bindings.createObjectBinding(() -> { return new Background(new BackgroundFill(Color.WHITE,
private void addShareNotification(long usages) { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); VBox content = new VBox(3, buildLabel(DefaultI18nContext.getInstance().i18n("You performed {0} tasks with PDFsam, did it help?", Long.toString(usages)), NotificationType.SHARE), new HBox(3, spacer, styledUrlButton(null, pdfsam.property(ConfigurableProperty.FACEBOOK_SHARE_URL), FontAwesomeIcon.FACEBOOK), styledUrlButton(DefaultI18nContext.getInstance().i18n("Spread the word!"), pdfsam.property(ConfigurableProperty.TWEETER_SHARE_URL), FontAwesomeIcon.TWITTER))); content.setAlignment(Pos.TOP_RIGHT); container.addStickyNotification(DefaultI18nContext.getInstance().i18n("PDFsam worked hard!"), content); }
private Node createSpacer() { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); return spacer; }
private Node createSpacer() { Region spacer = new Region(); HBox.setHgrow(spacer, Priority.ALWAYS); return spacer; }
private Node createButton() { Region btn = new Region(); btn.getStyleClass().add("button"); //$NON-NLS-1$ btn.setOnMouseMoved(mouseMoveHandler); btn.setOnMouseClicked(mouseClickHandler); return btn; }
/** * Creates a mapped list between the <code>miniatureUris</code> and a {@link Region} component * * @return A mapped list between miniatureUris and a Region component */ private ObservableList<Region> createMiniatures() { return new MappedList<>(miniatureUris, miniatureUri -> { final Region image = new Region(); image.getStyleClass().add("appMiniature"); image.setStyle(String.format("-fx-background-image: url(\"%s\");", miniatureUri.toString())); image.prefHeightProperty().bind(miniatureHeight); image.prefWidthProperty().bind(miniatureHeight.multiply(1.5)); return image; }); }
@Override public void changed(ObservableValue<? extends Boolean> observable, Boolean oldValue, Boolean newValue) { if (newValue != null && newValue != oldValue) { if (newValue.booleanValue()) { if (searchIconPath == null) { searchIconPath = new Region(); searchIconPath.getStyleClass().add("icon-search"); } getChildren().add(searchIconPath); } else if (oldValue != null && searchIconPath != null) { getChildren().remove(searchIconPath); } getSkinnable().requestLayout(); } } });
@Override protected void drawStepContent() { super.drawStepContent(); Region spacerAbove = new Region(); VBox.setVgrow(spacerAbove, Priority.ALWAYS); this.addToContentPane(spacerAbove); ProgressIndicator progressIndicator = new ProgressIndicator(); this.addToContentPane(progressIndicator); Region spacerBelow = new Region(); VBox.setVgrow(spacerBelow, Priority.ALWAYS); this.addToContentPane(spacerBelow); }
/** * Creates a miniature icon for the item * @return A miniature icon for the item */ private Region createMiniature() { final Region icon = new Region(); icon.getStyleClass().add("compactListMiniatureImage"); icon.styleProperty().bind( Bindings.createStringBinding( () -> String.format("-fx-background-image: url(\"%s\");", getControl().getMiniatureUri().toString()), getControl().miniatureUriProperty())); return icon; }
/** * Populate the header with a label for the title of this details view and a close button */ private void populateHeader() { this.titleLabel = new Label(); this.titleLabel.getStyleClass().add("descriptionTitle"); this.closeButton = new Button(); this.closeButton.getStyleClass().add("closeIcon"); this.closeButton.setOnAction(event -> onClose.run()); Region filler = new Region(); HBox headerBox = new HBox(); headerBox.getChildren().setAll(titleLabel, filler, closeButton); HBox.setHgrow(filler, Priority.ALWAYS); this.setTop(headerBox); }
/** * @return the button bar */ protected Node createButtonBar() { HBox b = new HBox(10); b.setPadding(new Insets(10)); Region spacer = new Region(); b.getChildren().add(spacer); HBox.setHgrow(spacer, Priority.ALWAYS); this.buttons = createButtonsForBar(); b.getChildren().addAll(this.buttons); return b; }
/** * {@inheritDoc} */ @Override protected Node createContent() { final Label descriptionLabel = new Label(); descriptionLabel.textProperty().bind(description); descriptionLabel.setWrapText(true); final GridPane propertiesGrid = createPropertiesGrid(); final Region spacer = new Region(); spacer.getStyleClass().add("detailsButtonSpacer"); final GridPane controlButtons = createControlButtons(); return new VBox(descriptionLabel, propertiesGrid, spacer, controlButtons); }
/** * {@inheritDoc} */ @Override protected Node createContent() { final Label descriptionLabel = new Label(); descriptionLabel.textProperty().bind(description); descriptionLabel.setWrapText(true); final GridPane propertiesGrid = createPropertiesGrid(); final Region spacer = new Region(); spacer.getStyleClass().add("detailsButtonSpacer"); final Button saveButton = new Button(tr("Save")); saveButton.setOnMouseClicked(event -> Optional.ofNullable(getControl().getOnShortcutChanged()).ifPresent( onShortcutChanged -> onShortcutChanged.accept(getControl().getShortcut()))); return new VBox(descriptionLabel, propertiesGrid, spacer, saveButton); }
@Override protected Node getMask() { Region clip = new Region(); JFXNodeUtils.updateBackground(JFXTreeCell.this.getBackground(), clip); double width = control.getLayoutBounds().getWidth(); double height = control.getLayoutBounds().getHeight(); clip.resize(width, height); return clip; }
@Override protected Node getMask() { Region clip = new Region(); JFXNodeUtils.updateBackground(JFXListCell.this.getBackground(), clip); double width = control.getLayoutBounds().getWidth(); double height = control.getLayoutBounds().getHeight(); clip.resize(width, height); return clip; }
protected void initialize() { track = new StackPane(); track.getStyleClass().setAll("track"); bar = new StackPane(); bar.getStyleClass().setAll("bar"); secondaryBar = new StackPane(); secondaryBar.getStyleClass().setAll("secondary-bar"); clip = new Region(); clip.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY))); bar.backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(bar.getBackground(), clip)); getChildren().setAll(track, secondaryBar, bar); }