Java 类javafx.collections.ObservableList 实例源码

项目:marathonv5    文件:CollatedTreeItem.java   
public CollatedTreeItem() {
    children = FXCollections.observableArrayList();
    filteredChildren = new FilteredList<>(children, new Predicate<TreeItem<T>>() {
        @Override public boolean test(TreeItem<T> t) {
            return filter.test(t.getValue());
        }
    });
    sortedChildren = new SortedList<>(filteredChildren);
    ObservableList<TreeItem<T>> original = super.getChildren();
    sortedChildren.addListener(new ListChangeListener<TreeItem<T>>() {
        @Override public void onChanged(javafx.collections.ListChangeListener.Change<? extends TreeItem<T>> c) {
            while (c.next()) {
                original.removeAll(c.getRemoved());
                original.addAll(c.getFrom(), c.getAddedSubList());
            }
        }
    });
}
项目:dialog-tool    文件:MainWindowController.java   
protected void refreshListView () {

        this.questionList.getItems().clear();

        //create list with all questions
        ObservableList<String> questions = FXCollections.observableArrayList();

        //iterate through all questions
        for (Map.Entry<String,QuestionEntry> entry : this.questionMap.entrySet()) {
            //add question name to list
            questions.add(entry.getKey());
        }

        Collections.sort(questions);

        if (questions.size() <= 0) {
            //hide delete button
            this.deleteButton.setVisible(false);
        } else {
            //show delete button
            this.deleteButton.setVisible(true);
        }

        this.questionList.setItems(questions);
    }
项目:voogasalad-ltub    文件:SpriteCreationScreen.java   
private ComponentSelectorPane instantiateSelector() {
    List<Class<? extends Component>> basicComponents = new ArrayList<>();
    ObservableList<Class<? extends Component>> observableComponents = FXCollections.observableList(basicComponents);
    observableComponents.add(Cost.class);
    observableComponents.add(Attacker.class);
    observableComponents.add(Collidable.class);
    observableComponents.add(Health.class);
    observableComponents.add(Images.class);
    observableComponents.add(Owner.class);
    observableComponents.add(PathFollower.class);
    observableComponents.add(Range.class);
    observableComponents.add(RangeShootingAI.class);
    observableComponents.add(Selectable.class);
    observableComponents.add(SoundEffect.class);
    observableComponents.add(Speed.class);
    observableComponents.add(SkillSet.class);
    observableComponents.add(TowerDefenceTypeInformation.class);
    observableComponents.add(Upgrade.class);

    return new ComponentSelectorPane(myResources.getString("addComponents"), observableComponents, infoPane);
}
项目:CNU_TermProject_SoftwareEngineering    文件:SalesStatusController.java   
public ObservableList<TableRowDataModel> convertPaymentArrayListToObservableList(ArrayList Payments) {
    ObservableList<TableRowDataModel> tempList = FXCollections.observableArrayList();
    for (Object dateAndPrice : Payments) {
        String oldstring = (String) ((Pair) dateAndPrice).getKey();
        try {
            Date old = new SimpleDateFormat("yyyy-MM-dd").parse(oldstring);
            String newstring = new SimpleDateFormat("yyyy년MM월dd일").format(old);

        SimpleStringProperty date = new SimpleStringProperty(newstring);
        int price = (int) ((Pair) dateAndPrice).getValue();
        tempList.add(new TableRowDataModel(date, new SimpleStringProperty(price + "원")));
        } catch (ParseException e) {
            e.printStackTrace();
        }
    }
    return tempList;
}
项目:keyboard-light-composer    文件:LayerBaseTreeCell.java   
private void droppedOnTreeItem(DragEvent event,
        TreeItem<LayerBaseContainer<? extends LayerBase>> currentlyDraggedLayerTreeItem,
        LayerBaseContainer<? extends LayerBase> targetItem) {
    LayerBase targetLayer = targetItem.getLayerBase();

    double y = event.getY();
    double height = getHeight();
    boolean above = y < height / 2;

    TreeItem<LayerBaseContainer<? extends LayerBase>> targetParent = this.getTreeItem().getParent();
    ObservableList<TreeItem<LayerBaseContainer<? extends LayerBase>>> targetParentChildren = targetParent
            .getChildren();

    TreeItem<LayerBaseContainer<? extends LayerBase>> draggedItem = currentlyDraggedLayerTreeItem;
    TreeItem<LayerBaseContainer<? extends LayerBase>> draggedParent = draggedItem.getParent();
    ObservableList<TreeItem<LayerBaseContainer<? extends LayerBase>>> draggedParentChildren = draggedParent != null
            ? draggedParent.getChildren() : null;

    if (targetLayer instanceof EffectGroupLayer && (y >= height / 4 && y < height * 3 / 4)) {
        // inside group
        ObservableList<TreeItem<LayerBaseContainer<? extends LayerBase>>> groupChildren = getTreeItem()
                .getChildren();
        if (!groupChildren.equals(draggedParentChildren)) {
            if (draggedParentChildren != null) {
                draggedParentChildren.remove(draggedItem);
            }
            DelayedExecuter.execute(100, () -> groupChildren.add(0, draggedItem));
        }
    } else {
        if (draggedParentChildren != null) {
            ListItemUtil.swapItemsJavaFxThread(draggedParentChildren, targetParentChildren, draggedItem, this.getTreeItem(),
                    above);
        } else {
            ListItemUtil.insertItem(targetParentChildren, draggedItem, this.getTreeItem(), above);
        }
    }
}
项目:jmonkeybuilder    文件:VirtualResourceTree.java   
/**
 * Fill the tree item.
 *
 * @param item the tree item.
 */
