当前位置: 首页>>代码示例>>Java>>正文


Java EasyBind类代码示例

本文整理汇总了Java中org.fxmisc.easybind.EasyBind的典型用法代码示例。如果您正苦于以下问题:Java EasyBind类的具体用法?Java EasyBind怎么用?Java EasyBind使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


EasyBind类属于org.fxmisc.easybind包,在下文中一共展示了EasyBind类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: onBitcoinSetup

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public void onBitcoinSetup() {
    model.setWallet(bitcoin.wallet());
    addressControl.addressProperty().bind(model.addressProperty());
    balance.textProperty().bind(EasyBind.map(model.balanceProperty(), coin -> MonetaryFormat.BTC.noCode().format(coin).toString()));
    // Don't let the user click send money when the wallet is empty.
    sendMoneyOutBtn.disableProperty().bind(model.balanceProperty().isEqualTo(Coin.ZERO));

    showBitcoinSyncMessage();
    model.syncProgressProperty().addListener(x -> {
        if (model.syncProgressProperty().get() >= 1.0) {
            readyToGoAnimation();
            if (syncItem != null) {
                syncItem.cancel();
                syncItem = null;
            }
        } else if (syncItem == null) {
            showBitcoinSyncMessage();
        }
    });
}
 
开发者ID:creativechain,项目名称:creacoinj,代码行数:21,代码来源:MainController.java

示例2: SourceTreeTable

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
/**
 * Creates a new source tree table. It comes pre-populated with a key and a value column.
 */
