Java 类javafx.beans.property.ReadOnlyBooleanProperty 实例源码

项目:easyMvvmFx    文件:CompositeCommand.java   
private void initRegisteredCommandsListener() {
    this.registeredCommands.addListener((ListChangeListener<Command>) c -> {
        while (c.next()) {
            if (registeredCommands.isEmpty()) {
                executable.unbind();
                running.unbind();
                progress.unbind();
            } else {
                BooleanBinding executableBinding = constantOf(true);
                BooleanBinding runningBinding = constantOf(false);

                for (Command registeredCommand : registeredCommands) {
                    ReadOnlyBooleanProperty currentExecutable = registeredCommand.executableProperty();
                    ReadOnlyBooleanProperty currentRunning = registeredCommand.runningProperty();
                    executableBinding = executableBinding.and(currentExecutable);
                    runningBinding = runningBinding.or(currentRunning);
                }
                executable.bind(executableBinding);
                running.bind(runningBinding);

                initProgressBinding();
            }
        }
    });
}
项目:javafx-qiniu-tinypng-client    文件:CompositeCommand.java   
private void initRegisteredCommandsListener() {
    this.registeredCommands.addListener((ListChangeListener<Command>) c -> {
        while (c.next()) {
            if (registeredCommands.isEmpty()) {
                executable.unbind();
                running.unbind();
                progress.unbind();
            } else {
                BooleanBinding executableBinding = constantOf(true);
                BooleanBinding runningBinding = constantOf(false);

                for (Command registeredCommand : registeredCommands) {
                    ReadOnlyBooleanProperty currentExecutable = registeredCommand.executableProperty();
                    ReadOnlyBooleanProperty currentRunning = registeredCommand.runningProperty();
                    executableBinding = executableBinding.and(currentExecutable);
                    runningBinding = runningBinding.or(currentRunning);
                }
                executable.bind(executableBinding);
                running.bind(runningBinding);

                initProgressBinding();
            }
        }
    });
}
项目:MPL    文件:MplIdeController.java   
private Tab createAndAttachTab(Path path) {
  BorderPane pane = new BorderPane();
  MplEditor editor = MplEditor.create(path, pane, eventBus, appMemento, this);

  ReadOnlyBooleanProperty modifiedProperty = editor.modifiedProperty();
  StringExpression titleText = Bindings.createStringBinding(() -> {
    return modifiedProperty.get() ? "*" : "";
  }, modifiedProperty).concat(path.getFileName());

  Tab tab = new Tab();
  tab.textProperty().bind(titleText);
  tab.setContent(pane);
  tab.setUserData(new MplEditorData(path, editor));
  tab.setOnCloseRequest(e -> {
    if (warnAboutUnsavedResources(Arrays.asList(tab)))
      e.consume();
  });
  editorTabPane.getTabs().add(tab);
  tab.setOnClosed(e -> {
    editors.remove(path);
    tabs.remove(path);
  });
  editors.put(path, editor);
  tabs.put(path, tab);
  return tab;
}
项目:VocabHunter    文件:SettingsController.java   
private void initialiseField(final TextField field, final Supplier<Object> settingGetter) {
    StringProperty textProperty = field.textProperty();
    ReadOnlyBooleanProperty focusedProperty = field.focusedProperty();

    field.setText(settingGetter.get().toString());
    textProperty.addListener((o, oldValue, newValue) -> cleanNonNegativeInteger(field::setText, newValue, oldValue));
    focusedProperty.addListener((o, old, isFocused) -> applyDefaultIfEmpty(field::setText, field::getText, settingGetter));
}
项目:JVx.javafx    文件:FXNodeFocusedHelper.java   
/**
 * Creates a new instance of {@link FXNodeFocusedHelper}.
 */
