List of usage examples for javafx.collections ObservableList add
boolean add(E e);
From source file:ninja.eivind.hotsreplayuploader.window.nodes.BattleLobbyNode.java
public void setFile(File file) { teamOneList.getItems().clear();/*from w w w . ja va2s . co m*/ teamTwoList.getItems().clear(); Replay replay = parser.apply(file); List<Player> players = replay.getReplayDetails().getPlayers(); for (int i = 0; i < players.size(); i++) { final Player player = players.get(i); final String playerName = getPlayerName(player); final ObservableList<String> items; if (i < 5) { items = teamOneList.getItems(); } else { items = teamTwoList.getItems(); } items.add(playerName); } link.setOnMouseClicked(event -> { final String url = MATCH_PREVIEW_URL.replace("{{data}}", base64EncodeBattleLobby(replay)); platformService.browse(url); }); }
From source file:Main.java
public void search(String oldVal, String newVal) { if (oldVal != null && (newVal.length() < oldVal.length())) { list.setItems(entries);/*from w w w .j av a2 s . com*/ } String value = newVal.toUpperCase(); ObservableList<String> subentries = FXCollections.observableArrayList(); for (Object entry : list.getItems()) { boolean match = true; String entryText = (String) entry; if (!entryText.toUpperCase().contains(value)) { match = false; break; } if (match) { subentries.add(entryText); } } list.setItems(subentries); }
From source file:SampleTableModel.java
public ObservableList<BarChart.Series> getBarChartData() { if (bcData == null) { bcData = FXCollections.<BarChart.Series>observableArrayList(); for (int row = 0; row < getRowCount(); row++) { ObservableList<BarChart.Data> series = FXCollections.<BarChart.Data>observableArrayList(); for (int column = 0; column < getColumnCount(); column++) { series.add(new BarChart.Data(getColumnName(column), getValueAt(row, column))); }//from ww w .j av a2 s .co m bcData.add(new BarChart.Series(series)); } } return bcData; }
From source file:de.micromata.mgc.javafx.launcher.gui.AbstractConfigDialog.java
protected void addCss() { ObservableList<String> list = getParent().getScene().getStylesheets(); if (list.indexOf(FXCssUtil.CSS) == -1) { list.add(FXCssUtil.CSS); }/*from www . j a v a 2s .c o m*/ list = getScene().getStylesheets(); if (list.indexOf(FXCssUtil.CSS) == -1) { list.add(FXCssUtil.CSS); } }
From source file:org.opendolphin.mvndemo.clientlazy.DemoController.java
@Override public void initialize(URL url, ResourceBundle rb) { //Sending Command and get list with column names in the response. DemoApp.clientDolphin.send(CMD_GETLAZYCOLUMNS, new OnFinishedHandlerAdapter() { @Override/*from w w w . j a v a 2 s . co m*/ public void onFinishedData(List<Map> data) { if (data != null && data.size() == 1) { //Create lazy table with colums from the response createTableLazy(data); } } }); // // when starting, first fill the table with pm ids DemoApp.clientDolphin.send(CMD_LAZYTABLELOAD, new OnFinishedHandlerAdapter() { @Override public void onFinishedData(List<Map> data) { for (Map map : data) { lazyRows.addAll(map.values()); } unused.setValue(lazyRows.size()); } }); // ObservableList<PieChart.Data> pieChartData = FXCollections.observableArrayList(); PieChart.Data usedData = new PieChart.Data("Used", 23); usedData.pieValueProperty().bind(used); pieChartData.add(usedData); PieChart.Data unusedData = new PieChart.Data("unused", 100 - 23); unusedData.pieValueProperty().bind(unused); pieChartData.add(unusedData); pieLazyUse.setData(pieChartData); // used.addListener(new ChangeListener<Number>() { @Override public void changed(ObservableValue<? extends Number> observable, Number oldValue, Number newValue) { pieLabel.setText(String.format("Zeilen: %d / %d ", newValue, lazyRows.size())); } }); // DemoApp.clientDolphin.getClientConnector().setUiThreadHandler(new JavaFXUiThreadHandler()); }
From source file:Main.java
private ObservableList<Map> generateDataInMap() { int max = 10; ObservableList<Map> allData = FXCollections.observableArrayList(); for (int i = 1; i < max; i++) { Map<String, String> dataRow = new HashMap<>(); String value1 = "A" + i; String value2 = "B" + i; dataRow.put(Column1MapKey, value1); dataRow.put(Column2MapKey, value2); allData.add(dataRow); }//from w ww . j a v a2 s .c o m return allData; }
From source file:net.sourceforge.pmd.util.fxdesigner.XPathPanelController.java
public void initialiseVersionChoiceBox(ChoiceBox<String> choiceBox) { this.xpathVersionChoiceBox = choiceBox; ObservableList<String> versionItems = choiceBox.getItems(); versionItems.add(XPathRuleQuery.XPATH_1_0); versionItems.add(XPathRuleQuery.XPATH_1_0_COMPATIBILITY); versionItems.add(XPathRuleQuery.XPATH_2_0); xpathVersionChoiceBox.getSelectionModel().select(XPathRuleQuery.XPATH_2_0); choiceBox.setConverter(DesignerUtil.stringConverter(s -> "XPath " + s, s -> s.substring(6))); }
From source file:jp.toastkid.script.Controller.java
/** * Set stage to this controller and apply style. * @param stage//from w w w . j a v a2 s . c o m */ public void setStage(final Stage stage) { this.stage = stage; final ObservableList<String> stylesheets = this.stage.getScene().getStylesheets(); if (stylesheets != null) { stylesheets.clear(); } stylesheets.addAll(stage.getScene().getStylesheets()); stylesheets.add(getClass().getClassLoader().getResource("keywords.css").toExternalForm()); }
From source file:com.SignalDiagram.FXMLDocumentController.java
private void updateDigitalChart(LineChart.Series<Double, Double> serie, ObservableList<XYChart.Series<Double, Double>> chartData, DigitalSignal signal) { serie = updatePoints(signal.getPoints()); chartData.setAll(chartData);// www. j a va 2 s .c o m chartData.add(serie); }
From source file:Main.java
@Override public void start(Stage stage) { stage.show();/*from w w w .ja va2s .co m*/ scene = new Scene(new Group(), 840, 680); ObservableList<Node> content = ((Group) scene.getRoot()).getChildren(); /// Perspective content.add(perspective()); /// DropShadow content.add(dropShadow()); /// BlendMode content.add(blendMode()); /// Bloom content.add(bloom()); /// BoxBlur content.add(boxBlur()); /// DisplacementMap content.add(displacementMap()); /// InnerShadow content.add(innerShadow()); /// Lighting content.add(lighting()); /// MotionBlur content.add(motionBlur()); /// Reflection content.add(reflection()); /// GaussianBlur content.add(gaussianBlur()); /// DistantLight content.add(distantLight()); stage.setScene(scene); }