當前位置: 首頁>>代碼示例>>Java>>正文


Java ReadOnlyBooleanProperty類代碼示例

本文整理匯總了Java中javafx.beans.property.ReadOnlyBooleanProperty的典型用法代碼示例。如果您正苦於以下問題:Java ReadOnlyBooleanProperty類的具體用法?Java ReadOnlyBooleanProperty怎麽用?Java ReadOnlyBooleanProperty使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


ReadOnlyBooleanProperty類屬於javafx.beans.property包,在下文中一共展示了ReadOnlyBooleanProperty類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: initRegisteredCommandsListener

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
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();
			}
		}
	});
}
 
開發者ID:cmlanche,項目名稱:easyMvvmFx,代碼行數:26,代碼來源:CompositeCommand.java

示例2: createAndAttachTab

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
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;
}
 
開發者ID:Adrodoc55,項目名稱:MPL,代碼行數:27,代碼來源:MplIdeController.java

示例3: initialiseField

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
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));
}
 
開發者ID:VocabHunter,項目名稱:VocabHunter,代碼行數:9,代碼來源:SettingsController.java

示例4: FXNodeFocusedHelper

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:ivartanian,項目名稱:JVx.javafx,代碼行數:15,代碼來源:FXNodeFocusedHelper.java

示例5: setWizard

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/**
 * 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);
}
 
開發者ID:subshare,項目名稱:subshare,代碼行數:49,代碼來源:WizardPage.java

示例6: setComponent

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/**
 * @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();
}
 
開發者ID:Apelon-VA,項目名稱:ISAAC,代碼行數:19,代碼來源:DynamicRefexView.java

示例7: setAssemblage

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/**
 * @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();
}
 
開發者ID:Apelon-VA,項目名稱:ISAAC,代碼行數:18,代碼來源:DynamicRefexView.java

示例8: testReadOnlyBooleanProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
@Test
public void testReadOnlyBooleanProperty(){
    ReadOnlyBooleanProperty actual = new SimpleBooleanProperty(true);
    assertThat(actual).isTrue();

    assertThat(actual).hasSameValue(actual);
}
 
開發者ID:lestard,項目名稱:assertj-javafx,代碼行數:8,代碼來源:BooleanTest.java

示例9: isNotNumber

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
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;
}
 
開發者ID:AdamBien,項目名稱:floyd,代碼行數:14,代碼來源:ScannerPresenter.java

示例10: ccwProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/** 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();
}
 
開發者ID:gallandarakhneorg,項目名稱:afc,代碼行數:19,代碼來源:Triangle2dfx.java

示例11: indexBuiltProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
public ReadOnlyBooleanProperty indexBuiltProperty() {
    return indexBuilt;
}
 
開發者ID:ProgrammingLife2017,項目名稱:hygene,代碼行數:4,代碼來源:GraphAnnotation.java

示例12: validProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
/**
 * @return <code>true</code> if there are no validation messages present.
 */
public ReadOnlyBooleanProperty validProperty() {
	return messages.emptyProperty();
}
 
開發者ID:cmlanche,項目名稱:easyMvvmFx,代碼行數:7,代碼來源:ValidationStatus.java

示例13: executableProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
@Override
public ReadOnlyBooleanProperty executableProperty() {
	return this.executable.getReadOnlyProperty();
}
 
開發者ID:cmlanche,項目名稱:easyMvvmFx,代碼行數:5,代碼來源:DelegateCommand.java

示例14: executableProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
@Override
public final ReadOnlyBooleanProperty executableProperty() {
	return executable.getReadOnlyProperty();
}
 
開發者ID:cmlanche,項目名稱:easyMvvmFx,代碼行數:5,代碼來源:CommandBase.java

示例15: runningProperty

import javafx.beans.property.ReadOnlyBooleanProperty; //導入依賴的package包/類
@Override
public final ReadOnlyBooleanProperty runningProperty() {
	return running.getReadOnlyProperty();
}
 
開發者ID:cmlanche,項目名稱:easyMvvmFx,代碼行數:5,代碼來源:CommandBase.java


注:本文中的javafx.beans.property.ReadOnlyBooleanProperty類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。