public FXNodeFocusedHelper()
{
    sceneFocusOwnerListener = this::onSceneFocusOwnerChanged;
    nodeSceneListener = this::onNodeSceneChanged;

    focused = new SimpleBooleanProperty();
    focusedReadOnly = ReadOnlyBooleanProperty.readOnlyBooleanProperty(focused);

    node = new SimpleObjectProperty<>();
    node.addListener(this::onNodeChanged);
}
项目:subshare    文件:WizardPage.java   
/**
 * Callback-method associating this {@code WizardPage} with the given {@code wizard}.
 * <p>
 * Implementors should <i>not</i> override this method, but instead initialise their {@code WizardPage}-sub-class
 * via overriding {@link #init()}!
 * <p>
 * Please note that a {@code WizardPage} cannot be re-used in another {@code Wizard}. Therefore, this method is
 * only invoked with one single wizard. It may be invoked multiple times, but it makes sure {@link #init()} is
 * only called once.
 * @param wizard the {@link Wizard} this {@code WizardPage} is used in. Must not be <code>null</code>.
 */
public void setWizard(final Wizard wizard) {
    assertNotNull(wizard, "wizard"); //$NON-NLS-1$
    if (this.wizard == wizard)
        return;

    if (this.wizard != null)
        throw new IllegalStateException("this.wizard != null :: Cannot re-use WizardPage in another Wizard!"); //$NON-NLS-1$

    this.wizard = wizard;

    Region spring = new Region();
    VBox.setVgrow(spring, Priority.ALWAYS);

    content = createContent();
    if (content == null)
        content = new HBox(new Text(String.format(
                ">>> NO CONTENT <<<\n\nYour implementation of WizardPage.createContent() in class\n%s\nreturned null!", //$NON-NLS-1$
                this.getClass().getName())));

    if (content instanceof CompletableContent) {
        final ReadOnlyBooleanProperty contentCompleteProperty = ((CompletableContent) content).completeProperty();
        assertNotNull(contentCompleteProperty, "content.completeProperty()");
        this.completeProperty().bind(contentCompleteProperty.and(shownOrNotShownRequired));
    }

    getChildren().add(content);

    getChildren().addAll(spring, createButtonBar(), new Region());
    finishButton.disableProperty().bind(wizard.canFinishProperty().not());

    init();
    wizard.registerWizardPage(this);

    final WizardPage nextPage = getNextPage();
    if (nextPage != null)
        nextPage.setWizard(wizard);
}
项目:ISAAC    文件:DynamicRefexView.java   
/**
 * @see gov.va.isaac.interfaces.gui.views.commonFunctionality.RefexViewI#setComponent(int, javafx.beans.property.ReadOnlyBooleanProperty, 
 * javafx.beans.property.ReadOnlyBooleanProperty, javafx.beans.property.ReadOnlyBooleanProperty, boolean)
 */
@Override
public void setComponent(int componentNid, ReadOnlyBooleanProperty showStampColumns, ReadOnlyBooleanProperty showActiveOnly, 
        ReadOnlyBooleanProperty showFullHistory, boolean displayFSNButton)
{
    //disable refresh, as the bindings mucking causes many refresh calls
    noRefresh_.getAndIncrement();
    initialInit();
    setFromType_ = new InputType(componentNid, false);
    handleExternalBindings(showStampColumns, showActiveOnly, showFullHistory, displayFSNButton);
    showViewUsageButton_.invalidate();
    newComponentHint_ = null;
    noRefresh_.getAndDecrement();
    initColumnsLoadData();
}
项目:ISAAC    文件:DynamicRefexView.java   
/**
 * @see gov.va.isaac.interfaces.gui.views.commonFunctionality.RefexViewI#setAssemblage(int, javafx.beans.property.ReadOnlyBooleanProperty, 
 * javafx.beans.property.ReadOnlyBooleanProperty, javafx.beans.property.ReadOnlyBooleanProperty, boolean)
 */