@FXThread
private void fill(@NotNull final TreeItem<VirtualResourceElement<?>> item) {

    final VirtualResourceElement<?> element = item.getValue();
    if(!element.hasChildren()) {
        return;
    }

    final ObservableList<TreeItem<VirtualResourceElement<?>>> items = item.getChildren();

    final Array<VirtualResourceElement<?>> children = element.getChildren();
    children.sort(NAME_COMPARATOR);
    children.forEach(child -> items.add(new TreeItem<>(child)));

    items.forEach(this::fill);
}
项目:Coconut-IDE    文件:CustomTreeItem.java   
@SneakyThrows(IOException.class)
private ObservableList<TreeItem<Path>> buildChildren() {
    if (Files.isDirectory(getValue())) {
        return Files.list(getValue())
                .map(e -> {
                    WatcherStructure watcherStructure = null;
                    if (Files.isDirectory(e)) {
                        watcherStructure = new WatcherStructure(e, project, tabUpdater, treeUpdater);
                    }

                    CustomTreeItem item = new CustomTreeItem(e, watcherStructure, project, tabUpdater, treeUpdater);

                    CustomIcons customIcons = new CustomIcons();
                    item.setGraphic(new ImageView(item.isDirectory() ? customIcons.getFolderCollapseImage() : customIcons.getFileImage()));
                    if (isDirectory()) {
                        item.expandedProperty().addListener(treeUpdater.expanderListener());
                    }

                    return item;
                })
                .collect(Collectors.toCollection(FXCollections::observableArrayList));
    }

    return FXCollections.emptyObservableList();
}
项目:jmonkeybuilder    文件:SpatialTreeNode.java   
@Override
@FXThread
public void fillContextMenu(@NotNull final NodeTree<?> nodeTree,
                            @NotNull final ObservableList<MenuItem> items) {
    if (!(nodeTree instanceof ModelNodeTree)) return;

    final T element = getElement();
    final AssetLinkNode linkNode = findParent(element, AssetLinkNode.class::isInstance);

    if (linkNode == null) {
        final Menu createMenu = createCreationMenu(nodeTree);
        if (createMenu != null) items.add(createMenu);
        final Menu toolMenu = createToolMenu(nodeTree);
        if (toolMenu != null) items.add(toolMenu);
    }

    if (linkNode == null || element == linkNode) {
        items.add(new AddUserDataAction(nodeTree, this));
    }

    if (canRemove()) {
        items.add(new RemoveNodeAction(nodeTree, this));
    }

    super.fillContextMenu(nodeTree, items);
}
项目:Java-oscilloscope-project    文件:ZoomManager.java   
static <X, Y> ObservableList<XYChart.Data<X, Y>> deepCopySeriesData(
        final Collection<? extends XYChart.Data<X, Y>> data) {
    final ObservableList<XYChart.Data<X, Y>> result = FXCollections.observableArrayList();
    for (final Data<X, Y> i : data) {
        result.add(new Data<>(i.getXValue(), i.getYValue()));
    }
    return result;
}
项目:marathonv5    文件:ModalDialog.java   
private ObservableList<Node> getChildren(Node node) {
    if (node instanceof ButtonBar) {
        return ((ButtonBar) node).getButtons();
    }
    if (node instanceof ToolBar) {
        return ((ToolBar) node).getItems();
    }
    if (node instanceof Pane) {
        return ((Pane) node).getChildren();
    }
    if (node instanceof TabPane) {
        ObservableList<Node> contents = FXCollections.observableArrayList();
        ObservableList<Tab> tabs = ((TabPane) node).getTabs();
        for (Tab tab : tabs) {
            contents.add(tab.getContent());
        }
        return contents;
    }
    return FXCollections.observableArrayList();
}
项目:voogasalad-ltub    文件:PathSetter.java   
public PathSetter(ObservableList<Path> paths, String variableName){
    super(Path.class,variableName);
    this.myPaths=paths;     

    pathChoices= new ComboBox<>(myPaths);

    pathChoices.setCellFactory(new Callback<ListView<Path>, ListCell<Path>>(){
        @Override
        public ListCell<Path> call(ListView<Path> list){
            return new PathCell();
        }
    });
    pathChoices.setButtonCell(new PathButtonCell());

    this.getChildren().add(pathChoices);

}
项目:MythRedisClient    文件:SetAction.java   
/**
 * 装载面板数据.
 *
 * @param key 数据库中的键
 */
