functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewLineChartApp.java

Print this page

        

*** 96,116 **** axis1 = new NumberAxis(0, 100, 10); axis2 = new NumberAxis(0, 100, 10); testedLineChart = getNewChart(); testedLineChart.setId(TESTED_CHART_ID); ! Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build(); hardResetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { HBox hb = (HBox) getRoot(); hb.getChildren().clear(); prepareMainSceneStructure(); prepareScene(); } }); ! Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build(); softResetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { //throw new UnsupportedOperationException("Not supported yet."); } }); --- 96,118 ---- axis1 = new NumberAxis(0, 100, 10); axis2 = new NumberAxis(0, 100, 10); testedLineChart = getNewChart(); testedLineChart.setId(TESTED_CHART_ID); ! Button hardResetButton = new Button("Hard reset"); ! hardResetButton.setId(HARD_RESET_BUTTON_ID); hardResetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { HBox hb = (HBox) getRoot(); hb.getChildren().clear(); prepareMainSceneStructure(); prepareScene(); } }); ! Button softResetButton = new Button("Soft reset"); ! softResetButton.setId(SOFT_RESET_BUTTON_ID); softResetButton.setOnAction(new EventHandler<ActionEvent>() { public void handle(ActionEvent t) { //throw new UnsupportedOperationException("Not supported yet."); } });
*** 131,149 **** public HBox getAddPointToDataDialog() { HBox hb = new HBox(); Label lb1 = new Label("To area"); ! final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).id(ADD_LINE_POS_TEXT_FIELD_ID).build(); Label lb2 = new Label("to index"); ! final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).id(ADD_INDEX_TEXT_FIELD_ID).build(); Label lb3 = new Label("value"); ! final TextField tf3 = TextFieldBuilder.create().text("0").prefWidth(50).id(ADD_VALUE_TEXT_FIELD_ID).build(); ! Button bt = ButtonBuilder.create().text("add point!").id(REMOVE_BUTTON_ID).build(); bt.setOnAction(new EventHandler() { public void handle(Event t) { int area = Integer.parseInt(tf1.getText()); int point = Integer.parseInt(tf2.getText()); double value = Double.parseDouble(tf3.getText()); --- 133,158 ---- public HBox getAddPointToDataDialog() { HBox hb = new HBox(); Label lb1 = new Label("To area"); ! final TextField tf1 = new TextField("0"); ! tf1.setPrefWidth(50); ! tf1.setId(ADD_LINE_POS_TEXT_FIELD_ID); Label lb2 = new Label("to index"); ! final TextField tf2 = new TextField("0"); ! tf2.setPrefWidth(50); ! tf2.setId(ADD_INDEX_TEXT_FIELD_ID); Label lb3 = new Label("value"); ! final TextField tf3 = new TextField("0"); ! tf3.setPrefWidth(50); ! tf3.setId(ADD_VALUE_TEXT_FIELD_ID); ! Button bt = new Button("add point!"); ! bt.setId(REMOVE_BUTTON_ID); bt.setOnAction(new EventHandler() { public void handle(Event t) { int area = Integer.parseInt(tf1.getText()); int point = Integer.parseInt(tf2.getText()); double value = Double.parseDouble(tf3.getText());
*** 161,176 **** public HBox getRemovePointFromDataDialog() { HBox hb = new HBox(); Label lb1 = new Label("From area"); ! final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_LINE_FROM_POS_TEXT_FIELD_ID).build(); Label lb2 = new Label("From index"); ! final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_INDEX_TEXT_FIELD_ID).build(); ! Button bt = ButtonBuilder.create().text("remove point!").id(REMOVE_BUTTON_ID).build(); bt.setOnAction(new EventHandler() { public void handle(Event t) { int area = Integer.parseInt(tf1.getText()); int point = Integer.parseInt(tf2.getText()); ((XYChart.Series) testedLineChart.getData().get(area)).getData().remove(point); --- 170,190 ---- public HBox getRemovePointFromDataDialog() { HBox hb = new HBox(); Label lb1 = new Label("From area"); ! final TextField tf1 = new TextField("0"); ! tf1.setPrefWidth(50); ! tf1.setId(REMOVE_LINE_FROM_POS_TEXT_FIELD_ID); Label lb2 = new Label("From index"); ! final TextField tf2 = new TextField("0"); ! tf2.setPrefWidth(50); ! tf2.setId(REMOVE_INDEX_TEXT_FIELD_ID); ! Button bt = new Button("remove point!"); ! bt.setId(REMOVE_BUTTON_ID); bt.setOnAction(new EventHandler() { public void handle(Event t) { int area = Integer.parseInt(tf1.getText()); int point = Integer.parseInt(tf2.getText()); ((XYChart.Series) testedLineChart.getData().get(area)).getData().remove(point);
*** 181,192 **** } public HBox getRemoveDataDialog() { HBox hb = new HBox(); Label lb = new Label("From index"); ! final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build(); ! Button bt = ButtonBuilder.create().text("remove line!").id(REMOVE_BUTTON_ID).build(); bt.setOnAction(new EventHandler() { public void handle(Event t) { int index = Integer.parseInt(tf.getText()); testedLineChart.getData().remove(index); } --- 195,209 ---- } public HBox getRemoveDataDialog() { HBox hb = new HBox(); Label lb = new Label("From index"); ! final TextField tf = new TextField("0"); ! tf.setPrefWidth(50); ! tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID); ! Button bt = new Button("remove line!"); ! bt.setId(REMOVE_BUTTON_ID); bt.setOnAction(new EventHandler() { public void handle(Event t) { int index = Integer.parseInt(tf.getText()); testedLineChart.getData().remove(index); }
*** 196,217 **** } public HBox getAddLineHBox() { HBox hb = new HBox(); Label lb = new Label("Add series named "); ! final TextField tf = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_NAME_TEXTFIELD_ID).build(); Label minLabel = new Label(" minX "); ! final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build(); Label maxLabel = new Label(" maxX "); ! final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build(); Label amountLabel = new Label(" with "); ! final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build(); ! Button bt = ButtonBuilder.create().text(" points add!").id(ADD_SERIES_COMMAND_BUTTON_ID).build(); bt.setOnAction(new EventHandler() { public void handle(Event t) { String serieName = tf.getText(); double min = Double.parseDouble(minText.getText()); double max = Double.parseDouble(maxText.getText()); --- 213,243 ---- } public HBox getAddLineHBox() { HBox hb = new HBox(); Label lb = new Label("Add series named "); ! final TextField tf = new TextField(); ! tf.setPrefWidth(50); ! tf.setId(ADDED_SERIES_NAME_TEXTFIELD_ID); Label minLabel = new Label(" minX "); ! final TextField minText = new TextField(); ! minText.setPrefWidth(50); ! minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID); Label maxLabel = new Label(" maxX "); ! final TextField maxText = new TextField(); ! maxText.setPrefWidth(50); ! maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID); Label amountLabel = new Label(" with "); ! final TextField amountText = new TextField(); ! amountText.setPrefWidth(50); ! amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID); ! Button bt = new Button(" points add!"); ! bt.setId(ADD_SERIES_COMMAND_BUTTON_ID); bt.setOnAction(new EventHandler() { public void handle(Event t) { String serieName = tf.getText(); double min = Double.parseDouble(minText.getText()); double max = Double.parseDouble(maxText.getText());