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


Java ObservableList.contains方法代码示例

本文整理汇总了Java中javafx.collections.ObservableList.contains方法的典型用法代码示例。如果您正苦于以下问题:Java ObservableList.contains方法的具体用法?Java ObservableList.contains怎么用?Java ObservableList.contains使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在javafx.collections.ObservableList的用法示例。


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

示例1: showMenuBar

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * show or hide the menuBar
 * 
 * @param scene
 * @param pMenuBar
 */
public void showMenuBar(Scene scene, MenuBar pMenuBar, boolean show) {
  Parent sroot = scene.getRoot();
  ObservableList<Node> rootChilds = null;
  if (sroot instanceof VBox)
    rootChilds = ((VBox) sroot).getChildren();
  if (rootChilds == null)
    throw new RuntimeException(
        "showMenuBar can not handle scene root of type "
            + sroot.getClass().getName());
  if (!show && rootChilds.contains(pMenuBar)) {
    rootChilds.remove(pMenuBar);
  } else if (show) {
    rootChilds.add(0, pMenuBar);
  }
  pMenuBar.setVisible(show);
  hideMenuButton
      .setText(show ? I18n.get(I18n.HIDE_MENU) : I18n.get(I18n.SHOW_MENU));
}
 
开发者ID:BITPlan,项目名称:can4eve,代码行数:25,代码来源:JavaFXDisplay.java

示例2: updatePathSizeValues

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Update a list of available path sizes.
 */
@FXThread
private void updatePathSizeValues() {

    final ComboBox<Integer> pathSizeComboBox = getPatchSizeComboBox();
    final SingleSelectionModel<Integer> selectionModel = pathSizeComboBox.getSelectionModel();
    final Integer current = selectionModel.getSelectedItem();

    final ObservableList<Integer> items = pathSizeComboBox.getItems();
    items.clear();

    final ComboBox<Integer> totalSizeComboBox = getTotalSizeComboBox();
    final Integer naxValue = totalSizeComboBox.getSelectionModel().getSelectedItem();

    for (final Integer value : PATCH_SIZE_VARIANTS) {
        if (value >= naxValue) break;
        items.add(value);
    }

    if (items.contains(current)) {
        selectionModel.select(current);
    } else {
        selectionModel.select(items.get(items.size() - 1));
    }
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:28,代码来源:CreateTerrainDialog.java

示例3: setBarColor

import javafx.collections.ObservableList; //导入方法依赖的package包/类
private void setBarColor() {
    ObservableList<String> styleClass = bar.getStyleClass();
    String sucessColor = "green-bar";
    String failureColor = "red-bar";
    if (error) {
        if (styleClass.contains(sucessColor)) {
            styleClass.remove(sucessColor);
        }
        styleClass.add(failureColor);
    } else {
        if (styleClass.contains(failureColor)) {
            styleClass.remove(failureColor);
        }
        styleClass.add(sucessColor);
    }
}
 
开发者ID:jalian-systems,项目名称:marathonv5,代码行数:17,代码来源:ProgressIndicatorBar.java

示例4: load

import javafx.collections.ObservableList; //导入方法依赖的package包/类
@Override
public void load() {
    final ObservableList<String> devices =
            FXCollections.observableArrayList(imageCaptureService.listDevices());
    comboBox.setItems(devices);
    final String selected = prefs.get(DEVICE_KEY, "");
    final ObservableList<String> items = comboBox.getItems();
    if (!items.contains(selected)) {
        items.add(noDevice);
        comboBox.getSelectionModel().select(noDevice);
    }
    else {
        comboBox.getSelectionModel().select(selected);
    }
}
 
开发者ID:mbari-media-management,项目名称:vars-annotation,代码行数:16,代码来源:SettingsPaneImpl.java

示例5: onDeleteVariableClicked

import javafx.collections.ObservableList; //导入方法依赖的package包/类
private void onDeleteVariableClicked(ActionEvent actionEvent) {
    TableView<FreeVariable> tableView = view.getFreeVariableTableView();
    List<FreeVariable> newList = new LinkedList<>();
    ObservableList<Integer> sm = tableView.getSelectionModel().getSelectedIndices();
    for (int i = 0; i < tableView.getItems().size(); i++) {
        if (!sm.contains(i)) {
            newList.add(tableView.getItems().get(i));
        }
    }
    tableView.getItems().setAll(newList);

    // naive implementation does not work, if two rows are equals (in name, type and constraint)
    //tableView.getItems().removeAll(tableView.getSelectionModel().getSelectedItems());
    tableView.getSelectionModel().clearSelection();
}
 
开发者ID:VerifAPS,项目名称:stvs,代码行数:16,代码来源:VariableCollectionController.java

示例6: hideCanvas

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Move the canvas component to hide layer.
 */
@FXThread
public void hideCanvas() {

    final ObservableList<Node> children = hideLayer.getChildren();
    if (children.contains(canvas)) return;

    children.add(canvas);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:12,代码来源:EditorFXScene.java

示例7: refresh

import javafx.collections.ObservableList; //导入方法依赖的package包/类
/**
 * Refresh the layers list.
 */
@FXThread
public void refresh() {

    final ListView<TextureLayer> listView = getListView();
    final MultipleSelectionModel<TextureLayer> selectionModel = listView.getSelectionModel();
    final TextureLayer selectedItem = selectionModel.getSelectedItem();

    final ObservableList<TextureLayer> items = listView.getItems();
    items.clear();

    final int maxLevels = getMaxLevels() - 1;

    for (int i = 0; i < maxLevels; i++) {

        final float scale = getTextureScale(i);
        if (scale == -1F) continue;

        items.add(new TextureLayer(this, i));
    }

    if (items.contains(selectedItem)) {
        selectionModel.select(selectedItem);
    } else if (!items.isEmpty()) {
        selectionModel.select(items.get(0));
    }

    final ExecutorManager executorManager = ExecutorManager.getInstance();
    executorManager.addFXTask(this::refreshHeight);
    executorManager.addFXTask(this::refreshAddButton);
}
 
开发者ID:JavaSaBr,项目名称:jmonkeybuilder,代码行数:34,代码来源:TextureLayerSettings.java

示例8: addToErrors

import javafx.collections.ObservableList; //导入方法依赖的package包/类
private static void addToErrors(final Component component, final Message message) {
    if(!ENABLED) return;

    final ObservableList<Message> list = getErrors(component);

    if (list.contains(message)) return;

    list.add(message);
    errors.add(message);
}
 
开发者ID:ulriknyman,项目名称:H-Uppaal,代码行数:11,代码来源:CodeAnalysis.java


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