@Override
public void setValue(String key) {
    ObservableList<TableEntity> values = FXCollections.observableArrayList();
    Set<String> sets = redisSet.getMembersSet(key);
    int i = 0;
    for (String set : sets) {
        TableEntity value = new TableEntity("" + i, key, set);
        values.add(value);
        i++;
    }
    this.dataTable.setItems(values);
    this.rowColumn.setCellValueFactory(cellData -> cellData.getValue().rowProperty());
    this.keyColumn.setCellValueFactory(cellData -> cellData.getValue().keyProperty());
    this.valueColumn.setCellValueFactory(cellData -> cellData.getValue().valueProperty());
}
项目:ABC-List    文件:SqlProviderTest.java   
@Test
public void testFindAllTermsWithTitle() {
    LoggerFacade.getDefault().own(SqlProviderTest.class, "testFindAllTermsWithTitle()"); // NOI18N

    // ---------------------------------------------------------------------
    try { Thread.sleep(15); } catch (InterruptedException e) { }

    Term term1 = ModelProvider.getDefault().getTerm("Term1");
    SqlProvider.getDefault().createTerm(term1);

    ObservableList<Term> terms = FXCollections.observableArrayList();
    terms.addAll(SqlProvider.getDefault().findAllTermsWithTitle("hello?"));
    assertTrue(terms.isEmpty());

    terms.clear();
    terms.addAll(SqlProvider.getDefault().findAllTermsWithTitle("Term1"));
    assertFalse(terms.isEmpty());
    assertTrue(terms.size() == 1);
    assertEquals("Term1", terms.get(0).getTitle());

    // ---------------------------------------------------------------------
    DatabaseFacade.getDefault()
            .getCrudService("testFindAllTerms()")
            .delete(Term.class, term1.getId());
}
项目:marathonv5    文件:JavaFXTargetLocator.java   
private Stage[] getValidWindows() {
    ObservableList<Stage> stages = StageHelper.getStages();
    List<Stage> valid = new ArrayList<Stage>();
    for (Stage window : stages) {
        if (window.isShowing()) {
            valid.add(window);
        }
    }
    return valid.toArray(new Stage[valid.size()]);
}
项目:marathonv5    文件:ChildSelector.java   
protected List<IJavaFXElement> found(List<IJavaFXElement> pElements, IJavaFXAgent driver) {
    List<IJavaFXElement> r = new ArrayList<IJavaFXElement>();
    for (IJavaFXElement je : pElements) {
        if (!(je.getComponent() instanceof Parent)) {
            continue;
        }
        JFXWindow topContainer = driver.switchTo().getTopContainer();
        ObservableList<Node> components = ((Parent) je.getComponent()).getChildrenUnmodifiable();
        for (Node c : components) {
            IJavaFXElement je2 = JavaFXElementFactory.createElement(c, driver, driver.switchTo().getTopContainer());
            List<IJavaFXElement> matched = child.matchesSelector(je2);
            for (IJavaFXElement javaElement : matched) {
                IJavaFXElement e = topContainer.addElement(javaElement);
                if (!r.contains(e)) {
                    r.add(e);
                }
            }
        }
    }
    return r;
}
项目:marathonv5    文件:AreaChartSample.java   
public AreaChartSample() {
    NumberAxis xAxis = new NumberAxis("X Values", 1.0d, 9.0d, 2.0d);
    xAxis.setTickLength(12.0f);
    NumberAxis yAxis = new NumberAxis("Y Values", 0.0d, 10.0d, 2.0d);
    ObservableList<AreaChart.Series> areaChartData = FXCollections.observableArrayList(
            new AreaChart.Series("Series 1",FXCollections.observableArrayList(
                new AreaChart.Data(0,4),
                new AreaChart.Data(2,5),
                new AreaChart.Data(4,4),
                new AreaChart.Data(6,2),
                new AreaChart.Data(8,6),
                new AreaChart.Data(10,8)
            )),
            new AreaChart.Series("Series 2", FXCollections.observableArrayList(
                new AreaChart.Data(0,8),
                new AreaChart.Data(2,2),
                new AreaChart.Data(4,9),
                new AreaChart.Data(6,7),
                new AreaChart.Data(8,5),
                new AreaChart.Data(10,7)
            )),
            new AreaChart.Series("Series 3", FXCollections.observableArrayList(
                new AreaChart.Data(0,2),
                new AreaChart.Data(2,5),
                new AreaChart.Data(4,8),
                new AreaChart.Data(6,6),
                new AreaChart.Data(8,9),
                new AreaChart.Data(10,7)
            ))
    );
    AreaChart chart = new AreaChart(xAxis, yAxis, areaChartData);
    getChildren().add(chart);
}
项目:stvs    文件:TimingDiagramView.java   
/**
 * Instantiates a new Timing diagram view.
 *
 * @param xaxis the x axis
 * @param yaxis the y axis
 */