@Override
public void setAssemblage(int assemblageConceptNid, ReadOnlyBooleanProperty showStampColumns, ReadOnlyBooleanProperty showActiveOnly, 
        ReadOnlyBooleanProperty showFullHistory, boolean displayFSNButton)
{
    //disable refresh, as the bindings mucking causes many refresh calls
    noRefresh_.getAndIncrement();
    initialInit();
    setFromType_ = new InputType(assemblageConceptNid, true);
    handleExternalBindings(showStampColumns, showActiveOnly, showFullHistory, displayFSNButton);
    newComponentHint_ = null;
    noRefresh_.getAndDecrement();
    initColumnsLoadData();
}
项目:assertj-javafx    文件:BooleanTest.java   
@Test
public void testReadOnlyBooleanProperty(){
    ReadOnlyBooleanProperty actual = new SimpleBooleanProperty(true);
    assertThat(actual).isTrue();

    assertThat(actual).hasSameValue(actual);
}
项目:floyd    文件:ScannerPresenter.java   
private ReadOnlyBooleanProperty isNotNumber(StringProperty textProperty) {
    SimpleBooleanProperty property = new SimpleBooleanProperty();
    textProperty.addListener((ObservableValue<? extends String> observable, String oldValue, String newValue) -> {
        try {
            String content = textProperty.get();
            Integer.parseInt(content);
            property.setValue(false);
        } catch (NumberFormatException nbr) {
            property.setValue(true);
        }
    });
    return property;
}
项目:afc    文件:Triangle2dfx.java   
/** Replies the property that indictes if the triangle's points are defined in a counter-clockwise order.
 *
 * @return the ccw property.
 */
@Pure
public ReadOnlyBooleanProperty ccwProperty() {
    if (this.ccw == null) {
        this.ccw = new ReadOnlyBooleanWrapper(this, MathFXAttributeNames.CCW);
        this.ccw.bind(Bindings.createBooleanBinding(() ->
            Triangle2afp.isCCW(
                    getX1(), getY1(), getX2(), getY2(),
                    getX3(), getY3()),
                x1Property(), y1Property(),
                x2Property(), y2Property(),
                x3Property(), y3Property()));
    }
    return this.ccw.getReadOnlyProperty();
}
项目:hygene    文件:GraphAnnotation.java   
public ReadOnlyBooleanProperty indexBuiltProperty() {
    return indexBuilt;
}
项目:easyMvvmFx    文件:ValidationStatus.java   
/**
 * @return <code>true</code> if there are no validation messages present.
 */
public ReadOnlyBooleanProperty validProperty() {
    return messages.emptyProperty();
}
项目:easyMvvmFx    文件:DelegateCommand.java   
@Override
public ReadOnlyBooleanProperty executableProperty() {
    return this.executable.getReadOnlyProperty();
}
项目:easyMvvmFx    文件:CommandBase.java   
@Override
public final ReadOnlyBooleanProperty executableProperty() {
    return executable.getReadOnlyProperty();
}
项目:easyMvvmFx    文件:CommandBase.java   
@Override
public final ReadOnlyBooleanProperty runningProperty() {
    return running.getReadOnlyProperty();
}
项目:JavaFX-EX    文件:ModifiableObject.java   
public ReadOnlyBooleanProperty modifiedProperty() {
  return modified.getReadOnlyProperty();
}
项目:javafx-qiniu-tinypng-client    文件:ValidationStatus.java   
/**
 * @return <code>true</code> if there are no validation messages present.
 */
