/** * @return the current slider value factory */ public final Callback<JFXSlider, StringBinding> getValueFactory() { return valueFactory == null ? null : valueFactory.get(); }
/** * set a speficed runnable when clicking on the close button * * @param onCloseButtonAction runnable to be executed */ public void setOnCloseButtonAction(Runnable onCloseButtonAction) { this.onCloseButtonAction.set(onCloseButtonAction); }
public JFXListViewSkin(final JFXListView<T> listView) { super(listView); JFXDepthManager.setDepth(flow, listView.depthProperty().get()); listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal)); }
private void refreshView() { if (glyph.getValue() == null) { idLabel.setText(""); nameLabel.setText(""); return; } sizeSlider.valueProperty().addListener(observable -> glyph.get().setSize(sizeSlider.getValue())); idLabel.setText(String.format("%04d", glyph.get().getGlyphId())); nameLabel.setText(glyph.get().getName()); glyph.get().setFill(colorPicker.getValue()); glyph.get().fillProperty().bind(colorPicker.valueProperty()); centeredGlyph.getChildren().setAll(glyph.get()); }
private static void setSpinnerBehaviour( final IntegerSpinnerValueFactory svf, final boolean useDefaultValue, final ObservableIntegerValue defaultValue, final ObjectProperty<Integer> customValue ) { if (useDefaultValue) { svf.valueProperty().unbindBidirectional(customValue); svf.setValue(defaultValue.get()); } else { svf.setValue(customValue.getValue()); svf.valueProperty().bindBidirectional(customValue); } } }
public JFXBadge(Node control, Pos pos) { initialize(); setPosition(pos); setControl(control); position.addListener((o, oldVal, newVal) -> StackPane.setAlignment(badge, newVal)); }
is24HourView = this.timePicker.is24HourView(); this.timePicker.valueProperty().addListener((o, oldVal, newVal) -> goToTime(newVal)); getStyleClass().add("date-picker-popup"); unit.addListener((o, oldVal, newVal) -> { if (newVal == TimeUnit.HOURS) { angle.set(Math.toDegrees(2 * Math.PI / 12)); pointerRotate.set(_24HourHoursPointerRotate); _24HourPointerRotate.set(_24HourHoursPointerRotate); timeLabel.set(selectedHourLabel); } else if (newVal == TimeUnit.MINUTES) { angle.set(Math.toDegrees(2 * Math.PI / 60)); pointerRotate.set(minsPointerRotate); timeLabel.set(selectedMinLabel);
private void unFocus() { focusTimer.stop(); scale.setX(initScale); focusedLine.setOpacity(0); if (control.isLabelFloat()) { animatedPromptTextFill.set(promptTextFill.get()); Object text = valueProperty.getValue(); text = validateComboBox(text); if (text == null || text.toString().isEmpty()) { animating = true; runTimer(unfocusTimer, true); } } }
public FilterableTreeItem(T value) { super(value); this.sourceList = FXCollections.observableArrayList(); this.filteredList = new FilteredList<>(this.sourceList); this.filteredList.predicateProperty().bind(Bindings.createObjectBinding(() -> { return child -> { // Set the predicate of child items to force filtering if (child instanceof FilterableTreeItem) { FilterableTreeItem<T> filterableChild = (FilterableTreeItem<T>) child; filterableChild.setPredicate(this.predicate.get()); } // If there is no predicate, keep this tree item if (this.predicate.get() == null) return true; // If there are children, keep this tree item if (child.getChildren().size() > 0) return true; // Otherwise ask the TreeItemPredicate return this.predicate.get().test(this, child.getValue()); }; }, this.predicate)); setHiddenFieldChildren(this.filteredList); }
@Override protected Node createUndecoratedEditor() { final boolean usesDefaultValue = value.getValue() == null || value.getValue().equals(defaultValue.getValue()); ); customValue.setValue(usesDefaultValue ? defaultValue.get() : value.get()); setSpinnerBehaviour(svf, usesDefaultValue, defaultValue, customValue); value.setValue(null); } else { value.setValue(n);
rect.setMouseTransparent(true); rect.setBlendMode(BlendMode.MULTIPLY); rect.fillProperty().bind(paintProperty()); rect.setManaged(false); rect.setX(boundingBox.getMinX());
Circle selectionCircle = new Circle(contentCircleRadius / 6), _24HourSelectionCircle = new Circle(contentCircleRadius / 6); selectionCircle.fillProperty().bind(timePicker.defaultColorProperty()); _24HourSelectionCircle.fillProperty().bind(timePicker.defaultColorProperty()); line.fillProperty().bind(timePicker.defaultColorProperty()); line.strokeProperty().bind(line.fillProperty()); line.setStrokeWidth(1.5); hoursPointer.getChildren().addAll(line, selectionCircle); pointerGroup.setTranslateX((-contentCircleRadius + shift) / 2); hoursPointerRotate = new Rotate(0, contentCircleRadius - shift, selectionCircle.getRadius()); pointerRotate.set(hoursPointerRotate); pointerGroup.getTransforms().add(hoursPointerRotate); pointerGroup.setVisible(!is24HourView); _24HourLine.fillProperty().bind(timePicker.defaultColorProperty()); _24HourLine.strokeProperty().bind(_24HourLine.fillProperty()); _24HourLine.setStrokeWidth(1.5); _24HoursPointer.getChildren().addAll(_24HourLine, _24HourSelectionCircle); pointer24HourGroup.setTranslateX(((-contentCircleRadius + shift) / 2) + (_24HourShift / 2)); _24HourHoursPointerRotate = new Rotate(0, contentCircleRadius - shift - _24HourShift, selectionCircle.getRadius()); _24HourPointerRotate.set(_24HourHoursPointerRotate); pointer24HourGroup.getTransforms().add(_24HourHoursPointerRotate); pointer24HourGroup.setVisible(is24HourView);
button.setMinSize(30,30); button.setMaxSize(30,30); button.ripplerFillProperty().bind(glyphDetailViewer.colorPicker.valueProperty()); glyphDetailViewer.colorPicker.valueProperty().addListener((o, oldVal, newVal) -> { String webColor = "#" + Integer.toHexString(newVal.hashCode()).substring(0, 6).toUpperCase(); Consumer<String> lookupConsumer = lookup->{
public JFXTreeCell() { selectedPane.getStyleClass().add("selection-bar"); selectedPane.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY))); selectedPane.setPrefWidth(3); selectedPane.setMouseTransparent(true); selectedProperty().addListener((o, oldVal, newVal) -> selectedPane.setVisible(newVal ? true : false)); final InvalidationListener treeItemInvalidationListener = observable -> { TreeItem<T> oldTreeItem = treeItemRef == null ? null : treeItemRef.get(); if (oldTreeItem != null) { oldTreeItem.graphicProperty().removeListener(weakTreeItemGraphicListener); } TreeItem<T> newTreeItem = getTreeItem(); if (newTreeItem != null) { newTreeItem.graphicProperty().addListener(weakTreeItemGraphicListener); treeItemRef = new WeakReference<>(newTreeItem); } }; final WeakInvalidationListener weakTreeItemListener = new WeakInvalidationListener(treeItemInvalidationListener); treeItemProperty().addListener(weakTreeItemListener); if (getTreeItem() != null) { getTreeItem().graphicProperty().addListener(weakTreeItemGraphicListener); } }
/** * svg color property */ public void setFill(Paint fill) { this.fill.setValue(fill); }
glyphProperty().addListener((observable, oldValue, newValue) -> { if (oldValue != null) { oldValue.fillProperty().unbind(); oldValue.prefWidthProperty().unbind(); oldValue.prefHeightProperty().unbind();
public Paint getFill() { return fill.getValue(); }
/** * {@inheritDoc} */ public JFXTreeTableRow() { // allow custom skin to grouped rows itemProperty().addListener(observable -> { T item = getItem(); pseudoClassStateChanged(groupedClass, isGroupItem(item)); }); }
this.getChildren().add(shapesStartIndex, path); path.setFill(Color.valueOf(getDefaultColor(i))); path.addEventHandler(MouseEvent.MOUSE_CLICKED, (event) -> selectedPath.set(path)); selectedPath.addListener((o, oldVal, newVal) -> { if (oldVal != null) { hslColorPicker.removeColorSelectionNode(oldVal); }); selectedPath.set((RecentColorPath) this.getChildren().get(shapesStartIndex));
pickerColorClip.backgroundProperty().bind(Bindings.createObjectBinding(() -> { return new Background(new BackgroundFill(Color.WHITE, colorBox.backgroundProperty() .get() != null ? colorBox.getBackground() .getFills() .get(0) 3), colorBox.backgroundProperty() .get() != null ? colorBox.getBackground() .getFills() .get(0)