private final void next() { synchronized (scheduledTasks) { if (!isIdleBinding.get()) currentTaskProperty.setValue( scheduledTasks.get(scheduledTasks.indexOf(currentTaskProperty.getValue()) + 1)); } }
private void onFocusOwnerChanged(Node oldFocusOwner, Node newFocusOwner) { if (oldFocusOwner != null && isViewerVisual(oldFocusOwner)) { oldFocusOwner.focusedProperty().removeListener(focusOwnerFocusedObserver); } if (newFocusOwner != null && isViewerVisual(newFocusOwner)) { newFocusOwner.focusedProperty().addListener(focusOwnerFocusedObserver); // check if viewer is focused if (Boolean.TRUE.equals(newFocusOwner.focusedProperty().get())) { isFocusOwnerFocused = true; viewerFocusedPropertyBinding.invalidate(); } } else { // viewer unfocused isFocusOwnerFocused = false; viewerFocusedPropertyBinding.invalidate(); } }
private void onWindowChanged(Window oldValue, Window newValue) { if (oldValue != null) { oldValue.focusedProperty().removeListener(windowFocusedObserver); } if (newValue != null) { newValue.focusedProperty().addListener(windowFocusedObserver); // check if window is focused if (Boolean.TRUE.equals(newValue.focusedProperty().get())) { isWindowFocused = true; viewerFocusedPropertyBinding.invalidate(); } } else { // window unfocused isInitialized = false; isWindowFocused = false; viewerFocusedPropertyBinding.invalidate(); } }
private void onWindowFocusedChanged(Boolean oldValue, Boolean newValue) { isWindowFocused = Boolean.TRUE.equals(newValue); viewerFocusedPropertyBinding.invalidate(); if (!isInitialized) { // XXX: When the embedded scene is opened, the viewer needs to // request focus for the root visual once so that a focus owner is // set. This could also possibly be done in the FXFocusBehavior, but // keeping it here we can limit 'knowledge' about the embedded // window. getRootPart().getVisual().requestFocus(); isInitialized = true; } }
public final void execute(final TimeTask<?> task) { Platform2.runOnFXThread( () -> { synchronized (scheduledTasks) { if (isIdleBinding.get()) currentTaskProperty.setValue(task); scheduledTasks.add(task); task.progressProperty() .addListener( (__, ___, ____) -> { overallProgressBinding.invalidate(); datasetProgressBindings.values().forEach(DoubleBinding::invalidate); }); task.stateProperty() .addListener( (__, ___, ____) -> { overallProgressBinding.invalidate(); datasetProgressBindings.values().forEach(DoubleBinding::invalidate); }); } }); }
private void setCredentialBinds() { ContentView view = viewDisplay.getView(credentialsPane); BindingGroup group = btnToCredentials.getBindingGroup(); group.addBinding(CART_NONEMPTY.and(not(RECEIPT_VIEW_ACTIVE))); group .getState() .addListener( (obs, o, n) -> { ContentView storeView = viewDisplay.getView(storePane); ContentView receiptView = viewDisplay.getView(storePane); ContentView currentView = viewDisplay.getCurrentView().getValue(); if (not(CART_NONEMPTY).get() && !currentView.equals(storeView) && !currentView.equals(receiptView)) viewDisplay.show(storeView); btnToCredentials.setDisable(true); }); view.getBindingGroup().setAll(group.getBinds()); }
private void onFocusOwnerFocusedChanged(Boolean oldValue, Boolean newValue) { isFocusOwnerFocused = Boolean.TRUE.equals(newValue); viewerFocusedPropertyBinding.invalidate(); }
protected BooleanBinding getAddButtonDisableBindings() { BooleanBinding binding = inputNodes.get(0).isEmpty(); for (int i = 1; i < inputNodes.size(); i++) binding = binding.or(inputNodes.get(i).isEmpty()); return binding; }
public BooleanBinding not(BooleanBinding binding) { return binding.not(); }