public ReadOnlyBooleanProperty validProperty() {
    return messages.emptyProperty();
}
项目:javafx-qiniu-tinypng-client    文件:DelegateCommand.java   
@Override
public ReadOnlyBooleanProperty executableProperty() {
    return this.executable.getReadOnlyProperty();
}
项目:javafx-qiniu-tinypng-client    文件:CommandBase.java   
@Override
public final ReadOnlyBooleanProperty executableProperty() {
    return executable.getReadOnlyProperty();
}
项目:javafx-qiniu-tinypng-client    文件:CommandBase.java   
@Override
public final ReadOnlyBooleanProperty runningProperty() {
    return running.getReadOnlyProperty();
}
项目:shuffleboard    文件:LiveWindow.java   
public static ReadOnlyBooleanProperty enabledProperty() {
  return enabled;
}
项目:shuffleboard    文件:Scrubber.java   
public final ReadOnlyBooleanProperty viewModeProperty() {
  return viewMode;
}
项目:fxexperience2    文件:PaintPicker.java   
public final ReadOnlyBooleanProperty liveUpdateProperty() {
    return controller.liveUpdateProperty();
}
项目:stvs    文件:ConstraintSpecificationValidator.java   
public ReadOnlyBooleanProperty validProperty() {
  return valid;
}
项目:stvs    文件:FreeVariableListValidator.java   
public ReadOnlyBooleanProperty validProperty() {
  return valid;
}
项目:jmonkeybuilder    文件:DynamicIconSupport.java   
@FXThread
private static void updateListener(@NotNull final Node node, @NotNull final ImageView imageView,
                                   @NotNull final ReadOnlyBooleanProperty condition,
                                   @NotNull final Object listenerKey, @NotNull final Object notSelectedKey,
                                   @NotNull final Object selectedKey) {

    final EditorConfig editorConfig = EditorConfig.getInstance();
    final CssColorTheme theme = editorConfig.getTheme();

    if (!theme.needRepaintIcons()) {
        return;
    }

    final ObservableMap<Object, Object> properties = node.getProperties();
    final Image newImage = imageView.getImage();

    if (newImage == null) {
        properties.remove(listenerKey);
        return;
    }

    final Image original = FILE_ICON_MANAGER.getOriginal(newImage);

    properties.put(notSelectedKey, newImage);
    properties.put(selectedKey, original);

    final ChangeListener<Boolean> listener = (observable, oldValue, newValue) -> {
        if (newValue) {
            imageView.setImage((Image) properties.get(selectedKey));
        } else {
            imageView.setImage((Image) properties.get(notSelectedKey));
        }
    };

    condition.addListener(listener);

    properties.put(listenerKey, listener);

    if (condition.get()) {
        imageView.setImage(original);
    } else {
        imageView.setImage(newImage);
    }
}
项目:fx-animation-editor    文件:CommandStack.java   
public ReadOnlyBooleanProperty canUndoProperty() {
    return canUndo;
}
项目:fx-animation-editor    文件:CommandStack.java   
public ReadOnlyBooleanProperty canRedoProperty() {
    return canRedo;
}
项目:willow-browser    文件:History.java   
public ReadOnlyBooleanProperty canNavForwardProperty() {
    return canNavForward.getReadOnlyProperty();
}
项目:willow-browser    文件:History.java   
public ReadOnlyBooleanProperty canNavBackwardProperty() {
    return canNavBackward.getReadOnlyProperty();
}
项目:FxEditor    文件:FxEditor.java   
public ReadOnlyBooleanProperty multipleSelectionProperty()
{
    return multipleSelectionProperty.getReadOnlyProperty();
}
项目:Gargoyle    文件:DockTab.java   
/**
 * The currently selected tab.
 */
public final ReadOnlyBooleanProperty selectedProperty() {
    return selectedPropertyImpl().getReadOnlyProperty();
}
项目:xdat_editor    文件:XdatEditor.java   
public ReadOnlyBooleanProperty workingProperty() {
    return working.getReadOnlyProperty();
}
项目:JavaFX-EX    文件:ModifiableObject.java   
public ReadOnlyBooleanProperty modifiedProperty() {
  return modified.getReadOnlyProperty();
}
项目:arma-dialog-creator    文件:StagePopup.java   
@NotNull
public ReadOnlyBooleanProperty getShowingProperty() {
    return myStage.showingProperty();
}
项目:myWMS    文件:BasicEntityEditor.java   
public ReadOnlyBooleanProperty showPopupProperty() {
    return showPopup.getReadOnlyProperty();
}
项目:Capstone2016    文件:Trap.java   
public ReadOnlyBooleanProperty dirtyProperty () {
    return dirtyProperty.getReadOnlyProperty();
}
项目:Capstone2016    文件:RestNetworkService.java   
@Override
public ReadOnlyBooleanProperty networkAvailableProperty() {
    return networkAvailableProperty.getReadOnlyProperty();
}
项目:Capstone2016    文件:DefaultTrapDataService.java   
@Override
public ReadOnlyBooleanProperty loadingProperty () {
    return loadingProperty.getReadOnlyProperty();
   }