public JFXBadge(Node control, Pos pos) { initialize(); setPosition(pos); setControl(control); position.addListener((o, oldVal, newVal) -> StackPane.setAlignment(badge, newVal)); }
/** * {@inheritDoc} */ public JFXTreeTableRow() { // allow custom skin to grouped rows itemProperty().addListener(observable -> { T item = getItem(); pseudoClassStateChanged(groupedClass, isGroupItem(item)); }); }
public JFXListViewSkin(final JFXListView<T> listView) { super(listView); JFXDepthManager.setDepth(flow, listView.depthProperty().get()); listView.depthProperty().addListener((o, oldVal, newVal) -> JFXDepthManager.setDepth(flow, newVal)); }
DocumentPropertyCell(ProjectTreeComponent projectTreeComponent) { this.projectTreeComponent = requireNonNull(projectTreeComponent); // Listener should be initiated with a listener attached // that removes enabled-listeners attached to the previous // node when a new node is selected. itemProperty().addListener((ob, o, n) -> { if (o != null && o instanceof HasEnabledProperty) { final HasEnabledProperty hasEnabled = (HasEnabledProperty) o; hasEnabled.enabledProperty().removeListener(change); } if (n != null && n instanceof HasEnabledProperty) { final HasEnabledProperty hasEnabled = (HasEnabledProperty) n; hasEnabled.enabledProperty().addListener(change); } }); }
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); } }
public TabContentHolder(Tab tab) { this.tab = tab; getStyleClass().setAll("tab-content-area"); setManaged(false); updateContent(); setVisible(tab.isSelected()); tab.selectedProperty().addListener(weakTabSelectedListener); tab.contentProperty().addListener(weakTabContentListener); }
valueProperty().addListener(observable -> { if (getValue() != null) { addChildrenListener(getValue()); predicate.addListener(observable -> { filteredItems.setPredicate(child -> { }); this.filteredItems.predicateProperty().addListener(observable -> JFXUtilities.runInFXAndWait(() -> { getChildren().clear();
this.name = name; getStyleClass().add(DEFAULT_STYLE_CLASS); this.fill.addListener((observable) -> setBackground(new Background( new BackgroundFill(getFill() == null ? Color.BLACK : getFill(), null, null)))); shapeProperty().addListener(observable -> { Shape shape = getShape(); if (getShape() != null) {
private void init() { setClip(clip); clip.setBackground(new Background(new BackgroundFill(Color.BLACK, new CornerRadii(2), Insets.EMPTY))); backgroundProperty().addListener(observable -> JFXNodeUtils.updateBackground(getBackground(), clip)); }
protected void init() { this.getStyleClass().add(DEFAULT_STYLE_CLASS); this.setRowFactory(param -> new JFXTreeTableRow<>()); this.getSelectionModel().selectedItemProperty().addListener((o, oldVal, newVal) -> { if (newVal != null && newVal.getValue() != null) { itemWasSelected = true; } }); this.predicate.addListener(observable -> filter(getPredicate())); this.sceneProperty().addListener(observable -> { if (getScene() == null) { threadPool.shutdownNow(); } else if (threadPool.isTerminated()) { threadPool = createThreadPool(); } }); this.rootProperty().addListener(observable -> { if (getRoot() != null) { setCurrentItemsCount(count(getRoot())); } if(!internalSetRoot) { originalRoot = getRoot(); reGroup(); } }); // compute the current items count setCurrentItemsCount(count(getRoot())); }
/** * creates a rippler for the specified control, mask and position. * * @param control * @param mask can be either rectangle/cricle * @param pos can be either FRONT/BACK (position the ripple effect infront of or behind the control) */ public JFXRippler(Node control, RipplerMask mask, RipplerPos pos) { initialize(); setMaskType(mask); setPosition(pos); createRippleUI(); setControl(control); // listen to control position changed position.addListener(observable -> updateControlPosition()); setPickOnBounds(false); setCache(true); setCacheHint(CacheHint.SPEED); setCacheShape(true); }
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->{
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));
selectedPath.addListener((o, oldVal, newVal) -> { if (oldVal != null) { hslColorPicker.removeColorSelectionNode(oldVal);
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); }
}); suggestionList.getStyleClass().add("autocomplete-list"); control.suggestionsCellFactoryProperty().addListener((o, oldVal, newVal) -> { if (newVal != null) { suggestionList.setCellFactory(newVal);
buttonRippler.setRipplerFill(((LabeledText) getChildren().get(i)).getFill()); ((LabeledText) getChildren().get(i)).fillProperty() .addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill( newVal)); break; buttonRippler.setRipplerFill(((Label) getChildren().get(i)).getTextFill()); ((Label) getChildren().get(i)).textFillProperty() .addListener((o, oldVal, newVal) -> buttonRippler.setRipplerFill( newVal)); break;
private void initListeners() { // delegate slider mouse events to track node mouseHandlerPane.setOnMousePressed(this::delegateToTrack); mouseHandlerPane.setOnMouseReleased(this::delegateToTrack); mouseHandlerPane.setOnMouseDragged(this::delegateToTrack); // animate value node track.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> { timeline.setRate(1); timeline.play(); }); track.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> { timeline.setRate(-1); timeline.play(); }); thumb.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> { timeline.setRate(1); timeline.play(); }); thumb.addEventHandler(MouseEvent.MOUSE_RELEASED, (event) -> { timeline.setRate(-1); timeline.play(); }); refreshSliderValueBinding(); updateValueStyleClass(); getSkinnable().valueProperty().addListener(observable -> updateValueStyleClass()); getSkinnable().orientationProperty().addListener(observable -> initAnimation(getSkinnable().getOrientation())); }
public JFXTogglePane() { this.clipProperty().addListener((o, oldVal, newVal) -> { if (newVal != null) { if (getToggleNode() != null) { this.heightProperty().addListener((o, oldVal, newVal) -> updateToggleAnimation()); toggleNode.addListener((o, oldVal, newVal) -> { if (newVal != null) { if (getClip() != null) {
glyphProperty().addListener((observable, oldValue, newValue) -> { if (oldValue != null) { oldValue.fillProperty().unbind();