public TimingDiagramView(NumberAxis xaxis, Axis<A> yaxis) {
  super(xaxis, yaxis);
  this.xaxis = xaxis;
  this.yaxis = yaxis;

  setPrefHeight(80);

  getPlotChildren().addAll(cycleSelectionPane, durationLinesPane, dataPane);
  ViewUtils.setupView(this);

  ObservableList<Series<Number, A>> seriesObservableList = FXCollections.observableArrayList();
  setData(seriesObservableList);
  seriesObservableList.addListener((InvalidationListener) change -> {
    Platform.runLater(TimingDiagramView.this::requestRelayout);
  });
}
项目:attics    文件:UIController.java   
public void initialize() {
    // populate year list
    List<Year> years = Database.getInstance().getYearsWithCollection(collection);

    ObservableList<Year> yearList = FXCollections.observableArrayList();
    yearList.addAll(years);

    // add the set to the list view
    yearsListView.setItems(yearList);
    yearsListView.setCellFactory(param -> new YearListViewCell());

    initializeListeners();

}
项目:Example.EMA.Java.SpeedGuide    文件:SpeedGuideViewController.java   
public void updateStatus(String status, StatusIndicator indicator, String item)
  {
// This will avoid a InvalidState Exception to ensure we are within the JavaFX thread
    Platform.runLater(new Runnable()
{
    @Override
    public void run()
    {
        if ( !item.isEmpty() )
            ric.setText(item);

        ObservableList<Node> nodes = statusText.getChildren();

        Text time = new Text();
        time.setId("status-time");      // Defined in CSS
        time.setText(new SimpleDateFormat("HH.mm.ss: ").format(new java.util.Date()));

        Text txt = new Text();
        txt.setText(status + SpeedGuide.NEWLINE);

        switch (indicator)
        {
            case REQUEST:
                txt.setId("status-request");            // Defined in CSS
                break;
            case RESPONSE_SUCCESS:
                txt.setId("status-response-success");   // Defined in CSS
                break;
            case RESPONSE_ERROR:
                txt.setId("status-response-error");     // Defined in CSS
                break;
        }

        nodes.add(0, txt);
        nodes.add(0, time);
    }
});
  }
