functional/ControlsTests/src/javafx/scene/control/test/ListView/NewListViewApp.java

Print this page




 101         private ListView testedControl;
 102         private ContentMotion cm;
 103         private int textFieldsCounter = 0;
 104 
 105         public ListViewScene() {
 106             super("ListView", 800, 600);
 107             someValues.addAll("Data item A", "Data item B", "Data item C");
 108             prepareScene();
 109         }
 110 
 111         @Override
 112         final protected void prepareScene() {
 113             testedControl = getNewTestedControl();
 114             tb = new PropertiesTable(testedControl);
 115             cm = new ContentMotion();
 116 
 117             final ListView testedListView = (ListView) testedControl;
 118             PropertyTablesFactory.explorePropertiesList(testedListView, tb);
 119             SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
 120 
 121             final TextField tf = TextFieldBuilder.create().id(LIST_VIEW_CONTROL_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();


 122 
 123             HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction<Node>() {
 124                 @Override
 125                 public void execute(Node node) {
 126                     testedControl.getItems().add(Integer.parseInt(tf.getText()), node);
 127                 }
 128             }, tf);
 129 
 130             HBox resetButtons = new HBox();
 131             Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();

 132             hardResetButton.setOnAction(new EventHandler<ActionEvent>() {
 133                 public void handle(ActionEvent t) {
 134                     HBox hb = (HBox) getRoot();
 135                     hb.getChildren().clear();
 136                     prepareMainSceneStructure();
 137                     prepareScene();
 138                 }
 139             });
 140 
 141             Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build();

 142             softResetButton.setOnAction(new EventHandler<ActionEvent>() {
 143                 public void handle(ActionEvent t) {
 144                     softReset();
 145                 }
 146             });
 147             resetButtons.getChildren().addAll(hardResetButton, softResetButton);
 148 
 149             Button flushLogger = new Button("Flush logger");
 150             final CustomMultipleSelectionModel cmsm = new CustomMultipleSelectionModel(testedListView.getItems());
 151             flushLogger.setOnAction(new EventHandler<ActionEvent>() {
 152                 public void handle(ActionEvent t) {
 153                     StaticLogger.log(cmsm.getLog());
 154                 }
 155             });
 156 
 157             Button changeSelectionModel = ButtonBuilder.create().text("Change selection model to custom").id(CHANGE_SELECTION_MODEL_BUTTON_ID).build();

 158             changeSelectionModel.setOnAction(new EventHandler<ActionEvent>() {
 159                 public void handle(ActionEvent t) {
 160                     testedListView.setSelectionModel(cmsm);
 161                 }
 162             });
 163 
 164             setTestedControl(testedControl);
 165 
 166             VBox vb = new VBox();
 167             vb.setSpacing(5);
 168             vb.getChildren().addAll(resetButtons, getAddTextFieldHbox(), getAddRectangleHbox(),
 169                     getAddFormHbox(),
 170                     getAddItemHBox(), getRemoveItemHBox(), getStartMotionHBox(),
 171                     getScrollToHBox(), getDecreaseScaleHBox(), getIncreaseScaleHBox(),
 172                     changeSelectionModel, flushLogger, nodeshb, getEditFactoryComboBoxChoser());
 173             setControllersContent(vb);
 174 
 175             tb.setStyle("-fx-border-color : yellow;");
 176             setPropertiesContent(tb);
 177         }
 178 
 179         private ListView getNewTestedControl() {
 180             ListView lv = new ListView();
 181             lv.setId(TESTED_LIST_VIEW_ID);
 182             return lv;
 183             //return ListViewBuilder.create().id(TESTED_LIST_VIEW_ID).build();
 184         }
 185 
 186         private void softReset() {
 187             tb.refresh();
 188             ListView newOne = new ListView();
 189 
 190             while (testedControl.getItems().size() != 0) {
 191                 testedControl.getItems().remove(0);
 192             }
 193             testedControl.setPrefHeight(newOne.getPrefHeight());
 194             testedControl.setPrefWidth(newOne.getPrefWidth());
 195             testedControl.setOrientation(newOne.getOrientation());
 196             testedControl.setEditable(newOne.isEditable());
 197             testedControl.getSelectionModel().setSelectionMode(newOne.getSelectionModel().getSelectionMode());
 198         }
 199 
 200         private ComboBox getEditFactoryComboBoxChoser() {
 201             ComboBox<CellsApp.CellType> cb = new ComboBox<CellsApp.CellType>();
 202             cb.getItems().addAll(FXCollections.observableArrayList(CellsApp.CellType.values()));
 203             cb.setId(LIST_FACTORY_CHOICE_ID);


 208                         case ChoiceBox:
 209                             testedControl.setCellFactory(ChoiceBoxListCell.forListView(new CellCustomStringConverter(), someValues));
 210                             break;
 211                         case ComboBox:
 212                             testedControl.setCellFactory(ComboBoxListCell.forListView(new CellCustomStringConverter(), someValues));
 213                             break;
 214                         case TextField:
 215                             testedControl.setCellFactory(TextFieldListCell.forListView(new CellCustomStringConverter()));
 216                             break;
 217                         default:
 218                             testedControl.setCellFactory(new ListView().getCellFactory());
 219                     }
 220                 }
 221             });
 222             return cb;
 223         }
 224 
 225         private HBox getAddItemHBox() {
 226             HBox hb = new HBox();
 227             Label lb = new Label("Add item");
 228             final TextField tf = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_TEXT_FIELD_ID).build();


 229 
 230             Label atLb = new Label("at pos");
 231             final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_POSITION_TEXT_FIELD_ID).build();


 232 
 233             Button bt = ButtonBuilder.create().text("Add!").id(ADD_ITEM_BUTTON_ID).build();

 234             bt.setOnAction(new EventHandler() {
 235                 public void handle(Event t) {
 236                     ((ListView) testedControl).getItems().add(Integer.parseInt(tfPos.getText()), tf.getText());
 237                 }
 238             });
 239             hb.getChildren().addAll(lb, tf, atLb, tfPos, bt);
 240             return hb;
 241         }
 242 
 243         private HBox getRemoveItemHBox() {
 244             HBox hb = new HBox();
 245             Label lb = new Label("From position");
 246             final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
 247             Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();



 248             bt.setOnAction(new EventHandler() {
 249                 public void handle(Event t) {
 250                     int index = Integer.parseInt(tf.getText());
 251                     ((ListView) testedControl).getItems().remove(index);
 252                 }
 253             });
 254             hb.getChildren().addAll(lb, tf, bt);
 255             return hb;
 256         }
 257 
 258         private HBox getScrollToHBox() {
 259             HBox hb = new HBox();
 260             Button button = ButtonBuilder.create().text("ScrollTo").id(SCROLL_TO_BUTTON_ID).build();
 261             final TextField tf = TextFieldBuilder.create().text("0").id(SCROLL_TO_TEXT_FIELD_ID).build();


 262 
 263             button.setOnAction(new EventHandler<ActionEvent>() {
 264                 public void handle(ActionEvent t) {
 265                     ((ListView) testedControl).scrollTo(Integer.parseInt(tf.getText()));
 266                 }
 267             });
 268 
 269             hb.getChildren().addAll(button, tf);
 270             return hb;
 271         }
 272 
 273         private HBox getAddRectangleHbox() {
 274             HBox hb = new HBox();
 275             Label lb = new Label("Add rectangle at pos");
 276             final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_RECTANGLE_TEXT_FIELD_ID).build();
 277             Button bt = ButtonBuilder.create().text("Add!").id(ADD_RECTANGLE_BUTTON_ID).build();



 278             bt.setOnAction(new EventHandler() {
 279                 public void handle(Event t) {
 280                     int index = Integer.parseInt(tfPos.getText());
 281                     ((ListView) testedControl).getItems().add(index, new Group(getNewRectangle()));
 282                 }
 283             });
 284             hb.getChildren().addAll(lb, tfPos, bt);
 285             return hb;
 286         }
 287 
 288         private HBox getAddFormHbox() {
 289             HBox hb = new HBox();
 290             Label lb = new Label("Add form at pos");
 291             final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_FORM_TEXT_FIELD_ID).build();
 292             Button bt = ButtonBuilder.create().text("Add!").id(ADD_FORM_BUTTON_ID).build();



 293             bt.setOnAction(new EventHandler() {
 294                 public void handle(Event t) {
 295                     int index = Integer.parseInt(tfPos.getText());
 296                     ((ListView) testedControl).getItems().add(index, new Group(getNewForm()));
 297                 }
 298             });
 299             hb.getChildren().addAll(lb, tfPos, bt);
 300             return hb;
 301         }
 302 
 303         private HBox getAddTextFieldHbox() {
 304             HBox hb = new HBox();
 305             Label lb = new Label("Add textField at pos");
 306             final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_TEXT_FIELD_TEXT_FIELD_ID).build();
 307             Button bt = ButtonBuilder.create().text("Add!").id(ADD_TEXT_FIELD_BUTTON_ID).build();



 308             bt.setOnAction(new EventHandler() {
 309                 public void handle(Event t) {
 310                     int index = Integer.parseInt(tfPos.getText());
 311                     ((ListView) testedControl).getItems().add(index, new Group(getNewTextField()));
 312                 }
 313             });
 314             hb.getChildren().addAll(lb, tfPos, bt);
 315             return hb;
 316         }
 317 
 318         private HBox getStartMotionHBox() {
 319             HBox hb = new HBox();
 320             Button startMotion = ButtonBuilder.create().text("start motion").id(START_MOTION_BUTTON_ID).build();

 321             Label label = new Label(" of element at position ");
 322             final TextField tf = TextFieldBuilder.create().text("0").id(START_MOTION_TEXT_FIELD_ID).build();

 323             startMotion.setOnAction(new EventHandler() {
 324                 public void handle(Event t) {
 325                     cm.applyTransition((Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText())));
 326                     cm.getTimeline().play();
 327                 }
 328             });
 329             hb.getChildren().addAll(startMotion, label, tf);
 330             return hb;
 331         }
 332 
 333         private HBox getIncreaseScaleHBox() {
 334             HBox hb = new HBox();
 335             final TextField tf = TextFieldBuilder.create().text("0").id(INCREASE_SCALE_TEXT_FIELD_ID).build();

 336             Label label = new Label(" of node on position ");
 337             Button increaseScaleButton = ButtonBuilder.create().id(INCREASE_SCALE_BUTTON_ID).text("Increase scale").build();

 338             increaseScaleButton.setOnAction(new EventHandler<ActionEvent>() {
 339                 public void handle(ActionEvent t) {
 340                     Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
 341                     content.setScaleX(content.getScaleX() + 0.15);
 342                     content.setScaleY(content.getScaleY() + 0.15);
 343                 }
 344             });
 345             hb.getChildren().addAll(increaseScaleButton, label, tf);
 346             return hb;
 347         }
 348 
 349         private HBox getDecreaseScaleHBox() {
 350             HBox hb = new HBox();
 351             final TextField tf = TextFieldBuilder.create().text("0").id(DECREASE_SCALE_TEXT_FIELD_ID).build();

 352             Label label = new Label(" of node on position ");
 353             Button increaseScaleButton = ButtonBuilder.create().id(DECREASE_SCALE_BUTTON_ID).text("Decrease scale").build();

 354             increaseScaleButton.setOnAction(new EventHandler<ActionEvent>() {
 355                 public void handle(ActionEvent t) {
 356                     Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
 357                     content.setScaleX(content.getScaleX() - 0.15);
 358                     content.setScaleY(content.getScaleY() - 0.15);
 359                 }
 360             });
 361             hb.getChildren().addAll(increaseScaleButton, label, tf);
 362             return hb;
 363         }
 364 
 365         private Group getNewRectangle() {
 366             return createCustomContent(200, 200);
 367         }
 368 
 369         private VBox getNewForm() {
 370             return createFormComponent();
 371         }
 372 
 373         private TextField getNewTextField() {
 374             return TextFieldBuilder.create().id("CONTENT_TEXT_FIELD_" + (textFieldsCounter++) + "_ID").build();


 375         }
 376     }
 377 }


 101         private ListView testedControl;
 102         private ContentMotion cm;
 103         private int textFieldsCounter = 0;
 104 
 105         public ListViewScene() {
 106             super("ListView", 800, 600);
 107             someValues.addAll("Data item A", "Data item B", "Data item C");
 108             prepareScene();
 109         }
 110 
 111         @Override
 112         final protected void prepareScene() {
 113             testedControl = getNewTestedControl();
 114             tb = new PropertiesTable(testedControl);
 115             cm = new ContentMotion();
 116 
 117             final ListView testedListView = (ListView) testedControl;
 118             PropertyTablesFactory.explorePropertiesList(testedListView, tb);
 119             SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
 120 
 121             final TextField tf = new TextField("0");
 122             tf.setId(LIST_VIEW_CONTROL_ADD_INDEX_TEXT_FIELD_ID);
 123             tf.setPrefWidth(40);
 124 
 125             HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction<Node>() {
 126                 @Override
 127                 public void execute(Node node) {
 128                     testedControl.getItems().add(Integer.parseInt(tf.getText()), node);
 129                 }
 130             }, tf);
 131 
 132             HBox resetButtons = new HBox();
 133             Button hardResetButton = new Button("Hard reset");
 134             hardResetButton.setId(HARD_RESET_BUTTON_ID);
 135             hardResetButton.setOnAction(new EventHandler<ActionEvent>() {
 136                 public void handle(ActionEvent t) {
 137                     HBox hb = (HBox) getRoot();
 138                     hb.getChildren().clear();
 139                     prepareMainSceneStructure();
 140                     prepareScene();
 141                 }
 142             });
 143 
 144             Button softResetButton = new Button("Soft reset");
 145             softResetButton.setId(SOFT_RESET_BUTTON_ID);
 146             softResetButton.setOnAction(new EventHandler<ActionEvent>() {
 147                 public void handle(ActionEvent t) {
 148                     softReset();
 149                 }
 150             });
 151             resetButtons.getChildren().addAll(hardResetButton, softResetButton);
 152 
 153             Button flushLogger = new Button("Flush logger");
 154             final CustomMultipleSelectionModel cmsm = new CustomMultipleSelectionModel(testedListView.getItems());
 155             flushLogger.setOnAction(new EventHandler<ActionEvent>() {
 156                 public void handle(ActionEvent t) {
 157                     StaticLogger.log(cmsm.getLog());
 158                 }
 159             });
 160 
 161             Button changeSelectionModel = new Button("Change selection model to custom");
 162             changeSelectionModel.setId(CHANGE_SELECTION_MODEL_BUTTON_ID);
 163             changeSelectionModel.setOnAction(new EventHandler<ActionEvent>() {
 164                 public void handle(ActionEvent t) {
 165                     testedListView.setSelectionModel(cmsm);
 166                 }
 167             });
 168 
 169             setTestedControl(testedControl);
 170 
 171             VBox vb = new VBox();
 172             vb.setSpacing(5);
 173             vb.getChildren().addAll(resetButtons, getAddTextFieldHbox(), getAddRectangleHbox(),
 174                     getAddFormHbox(),
 175                     getAddItemHBox(), getRemoveItemHBox(), getStartMotionHBox(),
 176                     getScrollToHBox(), getDecreaseScaleHBox(), getIncreaseScaleHBox(),
 177                     changeSelectionModel, flushLogger, nodeshb, getEditFactoryComboBoxChoser());
 178             setControllersContent(vb);
 179 
 180             tb.setStyle("-fx-border-color : yellow;");
 181             setPropertiesContent(tb);
 182         }
 183 
 184         private ListView getNewTestedControl() {
 185             ListView lv = new ListView();
 186             lv.setId(TESTED_LIST_VIEW_ID);
 187             return lv;

 188         }
 189 
 190         private void softReset() {
 191             tb.refresh();
 192             ListView newOne = new ListView();
 193 
 194             while (testedControl.getItems().size() != 0) {
 195                 testedControl.getItems().remove(0);
 196             }
 197             testedControl.setPrefHeight(newOne.getPrefHeight());
 198             testedControl.setPrefWidth(newOne.getPrefWidth());
 199             testedControl.setOrientation(newOne.getOrientation());
 200             testedControl.setEditable(newOne.isEditable());
 201             testedControl.getSelectionModel().setSelectionMode(newOne.getSelectionModel().getSelectionMode());
 202         }
 203 
 204         private ComboBox getEditFactoryComboBoxChoser() {
 205             ComboBox<CellsApp.CellType> cb = new ComboBox<CellsApp.CellType>();
 206             cb.getItems().addAll(FXCollections.observableArrayList(CellsApp.CellType.values()));
 207             cb.setId(LIST_FACTORY_CHOICE_ID);


 212                         case ChoiceBox:
 213                             testedControl.setCellFactory(ChoiceBoxListCell.forListView(new CellCustomStringConverter(), someValues));
 214                             break;
 215                         case ComboBox:
 216                             testedControl.setCellFactory(ComboBoxListCell.forListView(new CellCustomStringConverter(), someValues));
 217                             break;
 218                         case TextField:
 219                             testedControl.setCellFactory(TextFieldListCell.forListView(new CellCustomStringConverter()));
 220                             break;
 221                         default:
 222                             testedControl.setCellFactory(new ListView().getCellFactory());
 223                     }
 224                 }
 225             });
 226             return cb;
 227         }
 228 
 229         private HBox getAddItemHBox() {
 230             HBox hb = new HBox();
 231             Label lb = new Label("Add item");
 232             final TextField tf = new TextField();
 233             tf.setPrefWidth(50);
 234             tf.setId(ADD_ITEM_TEXT_FIELD_ID);
 235 
 236             Label atLb = new Label("at pos");
 237             final TextField tfPos = new TextField();
 238             tfPos.setPrefWidth(50);
 239             tfPos.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);
 240 
 241             Button bt = new Button("Add!");
 242             bt.setId(ADD_ITEM_BUTTON_ID);
 243             bt.setOnAction(new EventHandler() {
 244                 public void handle(Event t) {
 245                     ((ListView) testedControl).getItems().add(Integer.parseInt(tfPos.getText()), tf.getText());
 246                 }
 247             });
 248             hb.getChildren().addAll(lb, tf, atLb, tfPos, bt);
 249             return hb;
 250         }
 251 
 252         private HBox getRemoveItemHBox() {
 253             HBox hb = new HBox();
 254             Label lb = new Label("From position");
 255             final TextField tf = new TextField("0");
 256             tf.setPrefWidth(50);
 257             tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
 258             Button bt = new Button("Remove!");
 259             bt.setId(REMOVE_BUTTON_ID);
 260             bt.setOnAction(new EventHandler() {
 261                 public void handle(Event t) {
 262                     int index = Integer.parseInt(tf.getText());
 263                     ((ListView) testedControl).getItems().remove(index);
 264                 }
 265             });
 266             hb.getChildren().addAll(lb, tf, bt);
 267             return hb;
 268         }
 269 
 270         private HBox getScrollToHBox() {
 271             HBox hb = new HBox();
 272             Button button = new Button("ScrollTo");
 273             button.setId(SCROLL_TO_BUTTON_ID);
 274             final TextField tf = new TextField("0");
 275             tf.setId(SCROLL_TO_TEXT_FIELD_ID);
 276 
 277             button.setOnAction(new EventHandler<ActionEvent>() {
 278                 public void handle(ActionEvent t) {
 279                     ((ListView) testedControl).scrollTo(Integer.parseInt(tf.getText()));
 280                 }
 281             });
 282 
 283             hb.getChildren().addAll(button, tf);
 284             return hb;
 285         }
 286 
 287         private HBox getAddRectangleHbox() {
 288             HBox hb = new HBox();
 289             Label lb = new Label("Add rectangle at pos");
 290             final TextField tfPos = new TextField();
 291             tfPos.setPrefWidth(50);
 292             tfPos.setId(ADD_RECTANGLE_TEXT_FIELD_ID);
 293             Button bt = new Button("Add!");
 294             bt.setId(ADD_RECTANGLE_BUTTON_ID);
 295             bt.setOnAction(new EventHandler() {
 296                 public void handle(Event t) {
 297                     int index = Integer.parseInt(tfPos.getText());
 298                     ((ListView) testedControl).getItems().add(index, new Group(getNewRectangle()));
 299                 }
 300             });
 301             hb.getChildren().addAll(lb, tfPos, bt);
 302             return hb;
 303         }
 304 
 305         private HBox getAddFormHbox() {
 306             HBox hb = new HBox();
 307             Label lb = new Label("Add form at pos");
 308             final TextField tfPos = new TextField();
 309             tfPos.setPrefWidth(50);
 310             tfPos.setId(ADD_FORM_TEXT_FIELD_ID);
 311             Button bt = new Button("Add!");
 312             bt.setId(ADD_FORM_BUTTON_ID);
 313             bt.setOnAction(new EventHandler() {
 314                 public void handle(Event t) {
 315                     int index = Integer.parseInt(tfPos.getText());
 316                     ((ListView) testedControl).getItems().add(index, new Group(getNewForm()));
 317                 }
 318             });
 319             hb.getChildren().addAll(lb, tfPos, bt);
 320             return hb;
 321         }
 322 
 323         private HBox getAddTextFieldHbox() {
 324             HBox hb = new HBox();
 325             Label lb = new Label("Add textField at pos");
 326             final TextField tfPos = new TextField();
 327             tfPos.setPrefWidth(50);
 328             tfPos.setId(ADD_TEXT_FIELD_TEXT_FIELD_ID);
 329             Button bt = new Button("Add!");
 330             bt.setId(ADD_TEXT_FIELD_BUTTON_ID);
 331             bt.setOnAction(new EventHandler() {
 332                 public void handle(Event t) {
 333                     int index = Integer.parseInt(tfPos.getText());
 334                     ((ListView) testedControl).getItems().add(index, new Group(getNewTextField()));
 335                 }
 336             });
 337             hb.getChildren().addAll(lb, tfPos, bt);
 338             return hb;
 339         }
 340 
 341         private HBox getStartMotionHBox() {
 342             HBox hb = new HBox();
 343             Button startMotion = new Button("start motion");
 344             startMotion.setId(START_MOTION_BUTTON_ID);
 345             Label label = new Label(" of element at position ");
 346             final TextField tf = new TextField("0");
 347             tf.setId(START_MOTION_TEXT_FIELD_ID);
 348             startMotion.setOnAction(new EventHandler() {
 349                 public void handle(Event t) {
 350                     cm.applyTransition((Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText())));
 351                     cm.getTimeline().play();
 352                 }
 353             });
 354             hb.getChildren().addAll(startMotion, label, tf);
 355             return hb;
 356         }
 357 
 358         private HBox getIncreaseScaleHBox() {
 359             HBox hb = new HBox();
 360             final TextField tf = new TextField("0");
 361             tf.setId(INCREASE_SCALE_TEXT_FIELD_ID);
 362             Label label = new Label(" of node on position ");
 363             Button increaseScaleButton = new Button("Increase scale");
 364             increaseScaleButton.setId(INCREASE_SCALE_BUTTON_ID);
 365             increaseScaleButton.setOnAction(new EventHandler<ActionEvent>() {
 366                 public void handle(ActionEvent t) {
 367                     Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
 368                     content.setScaleX(content.getScaleX() + 0.15);
 369                     content.setScaleY(content.getScaleY() + 0.15);
 370                 }
 371             });
 372             hb.getChildren().addAll(increaseScaleButton, label, tf);
 373             return hb;
 374         }
 375 
 376         private HBox getDecreaseScaleHBox() {
 377             HBox hb = new HBox();
 378             final TextField tf = new TextField("0");
 379             tf.setId(DECREASE_SCALE_TEXT_FIELD_ID);
 380             Label label = new Label(" of node on position ");
 381             Button increaseScaleButton = new Button("Decrease scale");
 382             increaseScaleButton.setId(DECREASE_SCALE_BUTTON_ID);
 383             increaseScaleButton.setOnAction(new EventHandler<ActionEvent>() {
 384                 public void handle(ActionEvent t) {
 385                     Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
 386                     content.setScaleX(content.getScaleX() - 0.15);
 387                     content.setScaleY(content.getScaleY() - 0.15);
 388                 }
 389             });
 390             hb.getChildren().addAll(increaseScaleButton, label, tf);
 391             return hb;
 392         }
 393 
 394         private Group getNewRectangle() {
 395             return createCustomContent(200, 200);
 396         }
 397 
 398         private VBox getNewForm() {
 399             return createFormComponent();
 400         }
 401 
 402         private TextField getNewTextField() {
 403             TextField tf = new TextField();
 404             tf.setId("CONTENT_TEXT_FIELD_" + (textFieldsCounter++) + "_ID");
 405             return tf;
 406         }
 407     }
 408 }