public SourceTreeTable() {
  keyColumn.prefWidthProperty().bind(widthProperty().divide(2).subtract(2));
  valueColumn.prefWidthProperty().bind(widthProperty().divide(2).subtract(2));

  keyColumn.setCellValueFactory(
      f -> new ReadOnlyStringWrapper(getEntryForCellData(f).getViewName()));
  valueColumn.setCellValueFactory(
      f -> new ReadOnlyObjectWrapper(getEntryForCellData(f).getValueView()));
  Label placeholder = new Label();
  placeholder.textProperty().bind(EasyBind.monadic(sourceType)
      .map(SourceType::getName)
      .map(n -> "No data available. Is there a connection to " + n + "?")
      .orElse("No data available. Is the source connected?"));
  setPlaceholder(placeholder);

  getColumns().addAll(keyColumn, valueColumn);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:21,代码来源:SourceTreeTable.java

示例3: setUpPluginsStage

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
private void setUpPluginsStage() {
  pluginStage = new Stage();
  pluginStage.initModality(Modality.WINDOW_MODAL);
  pluginStage.addEventHandler(KeyEvent.KEY_PRESSED, e -> {
    if (e.getCode() == KeyCode.ESCAPE) {
      pluginStage.close();
    }
  });
  pluginStage.setScene(new Scene(pluginPane));
  pluginStage.sizeToScene();
  pluginStage.setMinWidth(675);
  pluginStage.setMinHeight(325);
  pluginStage.setTitle("Loaded Plugins");
  EasyBind.listBind(pluginPane.getStylesheets(), root.getStylesheets());
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:16,代码来源:MainWindowController.java

示例4: initialize

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
@FXML
private void initialize() {
  x.minProperty().bind(EasyBind.monadic(range).map(Range::getMagnitude).map(this::negateInteger));
  x.maxProperty().bind(EasyBind.monadic(range).map(Range::getMagnitude));

  x.majorTickUnitProperty().bind(EasyBind.monadic(range).map(Range::getMagnitude).map(i -> i / 2.0));

  x.valueProperty().bind(dataOrDefault.map(ThreeAxisAccelerometerData::getX));
  y.valueProperty().bind(dataOrDefault.map(ThreeAxisAccelerometerData::getY));
  z.valueProperty().bind(dataOrDefault.map(ThreeAxisAccelerometerData::getZ));

  xLabel.textProperty().bind(EasyBind.combine(x.valueProperty(), numDecimals, this::format));
  yLabel.textProperty().bind(EasyBind.combine(y.valueProperty(), numDecimals, this::format));
  zLabel.textProperty().bind(EasyBind.combine(z.valueProperty(), numDecimals, this::format));

  exportProperties(range, showText, numDecimals, x.showTickMarksProperty());
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:18,代码来源:ThreeAxisAccelerometerWidget.java

示例5: initialize

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
@FXML
private void initialize() {
  indicator.valueProperty().bind(dataOrDefault);
  text.textProperty().bind(EasyBind.map(dataOrDefault, n -> String.format("%.2f", n.doubleValue())));

  indicator.majorTickUnitProperty().bind(
      EasyBind.combine(indicator.minProperty(), indicator.maxProperty(), numTicks,
          (min, max, numTicks) -> {
            if (numTicks.intValue() > 1) {
              return (max.doubleValue() - min.doubleValue()) / (numTicks.intValue() - 1);
            } else {
              return max.doubleValue() - min.doubleValue();
            }
          }));

  exportProperties(indicator.minProperty(), indicator.maxProperty(), indicator.centerProperty(), numTicks, showText);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:18,代码来源:NumberBarWidget.java

示例6: initialize

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
@FXML
private void initialize() {
  controllable.set(LiveWindow.isEnabled());

  LiveWindow.enabledProperty().addListener((__, was, is) -> controllable.set(is));
  viewPane.visibleProperty().bind(controllable.not());
  controlPane.visibleProperty().bind(controllable);

  view.valueProperty().bind(EasyBind.monadic(dataProperty()).map(SpeedControllerData::getValue));

  control.valueProperty().addListener(numberUpdateListener);
  valueField.numberProperty().addListener(numberUpdateListener);
  dataOrDefault.addListener((__, prev, cur) -> {
    control.setValue(cur.getValue());
    valueField.setNumber(cur.getValue());
  });
  control.orientationProperty().bind(orientation);
  view.orientationProperty().bind(orientation);

  exportProperties(controllable, orientation);
}
 
开发者ID:wpilibsuite,项目名称:shuffleboard,代码行数:22,代码来源:SpeedControllerWidget.java

示例7: StyledTableCell

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public StyledTableCell(TableColumn<LogEntry, String> column, Search search) {
    text = new SearchableLabel(search);
    text.fontProperty().bind(fontProperty());

    setGraphic(text);
    setText(null);

    // this is usually called only once (when this cell is attached to a row)
    EasyBind.subscribe(tableRowProperty(), row -> {
        if (row == null) {
            return;
        }

        // bind the text for the foreground
        //noinspection unchecked
        Binding<Style> colorizedLogStyle = getOrCreateStyleBinding(row, colorizer);
        text.normalStyleProperty().bind(colorizedLogStyle);

        // apply the style to the cell for the background
        EasyBind.subscribe(colorizedLogStyle, s -> s.bindNode(this));
    });
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:23,代码来源:StyledTableCell.java

示例8: SearchableLabel

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public SearchableLabel(Search search) {
    this.search = search;

    // reuse the same initial text when not searching
    initialText = new Label();
    initialText.textProperty().bind(text);
    initialText.fontProperty().bind(font);
    initialText.setMinWidth(USE_COMPUTED_SIZE);

    EasyBind.subscribe(normalStyle, style -> style.bindNodes(initialText));

    text.addListener((obs, old, val) -> refreshSearch());
    search.textProperty().addListener((obs, old, val) -> refreshSearch());
    search.activeProperty().addListener((obs, old, val) -> refreshSearch());
    search.matchCaseProperty().addListener((obs, old, val) -> refreshSearch());
    search.regexModeProperty().addListener((obs, old, val) -> refreshSearch());

    // initialize the content
    refreshSearch();
}
 
开发者ID:joffrey-bion,项目名称:fx-log,代码行数:21,代码来源:SearchableLabel.java

示例9: setConnections

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
private void setConnections(ObservableList<ReadOnlyPerson> personList) {
    ObservableList<PersonCard> mappedList = EasyBind.map(
            personList, (person) -> new PersonCard(person, personList.indexOf(person) + 1));
    personListView.setItems(mappedList);
    personListView.setCellFactory(listView -> new PersonListViewCell());
    setEventHandlerForSelectionChangeEvent();
}
 
开发者ID:se-edu,项目名称:addressbook-level4,代码行数:8,代码来源:PersonListPanel.java

示例10: activate

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public void activate() {
    if (txIdTextField != null) {
        if (txIdSubscription != null)
            txIdSubscription.unsubscribe();

        txIdSubscription = EasyBind.subscribe(model.dataModel.txId, id -> {
            if (!id.isEmpty())
                txIdTextField.setup(id);
            else
                txIdTextField.cleanup();
        });
    }
    trade.errorMessageProperty().addListener(errorMessageListener);

    disputeStateSubscription = EasyBind.subscribe(trade.disputeStateProperty(), newValue -> {
        if (newValue != null)
            updateDisputeState(newValue);
    });

    tradePeriodStateSubscription = EasyBind.subscribe(trade.tradePeriodStateProperty(), newValue -> {
        if (newValue != null)
            updateTradePeriodState(newValue);
    });

    model.clock.addListener(clockListener);
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:27,代码来源:TradeStepView.java

示例11: activate

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
@Override
protected void activate() {
    tableView.getSelectionModel().selectedItemProperty().addListener(tableViewSelectionListener);
    sortedList.comparatorProperty().bind(tableView.comparatorProperty());

    updateList();

    walletService.addBalanceListener(balanceListener);
    amountTextFieldSubscription = EasyBind.subscribe(amountTextField.textProperty(), t -> {
        addressTextField.setAmountAsCoin(formatter.parseToCoin(t));
        updateQRCode();
    });

    if (tableView.getSelectionModel().getSelectedItem() == null && !sortedList.isEmpty())
        tableView.getSelectionModel().select(0);
}
 
开发者ID:bisq-network,项目名称:exchange,代码行数:17,代码来源:DepositView.java

示例12: DocumentViewerViewModel

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public DocumentViewerViewModel(StateManager stateManager) {
    this.stateManager = Objects.requireNonNull(stateManager);

    this.stateManager.getSelectedEntries().addListener((ListChangeListener<? super BibEntry>) c -> {
        // Switch to currently selected entry in live mode
        if (isLiveMode()) {
            setCurrentEntries(this.stateManager.getSelectedEntries());
        }
    });

    this.liveMode.addListener((observable, oldValue, newValue) -> {
        // Switch to currently selected entry if mode is changed to live
        if (oldValue != newValue && newValue) {
            setCurrentEntries(this.stateManager.getSelectedEntries());
        }
    });

    maxPages.bindBidirectional(
            EasyBind.monadic(currentDocument).selectProperty(DocumentViewModel::maxPagesProperty));

    setCurrentEntries(this.stateManager.getSelectedEntries());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:23,代码来源:DocumentViewerViewModel.java

示例13: IdentifierEditorViewModel

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public IdentifierEditorViewModel(String fieldName, AutoCompleteSuggestionProvider<?> suggestionProvider, TaskExecutor taskExecutor, DialogService dialogService, FieldCheckers fieldCheckers) {
    super(fieldName, suggestionProvider, fieldCheckers);

    this.taskExecutor = taskExecutor;
    this.dialogService = dialogService;

    identifier.bind(
            EasyBind.map(text, input -> IdentifierParser.parse(fieldName, input))
    );

    validIdentifierIsNotPresent.bind(
            EasyBind.map(identifier, parsedIdentifier -> !parsedIdentifier.isPresent())
    );

    idFetcherAvailable.setValue(WebFetchers.getIdFetcherForField(fieldName).isPresent());
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:17,代码来源:IdentifierEditorViewModel.java

示例14: EntryEditor

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
public EntryEditor(BasePanel panel) {
    this.panel = panel;
    this.bibDatabaseContext = panel.getBibDatabaseContext();
    this.undoManager = panel.getUndoManager();

    ControlHelper.loadFXMLForControl(this);

    getStylesheets().add(EntryEditor.class.getResource("EntryEditor.css").toExternalForm());
    setStyle("-fx-font-size: " + Globals.prefs.getFontSizeFX() + "pt;");

    EasyBind.subscribe(tabbed.getSelectionModel().selectedItemProperty(), tab -> {
        EntryEditorTab activeTab = (EntryEditorTab) tab;
        if (activeTab != null) {
            activeTab.notifyAboutFocus(entry);
        }
    });

    setupKeyBindings();

    tabs = createTabs();
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:22,代码来源:EntryEditor.java

示例15: getJavaFXTask

import org.fxmisc.easybind.EasyBind; //导入依赖的package包/类
private <V> Task<V> getJavaFXTask(BackgroundTask<V> task) {
    Task<V> javaTask = new Task<V>() {

        {
            EasyBind.subscribe(task.progressProperty(), progress -> updateProgress(progress.getWorkDone(), progress.getMax()));
        }

        @Override
        public V call() throws Exception {
            return task.call();
        }
    };
    Runnable onRunning = task.getOnRunning();
    if (onRunning != null) {
        javaTask.setOnRunning(event -> onRunning.run());
    }
    Consumer<V> onSuccess = task.getOnSuccess();
    if (onSuccess != null) {
        javaTask.setOnSucceeded(event -> onSuccess.accept(javaTask.getValue()));
    }
    Consumer<Exception> onException = task.getOnException();
    if (onException != null) {
        javaTask.setOnFailed(event -> onException.accept(convertToException(javaTask.getException())));
    }
    return javaTask;
}
 
开发者ID:JabRef,项目名称:jabref,代码行数:27,代码来源:DefaultTaskExecutor.java


注:本文中的org.fxmisc.easybind.EasyBind类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。