项目:GazePlay    文件:Utils.java   
/**
 * @return CSS files found in the styles folder
 */
public static void addStylesheets(ObservableList<String> styleSheets) {

    File F = new File(getStylesFolder());

    if (F.exists()) {

        File[] Tfiles = F.listFiles();
        for (int i = 0; i < Tfiles.length; i++) {

            if (Tfiles[i].toString().endsWith(".css"))
                styleSheets.add("file://" + Tfiles[i].toString());
        }
    }
}
项目:desktop-gmail-client    文件:ZoomInMailView.java   
public void goBack(){
    final WebHistory history = webEngine.getHistory();
    ObservableList<WebHistory.Entry> entryList = history.getEntries();
    int currentIndex = history.getCurrentIndex();
    Platform.runLater(new Runnable() {
        @Override
        public void run() {
            try {
                history.go(-1);
            }catch(Exception e){
                webEngine.loadContent(body);
            }
        }
    });
}
项目:OneClient    文件:MiscUtil.java   
public static <T> Collector<T, ?, ObservableList<T>> toObservableList() {
    return Collector.of(
        FXCollections::observableArrayList,
        ObservableList::add,
        (l1, l2) -> {
            l1.addAll(l2);
            return l1;
        });
}
项目:vars-annotation    文件:DeleteSelectedAnnotationsBC.java   
private void apply() {
    ObservableList<Annotation> annotations = toolBox.getData().getSelectedAnnotations();
    final int count = annotations.size();
    ResourceBundle i18n = toolBox.getI18nBundle();
    String content = i18n.getString("buttons.delete.dialog.content1") + " " +
            count + " " + i18n.getString("buttons.delete.dialog.content2");
    alert.setContentText(content);
    Optional<ButtonType> buttonType = alert.showAndWait();
    if (buttonType.get() == ButtonType.OK) {
        toolBox.getEventBus()
                .send(new DeleteAnnotationsCmd(annotations));
    }
}
项目:ShowMilhaoPOOJava    文件:ControllerLayoutRanking.java   
@FXML
private void limparRanking(ActionEvent e) {     

    jogadorDao.limparRanking();

    tblClmPosicao.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, Integer>("linhaTable"));        
    tblClmNome.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, String>("nomeTable"));
    tblClmPontuacao.setCellValueFactory(new PropertyValueFactory<ModelJogadorTable, Integer>("pontuacaoTable"));       

    ObservableList<ModelJogadorTable> jogadorTable = FXCollections.observableArrayList(mostrarRankingView());
    tblRanking.setItems(jogadorTable);
}
项目:can4eve    文件:ClockControl.java   
private static void calcNoOfNodes(Node node) {
    if (node instanceof Parent) {
        if (((Parent) node).getChildrenUnmodifiable().size() != 0) {
            ObservableList<Node> tempChildren = ((Parent) node).getChildrenUnmodifiable();
            noOfNodes += tempChildren.size();
            tempChildren.forEach(n -> calcNoOfNodes(n));
        }
    }
}
项目:gatepass    文件:StudentsReports.java   
private void initFilter() {
    txtsearch = TextFields.createSearchField();
    txtsearch.setStyle("-fx-background-radius:10;");
    txtsearch.setPromptText("Search The Records");
    txtsearch.setMinWidth(200);
    txtsearch.textProperty().addListener(new InvalidationListener() {
           @Override
    public void invalidated(Observable o) {
           if(txtsearch.textProperty().get().isEmpty()) {
               tableView.setItems(att);
               return;
           }
           ObservableList<Reports> tableItems = FXCollections.observableArrayList();
           ObservableList<TableColumn<Reports, ?>> cols = tableView.getColumns();
           for(int i=0; i<att.size(); i++) {

               for(int j=0; j<cols.size(); j++) {
                   TableColumn<Reports, ?> col = cols.get(j);
                   String cellValue = col.getCellData(att.get(i)).toString();
                   cellValue = cellValue.toLowerCase();
                   if(cellValue.contains(txtsearch.textProperty().get().toLowerCase())) {
                       tableItems.add(att.get(i));
                       break;
                   }                        
               }
           }
           tableView.setItems(tableItems);
       }
});
}
项目:sbc-qsystem    文件:BrowserFX.java   
public String goForward() {
    final WebHistory history = webEngine.getHistory();
    ObservableList<WebHistory.Entry> entryList = history.getEntries();
    int currentIndex = history.getCurrentIndex();
    //    Out("currentIndex = "+currentIndex);
    //    Out(entryList.toString().replace("],","]\n"));
    Platform.runLater(() -> {
        history.go(1);
    });
    return entryList
        .get(currentIndex < entryList.size() - 1 ? currentIndex + 1 : currentIndex)
        .getUrl();
}
项目:WebPLP    文件:WatcherWindow.java   
private ComboBox<String> createDisplayOptionsDropdown()
{
    ObservableList<String> options = FXCollections.observableArrayList();
    options.addAll(valueDisplayOptions.keySet());

    ComboBox<String> dropdown = new ComboBox<>(options);
    dropdown.getSelectionModel().select(0);
    return dropdown;
}
项目:Dr-Assistant    文件:PatientGetway.java   
public ObservableList<Patient> patients(Paginate paginate) {
    DBConnection connection = new DBConnection();
    Connection con = null;
    PreparedStatement pst = null;
    ResultSet rs = null;
    ObservableList<Patient> listData = FXCollections.observableArrayList();
    con = connection.geConnection();
    try {
        pst = con.prepareStatement("select * from patient limit " + paginate.getStart() + "," + paginate.getEnd());
        rs = pst.executeQuery();
        while (rs.next()) {
            listData.add(new Patient(
                    rs.getInt(1),
                    rs.getString(2),
                    rs.getString(3),
                    LocalDate.parse(rs.getString(4)),
                    rs.getInt(5),
                    rs.getString(6),
                    rs.getString(7),
                    rs.getString(8),
                    rs.getString(9),
                    totalPrescriptionByPatient(rs.getInt(1))
            ));
        }
        rs.close();
        pst.close();
        con.close();
        connection.con.close();
    } catch (SQLException ex) {
        Logger.getLogger(PatientGetway.class.getName()).log(Level.SEVERE, null, ex);
    }
    return listData;
}
项目:infxnity    文件:IFXContentBindingTest.java   
@Test
public void addElementsTest()
{
    final ObservableList<Model> collection1 = FXCollections.observableArrayList(new Model("value1"),
                                                                                new Model("value2"),
                                                                                new Model("value3"),
                                                                                new Model("value4"));
    final ObservableList<String> collection2 = FXCollections.observableArrayList();

    IFXContentBinding.bind(collection2, collection1, Model::getText);

    final AtomicReference<ListChangeListener.Change<? extends String>> change = new AtomicReference<>(null);
    collection2.addListener((ListChangeListener<String>) c -> {
        change.set(c);
    });

    collection1.addAll(2, Arrays.asList(new Model("value2bis"), new Model("value2ter")));

    assertNotNull("Change event", change.get());
    assertTrue("Has change", change.get().next());
    assertTrue("Was added", change.get().wasAdded());
    assertFalse("Was removed", change.get().wasRemoved());
    assertFalse("Was update", change.get().wasUpdated());
    assertFalse("Was permuted", change.get().wasPermutated());
    assertEquals("from", 2, change.get().getFrom());
    assertEquals("to", 4, change.get().getTo());
    assertEquals("Added sub-list", Arrays.asList("value2bis", "value2ter"), change.get().getAddedSubList());
    assertFalse("Has more change", change.get().next());

    assertEquals(Arrays.asList("value1", "value2", "value2bis", "value2ter", "value3", "value4"), collection2);
}
项目:TechnicalAnalysisTool    文件:OnBalanceVolume.java   
/**
 * Do OBV Calculation when input is a ObservableList
 * @param orgData 
 */
