public ValidatorBase() { parentProperty().addListener((o, oldVal, newVal) -> parentChanged()); errorTooltip = new Tooltip(); errorTooltip.getStyleClass().add("error-tooltip"); }
public CachedTransition(final Node node, final Timeline timeline, CacheMemento... cacheMomentos) { this.node = node; this.timeline.set(timeline); mementos = new CacheMemento[(node == null ? 0 : 1) + cacheMomentos.length]; if (node != null) { mementos[0] = new CacheMemento(node); } System.arraycopy(cacheMomentos, 0, mementos, node == null ? 0 : 1, cacheMomentos.length); statusProperty().addListener(observable -> { switch (getStatus()) { case RUNNING: starting(); break; default: stopping(); break; } }); }
public HighLightRectangle(Text text) { listener = observable -> clear(text); text.textProperty().addListener(new WeakInvalidationListener(listener)); text.localToSceneTransformProperty().addListener(new WeakInvalidationListener(listener)); }
protected void initControlListeners() { // if the control got resized the overlay rect must be rest control.layoutBoundsProperty().addListener(observable -> resetRippler()); if (getChildren().contains(control)) { control.boundsInParentProperty().addListener(observable -> resetRippler()); } control.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> createRipple(event.getX() + padding, event.getY() + padding)); // create fade out transition for the ripple control.addEventHandler(MouseEvent.MOUSE_RELEASED, e -> releaseRipple()); }
/** * init mouse listeners on the control */ protected void initControlListeners() { // if the control got resized the overlay rect must be rest control.layoutBoundsProperty().addListener(observable -> resetRippler()); if(getChildren().contains(control)) control.boundsInParentProperty().addListener(observable -> resetRippler()); control.addEventHandler(MouseEvent.MOUSE_PRESSED, (event) -> createRipple(event.getX(), event.getY())); // create fade out transition for the ripple control.addEventHandler(MouseEvent.MOUSE_RELEASED, e -> releaseRipple()); }
public CachedTransition(final Node node, final Timeline timeline) { this.node = node; this.timeline.set(timeline); mementos = node == null ? mementos : new CacheMemento[]{new CacheMemento(node)}; statusProperty().addListener(observable -> { switch (getStatus()) { case RUNNING: starting(); break; default: stopping(); break; } }); }
public JFXSnackbar(Pane snackbarContainer) { initialize(); content = new StackPane(); content.getStyleClass().add("jfx-snackbar-content"); //wrap the content in a group so that the content is managed inside its own container //but the group is not managed in the snackbarContainer so it does not affect any layout calculations getChildren().add(content); setManaged(false); setVisible(false); // register the container before resizing it registerSnackbarContainer(snackbarContainer); // resize the popup if its layout has been changed layoutBoundsProperty().addListener((o, oldVal, newVal) -> refreshPopup()); addEventHandler(SnackbarEvent.SNACKBAR, e -> enqueue(e)); }
/** * The constructor of {@code JFXFillTransition} * * @param duration The duration of the {@code JFXFillTransition} * @param region The {@code region} which filling will be animated * @param fromValue The start value of the color-animation * @param toValue The end value of the color-animation */ public JFXFillTransition(Duration duration, Region region, Color fromValue, Color toValue) { setDuration(duration); setRegion(region); setFromValue(fromValue); setToValue(toValue); setCycleDuration(duration); statusProperty().addListener(new ChangeListener<Status>() { @Override public void changed(ObservableValue<? extends Status> ov, Status t, Status newStatus) { switch (newStatus) { case RUNNING: starting(); break; default: stopping(); break; } } }); }
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); } }
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())); }
this.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(this)); .forEach(item -> item.getSelectionModel() .selectedItemProperty() .addListener((o, oldVal, newVal) -> clearSelection(item)));
.addListener((observable, old, typeName) -> { if (!typeName.isEmpty()) { dbmsType.set(findDbmsType(typeName));
scrollPane.getContent().getParent().addEventHandler(ScrollEvent.ANY, scrollHandler); scrollPane.getContent().parentProperty().addListener((o,oldVal, newVal)->{ if (oldVal != null) { oldVal.removeEventHandler(MouseEvent.DRAG_DETECTED, dragHandler);
lstProjectProblems.getSelectionModel().selectedItemProperty().addListener((ov, oldValue, newValue) -> { txtDescription.getChildren().clear(); if( newValue != null ) { btnProceed.disableProperty().bind(hasErrors); btnProceed.sceneProperty().addListener( (ov, oldVal, newVal) -> { if( oldVal == null && newVal != null ){ Window window = newVal.windowProperty().get(); window.setOnCloseRequest( (ev) -> closeWindow() ); } else { newVal.windowProperty().addListener( (ob, oldW, newW) -> { newW.setOnCloseRequest( (ev) -> closeWindow() ); });
FlowHandler contentFlowHandler = (FlowHandler) context.getRegisteredObject("ContentFlowHandler"); sideList.propagateMouseEventsToParent(); sideList.getSelectionModel().selectedItemProperty().addListener((o, oldVal, newVal) -> { new Thread(()->{ Platform.runLater(()->{
listViewProperty().addListener((listObj, oldList, newList) -> { if (newList != null) { if (getListView() instanceof JFXListView) {
setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER); setFitToHeight(true); treeView.getSelectionModel().selectedItemProperty().addListener(observable -> { TreeItem selectedItem = treeView.getSelectionModel().getSelectedItem(); TreeItem temp = selectedItem;
}); activeValidatorProperty().addListener((o, oldVal, newVal) -> { if (!isDisableAnimation()) { if (hideErrorAnimation != null && hideErrorAnimation.getStatus() == Status.RUNNING) {
contentContainer.localToSceneTransformProperty().addListener((o, oldVal, newVal) -> oldSceneTransform = oldVal); final ScrollPane scrollPane = new ScrollPane(); scrollPane.setContent(contentContainer);
control.activeValidatorProperty().addListener((ObservableValue<? extends ValidatorBase> o, ValidatorBase oldVal, ValidatorBase newVal) -> { if (!control.isDisableAnimation()) { if (newVal != null) {