Exemplo n.º 1
0
 private final void next() {
   synchronized (scheduledTasks) {
     if (!isIdleBinding.get())
       currentTaskProperty.setValue(
           scheduledTasks.get(scheduledTasks.indexOf(currentTaskProperty.getValue()) + 1));
   }
 }
Exemplo n.º 2
0
 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();
   }
 }
Exemplo n.º 3
0
 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();
   }
 }
Exemplo n.º 4
0
 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;
   }
 }
Exemplo n.º 5
0
 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);
                   });
         }
       });
 }
Exemplo n.º 6
0
  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());
  }
Exemplo n.º 7
0
 private void onFocusOwnerFocusedChanged(Boolean oldValue, Boolean newValue) {
   isFocusOwnerFocused = Boolean.TRUE.equals(newValue);
   viewerFocusedPropertyBinding.invalidate();
 }
Exemplo n.º 8
0
 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;
 }
Exemplo n.º 9
0
 public BooleanBinding not(BooleanBinding binding) {
   return binding.not();
 }