public void doCalculation(ObservableList<OHLC> orgData){
    //Convert list to array
    Object[] rawData;
    rawData = (Object[])orgData.toArray();
    calculateObv(rawData);
}
项目:Squid    文件:ExpressionBuilderController.java   
private void populateNumberListViews() {
    // constants and numbers ===============================================
    List<String> constantStrings = new ArrayList<>();
    constantStrings.add(numberString + operationFlagDelimeter + "placeholder for custom number");
    for (Map.Entry<String, ExpressionTreeInterface> constant : squidProject.getTask().getNamedConstantsMap().entrySet()) {
        constantStrings.add(constant.getKey() + operationFlagDelimeter + ((ConstantNode) constant.getValue()).getValue());
    }

    ObservableList<String> items = FXCollections.observableArrayList(constantStrings);
    constantsListView.setItems(items);
}
项目:Planchester    文件:MusicianTableHelper.java   
public static ObservableList<KeyValuePair> getSectionTypeList() {
    ObservableList<KeyValuePair> list = FXCollections.observableArrayList(
            new KeyValuePair("Brass", SectionType.BRASS),
            new KeyValuePair("Doublebass", SectionType.DOUBLEBASS),
            new KeyValuePair("Percussion", SectionType.PERCUSSION),
            new KeyValuePair("Viola", SectionType.VIOLA),
            new KeyValuePair("Violin 1", SectionType.VIOLIN1),
            new KeyValuePair("Violin 2", SectionType.VIOLIN2),
            new KeyValuePair("Violincello", SectionType.VIOLINCELLO),
            new KeyValuePair("Woodwind", SectionType.WOODWIND));

    return list;
}
项目:Java-9-Programming-Blueprints    文件:FXMLController.java   
@FXML
public void deleteSelectedFiles(ActionEvent event) {
    final ObservableList<FileInfo> selectedFiles = matchingFilesListView.getSelectionModel().getSelectedItems();
    if (selectedFiles.size() > 0) {
        showConfirmationDialog("Are you sure you want to delete the selected files",
                () -> selectedFiles.forEach(f -> {
                    if (Desktop.getDesktop().moveToTrash(new File(f.getPath()))) {
                        matchingFilesListView.getItems().remove(f);
                        dupes.get(dupeFileGroupListView.getSelectionModel().getSelectedItem())
                                .remove(f);
                    }
                }));
    }
}
项目:jmonkeybuilder    文件:AnimationControlTreeNode.java   
@Override
@FXThread
public void fillContextMenu(@NotNull final NodeTree<?> nodeTree,
                            @NotNull final ObservableList<MenuItem> items) {
    items.add(new PlaySettingsAction(nodeTree, this));
    super.fillContextMenu(nodeTree, items);
}
项目:marathonv5    文件:TabDockingContainer.java   
private void populateMenuItems(ContextMenu contextMenu, Tab tab) {
    int tabCount = getTabs().size();
    int tabIndex = getTabs().indexOf(tab);
    ObservableList<MenuItem> items = contextMenu.getItems();
    items.clear();
    MenuItem closeMenuItem = new MenuItem("Close");
    closeMenuItem.setOnAction((e) -> requestClose(tab));
    items.add(closeMenuItem);
    if (tabCount > 1) {
        MenuItem closeRestMenuItem = new MenuItem("Close Others");
        closeRestMenuItem.setOnAction((e) -> closeOtherTabs(tab));
        items.add(closeRestMenuItem);
    }
    if (tabCount > 1 && tabIndex != 0) {
        MenuItem closeLeftTabsMenuItem = new MenuItem("Close Tabs to the Left");
        closeLeftTabsMenuItem.setOnAction((e) -> closeTabsToLeft(tab));
        items.add(closeLeftTabsMenuItem);
    }
    if (tabCount > 1 && tabIndex != tabCount - 1) {
        MenuItem closeRigthTabsMenuItem = new MenuItem("Close Tabs to the Right");
        closeRigthTabsMenuItem.setOnAction((e) -> closeTabsToRight(tab));
        items.add(closeRigthTabsMenuItem);
    }
    if (tabCount > 1) {
        MenuItem closeAllMenuItem = new MenuItem("Close All");
        closeAllMenuItem.setOnAction((e) -> closeAllTabs());
        items.addAll(new SeparatorMenuItem(), closeAllMenuItem);
    }
}
项目:GameAuthoringEnvironment    文件:TypeFactory.java   
public ObservableList<ProfileDisplay> getEffectTypes (ResourceBundle typeFile) {
    List<ProfileDisplay> list = Collections.list(typeFile.getKeys())
            .stream()
            .map(s -> new ProfileDisplay(s))
            .collect(Collectors.toList());
    return FXCollections.observableArrayList(list);
}
项目:passepartout    文件:ServiceControl.java   
public ServiceControl(ServerControl serverControl, ServiceModel service) {
    FXMLLoader fxmlLoader = new FXMLLoader(getClass().getResource("fxml/service.fxml"));
    fxmlLoader.setRoot(this);
    fxmlLoader.setController(this);

    try {
        fxmlLoader.load();
    } catch (IOException exception) {
        throw new RuntimeException(exception);
    }

    this.serverControl = serverControl;
    this.service = service;

    final ConfigurationModel configuration = App.getConfiguration();

    final String actionName = service.getActionName();
    action = configuration.getActionByName(actionName);

    this.setText(action.getDescription());

    final ObservableList<Node> formEntriesControls = formEntriesContainer.getChildren();

    formEntryControls = buildUserParamsControls();
    formEntriesControls.addAll(formEntryControls);

    if (formEntriesControls.isEmpty()) {
        formEntriesContainer.getChildren().add(0, new Label("Nothing to configure for this service."));
    }
}
项目:ABC-List    文件:TermSqlService.java   
ObservableList<Term> findAllTerms() {
    final ObservableList<Term> allTerms = FXCollections.observableArrayList();
    final List<Term> terms = DatabaseFacade.getDefault().getCrudService()
            .findByNamedQuery(Term.class, NAMED_QUERY__NAME__FIND_ALL);

    allTerms.addAll(terms);
    Collections.sort(allTerms);

    return allTerms;
}