--- old/./build.xml 2016-12-22 11:26:18.192970779 +0300
+++ new/./build.xml 2016-12-22 11:26:18.132970201 +0300
@@ -1,5 +1,5 @@
-
+
+
+
@@ -63,9 +63,9 @@
-
+
--- old/./detect_javafx.xml 2016-12-22 11:26:18.388972669 +0300
+++ new/./detect_javafx.xml 2016-12-22 11:26:18.332972130 +0300
@@ -9,24 +9,21 @@
-
+
-
-
-
-
-
-
+
+
+
-
+
-
\ No newline at end of file
+
--- old/functional/ControlsTests/build.xml 2016-12-22 11:26:18.580974522 +0300
+++ new/functional/ControlsTests/build.xml 2016-12-22 11:26:18.524973981 +0300
@@ -1,5 +1,5 @@
-
Builds, tests, and runs the project ControlsTests.
-
+
@@ -38,7 +38,7 @@
-
+
@@ -48,7 +48,7 @@
-
+
Must set test.subdir with short name of root dir of tests; eg ListView
@@ -68,7 +68,7 @@
-
+
@@ -76,7 +76,7 @@
-
+
@@ -89,8 +89,8 @@
-
-
+
+
--- old/functional/ControlsTests/coverage.fcov 2016-12-22 11:26:18.764976296 +0300
+++ new/functional/ControlsTests/coverage.fcov 2016-12-22 11:26:18.712975795 +0300
@@ -1,96 +1,96 @@
-javafx.scene.control.ScrollPane.prefViewportWidth.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortWidthOptionTest();FULL
-javafx.scene.control.ColorPicker.value.GET;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
-com.sun.javafx.scene.control.Pagination.currentpageindex.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
-com.sun.javafx.scene.control.Pagination.pageindicatorcount.GET;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
-javafx.scene.control.Button.cancelButton.SET;javafx.scene.control.test.ButtonsTest.cancelButtonTest();FULL
-javafx.scene.control.Button.text.GET;javafx.scene.control.test.ButtonsTest.binding();FULL
-javafx.scene.control.MenuItem.onHidden.GET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-com.sun.javafx.scene.control.Pagination.pageindicatorcount.BIND;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
-javafx.scene.control.Button.defaultButton.BIND;javafx.scene.control.test.ButtonsTest.defaultButtonTest();FULL
-javafx.scene.control.ScrollPane.hmin.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMinOptionTest();FULL
-javafx.scene.control.Button.cancelButton.GET;javafx.scene.control.test.ButtonsTest.cancelButtonTest();FULL
-javafx.scene.control.MenuItem.onHidden.SET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-javafx.scene.control.CheckBox.indeterminate.SET;javafx.scene.control.test.ChecksTest.checks();FULL
-javafx.scene.control.CheckBox.selected.GET;javafx.scene.control.test.tableview.TableViewApp.getControlsContainer(),javafx.scene.control.test.ChecksTest.checks();FULL
-javafx.scene.control.Button.text.SET;javafx.scene.control.test.ButtonsTest.binding();FULL
-javafx.scene.control.Tooltip.activated.GET;javafx.scene.control.test.TooltipTest.enabled();FULL
-javafx.scene.control.ChoiceBox.showing.BIND;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-javafx.scene.control.SingleSelectionModel.selectedItem.BIND;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-javafx.scene.control.ChoiceBox.showing.GET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-com.sun.javafx.scene.control.Pagination.currentpageindex.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
-javafx.scene.control.ColorPicker.value.SET;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
-javafx.scene.control.ColorPicker.value.DEFAULT;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
-javafx.scene.control.CheckBox.indeterminate.GET;javafx.scene.control.test.ChecksTest.checks();FULL
-javafx.scene.control.CheckBox.selected.SET;javafx.scene.control.test.tableview.TableViewApp.getControlsContainer(),javafx.scene.control.test.ChecksTest.checks();FULL
-javafx.scene.control.MenuItem.onHiding.SET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-javafx.scene.control.ScrollPane.vbarPolicy.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
-javafx.scene.control.ScrollPane.fitToWidth.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
-javafx.scene.control.Tooltip.activated.SET;javafx.scene.control.test.TooltipTest.enabled();FULL
-javafx.scene.control.ScrollPane.pannable.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPannableOptionTest();FULL
-com.sun.javafx.scene.control.Pagination.pagecount.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
-javafx.scene.control.CheckMenuItem.selected.SET;javafx.scene.control.test.tableview.TableViewApp.createColumn();FULL
-javafx.scene.control.ScrollPane.vmin.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMinOptionTest();FULL
-javafx.scene.control.SingleSelectionModel.selectedItem.GET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-com.sun.javafx.scene.control.Pagination.currentpageindex.BIND;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
-javafx.scene.control.SingleSelectionModel.selectedItem.SET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-javafx.scene.control.MenuItem.onHiding.GET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-TreeView.onEditStartProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditStartCancel();FULL
-TreeView.onEditCommitProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
-com.sun.javafx.scene.control.Pagination.pagefactory.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
-com.sun.javafx.scene.control.Pagination.pagecount.BIND;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
-javafx.scene.control.ScrollPane.prefViewportWidth.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortWidthOptionTest();FULL
-com.sun.javafx.scene.control.Pagination.pagecount.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
-javafx.scene.control.ScrollPane.prefViewportHeight.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortHeightOptionTest();FULL
-javafx.scene.control.MenuItem.disable.SET;javafx.scene.control.test.MenuItemTest.disableTest();FULL
-TreeView.onEditStartProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
-TreeView.onEditCommitProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditCommit();FULL
-javafx.scene.control.CheckMenuItem.selected.GET;javafx.scene.control.test.tableview.TableViewApp.createColumn();FULL
-javafx.scene.control.ScrollPane.fitToHeight.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
-javafx.scene.control.ScrollPane.hbarPolicy.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
-javafx.scene.control.MenuItem.visible.BIND;javafx.scene.control.test.MenuItemTest.visibleTest();FULL
-javafx.scene.control.ScrollPane.hmax.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMaxOptionTest();FULL
-javafx.scene.control.ScrollPane.vmax.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMaxOptionTest();FULL
-javafx.scene.control.ScrollPane.prefViewportHeight.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortHeightOptionTest();FULL
-javafx.scene.control.ScrollPane.hmin.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMinOptionTest();FULL
-javafx.scene.control.MenuItem.disable.GET;javafx.scene.control.test.MenuItemTest.disableTest();FULL
-javafx.scene.control.MenuItem.onHidden.BIND;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-javafx.scene.control.MenuItem.disable.BIND;javafx.scene.control.test.MenuItemTest.disableTest();FULL
-javafx.scene.control.ScrollPane.viewportBounds.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.boundsTest();FULL
-TreeView.onEditCancelProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
-javafx.scene.control.ScrollPane.pannable.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPannableOptionTest();FULL
-javafx.scene.control.ScrollPane.hbarPolicy.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
-javafx.scene.control.ColorPicker.value.BIND;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
-com.sun.javafx.scene.control.Pagination.pagefactory.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
-javafx.scene.control.ListView.selectionModel.SET;javafx.scene.control.test.ListView.ListViewApp.getTestContainer();FULL
-com.sun.javafx.scene.control.Pagination.currentpageindex.SET;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
-javafx.scene.control.ScrollPane.vbarPolicy.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
-javafx.scene.control.ListView.selectionModel.GET;javafx.scene.control.test.ListView.ListViewApp.getTestContainer();FULL
-javafx.scene.control.MenuItem.visible.SET;javafx.scene.control.test.MenuItemTest.visibleTest();FULL
-javafx.scene.control.ScrollPane.fitToWidth.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
-javafx.scene.control.Button.cancelButton.BIND;javafx.scene.control.test.ButtonsTest.cancelButtonTest();FULL
-javafx.scene.control.CheckBox.selected.DEFAULT;javafx.scene.control.test.ChecksTest.checks();FULL
-javafx.scene.control.ChoiceBox.showing.DEFAULT;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-javafx.scene.control.MenuItem.visible.GET;javafx.scene.control.test.MenuItemTest.visibleTest();FULL
-com.sun.javafx.scene.control.Pagination.currentpageindex.GET;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
-TreeView.onEditCancelProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditStartCancel();FULL
-javafx.scene.control.ChoiceBox.showing.SET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
-com.sun.javafx.scene.control.Pagination.pagecount.GET;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
-javafx.scene.control.Button.defaultButton.GET;javafx.scene.control.test.ButtonsTest.defaultButtonTest();FULL
-javafx.scene.control.MenuItem.onHiding.BIND;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest();FULL
-com.sun.javafx.scene.control.Pagination.pageindicatorcounts.SET;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
-javafx.scene.control.ScrollPane.vmax.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMaxOptionTest();FULL
-com.sun.javafx.scene.control.Pagination.pageindicatorcount.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
-javafx.scene.control.CheckBox.indeterminate.DEFAULT;javafx.scene.control.test.ChecksTest.checks();FULL
-com.sun.javafx.scene.control.Pagination.pagecount.SET;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
-com.sun.javafx.scene.control.Pagination.pagefactory.GET;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
-javafx.scene.control.Button.defaultButton.SET;javafx.scene.control.test.ButtonsTest.defaultButtonTest();FULL
-javafx.scene.control.Button.cancelButton.DEFAULT;javafx.scene.control.test.ButtonsTest.cancelButtonTest();FULL
-javafx.scene.control.Button.defaultButton.DEFAULT;javafx.scene.control.test.ButtonsTest.defaultButtonTest();FULL
-javafx.scene.control.Button.text.BIND;javafx.scene.control.test.ButtonsTest.binding();FULL
-com.sun.javafx.scene.control.Pagination.pageindicatorcount.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
-javafx.scene.control.Button.text.DEFAULT;javafx.scene.control.test.ButtonsTest.binding();FULL
-javafx.scene.control.ScrollPane.hmax.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMaxOptionTest();FULL
-javafx.scene.control.ScrollPane.fitToHeight.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
-javafx.scene.control.ScrollPane.vmin.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMinOptionTest();FULL
-javafx.scene.control.ColorPicker.value.BEHAVIOR;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
-com.sun.javafx.scene.control.Pagination.pagefactory.SET;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
+javafx.scene.control.ScrollPane.prefViewportWidth.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortWidthOptionTest(),javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkMinViewPortWidthSetTest();FULL
+javafx.scene.control.ColorPicker.value.GET;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
+com.sun.javafx.scene.control.Pagination.currentpageindex.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
+com.sun.javafx.scene.control.Pagination.pageindicatorcount.GET;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
+javafx.scene.control.Button.cancelButton.SET;javafx.scene.control.test.ButtonsTest.cancelButtonTest(),javafx.scene.control.test.mix.ButtonsTest.cancelButtonTest();FULL
+javafx.scene.control.Button.text.GET;javafx.scene.control.test.ButtonsTest.binding(),javafx.scene.control.test.mix.ButtonsTest.binding();FULL
+javafx.scene.control.MenuItem.onHidden.GET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+com.sun.javafx.scene.control.Pagination.pageindicatorcount.BIND;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
+javafx.scene.control.Button.defaultButton.BIND;javafx.scene.control.test.ButtonsTest.defaultButtonTest(),javafx.scene.control.test.mix.ButtonsTest.defaultButtonTest();FULL
+javafx.scene.control.ScrollPane.hmin.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMinOptionTest();FULL
+javafx.scene.control.Button.cancelButton.GET;javafx.scene.control.test.ButtonsTest.cancelButtonTest(),javafx.scene.control.test.mix.ButtonsTest.cancelButtonTest();FULL
+javafx.scene.control.MenuItem.onHidden.SET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+javafx.scene.control.CheckBox.indeterminate.SET;javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+javafx.scene.control.CheckBox.selected.GET;javafx.scene.control.test.tableview.TableViewApp.getControlsContainer(),javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+javafx.scene.control.Button.text.SET;javafx.scene.control.test.ButtonsTest.binding(),javafx.scene.control.test.mix.ButtonsTest.binding();FULL
+javafx.scene.control.Tooltip.activated.GET;javafx.scene.control.test.TooltipTest.enabled(),javafx.scene.control.test.mix.TooltipTest.enabled();FULL
+javafx.scene.control.ChoiceBox.showing.BIND;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+javafx.scene.control.SingleSelectionModel.selectedItem.BIND;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+javafx.scene.control.ChoiceBox.showing.GET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+com.sun.javafx.scene.control.Pagination.currentpageindex.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
+javafx.scene.control.ColorPicker.value.SET;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
+javafx.scene.control.ColorPicker.value.DEFAULT;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
+javafx.scene.control.CheckBox.indeterminate.GET;javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+javafx.scene.control.CheckBox.selected.SET;javafx.scene.control.test.tableview.TableViewApp.getControlsContainer(),javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+javafx.scene.control.MenuItem.onHiding.SET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+javafx.scene.control.ScrollPane.vbarPolicy.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
+javafx.scene.control.ScrollPane.fitToWidth.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
+javafx.scene.control.Tooltip.activated.SET;javafx.scene.control.test.TooltipTest.enabled(),javafx.scene.control.test.mix.TooltipTest.enabled();FULL
+javafx.scene.control.ScrollPane.pannable.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPannableOptionTest();FULL
+com.sun.javafx.scene.control.Pagination.pagecount.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
+javafx.scene.control.CheckMenuItem.selected.SET;javafx.scene.control.test.tableview.TableViewApp.createColumn();FULL
+javafx.scene.control.ScrollPane.vmin.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMinOptionTest();FULL
+javafx.scene.control.SingleSelectionModel.selectedItem.GET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+com.sun.javafx.scene.control.Pagination.currentpageindex.BIND;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
+javafx.scene.control.SingleSelectionModel.selectedItem.SET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+javafx.scene.control.MenuItem.onHiding.GET;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+TreeView.onEditStartProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditStartCancel();FULL
+TreeView.onEditCommitProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
+com.sun.javafx.scene.control.Pagination.pagefactory.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
+com.sun.javafx.scene.control.Pagination.pagecount.BIND;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
+javafx.scene.control.ScrollPane.prefViewportWidth.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortWidthOptionTest(),javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkMinViewPortWidthSetTest();FULL
+com.sun.javafx.scene.control.Pagination.pagecount.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
+javafx.scene.control.ScrollPane.prefViewportHeight.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortHeightOptionTest();FULL
+javafx.scene.control.MenuItem.disable.SET;javafx.scene.control.test.MenuItemTest.disableTest(),javafx.scene.control.test.mix.MenuItemTest.disableTest();FULL
+TreeView.onEditStartProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
+TreeView.onEditCommitProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditCommit();FULL
+javafx.scene.control.CheckMenuItem.selected.GET;javafx.scene.control.test.tableview.TableViewApp.createColumn();FULL
+javafx.scene.control.ScrollPane.fitToHeight.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
+javafx.scene.control.ScrollPane.hbarPolicy.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
+javafx.scene.control.MenuItem.visible.BIND;javafx.scene.control.test.MenuItemTest.visibleTest(),javafx.scene.control.test.mix.MenuItemTest.visibleTest();FULL
+javafx.scene.control.ScrollPane.hmax.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMaxOptionTest();FULL
+javafx.scene.control.ScrollPane.vmax.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMaxOptionTest();FULL
+javafx.scene.control.ScrollPane.prefViewportHeight.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPrefViewPortHeightOptionTest();FULL
+javafx.scene.control.ScrollPane.hmin.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMinOptionTest();FULL
+javafx.scene.control.MenuItem.disable.GET;javafx.scene.control.test.MenuItemTest.disableTest(),javafx.scene.control.test.mix.MenuItemTest.disableTest();FULL
+javafx.scene.control.MenuItem.onHidden.BIND;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+javafx.scene.control.MenuItem.disable.BIND;javafx.scene.control.test.MenuItemTest.disableTest(),javafx.scene.control.test.mix.MenuItemTest.disableTest();FULL
+javafx.scene.control.ScrollPane.viewportBounds.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.boundsTest();FULL
+TreeView.onEditCancelProperty.GET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditOnCancelEventSequence();FULL
+javafx.scene.control.ScrollPane.pannable.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkPannableOptionTest();FULL
+javafx.scene.control.ScrollPane.hbarPolicy.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
+javafx.scene.control.ColorPicker.value.BIND;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
+com.sun.javafx.scene.control.Pagination.pagefactory.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
+javafx.scene.control.ListView.selectionModel.SET;javafx.scene.control.test.ListView.ListViewApp.getTestContainer();FULL
+com.sun.javafx.scene.control.Pagination.currentpageindex.SET;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
+javafx.scene.control.ScrollPane.vbarPolicy.GET;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHVBarPolicyOptionTest();FULL
+javafx.scene.control.ListView.selectionModel.GET;javafx.scene.control.test.ListView.ListViewApp.getTestContainer();FULL
+javafx.scene.control.MenuItem.visible.SET;javafx.scene.control.test.MenuItemTest.visibleTest(),javafx.scene.control.test.mix.MenuItemTest.visibleTest();FULL
+javafx.scene.control.ScrollPane.fitToWidth.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
+javafx.scene.control.Button.cancelButton.BIND;javafx.scene.control.test.ButtonsTest.cancelButtonTest(),javafx.scene.control.test.mix.ButtonsTest.cancelButtonTest();FULL
+javafx.scene.control.CheckBox.selected.DEFAULT;javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+javafx.scene.control.ChoiceBox.showing.DEFAULT;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+javafx.scene.control.MenuItem.visible.GET;javafx.scene.control.test.MenuItemTest.visibleTest(),javafx.scene.control.test.mix.MenuItemTest.visibleTest();FULL
+com.sun.javafx.scene.control.Pagination.currentpageindex.GET;javafx.scene.control.test.pagination.PaginationTest.currentPageIndexPropertyTest();FULL
+TreeView.onEditCancelProperty.SET;javafx.scene.control.test.treeview.TreeViewTest.testOnEditStartCancel();FULL
+javafx.scene.control.ChoiceBox.showing.SET;javafx.scene.control.test.choicebox.ChoiceBoxApp.getScene();FULL
+com.sun.javafx.scene.control.Pagination.pagecount.GET;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
+javafx.scene.control.Button.defaultButton.GET;javafx.scene.control.test.ButtonsTest.defaultButtonTest(),javafx.scene.control.test.mix.ButtonsTest.defaultButtonTest();FULL
+javafx.scene.control.MenuItem.onHiding.BIND;javafx.scene.control.test.MenuTest.apiTest(),javafx.scene.control.test.MenuTest.dropTest(),javafx.scene.control.test.mix.MenuTest.apiTest(),javafx.scene.control.test.mix.MenuTest.dropTest();FULL
+com.sun.javafx.scene.control.Pagination.pageindicatorcounts.SET;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
+javafx.scene.control.ScrollPane.vmax.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMaxOptionTest();FULL
+com.sun.javafx.scene.control.Pagination.pageindicatorcount.BEHAVIOR;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
+javafx.scene.control.CheckBox.indeterminate.DEFAULT;javafx.scene.control.test.ChecksTest.checks(),javafx.scene.control.test.mix.ChecksTest.checks();FULL
+com.sun.javafx.scene.control.Pagination.pagecount.SET;javafx.scene.control.test.pagination.PaginationTest.pageCountPropertyTest();FULL
+com.sun.javafx.scene.control.Pagination.pagefactory.GET;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
+javafx.scene.control.Button.defaultButton.SET;javafx.scene.control.test.ButtonsTest.defaultButtonTest(),javafx.scene.control.test.mix.ButtonsTest.defaultButtonTest();FULL
+javafx.scene.control.Button.cancelButton.DEFAULT;javafx.scene.control.test.ButtonsTest.cancelButtonTest(),javafx.scene.control.test.mix.ButtonsTest.cancelButtonTest();FULL
+javafx.scene.control.Button.defaultButton.DEFAULT;javafx.scene.control.test.ButtonsTest.defaultButtonTest(),javafx.scene.control.test.mix.ButtonsTest.defaultButtonTest();FULL
+javafx.scene.control.Button.text.BIND;javafx.scene.control.test.ButtonsTest.binding(),javafx.scene.control.test.mix.ButtonsTest.binding();FULL
+com.sun.javafx.scene.control.Pagination.pageindicatorcount.DEFAULT;javafx.scene.control.test.pagination.PaginationTest.pageIndicatorCountTest();FULL
+javafx.scene.control.Button.text.DEFAULT;javafx.scene.control.test.ButtonsTest.binding(),javafx.scene.control.test.mix.ButtonsTest.binding();FULL
+javafx.scene.control.ScrollPane.hmax.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkHMaxOptionTest();FULL
+javafx.scene.control.ScrollPane.fitToHeight.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkFitToWidthAndHeightOptionTest();FULL
+javafx.scene.control.ScrollPane.vmin.DEFAULT;javafx.scene.control.test.ScrollPane.ScrollPaneTest.checkVMinOptionTest();FULL
+javafx.scene.control.ColorPicker.value.BEHAVIOR;javafx.scene.control.test.colorpicker.ColorPickerTest.colorPropertyTest();FULL
+com.sun.javafx.scene.control.Pagination.pagefactory.SET;javafx.scene.control.test.pagination.PaginationTest.factoryChangingTest();FULL
--- old/functional/ControlsTests/nbproject/project.properties 2016-12-22 11:26:18.960978186 +0300
+++ new/functional/ControlsTests/nbproject/project.properties 2016-12-22 11:26:18.904977646 +0300
@@ -25,7 +25,7 @@
file.reference.JemmyFX.jar=../../tools/Jemmy/JemmyFX/dist/JemmyFX.jar
file.reference.JemmyFXBrowser.jar=../../tools/Jemmy/JemmyFXBrowser/dist/JemmyFXBrowser.jar
file.reference.JemmySWT.jar=../../tools/lib/JemmySWT.jar
-file.reference.jfxswt.jar=${java.home}/lib/jfxswt.jar
+file.reference.jfxswt.jar=${java.home}/lib/javafx-swt.jar
build.test.results.dir=${external.output}/${application.title}/build/test/results
file.reference.junit.jar=../../tools/Jemmy/jemmy_core/junit.jar
file.reference.SharedTestUtilsOpen.jar=../../tools/SharedTestUtilsOpen/dist/SharedTestUtilsOpen.jar
--- old/functional/ControlsTests/src/javafx/commons/ControlChooserApp.java 2016-12-22 11:26:19.148979998 +0300
+++ new/functional/ControlsTests/src/javafx/commons/ControlChooserApp.java 2016-12-22 11:26:19.100979536 +0300
@@ -1,136 +1,132 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.commons;
-
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.factory.ControlsFactory;
-import javafx.factory.NodeFactory;
-import javafx.factory.Panes;
-import javafx.factory.Shapes;
-import javafx.geometry.Pos;
-import javafx.scene.Node;
-import javafx.scene.Parent;
-import javafx.scene.Scene;
-import javafx.scene.control.ChoiceBox;
-import javafx.scene.control.Label;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.PaneBuilder;
-import javafx.scene.layout.VBox;
-import javafx.scene.layout.VBoxBuilder;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- *
- * @author Dmitry Zinkevich
- */
-public class ControlChooserApp extends InteroperabilityApp {
- public static final String NODE_CHOOSER_ID = "nodeChooser";
- public static final String TESTED_CONTROL_ID = "target";
-
- private VBox spaceForNode;
- private PropertiesTable propertiesTable;
- private Pane propertiesPane = PaneBuilder.create()
- .style("-fx-border-color:BLUE")
- .build();
-
- public static void main(String[] args) {
- Utils.launch(javafx.commons.ControlChooserApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Scene scene = new Scene(getContent(), 800, 600);
- Utils.addBrowser(scene);
- return scene;
- }
-
- private Node createNodeChooser() {
- ChoiceBox cb = new ChoiceBox();
- cb.setId(NODE_CHOOSER_ID);
- cb.getItems().addAll(ControlsFactory.filteredValues());
- /*
- * Remove image view and media view
- */
- cb.getItems().removeAll(ControlsFactory.ImageView, ControlsFactory.MediaView);
-
- cb.getItems().addAll(Shapes.values());
- cb.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
-
- @Override
- public void changed(ObservableValue extends NodeFactory> ov, NodeFactory t, NodeFactory t1) {
- final Node node = t1.createNode();
-
- node.setId(TESTED_CONTROL_ID);
- spaceForNode.getChildren().clear();
- spaceForNode.getChildren().add(node);
-
- propertiesTable = new PropertiesTable(node);
- propertiesTable.addBooleanPropertyLine(node.disableProperty());
- propertiesTable.addDoublePropertyLine(node.opacityProperty(), 0, 1, 1);
- propertiesTable.addSimpleListener(node.focusedProperty(), node);
-
- propertiesPane.getChildren().clear();
- propertiesPane.getChildren().add(propertiesTable);
- }
- });
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(new Label("Choose tested control : "), cb);
- return vb;
- }
-
- private Parent getContent() {
- spaceForNode = new VBox(10);
- spaceForNode.setAlignment(Pos.CENTER);
- spaceForNode.setMinWidth(300);
- spaceForNode.setPrefWidth(300);
- spaceForNode.setMaxWidth(300);
- spaceForNode.setMinHeight(300);
- spaceForNode.setPrefHeight(300);
- spaceForNode.setMaxHeight(300);
- spaceForNode.setStyle("-fx-border-color:RED");
-
- VBox controls = new VBox(10);
- controls.setAlignment(Pos.CENTER);
- controls.getChildren().add(createNodeChooser());
- controls.setStyle("-fx-border-color:GREEN");
-
- VBox vBox = VBoxBuilder.create()
- .children(spaceForNode, controls)
- .spacing(10d)
- .build();
-
- HBox hBox = new HBox(10);
- hBox.setAlignment(Pos.TOP_LEFT);
- hBox.getChildren().addAll(
- vBox,
- propertiesPane);
- return hBox;
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.commons;
+
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.factory.ControlsFactory;
+import javafx.factory.NodeFactory;
+import javafx.factory.Panes;
+import javafx.factory.Shapes;
+import javafx.geometry.Pos;
+import javafx.scene.Node;
+import javafx.scene.Parent;
+import javafx.scene.Scene;
+import javafx.scene.control.ChoiceBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ *
+ * @author Dmitry Zinkevich
+ */
+public class ControlChooserApp extends InteroperabilityApp {
+ public static final String NODE_CHOOSER_ID = "nodeChooser";
+ public static final String TESTED_CONTROL_ID = "target";
+
+ private VBox spaceForNode;
+ private PropertiesTable propertiesTable;
+ private Pane propertiesPane;
+
+ public static void main(String[] args) {
+ Utils.launch(javafx.commons.ControlChooserApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Scene scene = new Scene(getContent(), 800, 600);
+ Utils.addBrowser(scene);
+ return scene;
+ }
+
+ private Node createNodeChooser() {
+ ChoiceBox cb = new ChoiceBox();
+ cb.setId(NODE_CHOOSER_ID);
+ cb.getItems().addAll(ControlsFactory.filteredValues());
+ /*
+ * Remove image view and media view
+ */
+ cb.getItems().removeAll(ControlsFactory.ImageView, ControlsFactory.MediaView);
+
+ cb.getItems().addAll(Shapes.values());
+ cb.getSelectionModel().selectedItemProperty().addListener(new ChangeListener() {
+
+ @Override
+ public void changed(ObservableValue extends NodeFactory> ov, NodeFactory t, NodeFactory t1) {
+ final Node node = t1.createNode();
+
+ node.setId(TESTED_CONTROL_ID);
+ spaceForNode.getChildren().clear();
+ spaceForNode.getChildren().add(node);
+
+ propertiesTable = new PropertiesTable(node);
+ propertiesTable.addBooleanPropertyLine(node.disableProperty());
+ propertiesTable.addDoublePropertyLine(node.opacityProperty(), 0, 1, 1);
+ propertiesTable.addSimpleListener(node.focusedProperty(), node);
+
+ propertiesPane.getChildren().clear();
+ propertiesPane.getChildren().add(propertiesTable);
+ }
+ });
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(new Label("Choose tested control : "), cb);
+ return vb;
+ }
+
+ private Parent getContent() {
+ propertiesPane = new Pane();
+ propertiesPane.setStyle("-fx-border-color:BLUE");
+
+ spaceForNode = new VBox(10);
+ spaceForNode.setAlignment(Pos.CENTER);
+ spaceForNode.setMinWidth(300);
+ spaceForNode.setPrefWidth(300);
+ spaceForNode.setMaxWidth(300);
+ spaceForNode.setMinHeight(300);
+ spaceForNode.setPrefHeight(300);
+ spaceForNode.setMaxHeight(300);
+ spaceForNode.setStyle("-fx-border-color:RED");
+
+ VBox controls = new VBox(10);
+ controls.setAlignment(Pos.CENTER);
+ controls.getChildren().add(createNodeChooser());
+ controls.setStyle("-fx-border-color:GREEN");
+
+ VBox vBox = new VBox(spaceForNode, controls);
+ vBox.setSpacing(10d);
+ HBox hBox = new HBox(10);
+ hBox.setAlignment(Pos.TOP_LEFT);
+ hBox.getChildren().addAll(
+ vBox,
+ propertiesPane);
+ return hBox;
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/draganddrop/DragDropWithControls.java 2016-12-22 11:26:19.332981773 +0300
+++ new/functional/ControlsTests/src/javafx/draganddrop/DragDropWithControls.java 2016-12-22 11:26:19.284981310 +0300
@@ -50,14 +50,13 @@
import javafx.scene.Parent;
import javafx.scene.Scene;
import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
import javafx.scene.control.CheckBox;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.Label;
import javafx.scene.control.Separator;
import javafx.scene.control.TextField;
import javafx.scene.image.Image;
-import javafx.scene.image.ImageViewBuilder;
+import javafx.scene.image.ImageView;
import javafx.scene.input.Clipboard;
import javafx.scene.input.ClipboardContent;
import javafx.scene.input.DataFormat;
@@ -293,15 +292,16 @@
createTMSelect(sourceModes));
VBox rbox = new VBox(10);
- rbox.getChildren().addAll(new Text("Data formats:"),
- createFormatSelect(sourceFormats),
- ButtonBuilder.create().text("Put to clipboard")
- .id(ID_TO_CLIPBOARD_BUTTON)
- .onAction(new EventHandler() {
+ Button b = new Button("Put to clipboard");
+ b.setId(ID_TO_CLIPBOARD_BUTTON);
+ b.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
Clipboard.getSystemClipboard().setContent(prepareClipboardContent());
}
- }).build());
+ });
+ rbox.getChildren().addAll(new Text("Data formats:"),
+ createFormatSelect(sourceFormats),
+ b);
HBox hbox = new HBox(10);
hbox.getChildren().addAll(lbox, new Separator(Orientation.VERTICAL), rbox);
@@ -342,10 +342,13 @@
useCustomViewCB = new CheckBox("Use custom drag view.");
VBox box = new VBox(10);
+ ImageView i = new ImageView();
+ i.setImage(CONTENT_IMAGE);
+ i.setId(ID_SRC_IMAGE);
box.getChildren().addAll(hbox, new Separator(), fileHdr,
fileNames, tb, btns,
useCustomViewCB, new Text("Image: "),
- ImageViewBuilder.create().image(CONTENT_IMAGE).id(ID_SRC_IMAGE).build(),
+ i,
log);
if (parameters.size() > 0) {
box.setStyle("-fx-background-color: " + parameters.get(0) + ";");
@@ -370,12 +373,14 @@
createControlCombo(targetControlPane, false), new Text("Target transfer modes:"), createTMSelect(targetModes));
VBox rbox = new VBox(10);
- rbox.getChildren().addAll(new Text("Data formats:"), createFormatSelect(targetFormats),
- ButtonBuilder.create().text("paste from clipboard").id(ID_FROM_CLIPBOARD_BUTTON).onAction(new EventHandler() {
+ Button b = new Button("paste from clipboard");
+ b.setId(ID_FROM_CLIPBOARD_BUTTON);
+ b.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
getDataFromClipboard(Clipboard.getSystemClipboard());
}
- }).build());
+ });
+ rbox.getChildren().addAll(new Text("Data formats:"), createFormatSelect(targetFormats), b);
VBox content = new VBox(10);
content.getChildren().addAll(new Text("Transfered content:"), transferedContentPane);
@@ -400,6 +405,9 @@
public void changed(ObservableValue extends NodeFactory> ov, NodeFactory t, NodeFactory t1) {
Node ctrl = null;
ctrl = t1.createNode();
+ if (ctrl instanceof ImageView) {
+ ctrl.setPickOnBounds(true);
+ }
if (source) {
ctrl.setId(ID_DRAG_SOURCE);
} else {
@@ -569,7 +577,9 @@
}
if (targetFormats.contains(DataFormat.IMAGE) && cb.hasImage()) {
receivedContent.put(DataFormat.IMAGE, cb.getImage());
- transferedContentPane.getChildren().addAll(new Text("Image: "), ImageViewBuilder.create().image(cb.getImage()).id(ID_RECEIVED_IMAGE).build());
+ ImageView i = new ImageView(cb.getImage());
+ i.setId(ID_RECEIVED_IMAGE);
+ transferedContentPane.getChildren().addAll(new Text("Image: "), i);
log("Dropped image: " + cb.getImage());
gotData = true;
}
--- old/functional/ControlsTests/src/javafx/factory/ControlsFactory.java 2016-12-22 11:26:19.536983741 +0300
+++ new/functional/ControlsTests/src/javafx/factory/ControlsFactory.java 2016-12-22 11:26:19.480983200 +0300
@@ -46,54 +46,38 @@
import javafx.scene.Node;
import javafx.scene.control.Accordion;
import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
import javafx.scene.control.CheckBox;
-import javafx.scene.control.CheckBoxBuilder;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ColorPicker;
import javafx.scene.control.ComboBox;
import javafx.scene.control.Control;
import javafx.scene.control.DatePicker;
import javafx.scene.control.Hyperlink;
-import javafx.scene.control.HyperlinkBuilder;
import javafx.scene.control.Label;
-import javafx.scene.control.LabelBuilder;
import javafx.scene.control.ListView;
import javafx.scene.control.Menu;
import javafx.scene.control.MenuBar;
import javafx.scene.control.MenuItem;
import javafx.scene.control.Pagination;
import javafx.scene.control.PasswordField;
-import javafx.scene.control.PasswordFieldBuilder;
import javafx.scene.control.ProgressBar;
-import javafx.scene.control.ProgressBarBuilder;
import javafx.scene.control.ProgressIndicator;
-import javafx.scene.control.ProgressIndicatorBuilder;
import javafx.scene.control.RadioButton;
-import javafx.scene.control.RadioButtonBuilder;
import javafx.scene.control.ScrollBar;
-import javafx.scene.control.ScrollBarBuilder;
import javafx.scene.control.ScrollPane;
import javafx.scene.control.Separator;
-import javafx.scene.control.SeparatorBuilder;
import javafx.scene.control.Slider;
-import javafx.scene.control.SliderBuilder;
import javafx.scene.control.SplitMenuButton;
-import javafx.scene.control.SplitMenuButtonBuilder;
import javafx.scene.control.SplitPane;
-import javafx.scene.control.SplitPaneBuilder;
import javafx.scene.control.Tab;
import javafx.scene.control.TabPane;
import javafx.scene.control.TableColumn;
import javafx.scene.control.TableColumn.CellDataFeatures;
import javafx.scene.control.TableView;
import javafx.scene.control.TextArea;
-import javafx.scene.control.TextAreaBuilder;
import javafx.scene.control.TextField;
-import javafx.scene.control.TextFieldBuilder;
import javafx.scene.control.TitledPane;
import javafx.scene.control.ToggleButton;
-import javafx.scene.control.ToggleButtonBuilder;
import javafx.scene.control.ToolBar;
import javafx.scene.control.TreeItem;
import javafx.scene.control.TreeTableColumn;
@@ -102,7 +86,7 @@
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.HBox;
-import javafx.scene.layout.StackPaneBuilder;
+import javafx.scene.layout.StackPane;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import javafx.scene.shape.Circle;
@@ -114,7 +98,10 @@
Buttons(new ControlFactory() {
public Control createControl() {
- return ButtonBuilder.create().text("Button the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).graphic(new Rectangle(10, 10, Color.RED)).build();
+ Button b = new Button("Button the first line" + "\nthe sec long line" + "\nthe third line");
+ b.setFocusTraversable(false);
+ b.setGraphic(new Rectangle(10, 10, Color.RED));
+ return b;
}
public Class getControlClass() {
@@ -183,7 +170,10 @@
}),
CheckBoxes(new ControlFactory() {
public Control createControl() {
- return CheckBoxBuilder.create().text("Check box the first line" + "\nthe sec long line" + "\nthe third line").graphic(new Rectangle(20, 20, Color.web("lightblue"))).focusTraversable(false).build();
+ CheckBox cb = new CheckBox("Check box the first line" + "\nthe sec long line" + "\nthe third line");
+ cb.setFocusTraversable(false);
+ cb.setGraphic(new Rectangle(20, 20, Color.web("lightblue")));
+ return cb;
}
public Class getControlClass() {
@@ -192,7 +182,11 @@
}),
RadioButtons(new ControlFactory() {
public Control createControl() {
- return RadioButtonBuilder.create().text("Radio the first line" + "\nthe sec long line" + "\nthe third line").graphic(new Rectangle(20, 20, Color.web("lightblue"))).focusTraversable(false).textAlignment(TextAlignment.RIGHT).build();
+ RadioButton rb = new RadioButton("Radio the first line" + "\nthe sec long line" + "\nthe third line");
+ rb.setFocusTraversable(false);
+ rb.setGraphic(new Rectangle(20, 20, Color.web("lightblue")));
+ rb.setTextAlignment(TextAlignment.RIGHT);
+ return rb;
}
public Class getControlClass() {
@@ -201,7 +195,9 @@
}),
TextFields(new ControlFactory() {
public Control createControl() {
- return TextFieldBuilder.create().text("Text box the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).build();
+ TextField tf = new TextField("Text box the first line" + "\nthe sec long line" + "\nthe third line");
+ tf.setFocusTraversable(false);
+ return tf;
}
public Class getControlClass() {
@@ -210,7 +206,10 @@
}),
TextAreas(new ControlFactory() {
public Control createControl() {
- return TextAreaBuilder.create().maxWidth(100).maxHeight(50).text("Text area the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).build();
+ TextArea ta = new TextArea("Text area the first line" + "\nthe sec long line" + "\nthe third line");
+ ta.setFocusTraversable(false);
+ ta.setMaxSize(100, 50);
+ return ta;
}
public Class getControlClass() {
@@ -219,7 +218,10 @@
}),
PasswordFields(new ControlFactory() {
public Control createControl() {
- return PasswordFieldBuilder.create().promptText("Password box the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).build();
+ PasswordField pf = new PasswordField();
+ pf.setPromptText("Password box the first line" + "\nthe sec long line" + "\nthe third line");
+ pf.setFocusTraversable(false);
+ return pf;
}
public Class getControlClass() {
@@ -228,7 +230,12 @@
}),
Sliders(new ControlFactory() {
public Control createControl() {
- return SliderBuilder.create().min(0).max(100).value(20).focusTraversable(false).build();
+ Slider s = new Slider();
+ s.setMin(0);
+ s.setMax(100);
+ s.setValue(20);
+ s.setFocusTraversable(false);
+ return s;
}
public Class getControlClass() {
@@ -237,7 +244,10 @@
}),
Labels(new ControlFactory() {
public Control createControl() {
- return LabelBuilder.create().text("Label the first line" + "\nthe sec longlong line" + "\nthe third line").focusTraversable(false).graphic(new Rectangle(20, 20, Color.web("lightblue"))).build();
+ Label l = new Label("Label the first line" + "\nthe sec longlong line" + "\nthe third line");
+ l.setFocusTraversable(false);
+ l.setGraphic(new Rectangle(20, 20, Color.web("lightblue")));
+ return l;
}
public Class getControlClass() {
@@ -246,7 +256,10 @@
}),
Hyperlinks(new ControlFactory() {
public Control createControl() {
- return HyperlinkBuilder.create().text("Hyperlink the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).graphic(new Circle(10, Color.BLUE)).build();
+ Hyperlink hl = new Hyperlink("Hyperlink the first line" + "\nthe sec long line" + "\nthe third line");
+ hl.setFocusTraversable(false);
+ hl.setGraphic(new Circle(10, Color.BLUE));
+ return hl;
}
public Class getControlClass() {
@@ -299,7 +312,8 @@
}),
Separators(new ControlFactory() {
public Control createControl() {
- Separator sep = SeparatorBuilder.create().halignment(HPos.CENTER).build();
+ Separator sep = new Separator();
+ sep.setHalignment(HPos.CENTER);
sep.setPrefWidth(80);
return sep;
}
@@ -310,7 +324,12 @@
}),
ScrollBars(new ControlFactory() {
public Control createControl() {
- return ScrollBarBuilder.create().value(45).min(0).max(100).focusTraversable(false).build();
+ ScrollBar sb = new ScrollBar();
+ sb.setValue(45);
+ sb.setMin(0);
+ sb.setMax(100);
+ sb.setFocusTraversable(false);
+ return sb;
}
public Class getControlClass() {
@@ -337,7 +356,9 @@
}),
ProgressIndicators(new ControlFactory() {
public Node createControl() {
- return ProgressIndicatorBuilder.create().progress(0.85).focusTraversable(false).build();
+ ProgressIndicator pi = new ProgressIndicator(0.85);
+ pi.setFocusTraversable(false);
+ return pi;
}
public Class getControlClass() {
@@ -346,7 +367,9 @@
}),
ProgressBars(new ControlFactory() {
public Node createControl() {
- return ProgressBarBuilder.create().progress(0.25).focusTraversable(false).build();
+ ProgressBar pb = new ProgressBar(0.25);
+ pb.setFocusTraversable(false);
+ return pb;
}
public Class getControlClass() {
@@ -356,6 +379,8 @@
ListViews(new ControlFactory() {
public Node createControl() {
ListView list = new ListView();
+
+ // The following requires --add-exports javafx.base/com.sun.javafx.collections=ALL-UNNAMED
ObservableListWrapper items = new ObservableListWrapper(Arrays.asList("One", "Two", "Three", "Four", "Five", "Six", "long line long line long line long line"));
list.setItems(items);
list.setPrefWidth(100);
@@ -370,7 +395,11 @@
}),
PressedToggleButtons(new ControlFactory() {
public Control createControl() {
- return ToggleButtonBuilder.create().selected(true).text("Button the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).graphic(new Rectangle(10, 10, Color.RED)).build();
+ ToggleButton tb = new ToggleButton("Button the first line" + "\nthe sec long line" + "\nthe third line");
+ tb.setFocusTraversable(false);
+ tb.setGraphic(new Rectangle(10, 10, Color.RED));
+ tb.setSelected(true);
+ return tb;
}
public Class getControlClass() {
@@ -379,7 +408,11 @@
}),
UnPressedToggleButtons(new ControlFactory() {
public Control createControl() {
- return ToggleButtonBuilder.create().selected(false).text("Button the first line" + "\nthe sec long line" + "\nthe third line").focusTraversable(false).graphic(new Rectangle(10, 10, Color.RED)).build();
+ ToggleButton tb = new ToggleButton("Button the first line" + "\nthe sec long line" + "\nthe third line");
+ tb.setFocusTraversable(false);
+ tb.setGraphic(new Rectangle(10, 10, Color.RED));
+ tb.setSelected(false);
+ return tb;
}
public Class getControlClass() {
@@ -389,7 +422,9 @@
Toolbars(new ControlFactory() {
public Node createControl() {
ToolBar toolbar = new ToolBar();
- toolbar.getItems().addAll(new Button("One"), new Button("Two"), new Separator(), SplitMenuButtonBuilder.create().text("three").build());
+ SplitMenuButton smb = new SplitMenuButton();
+ smb.setText("three");
+ toolbar.getItems().addAll(new Button("One"), new Button("Two"), new Separator(), smb);
toolbar.setFocusTraversable(false);
return toolbar;
}
@@ -412,12 +447,10 @@
}),
SplitMenuButtons(new ControlFactory() {
public Node createControl() {
- SplitMenuButton smb = SplitMenuButtonBuilder.create()
- .text("Split box the first line" + "\nthe sec long line" + "\nthe third line")
- .items(new MenuItem("Split box the first line" + "\nthe sec long line" + "\nthe third line",
- new Rectangle(10, 10, Color.BLUE)))
- .graphic(new Rectangle(10, 10, Color.RED))
- .build();
+ SplitMenuButton smb = new SplitMenuButton(new MenuItem("Split box the first line" + "\nthe sec long line" + "\nthe third line",
+ new Rectangle(10, 10, Color.BLUE)));
+ smb.setText("Split box the first line" + "\nthe sec long line" + "\nthe third line");
+ smb.setGraphic(new Rectangle(10, 10, Color.RED));
smb.setMinWidth(100);
smb.setFocusTraversable(false);
return smb;
@@ -491,7 +524,6 @@
table.getColumns().setAll(column1, column2);
table.setPrefHeight(100);
table.setPrefWidth(100);
- table.setMinHeight(Control.USE_PREF_SIZE);
table.setFocusTraversable(false);
return table;
}
@@ -531,7 +563,6 @@
treeTable.getColumns().setAll(column1, column2);
treeTable.setPrefHeight(100);
treeTable.setPrefWidth(100);
- treeTable.setMinHeight(Control.USE_PREF_SIZE);
treeTable.setFocusTraversable(false);
return treeTable;
}
@@ -584,10 +615,11 @@
}),
SplitPanes(new ControlFactory() {
public Node createControl() {
- SplitPane pane = SplitPaneBuilder.create().items(
- StackPaneBuilder.create().children(new Rectangle(40, 40, Color.WHITESMOKE)).build(),
- StackPaneBuilder.create().children(new Rectangle(40, 40, Color.BLUE)).build(),
- StackPaneBuilder.create().children(new Rectangle(40, 40, Color.RED)).build()).prefWidth(150).prefHeight(150).build();
+ StackPane sp1 = new StackPane(new Rectangle(40, 40, Color.WHITESMOKE));
+ StackPane sp2 = new StackPane(new Rectangle(40, 40, Color.BLUE));
+ StackPane sp3 = new StackPane(new Rectangle(40, 40, Color.RED));
+ SplitPane pane = new SplitPane(sp1, sp2, sp3);
+ pane.setPrefSize(150, 150);
pane.setMinWidth(100);
pane.setDividerPositions(0.33, 0.67);
pane.setFocusTraversable(false);
--- old/functional/ControlsTests/src/javafx/scene/control/test/ListView/NewListViewApp.java 2016-12-22 11:26:19.752985824 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/ListView/NewListViewApp.java 2016-12-22 11:26:19.696985284 +0300
@@ -118,7 +118,9 @@
PropertyTablesFactory.explorePropertiesList(testedListView, tb);
SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
- final TextField tf = TextFieldBuilder.create().id(LIST_VIEW_CONTROL_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();
+ final TextField tf = new TextField("0");
+ tf.setId(LIST_VIEW_CONTROL_ADD_INDEX_TEXT_FIELD_ID);
+ tf.setPrefWidth(40);
HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
@Override
@@ -128,7 +130,8 @@
}, tf);
HBox resetButtons = new HBox();
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
hardResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -138,7 +141,8 @@
}
});
- Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build();
+ Button softResetButton = new Button("Soft reset");
+ softResetButton.setId(SOFT_RESET_BUTTON_ID);
softResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
softReset();
@@ -154,7 +158,8 @@
}
});
- Button changeSelectionModel = ButtonBuilder.create().text("Change selection model to custom").id(CHANGE_SELECTION_MODEL_BUTTON_ID).build();
+ Button changeSelectionModel = new Button("Change selection model to custom");
+ changeSelectionModel.setId(CHANGE_SELECTION_MODEL_BUTTON_ID);
changeSelectionModel.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedListView.setSelectionModel(cmsm);
@@ -180,7 +185,6 @@
ListView lv = new ListView();
lv.setId(TESTED_LIST_VIEW_ID);
return lv;
- //return ListViewBuilder.create().id(TESTED_LIST_VIEW_ID).build();
}
private void softReset() {
@@ -225,12 +229,17 @@
private HBox getAddItemHBox() {
HBox hb = new HBox();
Label lb = new Label("Add item");
- final TextField tf = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_TEXT_FIELD_ID).build();
+ final TextField tf = new TextField();
+ tf.setPrefWidth(50);
+ tf.setId(ADD_ITEM_TEXT_FIELD_ID);
Label atLb = new Label("at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_POSITION_TEXT_FIELD_ID).build();
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_ITEM_BUTTON_ID).build();
+ Button bt = new Button("Add!");
+ bt.setId(ADD_ITEM_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
((ListView) testedControl).getItems().add(Integer.parseInt(tfPos.getText()), tf.getText());
@@ -243,8 +252,11 @@
private HBox getRemoveItemHBox() {
HBox hb = new HBox();
Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tf.getText());
@@ -257,8 +269,10 @@
private HBox getScrollToHBox() {
HBox hb = new HBox();
- Button button = ButtonBuilder.create().text("ScrollTo").id(SCROLL_TO_BUTTON_ID).build();
- final TextField tf = TextFieldBuilder.create().text("0").id(SCROLL_TO_TEXT_FIELD_ID).build();
+ Button button = new Button("ScrollTo");
+ button.setId(SCROLL_TO_BUTTON_ID);
+ final TextField tf = new TextField("0");
+ tf.setId(SCROLL_TO_TEXT_FIELD_ID);
button.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
@@ -273,8 +287,11 @@
private HBox getAddRectangleHbox() {
HBox hb = new HBox();
Label lb = new Label("Add rectangle at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_RECTANGLE_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_RECTANGLE_BUTTON_ID).build();
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_RECTANGLE_TEXT_FIELD_ID);
+ Button bt = new Button("Add!");
+ bt.setId(ADD_RECTANGLE_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tfPos.getText());
@@ -288,8 +305,11 @@
private HBox getAddFormHbox() {
HBox hb = new HBox();
Label lb = new Label("Add form at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_FORM_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_FORM_BUTTON_ID).build();
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_FORM_TEXT_FIELD_ID);
+ Button bt = new Button("Add!");
+ bt.setId(ADD_FORM_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tfPos.getText());
@@ -303,8 +323,11 @@
private HBox getAddTextFieldHbox() {
HBox hb = new HBox();
Label lb = new Label("Add textField at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_TEXT_FIELD_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_TEXT_FIELD_BUTTON_ID).build();
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_TEXT_FIELD_TEXT_FIELD_ID);
+ Button bt = new Button("Add!");
+ bt.setId(ADD_TEXT_FIELD_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tfPos.getText());
@@ -317,9 +340,11 @@
private HBox getStartMotionHBox() {
HBox hb = new HBox();
- Button startMotion = ButtonBuilder.create().text("start motion").id(START_MOTION_BUTTON_ID).build();
+ Button startMotion = new Button("start motion");
+ startMotion.setId(START_MOTION_BUTTON_ID);
Label label = new Label(" of element at position ");
- final TextField tf = TextFieldBuilder.create().text("0").id(START_MOTION_TEXT_FIELD_ID).build();
+ final TextField tf = new TextField("0");
+ tf.setId(START_MOTION_TEXT_FIELD_ID);
startMotion.setOnAction(new EventHandler() {
public void handle(Event t) {
cm.applyTransition((Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText())));
@@ -332,9 +357,11 @@
private HBox getIncreaseScaleHBox() {
HBox hb = new HBox();
- final TextField tf = TextFieldBuilder.create().text("0").id(INCREASE_SCALE_TEXT_FIELD_ID).build();
+ final TextField tf = new TextField("0");
+ tf.setId(INCREASE_SCALE_TEXT_FIELD_ID);
Label label = new Label(" of node on position ");
- Button increaseScaleButton = ButtonBuilder.create().id(INCREASE_SCALE_BUTTON_ID).text("Increase scale").build();
+ Button increaseScaleButton = new Button("Increase scale");
+ increaseScaleButton.setId(INCREASE_SCALE_BUTTON_ID);
increaseScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
@@ -348,9 +375,11 @@
private HBox getDecreaseScaleHBox() {
HBox hb = new HBox();
- final TextField tf = TextFieldBuilder.create().text("0").id(DECREASE_SCALE_TEXT_FIELD_ID).build();
+ final TextField tf = new TextField("0");
+ tf.setId(DECREASE_SCALE_TEXT_FIELD_ID);
Label label = new Label(" of node on position ");
- Button increaseScaleButton = ButtonBuilder.create().id(DECREASE_SCALE_BUTTON_ID).text("Decrease scale").build();
+ Button increaseScaleButton = new Button("Decrease scale");
+ increaseScaleButton.setId(DECREASE_SCALE_BUTTON_ID);
increaseScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
Node content = (Node) ((ListView) testedControl).getItems().get(Integer.parseInt(tf.getText()));
@@ -371,7 +400,9 @@
}
private TextField getNewTextField() {
- return TextFieldBuilder.create().id("CONTENT_TEXT_FIELD_" + (textFieldsCounter++) + "_ID").build();
+ TextField tf = new TextField();
+ tf.setId("CONTENT_TEXT_FIELD_" + (textFieldsCounter++) + "_ID");
+ return tf;
}
}
}
--- old/functional/ControlsTests/src/javafx/scene/control/test/ScrollPane/NewScrollPaneApp.java 2016-12-22 11:26:19.952987752 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/ScrollPane/NewScrollPaneApp.java 2016-12-22 11:26:19.900987251 +0300
@@ -113,14 +113,13 @@
public ScrollPaneScene() {
super("ScrollPane", 800, 600);
-
- prepareScene();
}
@Override
protected final void prepareScene() {
Utils.addBrowser(this);
- testedScrollPane = ScrollPaneBuilder.create().id(TESTED_SCROLLPANE_ID).build();
+ testedScrollPane = new ScrollPane();
+ testedScrollPane.setId(TESTED_SCROLLPANE_ID);
final Node content = setCustomContent(customContentHeight, customContentWidth);
final ContentMotion cm = new ContentMotion();
@@ -136,7 +135,8 @@
testedScrollPane.setPrefViewportHeight(scrollPaneHeight);
}
- Button changeContentButton = ButtonBuilder.create().id(CHANGE_CONTENT_BUTTON_ID).text("ChangeContent").build();
+ Button changeContentButton = new Button("ChangeContent");
+ changeContentButton.setId(CHANGE_CONTENT_BUTTON_ID);
changeContentButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
changeContent();
@@ -144,7 +144,8 @@
}
});
- Button addPrefWidthAndHeightButton = ButtonBuilder.create().id(ADD_SIZE_BUTTON_ID).text("Add pref sizes").build();
+ Button addPrefWidthAndHeightButton = new Button("Add pref sizes");
+ addPrefWidthAndHeightButton.setId(ADD_SIZE_BUTTON_ID);
addPrefWidthAndHeightButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
tb.addDoublePropertyLine(testedScrollPane.prefWidthProperty(), -100, 200, 100);
@@ -152,7 +153,8 @@
}
});
- Button setTextAreaAsContentButton = ButtonBuilder.create().id(CHANGE_CONTENT_TO_RESIZABLE_BUTTON_ID).text("Set blue pane as content").build();
+ Button setTextAreaAsContentButton = new Button("Set blue pane as content");
+ setTextAreaAsContentButton.setId(CHANGE_CONTENT_TO_RESIZABLE_BUTTON_ID);
setTextAreaAsContentButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
setResizableContent();
@@ -162,35 +164,40 @@
}
});
- Button setCustomContentButton = ButtonBuilder.create().id(CHANGE_CONTENT_TO_CUSTOM_BUTTON_ID).text("Set custom content").build();
+ Button setCustomContentButton = new Button("Set custom content");
+ setCustomContentButton.setId(CHANGE_CONTENT_TO_CUSTOM_BUTTON_ID);
setCustomContentButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
setCustomContent();
}
});
- Button buttonStart = ButtonBuilder.create().id(START_MOTION_BUTTON_ID).text("Start motion").build();
+ Button buttonStart = new Button("Start motion");
+ buttonStart.setId(START_MOTION_BUTTON_ID);
buttonStart.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
cm.getTimeline().play();
}
});
- Button rotateButton = ButtonBuilder.create().id(ROTATE_BUTTON_ID).text("Rotate on 30deg").build();
+ Button rotateButton = new Button("Rotate on 30deg");
+ rotateButton.setId(ROTATE_BUTTON_ID);
rotateButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
content.setRotate(content.getRotate() + 30);
}
});
- Button rotateScrollPaneButton = ButtonBuilder.create().id(ROTATE_SCROLLPANE_BUTTON_ID).text("Rotate scrollpane on 30deg").build();
+ Button rotateScrollPaneButton = new Button("Rotate scrollpane on 30deg");
+ rotateScrollPaneButton.setId(ROTATE_SCROLLPANE_BUTTON_ID);
rotateScrollPaneButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedScrollPane.setRotate(testedScrollPane.getRotate() + 30);
}
});
- Button increaseScaleButton = ButtonBuilder.create().id(INCREASE_SCALE_BUTTON_ID).text("Increase scale").build();
+ Button increaseScaleButton = new Button("Increase scale");
+ increaseScaleButton.setId(INCREASE_SCALE_BUTTON_ID);
increaseScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
content.setScaleX(content.getScaleX() + 0.15);
@@ -198,7 +205,8 @@
}
});
- Button decreaseScaleButton = ButtonBuilder.create().id(DECREASE_SCALE_BUTTON_ID).text("Decrease scale").build();
+ Button decreaseScaleButton = new Button("Decrease scale");
+ decreaseScaleButton.setId(DECREASE_SCALE_BUTTON_ID);
decreaseScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
content.setScaleX(content.getScaleX() - 0.15);
@@ -206,7 +214,8 @@
}
});
- Button increaseScrollPaneScaleButton = ButtonBuilder.create().id(INCREASE_SCROLLPANE_SCALE_BUTTON_ID).text("Increase ScrollPane scale").build();
+ Button increaseScrollPaneScaleButton = new Button("Increase ScrollPane scale");
+ increaseScrollPaneScaleButton.setId(INCREASE_SCROLLPANE_SCALE_BUTTON_ID);
increaseScrollPaneScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedScrollPane.setScaleX(testedScrollPane.getScaleX() + 0.15);
@@ -214,7 +223,8 @@
}
});
- Button decreaseScrollPaneScaleButton = ButtonBuilder.create().id(DECREASE_SCROLLPANE_SCALE_BUTTON_ID).text("Decrease ScrollPane scale").build();
+ Button decreaseScrollPaneScaleButton = new Button("Decrease ScrollPane scale");
+ decreaseScrollPaneScaleButton.setId(DECREASE_SCROLLPANE_SCALE_BUTTON_ID);
decreaseScrollPaneScaleButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedScrollPane.setScaleX(testedScrollPane.getScaleX() - 0.15);
@@ -222,7 +232,8 @@
}
});
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
resetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -246,8 +257,12 @@
}
private Node getAddGridPaneForm() {
- final TextField dimension = TextFieldBuilder.create().id(GRID_DIMENSION_TEXTFIELD_ID).promptText("int-dimension").maxWidth(50).build();
- Button addButton = ButtonBuilder.create().id(ADD_GRID_BUTTON_ID).text("Add grid").build();
+ final TextField dimension = new TextField();
+ dimension.setId(GRID_DIMENSION_TEXTFIELD_ID);
+ dimension.setPromptText("int-dimension");
+ dimension.setMaxWidth(50);
+ Button addButton = new Button("Add grid");
+ addButton.setId(ADD_GRID_BUTTON_ID);
addButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
int c = Integer.parseInt(dimension.getText());
@@ -256,7 +271,11 @@
for (int i = 0; i < c; i++) {
for (int j = 0; j < c; j++) {
final String name = "B-" + String.valueOf(i) + "-" + String.valueOf(j);
- gridPane.add(ButtonBuilder.create().text(name).id(name).minHeight(10 * i).minWidth(10 * j).build(), i, j);
+ Button temp = new Button(name);
+ temp.setId(name);
+ temp.setMinHeight(10 * i);
+ temp.setMinWidth(10 * j);
+ gridPane.add(temp, i, j);
}
}
testedScrollPane.setContent(gridPane);
@@ -291,18 +310,23 @@
private void changeContent() {
VBox vb = new VBox();
- Button button = ButtonBuilder.create().id(CONTENT_BUTTON).text("Press me").build();
- final TextField tf1 = TextFieldBuilder.create().id(CONTENT_TEXT_FIELD_ID).text("0").build();
+ Button button = new Button("Press me");
+ button.setId(CONTENT_BUTTON);
+ final TextField tf1 = new TextField("0");
+ tf1.setId(CONTENT_TEXT_FIELD_ID);
button.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
tf1.setText(String.valueOf(Integer.parseInt(tf1.getText()) + 1));
}
});
- TextArea tf2 = TextAreaBuilder.create().prefHeight(100).id(CONTENT_TEXT_AREA_ID).build();
+ TextArea tf2 = new TextArea();
+ tf2.setPrefHeight(100);
+ tf2.setId(CONTENT_TEXT_AREA_ID);
for (int i = 0; i < 15; i++) {
tf2.appendText("text" + i + "\n");
}
- Button empty = ButtonBuilder.create().text("This is empty-action button").id(WITHOUT_ACTION_BUTTON).build();
+ Button empty = new Button("This is empty-action button");
+ empty.setId(WITHOUT_ACTION_BUTTON);
vb.getChildren().addAll(button, tf1, tf2, empty);
vb.setStyle("-fx-border-color: blue;");
--- old/functional/ControlsTests/src/javafx/scene/control/test/ToggleButtonNewApp.java 2016-12-22 11:26:20.152989681 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/ToggleButtonNewApp.java 2016-12-22 11:26:20.100989180 +0300
@@ -31,14 +31,10 @@
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
import javafx.scene.control.CheckBox;
-import javafx.scene.control.CheckBoxBuilder;
import javafx.scene.control.Label;
-import javafx.scene.control.LabelBuilder;
-import javafx.scene.control.RadioButtonBuilder;
+import javafx.scene.control.RadioButton;
import javafx.scene.control.ToggleButton;
-import javafx.scene.control.ToggleButtonBuilder;
import javafx.scene.control.ToggleGroup;
import javafx.scene.input.MouseEvent;
import javafx.scene.layout.HBox;
@@ -80,21 +76,45 @@
ToggleButton toggleButton1;
ToggleButton toggleButton2;
- CheckBox checkBox1 = CheckBoxBuilder.create().wrapText(true).text("Unidirectionally binded to\ntoggle button 1 selection property").id(CHECK_BOX_LISTENING_1_ID).build();
- CheckBox checkBox2 = CheckBoxBuilder.create().wrapText(true).text("Unidirectionally binded to\ntoggle button 2 selection property").id(CHECK_BOX_LISTENING_2_ID).build();
- CheckBox checkBox3 = CheckBoxBuilder.create().wrapText(true).text("This check box is bidirectionally binded\nto Toggle Button 1 selection property").id(CHECK_BOX_SETTING_1_BIDIR_ID).build();
- CheckBox checkBox4 = CheckBoxBuilder.create().wrapText(true).text("This check box unidirectionally sets\ntoggle button 2 selection property").id(CHECK_BOX_SETTING_2_UNIDIR_ID).build();
+ CheckBox checkBox1;
+ CheckBox checkBox2;
+ CheckBox checkBox3;
+ CheckBox checkBox4;
ToggleGroup toggleGroup = new ToggleGroup();
- ToggleButton bindingsSettingButton = ToggleButtonBuilder.create().text("State: Unbinded").id(BINDING_SET_TOGGLE_BUTTON_ID).build();
- ToggleButton groupingButton = ToggleButtonBuilder.create().text("State: Ungrouped").id(GROUPING_TOGGLE_BUTTON_ID).build();
- ToggleButton testedControlChangeButton = ToggleButtonBuilder.create().text("Control: radio button").id(SETTING_CONTROL_TOGGLE_BUTTON_ID).build();
- Button resetButton = ButtonBuilder.create().text("Reset state").id(RESET_BUTTON_ID).build();
- Label mouseEventsLogger = LabelBuilder.create().text("0").id(MOUSE_EVENTS_LOGGER_LABEL_ID).build();
+ ToggleButton bindingsSettingButton;
+ ToggleButton groupingButton;
+ ToggleButton testedControlChangeButton;
+ Button resetButton;
+ Label mouseEventsLogger;
VBox vb1 = new VBox();
public ToggleButtonNewAppScene() {
super(new HBox(), 800, 320);
+ checkBox1 = new CheckBox("Unidirectionally binded to\ntoggle button 1 selection property");
+ checkBox1.setWrapText(true);
+ checkBox1.setId(CHECK_BOX_LISTENING_1_ID);
+ checkBox2 = new CheckBox("Unidirectionally binded to\ntoggle button 2 selection property");
+ checkBox2.setWrapText(true);
+ checkBox2.setId(CHECK_BOX_LISTENING_2_ID);
+ checkBox3 = new CheckBox("This check box is bidirectionally binded\nto Toggle Button 1 selection property");
+ checkBox3.setWrapText(true);
+ checkBox3.setId(CHECK_BOX_SETTING_1_BIDIR_ID);
+ checkBox4 = new CheckBox("This check box unidirectionally sets\ntoggle button 2 selection property");
+ checkBox4.setWrapText(true);
+ checkBox4.setId(CHECK_BOX_SETTING_2_UNIDIR_ID);
+
+ bindingsSettingButton = new ToggleButton("State: Unbinded");
+ bindingsSettingButton.setId(BINDING_SET_TOGGLE_BUTTON_ID);
+ groupingButton = new ToggleButton("State: Ungrouped");
+ groupingButton.setId(GROUPING_TOGGLE_BUTTON_ID);
+ testedControlChangeButton = new ToggleButton("Control: radio button");
+ testedControlChangeButton.setId(SETTING_CONTROL_TOGGLE_BUTTON_ID);
+ resetButton = new Button("Reset state");
+ resetButton.setId(RESET_BUTTON_ID);
+ mouseEventsLogger = new Label("0");
+ mouseEventsLogger.setId(MOUSE_EVENTS_LOGGER_LABEL_ID);
+
setControl(ControlType.RADIO_BUTTON);
addButtonsListeners();
@@ -131,11 +151,15 @@
private void setControl(ControlType type) {
if (type == ControlType.RADIO_BUTTON) {
- toggleButton1 = RadioButtonBuilder.create().text("Radio button 1").id(TOGGLE_BUTTON_1_ID).build();
- toggleButton2 = RadioButtonBuilder.create().text("Radio button 2").id(TOGGLE_BUTTON_2_ID).build();
+ toggleButton1 = new RadioButton("Radio button 1");
+ toggleButton1.setId(TOGGLE_BUTTON_1_ID);
+ toggleButton2 = new RadioButton("Radio button 2");
+ toggleButton2.setId(TOGGLE_BUTTON_2_ID);
} else {
- toggleButton1 = ToggleButtonBuilder.create().text("Toggle button 1").id(TOGGLE_BUTTON_1_ID).build();
- toggleButton2 = ToggleButtonBuilder.create().text("Toggle button 2").id(TOGGLE_BUTTON_2_ID).build();
+ toggleButton1 = new ToggleButton("Toggle button 1");
+ toggleButton1.setId(TOGGLE_BUTTON_1_ID);
+ toggleButton2 = new ToggleButton("Toggle button 2");
+ toggleButton2.setId(TOGGLE_BUTTON_2_ID);
}
vb1.getChildren().clear();
--- old/functional/ControlsTests/src/javafx/scene/control/test/accordion/NewAccordionApp.java 2016-12-22 11:26:20.344991533 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/accordion/NewAccordionApp.java 2016-12-22 11:26:20.296991070 +0300
@@ -1,150 +1,154 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.Accordion;
-
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Node;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.*;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewAccordionApp extends InteroperabilityApp {
-
- public final static String TESTED_ACCORDION_ID = "TESTED_ACCORDION_ID";
- public final static String RESET_BUTTON_ID = "RESET_ACCORDION_BUTTON_ID";
- public final String ACCORDION_ADD_INDEX_TEXT_FIELD_ID = "ACCORDION_ADD_INDEX_TEXT_FIELD_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewAccordionApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "AccordionTestApp");
- return new NewAccordionApp.AccordionScene();
- }
-
- class AccordionScene extends Scene {
-
- //VBox which contain tested Accordion.
- Pane pane;
- //Accordion to be tested.
- Accordion testedAccordion;
-
- public AccordionScene() {
- super(new HBox(), 800, 600);
-
- prepareScene();
- }
-
- private void prepareScene() {
- pane = new Pane();
- testedAccordion = AccordionBuilder.create().id(TESTED_ACCORDION_ID).build();
-
- PropertiesTable tb = new PropertiesTable(testedAccordion);
- PropertyTablesFactory.explorePropertiesList(testedAccordion, tb);
-
- final TabPaneWithControl tabPane = new TabPaneWithControl("Accordion", tb);
-
- final TextField tf = TextFieldBuilder.create().id(ACCORDION_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();
-
- HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
-
- @Override
- public void execute(Node node) {
- TitledPane tp = new TitledPane(node.getClass().getSimpleName(), node);
- testedAccordion.getPanes().add(Integer.parseInt(tf.getText()), tp);
- tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
- tabPane.addPropertiesTable(tp.getClass().getSimpleName(), NodeControllerFactory.createFullController(tp, tabPane));
- }
- }, tf);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedAccordion);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- final ToggleButton compactStateToggle = new ToggleButton("Compact");
- compactStateToggle.setSelected(true);
- compactStateToggle.selectedProperty().addListener(new ChangeListener() {
-
- public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
- if (t1) {
- compactStateToggle.setText("Compact");
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- AccordionScene.this.getWindow().setWidth(1200);
- AccordionScene.this.getWindow().setHeight(700);
- } else {
- compactStateToggle.setText("Free");
- pane.setMinSize(600, 600);
- pane.setPrefSize(600, 600);
- AccordionScene.this.getWindow().setWidth(800);
- AccordionScene.this.getWindow().setHeight(600);
- }
- }
- });
-
-
- vb.getChildren().addAll(new Label("Pane with tested Accordion"), pane, resetButton, compactStateToggle, nodeshb);
-
- hb.getChildren().addAll(vb, tabPane);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.Accordion;
+
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.*;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewAccordionApp extends InteroperabilityApp {
+
+ public final static String TESTED_ACCORDION_ID = "TESTED_ACCORDION_ID";
+ public final static String RESET_BUTTON_ID = "RESET_ACCORDION_BUTTON_ID";
+ public final String ACCORDION_ADD_INDEX_TEXT_FIELD_ID = "ACCORDION_ADD_INDEX_TEXT_FIELD_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewAccordionApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "AccordionTestApp");
+ return new NewAccordionApp.AccordionScene();
+ }
+
+ class AccordionScene extends Scene {
+
+ //VBox which contain tested Accordion.
+ Pane pane;
+ //Accordion to be tested.
+ Accordion testedAccordion;
+
+ public AccordionScene() {
+ super(new HBox(), 800, 600);
+
+ prepareScene();
+ }
+
+ private void prepareScene() {
+ pane = new Pane();
+ testedAccordion = new Accordion();
+ testedAccordion.setId(TESTED_ACCORDION_ID);
+
+ PropertiesTable tb = new PropertiesTable(testedAccordion);
+ PropertyTablesFactory.explorePropertiesList(testedAccordion, tb);
+
+ final TabPaneWithControl tabPane = new TabPaneWithControl("Accordion", tb);
+
+ final TextField tf = new TextField("0");
+ tf.setId(ACCORDION_ADD_INDEX_TEXT_FIELD_ID);
+ tf.setPrefWidth(40);
+
+ HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
+
+ @Override
+ public void execute(Node node) {
+ TitledPane tp = new TitledPane(node.getClass().getSimpleName(), node);
+ testedAccordion.getPanes().add(Integer.parseInt(tf.getText()), tp);
+ tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
+ tabPane.addPropertiesTable(tp.getClass().getSimpleName(), NodeControllerFactory.createFullController(tp, tabPane));
+ }
+ }, tf);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedAccordion);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ final ToggleButton compactStateToggle = new ToggleButton("Compact");
+ compactStateToggle.setSelected(true);
+ compactStateToggle.selectedProperty().addListener(new ChangeListener() {
+
+ public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
+ if (t1) {
+ compactStateToggle.setText("Compact");
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ AccordionScene.this.getWindow().setWidth(1200);
+ AccordionScene.this.getWindow().setHeight(700);
+ } else {
+ compactStateToggle.setText("Free");
+ pane.setMinSize(600, 600);
+ pane.setPrefSize(600, 600);
+ AccordionScene.this.getWindow().setWidth(800);
+ AccordionScene.this.getWindow().setHeight(600);
+ }
+ }
+ });
+
+
+ vb.getChildren().addAll(new Label("Pane with tested Accordion"), pane, resetButton, compactStateToggle, nodeshb);
+
+ hb.getChildren().addAll(vb, tabPane);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewAreaChartApp.java 2016-12-22 11:26:20.528993308 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewAreaChartApp.java 2016-12-22 11:26:20.480992844 +0300
@@ -1,301 +1,328 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.AreaChart;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.scene.chart.XYChart.Series;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewAreaChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
- public final static String REMOVE_AREA_POS_TEXT_FIELD_ID = "REMOVE_AREA_POS_TEXT_FIELD_ID";
- public final static String REMOVE_INDEX_TEXT_FIELD_ID = "REMOVE_INDEX_TEXT_FIELD_ID";
- public final static String ADD_AREA_POS_TEXT_FIELD_ID = "ADD_AREA_POS_TEXT_FIELD_ID";
- public final static String ADD_INDEX_TEXT_FIELD_ID = "ADD_INDEX_TEXT_FIELD_ID";
- public final static String ADD_VALUE_TEXT_FIELD_ID = "ADD_VALUE_TEXT_FIELD_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewAreaChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "AreaChartTestApp");
- return new NewAreaChartApp.AreaChartScene();
- }
-
- class AreaChartScene extends CommonPropertiesScene {
-
- //AreaChart to be tested.
- AreaChart testedAreaChart;
- NumberAxis axis1;
- NumberAxis axis2;
- TabPaneWithControl pane;
-
- public AreaChartScene() {
- super("AreaChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- axis1 = new NumberAxis(0, 100, 10);
- axis2 = new NumberAxis(0, 100, 10);
- testedAreaChart = getNewChart();
- testedAreaChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddAreaHBox(), getAddPointToDataDialog(), getRemovePointFromDataDialog(), getRemoveDataDialog());
-
- pane = getPaneFor(testedAreaChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedAreaChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getAddPointToDataDialog() {
- HBox hb = new HBox();
-
- Label lb1 = new Label("To area");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).id(ADD_AREA_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());
-
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue((((Double) ((XYChart.Data) (((Series) testedAreaChart.getData().get(area)).getData().get(point))).getXValue()) + ((Double) ((XYChart.Data) (((Series) testedAreaChart.getData().get(area)).getData().get(point - 1))).getXValue())) / 2);
- newData.setYValue(value);
-
- ((Series) testedAreaChart.getData().get(area)).getData().add(point, newData);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, bt);
- return hb;
- }
-
- public HBox getRemovePointFromDataDialog() {
- HBox hb = new HBox();
-
- Label lb1 = new Label("From area");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_AREA_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());
- ((Series) testedAreaChart.getData().get(area)).getData().remove(point);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
- return hb;
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From index");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_AREA_INDEX_TEXTFIELD_ID).build();
- Button bt = ButtonBuilder.create().text("remove area!").id(REMOVE_AREA_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedAreaChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getAddAreaHBox() {
- 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("add area!").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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(new Random().nextDouble() * (max - min) + min);
- newData.setYValue(new Random().nextDouble() * (max - min) + min);
- list.add(newData);
- }
- Object[] array = list.toArray();
- Arrays.sort(array, new Comparator() {
- public int compare(Object t, Object t1) {
- return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
- }
- });
-
- XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
-
- testedAreaChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateX.isBound()) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateY.isBound()) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public AreaChart getNewChart() {
- AreaChart chart = new AreaChart(axis1, axis2);
- chart.setTitle("AreaChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.AreaChart;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.scene.chart.XYChart.Series;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.ChartIDsInterface.HARD_RESET_BUTTON_ID;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewAreaChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+ public final static String REMOVE_AREA_POS_TEXT_FIELD_ID = "REMOVE_AREA_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_INDEX_TEXT_FIELD_ID = "REMOVE_INDEX_TEXT_FIELD_ID";
+ public final static String ADD_AREA_POS_TEXT_FIELD_ID = "ADD_AREA_POS_TEXT_FIELD_ID";
+ public final static String ADD_INDEX_TEXT_FIELD_ID = "ADD_INDEX_TEXT_FIELD_ID";
+ public final static String ADD_VALUE_TEXT_FIELD_ID = "ADD_VALUE_TEXT_FIELD_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewAreaChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "AreaChartTestApp");
+ return new NewAreaChartApp.AreaChartScene();
+ }
+
+ class AreaChartScene extends CommonPropertiesScene {
+
+ //AreaChart to be tested.
+ AreaChart testedAreaChart;
+ NumberAxis axis1;
+ NumberAxis axis2;
+ TabPaneWithControl pane;
+
+ public AreaChartScene() {
+ super("AreaChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ axis1 = new NumberAxis(0, 100, 10);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedAreaChart = getNewChart();
+ testedAreaChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddAreaHBox(), getAddPointToDataDialog(), getRemovePointFromDataDialog(), getRemoveDataDialog());
+
+ pane = getPaneFor(testedAreaChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedAreaChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ 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_AREA_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());
+
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue((((Double) ((XYChart.Data) (((Series) testedAreaChart.getData().get(area)).getData().get(point))).getXValue()) + ((Double) ((XYChart.Data) (((Series) testedAreaChart.getData().get(area)).getData().get(point - 1))).getXValue())) / 2);
+ newData.setYValue(value);
+
+ ((Series) testedAreaChart.getData().get(area)).getData().add(point, newData);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, bt);
+ return hb;
+ }
+
+ 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_AREA_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());
+ ((Series) testedAreaChart.getData().get(area)).getData().remove(point);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
+ return hb;
+ }
+
+ 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_AREA_INDEX_TEXTFIELD_ID);
+ Button bt = new Button("remove area!");
+ bt.setId(REMOVE_AREA_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedAreaChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getAddAreaHBox() {
+ 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("add area!");
+ 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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(new Random().nextDouble() * (max - min) + min);
+ newData.setYValue(new Random().nextDouble() * (max - min) + min);
+ list.add(newData);
+ }
+ Object[] array = list.toArray();
+ Arrays.sort(array, new Comparator() {
+ public int compare(Object t, Object t1) {
+ return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
+ }
+ });
+
+ XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
+
+ testedAreaChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateX.isBound()) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateY.isBound()) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public AreaChart getNewChart() {
+ AreaChart chart = new AreaChart(axis1, axis2);
+ chart.setTitle("AreaChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewBarChartApp.java 2016-12-22 11:26:20.732995275 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewBarChartApp.java 2016-12-22 11:26:20.672994696 +0300
@@ -1,273 +1,290 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.BarChart;
-import javafx.scene.chart.CategoryAxis;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewBarChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewBarChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ScatterChartTestApp");
- return new NewBarChartApp.BarChartScene();
- }
-
- class BarChartScene extends CommonPropertiesScene {
-
- //BarChart to be tested.
- BarChart testedBarChart;
- NumberAxis axis2;
- ObservableList existingCategories;
- CategoryAxis axis1;
- TabPaneWithControl pane;
-
- public BarChartScene() {
- super("BarChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- existingCategories = FXCollections.observableArrayList();
- existingCategories.addAll("category1", "category2", "category3");
- axis1 = new CategoryAxis(existingCategories);
- axis2 = new NumberAxis(0, 100, 10);
- testedBarChart = getNewChart();
- testedBarChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog(), getAddCategoryDialog(), getRemoveCategoryDialog());
-
- pane = getPaneFor(testedBarChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedBarChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedBarChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getRemoveCategoryDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From index");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).build();
- Button bt = ButtonBuilder.create().text("Remove category!").build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- existingCategories.remove(index);
- axis1.getCategories().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getAddCategoryDialog() {
- HBox hb = new HBox();
- Label lb = new Label("Category");
- final TextField tf = TextFieldBuilder.create().text("").prefWidth(50).build();
-
- Label lind = new Label("to index");
- final TextField tfind = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("Add!").build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tfind.getText());
- existingCategories.add(index, tf.getText());
- axis1.getCategories().add(index, tf.getText());
- }
- });
- hb.getChildren().addAll(lb, tf, lind, tfind, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- 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(" min ");
- final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build();
-
- Label maxLabel = new Label(" max ");
- final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build();
-
- Label amountLabel = new Label(" amount ");
- final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build();
-
- Button bt = ButtonBuilder.create().text("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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- XYChart.Series serie = new XYChart.Series(serieName, list);
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- String category = existingCategories.get(new Random().nextInt(existingCategories.size()));
- Double value = new Random().nextDouble() * (max - min) + min;
- newData.setYValue(category);
- newData.setXValue(value);
- list.add(newData);
- }
-
- testedBarChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getXValue(), data);
- }
-
- return table;
- }
-
- public BarChart getNewChart() {
- BarChart chart = new BarChart(axis2, axis1);
- chart.setTitle("BarChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.BarChart;
+import javafx.scene.chart.CategoryAxis;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewBarChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewBarChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ScatterChartTestApp");
+ return new NewBarChartApp.BarChartScene();
+ }
+
+ class BarChartScene extends CommonPropertiesScene {
+
+ //BarChart to be tested.
+ BarChart testedBarChart;
+ NumberAxis axis2;
+ ObservableList existingCategories;
+ CategoryAxis axis1;
+ TabPaneWithControl pane;
+
+ public BarChartScene() {
+ super("BarChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ existingCategories = FXCollections.observableArrayList();
+ existingCategories.addAll("category1", "category2", "category3");
+ axis1 = new CategoryAxis(existingCategories);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedBarChart = getNewChart();
+ testedBarChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog(), getAddCategoryDialog(), getRemoveCategoryDialog());
+
+ pane = getPaneFor(testedBarChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedBarChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedBarChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getRemoveCategoryDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From index");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ Button bt = new Button("Remove category!");
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ existingCategories.remove(index);
+ axis1.getCategories().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getAddCategoryDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("Category");
+ final TextField tf = new TextField("");
+ tf.setPrefWidth(50);
+
+ Label lind = new Label("to index");
+ final TextField tfind = new TextField("0");
+ tfind.setPrefWidth(50);
+
+ Button bt = new Button("Add!");
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tfind.getText());
+ existingCategories.add(index, tf.getText());
+ axis1.getCategories().add(index, tf.getText());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, lind, tfind, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ 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(" min ");
+ final TextField minText = new TextField();
+ minText.setPrefWidth(50);
+ minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID);
+
+ Label maxLabel = new Label(" max ");
+ final TextField maxText = new TextField();
+ maxText.setPrefWidth(50);
+ maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID);
+
+ Label amountLabel = new Label(" amount ");
+ final TextField amountText = new TextField();
+ amountText.setPrefWidth(50);
+ amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID);
+
+ Button bt = new Button("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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ XYChart.Series serie = new XYChart.Series(serieName, list);
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ String category = existingCategories.get(new Random().nextInt(existingCategories.size()));
+ Double value = new Random().nextDouble() * (max - min) + min;
+ newData.setYValue(category);
+ newData.setXValue(value);
+ list.add(newData);
+ }
+
+ testedBarChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getXValue(), data);
+ }
+
+ return table;
+ }
+
+ public BarChart getNewChart() {
+ BarChart chart = new BarChart(axis2, axis1);
+ chart.setTitle("BarChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewBubbleChartApp.java 2016-12-22 11:26:20.920997088 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewBubbleChartApp.java 2016-12-22 11:26:20.868996586 +0300
@@ -1,312 +1,335 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.BubbleChart;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.scene.chart.XYChart.Series;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewBubbleChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewBubbleChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "BubbleChartTestApp");
- return new NewBubbleChartApp.BubbleChartScene();
- }
-
- class BubbleChartScene extends CommonPropertiesScene {
-
- //BubbleChart to be tested.
- BubbleChart testedBubbleChart;
- NumberAxis axis1;
- NumberAxis axis2;
- TabPaneWithControl pane;
-
- public BubbleChartScene() {
- super("BubbleChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- axis1 = new NumberAxis(0, 100, 10);
- axis2 = new NumberAxis(0, 100, 10);
- testedBubbleChart = getNewChart();
- testedBubbleChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getAddBubbleToSerieDialog(), getRemoveDataDialog(), getRemoveDataFromSerieDialog());
-
- pane = getPaneFor(testedBubbleChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedBubbleChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove serie!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedBubbleChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getRemoveDataFromSerieDialog() {
- HBox hb = new HBox();
- Label lb1 = new Label("From serie");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb2 = new Label("from index");
- final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("remove bubble!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int serie = Integer.parseInt(tf1.getText());
- int index = Integer.parseInt(tf2.getText());
- ((Series) testedBubbleChart.getData().get(serie)).getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
- return hb;
- }
-
- public HBox getAddBubbleToSerieDialog() {
- HBox hb = new HBox();
- Label lb1 = new Label("To serie");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb2 = new Label("to index");
- final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb3 = new Label("X");
- final TextField tf3 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb4 = new Label("Y");
- final TextField tf4 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb5 = new Label("R");
- final TextField tf5 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("add bubble!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int serie = Integer.parseInt(tf1.getText());
- int index = Integer.parseInt(tf2.getText());
- double X = Double.parseDouble(tf3.getText());
- double Y = Double.parseDouble(tf4.getText());
- double R = Double.parseDouble(tf5.getText());
-
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(X);
- newData.setYValue(Y);
- newData.setExtraValue(R);
-
- ((Series) testedBubbleChart.getData().get(serie)).getData().add(index, newData);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, lb4, tf4, lb5, tf5, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- 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(" min X,Y ");
- final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build();
-
- Label maxLabel = new Label(" max X,Y ");
- final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build();
-
- Label amountLabel = new Label(" add ");
- final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build();
-
- Button bt = ButtonBuilder.create().text(" bubbles!").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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- XYChart.Series serie = new XYChart.Series(serieName, list);
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(new Random().nextDouble() * (max - min) + min);
- newData.setYValue(new Random().nextDouble() * (max - min) + min);
- newData.setExtraValue(new Random().nextDouble() * (max - min) / 8 + min);
- list.add(newData);
- }
-
- testedBubbleChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
- final DoubleProperty intermediateExtra = new SimpleDoubleProperty(null, "ExtraValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateX.isBound()) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateY.isBound()) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- }
- });
-
- data.extraValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateExtra.isBound()) {
- intermediateExtra.setValue((Double) data.extraValueProperty().getValue());
- }
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- intermediateExtra.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setExtraValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- table.addDoublePropertyLine(intermediateExtra, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public BubbleChart getNewChart() {
- BubbleChart chart = new BubbleChart(axis1, axis2);
- chart.setTitle("BubbleChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.BubbleChart;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.scene.chart.XYChart.Series;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewBubbleChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewBubbleChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "BubbleChartTestApp");
+ return new NewBubbleChartApp.BubbleChartScene();
+ }
+
+ class BubbleChartScene extends CommonPropertiesScene {
+
+ //BubbleChart to be tested.
+ BubbleChart testedBubbleChart;
+ NumberAxis axis1;
+ NumberAxis axis2;
+ TabPaneWithControl pane;
+
+ public BubbleChartScene() {
+ super("BubbleChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ axis1 = new NumberAxis(0, 100, 10);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedBubbleChart = getNewChart();
+ testedBubbleChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getAddBubbleToSerieDialog(), getRemoveDataDialog(), getRemoveDataFromSerieDialog());
+
+ pane = getPaneFor(testedBubbleChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedBubbleChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove serie!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedBubbleChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getRemoveDataFromSerieDialog() {
+ HBox hb = new HBox();
+ Label lb1 = new Label("From serie");
+ final TextField tf1 = new TextField("0");
+ tf1.setPrefWidth(50);
+
+ Label lb2 = new Label("from index");
+ final TextField tf2 = new TextField("0");
+ tf2.setPrefWidth(50);
+
+ Button bt = new Button("remove bubble!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int serie = Integer.parseInt(tf1.getText());
+ int index = Integer.parseInt(tf2.getText());
+ ((Series) testedBubbleChart.getData().get(serie)).getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
+ return hb;
+ }
+
+ public HBox getAddBubbleToSerieDialog() {
+ HBox hb = new HBox();
+ Label lb1 = new Label("To serie");
+ final TextField tf1 = new TextField("0");
+ tf1.setPrefWidth(50);
+
+ Label lb2 = new Label("to index");
+ final TextField tf2 = new TextField("0");
+ tf2.setPrefWidth(50);
+
+ Label lb3 = new Label("X");
+ final TextField tf3 = new TextField("0");
+ tf3.setPrefWidth(50);
+
+ Label lb4 = new Label("Y");
+ final TextField tf4 = new TextField("0");
+ tf4.setPrefWidth(50);
+
+ Label lb5 = new Label("R");
+ final TextField tf5 = new TextField("0");
+ tf5.setPrefWidth(50);
+
+ Button bt = new Button("add bubble!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int serie = Integer.parseInt(tf1.getText());
+ int index = Integer.parseInt(tf2.getText());
+ double X = Double.parseDouble(tf3.getText());
+ double Y = Double.parseDouble(tf4.getText());
+ double R = Double.parseDouble(tf5.getText());
+
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(X);
+ newData.setYValue(Y);
+ newData.setExtraValue(R);
+
+ ((Series) testedBubbleChart.getData().get(serie)).getData().add(index, newData);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, lb4, tf4, lb5, tf5, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ 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(" min X,Y ");
+ final TextField minText = new TextField();
+ minText.setPrefWidth(50);
+ minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID);
+
+ Label maxLabel = new Label(" max X,Y ");
+ final TextField maxText = new TextField();
+ maxText.setPrefWidth(50);
+ maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID);
+
+ Label amountLabel = new Label(" add ");
+ final TextField amountText = new TextField();
+ amountText.setPrefWidth(50);
+ amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID);
+
+ Button bt = new Button(" bubbles!");
+ 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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ XYChart.Series serie = new XYChart.Series(serieName, list);
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(new Random().nextDouble() * (max - min) + min);
+ newData.setYValue(new Random().nextDouble() * (max - min) + min);
+ newData.setExtraValue(new Random().nextDouble() * (max - min) / 8 + min);
+ list.add(newData);
+ }
+
+ testedBubbleChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+ final DoubleProperty intermediateExtra = new SimpleDoubleProperty(null, "ExtraValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateX.isBound()) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateY.isBound()) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ }
+ });
+
+ data.extraValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateExtra.isBound()) {
+ intermediateExtra.setValue((Double) data.extraValueProperty().getValue());
+ }
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ intermediateExtra.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setExtraValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ table.addDoublePropertyLine(intermediateExtra, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public BubbleChart getNewChart() {
+ BubbleChart chart = new BubbleChart(axis1, axis2);
+ chart.setTitle("BubbleChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewLineChartApp.java 2016-12-22 11:26:21.108998901 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewLineChartApp.java 2016-12-22 11:26:21.060998438 +0300
@@ -1,300 +1,326 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.LineChart;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.XYChart;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewLineChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_LINE_TEXT_FIELD_ID = "ADD_LINE_TEXT_FIELD_ID";
- public final static String ADD_LINE_AT_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_LINE_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
- public final static String REMOVE_LINE_FROM_POS_TEXT_FIELD_ID = "REMOVE_AREA_POS_TEXT_FIELD_ID";
- public final static String REMOVE_INDEX_TEXT_FIELD_ID = "REMOVE_INDEX_TEXT_FIELD_ID";
- public final static String ADD_LINE_POS_TEXT_FIELD_ID = "ADD_AREA_POS_TEXT_FIELD_ID";
- public final static String ADD_INDEX_TEXT_FIELD_ID = "ADD_INDEX_TEXT_FIELD_ID";
- public final static String ADD_VALUE_TEXT_FIELD_ID = "ADD_VALUE_TEXT_FIELD_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewLineChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "LineChartTestApp");
- return new NewLineChartApp.LineChartScene();
- }
-
- class LineChartScene extends CommonPropertiesScene {
-
- //LineChart to be tested.
- LineChart testedLineChart;
- NumberAxis axis1;
- NumberAxis axis2;
- TabPaneWithControl pane;
-
- public LineChartScene() {
- super("LineChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- 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() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddLineHBox(), getAddPointToDataDialog(), getRemoveDataDialog(), getRemovePointFromDataDialog());
-
- pane = getPaneFor(testedLineChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedLineChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- 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());
-
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue((((Double) ((XYChart.Data) (((XYChart.Series) testedLineChart.getData().get(area)).getData().get(point))).getXValue()) + ((Double) ((XYChart.Data) (((XYChart.Series) testedLineChart.getData().get(area)).getData().get(point - 1))).getXValue())) / 2);
- newData.setYValue(value);
-
- ((XYChart.Series) testedLineChart.getData().get(area)).getData().add(point, newData);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, bt);
- return hb;
- }
-
- 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);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
- return hb;
- }
-
- 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);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- 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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(new Random().nextDouble() * (max - min) + min);
- newData.setYValue(new Random().nextDouble() * (max - min) + min);
- list.add(newData);
- }
- Object[] array = list.toArray();
- Arrays.sort(array, new Comparator() {
- public int compare(Object t, Object t1) {
- return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
- }
- });
-
- XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
-
- testedLineChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateX.isBound()) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- if (!intermediateY.isBound()) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public LineChart getNewChart() {
- LineChart chart = new LineChart(axis1, axis2);
- chart.setTitle("LineChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.LineChart;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.XYChart;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewLineChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_LINE_TEXT_FIELD_ID = "ADD_LINE_TEXT_FIELD_ID";
+ public final static String ADD_LINE_AT_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_LINE_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+ public final static String REMOVE_LINE_FROM_POS_TEXT_FIELD_ID = "REMOVE_AREA_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_INDEX_TEXT_FIELD_ID = "REMOVE_INDEX_TEXT_FIELD_ID";
+ public final static String ADD_LINE_POS_TEXT_FIELD_ID = "ADD_AREA_POS_TEXT_FIELD_ID";
+ public final static String ADD_INDEX_TEXT_FIELD_ID = "ADD_INDEX_TEXT_FIELD_ID";
+ public final static String ADD_VALUE_TEXT_FIELD_ID = "ADD_VALUE_TEXT_FIELD_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewLineChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "LineChartTestApp");
+ return new NewLineChartApp.LineChartScene();
+ }
+
+ class LineChartScene extends CommonPropertiesScene {
+
+ //LineChart to be tested.
+ LineChart testedLineChart;
+ NumberAxis axis1;
+ NumberAxis axis2;
+ TabPaneWithControl pane;
+
+ public LineChartScene() {
+ super("LineChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ 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() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddLineHBox(), getAddPointToDataDialog(), getRemoveDataDialog(), getRemovePointFromDataDialog());
+
+ pane = getPaneFor(testedLineChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedLineChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ 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());
+
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue((((Double) ((XYChart.Data) (((XYChart.Series) testedLineChart.getData().get(area)).getData().get(point))).getXValue()) + ((Double) ((XYChart.Data) (((XYChart.Series) testedLineChart.getData().get(area)).getData().get(point - 1))).getXValue())) / 2);
+ newData.setYValue(value);
+
+ ((XYChart.Series) testedLineChart.getData().get(area)).getData().add(point, newData);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, bt);
+ return hb;
+ }
+
+ 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);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
+ return hb;
+ }
+
+ 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);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ 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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(new Random().nextDouble() * (max - min) + min);
+ newData.setYValue(new Random().nextDouble() * (max - min) + min);
+ list.add(newData);
+ }
+ Object[] array = list.toArray();
+ Arrays.sort(array, new Comparator() {
+ public int compare(Object t, Object t1) {
+ return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
+ }
+ });
+
+ XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
+
+ testedLineChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateX.isBound()) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ if (!intermediateY.isBound()) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public LineChart getNewChart() {
+ LineChart chart = new LineChart(axis1, axis2);
+ chart.setTitle("LineChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewNumberScatterChartApp.java 2016-12-22 11:26:21.301000752 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewNumberScatterChartApp.java 2016-12-22 11:26:21.249000251 +0300
@@ -1,287 +1,309 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.ScatterChart;
-import javafx.scene.chart.XYChart;
-import javafx.scene.chart.XYChart.Data;
-import javafx.scene.chart.XYChart.Series;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewNumberScatterChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewNumberScatterChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ScatterChartTestApp");
- return new NewNumberScatterChartApp.ScatterChartScene();
- }
-
- class ScatterChartScene extends CommonPropertiesScene {
-
- //ScatterChart to be tested.
- ScatterChart testedScatterChart;
- NumberAxis axis1;
- NumberAxis axis2;
- TabPaneWithControl pane;
-
- public ScatterChartScene() {
- super("NumberScatterChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- axis1 = new NumberAxis(0, 100, 10);
- axis2 = new NumberAxis(0, 100, 10);
- testedScatterChart = getNewChart();
- testedScatterChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getAddPointToSerieDialog(), getRemoveDataFromSerieDialog(), getRemoveDataDialog());
-
- pane = getPaneFor(testedScatterChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedScatterChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedScatterChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getRemoveDataFromSerieDialog() {
- HBox hb = new HBox();
- Label lb1 = new Label("From serie");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb2 = new Label("from index");
- final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("remove point!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int serie = Integer.parseInt(tf1.getText());
- int index = Integer.parseInt(tf2.getText());
- ((Series) testedScatterChart.getData().get(serie)).getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
- return hb;
- }
-
- public HBox getAddPointToSerieDialog() {
- HBox hb = new HBox();
- Label lb1 = new Label("To serie");
- final TextField tf1 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb2 = new Label("to index");
- final TextField tf2 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb3 = new Label("X");
- final TextField tf3 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Label lb4 = new Label("Y");
- final TextField tf4 = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("add point!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int serie = Integer.parseInt(tf1.getText());
- int index = Integer.parseInt(tf2.getText());
- double X = Double.parseDouble(tf3.getText());
- double Y = Double.parseDouble(tf4.getText());
-
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(X);
- newData.setYValue(Y);
-
- ((Series) testedScatterChart.getData().get(serie)).getData().add(index, newData);
- }
- });
- hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, lb4, tf4, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- 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(" min ");
- final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build();
-
- Label maxLabel = new Label(" max ");
- final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build();
-
- Label amountLabel = new Label(" amount ");
- final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build();
-
- Button bt = ButtonBuilder.create().text("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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- Series serie = new XYChart.Series(serieName, list);
-
- for (int i = 0; i < amount; i++) {
- Data newData = new Data();
- newData.setXValue(new Random().nextDouble() * (max - min) + min);
- newData.setYValue(new Random().nextDouble() * (max - min) + min);
- list.add(newData);
- }
-
- testedScatterChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final Data data = (Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public ScatterChart getNewChart() {
- ScatterChart chart = new ScatterChart(axis1, axis2);
- chart.setTitle("ScatterChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.ScatterChart;
+import javafx.scene.chart.XYChart;
+import javafx.scene.chart.XYChart.Data;
+import javafx.scene.chart.XYChart.Series;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewNumberScatterChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewNumberScatterChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ScatterChartTestApp");
+ return new NewNumberScatterChartApp.ScatterChartScene();
+ }
+
+ class ScatterChartScene extends CommonPropertiesScene {
+
+ //ScatterChart to be tested.
+ ScatterChart testedScatterChart;
+ NumberAxis axis1;
+ NumberAxis axis2;
+ TabPaneWithControl pane;
+
+ public ScatterChartScene() {
+ super("NumberScatterChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ axis1 = new NumberAxis(0, 100, 10);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedScatterChart = getNewChart();
+ testedScatterChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getAddPointToSerieDialog(), getRemoveDataFromSerieDialog(), getRemoveDataDialog());
+
+ pane = getPaneFor(testedScatterChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedScatterChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedScatterChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getRemoveDataFromSerieDialog() {
+ HBox hb = new HBox();
+ Label lb1 = new Label("From serie");
+ final TextField tf1 = new TextField("0");
+ tf1.setPrefWidth(50);
+
+ Label lb2 = new Label("from index");
+ final TextField tf2 = new TextField("0");
+ tf2.setPrefWidth(50);
+
+ Button bt = new Button("remove point!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int serie = Integer.parseInt(tf1.getText());
+ int index = Integer.parseInt(tf2.getText());
+ ((Series) testedScatterChart.getData().get(serie)).getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, bt);
+ return hb;
+ }
+
+ public HBox getAddPointToSerieDialog() {
+ HBox hb = new HBox();
+ Label lb1 = new Label("To serie");
+ final TextField tf1 = new TextField("0");
+ tf1.setPrefWidth(50);
+
+ Label lb2 = new Label("to index");
+ final TextField tf2 = new TextField("0");
+ tf2.setPrefWidth(50);
+
+ Label lb3 = new Label("X");
+ final TextField tf3 = new TextField("0");
+ tf3.setPrefWidth(50);
+
+ Label lb4 = new Label("Y");
+ final TextField tf4 = new TextField("0");
+ tf4.setPrefWidth(50);
+
+ Button bt = new Button("add point!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int serie = Integer.parseInt(tf1.getText());
+ int index = Integer.parseInt(tf2.getText());
+ double X = Double.parseDouble(tf3.getText());
+ double Y = Double.parseDouble(tf4.getText());
+
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(X);
+ newData.setYValue(Y);
+
+ ((Series) testedScatterChart.getData().get(serie)).getData().add(index, newData);
+ }
+ });
+ hb.getChildren().addAll(lb1, tf1, lb2, tf2, lb3, tf3, lb4, tf4, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ 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(" min ");
+ final TextField minText = new TextField();
+ minText.setPrefWidth(50);
+ minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID);
+
+ Label maxLabel = new Label(" max ");
+ final TextField maxText = new TextField();
+ maxText.setPrefWidth(50);
+ maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID);
+
+ Label amountLabel = new Label(" amount ");
+ final TextField amountText = new TextField();
+ amountText.setPrefWidth(50);
+ amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID);
+
+ Button bt = new Button("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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ Series serie = new XYChart.Series(serieName, list);
+
+ for (int i = 0; i < amount; i++) {
+ Data newData = new Data();
+ newData.setXValue(new Random().nextDouble() * (max - min) + min);
+ newData.setYValue(new Random().nextDouble() * (max - min) + min);
+ list.add(newData);
+ }
+
+ testedScatterChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final Data data = (Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public ScatterChart getNewChart() {
+ ScatterChart chart = new ScatterChart(axis1, axis2);
+ chart.setTitle("ScatterChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewPieChartApp.java 2016-12-22 11:26:21.493002605 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewPieChartApp.java 2016-12-22 11:26:21.441002103 +0300
@@ -1,201 +1,213 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Scene;
-import javafx.scene.chart.PieChart;
-import javafx.scene.chart.PieChart.Data;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewPieChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_VALUE_TEXT_FIELD_ID = "ADD_ITEM_VALUE_TEXT_FIELD_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewPieChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "PieChartTestApp");
- return new PieChartScene();
- }
-
- class PieChartScene extends CommonPropertiesScene {
-
- //VBox which contain tested PieChart.
- Pane pane;
- PropertiesTable tb;
- //PieChart to be tested.
- PieChart testedPieChart;
- double controlContainerWidth = 600;
- double controlContainerHeight = 600;
- ObservableList data;
-
- public PieChartScene() {
- super("PieChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
- pane = new Pane();
- testedPieChart = getNewChart();
- testedPieChart.setId(TESTED_CHART_ID);
-
- tb = new PropertiesTable(testedPieChart);
- PropertyTablesFactory.explorePropertiesList(testedPieChart, tb);
- SpecialTablePropertiesProvider.provideForControl(testedPieChart, tb);
-
- pane.setMinSize(controlContainerWidth, controlContainerHeight);
- pane.setPrefSize(controlContainerWidth, controlContainerHeight);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedPieChart);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- Button b = new Button("Add");
- b.setOnAction(new EventHandler() {
- public void handle(Event t) {
- for (Data data : testedPieChart.getData()) {
- Label label = new Label("Label");
- label.setLabelFor(data.getNode());
- }
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton, b);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog());
-
- ScrollPane sp = new ScrollPane();
- sp.setContent(tb);
- sp.setPannable(true);
- sp.setMinWidth(1000);
- sp.setMinHeight(800);
-
- setTestedControl(testedPieChart);
- setPropertiesContent(sp);
- setTestedControlContainerSize(500, 500);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- ((PieChart) testedPieChart).getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- HBox hb = new HBox();
- Label lb = new Label("Add item");
- final TextField tf = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_VALUE_TEXT_FIELD_ID).build();
- Label namedLabel = new Label(" named ");
- final TextField name = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_TEXT_FIELD_ID).build();
- Label atLb = new Label("at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_POSITION_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_ITEM_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tfPos.getText());
-
- Data newData = new Data("".equals(name.getText()) ? String.valueOf(index) : name.getText(), Double.parseDouble(tf.getText()));
-
- ((PieChart) testedPieChart).getData().add(index, newData);
-
- tb.addDoublePropertyLine(newData.pieValueProperty(), -10, 10000, 100, newData);
- }
- });
- hb.getChildren().addAll(lb, tf, namedLabel, name, atLb, tfPos, bt);
- return hb;
- }
-
- public PieChart getNewChart() {
- data = FXCollections.observableArrayList();
- //Don't change numbers here.
- for (int i = 0; i < 4; i++) {
- data.add(new Data("Data item " + i, 100));
- }
- PieChart chart = new PieChart(data);
- chart.setTitle("PieChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.chart.PieChart;
+import javafx.scene.chart.PieChart.Data;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewPieChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_VALUE_TEXT_FIELD_ID = "ADD_ITEM_VALUE_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewPieChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "PieChartTestApp");
+ return new PieChartScene();
+ }
+
+ class PieChartScene extends CommonPropertiesScene {
+
+ //VBox which contain tested PieChart.
+ Pane pane;
+ PropertiesTable tb;
+ //PieChart to be tested.
+ PieChart testedPieChart;
+ double controlContainerWidth = 600;
+ double controlContainerHeight = 600;
+ ObservableList data;
+
+ public PieChartScene() {
+ super("PieChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+ pane = new Pane();
+ testedPieChart = getNewChart();
+ testedPieChart.setId(TESTED_CHART_ID);
+
+ tb = new PropertiesTable(testedPieChart);
+ PropertyTablesFactory.explorePropertiesList(testedPieChart, tb);
+ SpecialTablePropertiesProvider.provideForControl(testedPieChart, tb);
+
+ pane.setMinSize(controlContainerWidth, controlContainerHeight);
+ pane.setPrefSize(controlContainerWidth, controlContainerHeight);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedPieChart);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ Button b = new Button("Add");
+ b.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ for (Data data : testedPieChart.getData()) {
+ Label label = new Label("Label");
+ label.setLabelFor(data.getNode());
+ }
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton, b);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog());
+
+ ScrollPane sp = new ScrollPane();
+ sp.setContent(tb);
+ sp.setPannable(true);
+ sp.setMinWidth(1000);
+ sp.setMinHeight(800);
+
+ setTestedControl(testedPieChart);
+ setPropertiesContent(sp);
+ setTestedControlContainerSize(500, 500);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ ((PieChart) testedPieChart).getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ HBox hb = new HBox();
+ Label lb = new Label("Add item");
+ final TextField tf = new TextField();
+ tf.setPrefWidth(50);
+ tf.setId(ADD_ITEM_VALUE_TEXT_FIELD_ID);
+ Label namedLabel = new Label(" named ");
+ final TextField name = new TextField();
+ name.setPrefWidth(50);
+ name.setId(ADD_ITEM_TEXT_FIELD_ID);
+ Label atLb = new Label("at pos");
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);
+ Button bt = new Button("Add!");
+ bt.setId(ADD_ITEM_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tfPos.getText());
+
+ Data newData = new Data("".equals(name.getText()) ? String.valueOf(index) : name.getText(), Double.parseDouble(tf.getText()));
+
+ ((PieChart) testedPieChart).getData().add(index, newData);
+
+ tb.addDoublePropertyLine(newData.pieValueProperty(), -10, 10000, 100, newData);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, namedLabel, name, atLb, tfPos, bt);
+ return hb;
+ }
+
+ public PieChart getNewChart() {
+ data = FXCollections.observableArrayList();
+ //Don't change numbers here.
+ for (int i = 0; i < 4; i++) {
+ data.add(new Data("Data item " + i, 100));
+ }
+ PieChart chart = new PieChart(data);
+ chart.setTitle("PieChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewStackedAreaChartApp.java 2016-12-22 11:26:21.681004418 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewStackedAreaChartApp.java 2016-12-22 11:26:21.629003917 +0300
@@ -1,234 +1,248 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Arrays;
-import java.util.Comparator;
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.StackedAreaChart;
-import javafx.scene.chart.XYChart;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewStackedAreaChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public static void main(String[] args) {
- Utils.launch(NewStackedAreaChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "StackedAreaChartTestApp");
- return new NewStackedAreaChartApp.AreaChartScene();
- }
-
- class AreaChartScene extends CommonPropertiesScene {
-
- //AreaChart to be tested.
- StackedAreaChart testedStackedAreaChart;
- NumberAxis axis1;
- NumberAxis axis2;
- TabPaneWithControl pane;
-
- public AreaChartScene() {
- super("StackedAreaChartApp", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- axis1 = new NumberAxis(0, 100, 10);
- axis2 = new NumberAxis(0, 100, 10);
- testedStackedAreaChart = getNewChart();
- testedStackedAreaChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog());
-
- pane = getPaneFor(testedStackedAreaChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedStackedAreaChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_AREA_INDEX_TEXTFIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_AREA_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedStackedAreaChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- 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(" min ");
- final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build();
-
- Label maxLabel = new Label(" max ");
- final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build();
-
- Label amountLabel = new Label(" amount ");
- final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build();
-
- Button bt = ButtonBuilder.create().text("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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- newData.setXValue(new Random().nextDouble() * (max - min) + min);
- newData.setYValue(new Random().nextDouble() * (max - min) / 4 + min);
- list.add(newData);
- }
- Object[] array = list.toArray();
- Arrays.sort(array, new Comparator() {
- public int compare(Object t, Object t1) {
- return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
- }
- });
-
- XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
-
- testedStackedAreaChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public StackedAreaChart getNewChart() {
- StackedAreaChart chart = new StackedAreaChart(axis1, axis2);
- chart.setTitle("StackedAreaChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Arrays;
+import java.util.Comparator;
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.StackedAreaChart;
+import javafx.scene.chart.XYChart;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewStackedAreaChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public static void main(String[] args) {
+ Utils.launch(NewStackedAreaChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "StackedAreaChartTestApp");
+ return new NewStackedAreaChartApp.AreaChartScene();
+ }
+
+ class AreaChartScene extends CommonPropertiesScene {
+
+ //AreaChart to be tested.
+ StackedAreaChart testedStackedAreaChart;
+ NumberAxis axis1;
+ NumberAxis axis2;
+ TabPaneWithControl pane;
+
+ public AreaChartScene() {
+ super("StackedAreaChartApp", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ axis1 = new NumberAxis(0, 100, 10);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedStackedAreaChart = getNewChart();
+ testedStackedAreaChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog());
+
+ pane = getPaneFor(testedStackedAreaChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedStackedAreaChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_AREA_INDEX_TEXTFIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_AREA_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedStackedAreaChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ 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(" min ");
+ final TextField minText = new TextField();
+ minText.setPrefWidth(50);
+ minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID);
+
+ Label maxLabel = new Label(" max ");
+ final TextField maxText = new TextField();
+ maxText.setPrefWidth(50);
+ maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID);
+
+ Label amountLabel = new Label(" amount ");
+ final TextField amountText = new TextField();
+ amountText.setPrefWidth(50);
+ amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID);
+
+ Button bt = new Button("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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ newData.setXValue(new Random().nextDouble() * (max - min) + min);
+ newData.setYValue(new Random().nextDouble() * (max - min) / 4 + min);
+ list.add(newData);
+ }
+ Object[] array = list.toArray();
+ Arrays.sort(array, new Comparator() {
+ public int compare(Object t, Object t1) {
+ return (int) Math.round(((Double) ((XYChart.Data) t).getXValue()) - ((Double) ((XYChart.Data) t1).getXValue()));
+ }
+ });
+
+ XYChart.Series serie = new XYChart.Series(serieName, FXCollections.observableArrayList(array));
+
+ testedStackedAreaChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateX, min, max, (Double) data.getXValue(), data);
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public StackedAreaChart getNewChart() {
+ StackedAreaChart chart = new StackedAreaChart(axis1, axis2);
+ chart.setTitle("StackedAreaChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewStackedBarChartApp.java 2016-12-22 11:26:21.877006308 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/apps/NewStackedBarChartApp.java 2016-12-22 11:26:21.825005806 +0300
@@ -1,273 +1,290 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.apps;
-
-import java.util.Iterator;
-import java.util.Random;
-import javafx.beans.property.DoubleProperty;
-import javafx.beans.property.SimpleDoubleProperty;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.chart.CategoryAxis;
-import javafx.scene.chart.NumberAxis;
-import javafx.scene.chart.StackedBarChart;
-import javafx.scene.chart.XYChart;
-import javafx.scene.control.*;
-import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewStackedBarChartApp extends InteroperabilityApp implements ChartIDsInterface {
-
- public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
- public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
- public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
- public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
- public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewStackedBarChartApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ScatterChartTestApp");
- return new NewStackedBarChartApp.StackedBarChartScene();
- }
-
- class StackedBarChartScene extends CommonPropertiesScene {
-
- //StackedBarChart to be tested.
- StackedBarChart testedStackedBarChart;
- NumberAxis axis2;
- ObservableList existingCategories;
- CategoryAxis axis1;
- TabPaneWithControl pane;
-
- public StackedBarChartScene() {
- super("StackedBarChart", 1300, 800);
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- existingCategories = FXCollections.observableArrayList();
- existingCategories.addAll("category1", "category2", "category3");
- axis1 = new CategoryAxis(existingCategories);
- axis2 = new NumberAxis(0, 100, 10);
- testedStackedBarChart = getNewChart();
- testedStackedBarChart.setId(TESTED_CHART_ID);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- //throw new UnsupportedOperationException("Not supported yet.");
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog(), getAddCategoryDialog(), getRemoveCategoryDialog());
-
- pane = getPaneFor(testedStackedBarChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
-
- setTestedControlContainerSize(500, 500);
- setTestedControl(testedStackedBarChart);
- setPropertiesContent(pane);
- setControllersContent(vb);
- }
-
- public HBox getRemoveDataDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- testedStackedBarChart.getData().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getRemoveCategoryDialog() {
- HBox hb = new HBox();
- Label lb = new Label("From index");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).build();
- Button bt = ButtonBuilder.create().text("Remove category!").build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tf.getText());
- existingCategories.remove(index);
- axis1.getCategories().remove(index);
- }
- });
- hb.getChildren().addAll(lb, tf, bt);
- return hb;
- }
-
- public HBox getAddCategoryDialog() {
- HBox hb = new HBox();
- Label lb = new Label("Category");
- final TextField tf = TextFieldBuilder.create().text("").prefWidth(50).build();
-
- Label lind = new Label("to index");
- final TextField tfind = TextFieldBuilder.create().text("0").prefWidth(50).build();
-
- Button bt = ButtonBuilder.create().text("Add!").build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- int index = Integer.parseInt(tfind.getText());
- existingCategories.add(index, tf.getText());
- axis1.getCategories().add(index, tf.getText());
- }
- });
- hb.getChildren().addAll(lb, tf, lind, tfind, bt);
- return hb;
- }
-
- public HBox getAddItemHBox() {
- 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(" min ");
- final TextField minText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID).build();
-
- Label maxLabel = new Label(" max ");
- final TextField maxText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID).build();
-
- Label amountLabel = new Label(" amount ");
- final TextField amountText = TextFieldBuilder.create().prefWidth(50).id(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID).build();
-
- Button bt = ButtonBuilder.create().text("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());
- int amount = Integer.parseInt(amountText.getText());
-
- ObservableList list = FXCollections.observableArrayList();
-
- XYChart.Series serie = new XYChart.Series(serieName, list);
-
- for (int i = 0; i < amount; i++) {
- XYChart.Data newData = new XYChart.Data();
- String category = existingCategories.get(new Random().nextInt(existingCategories.size()));
- Double value = new Random().nextDouble() * (max - min) + min;
- newData.setYValue(value);
- newData.setXValue(category);
- list.add(newData);
- }
-
- testedStackedBarChart.getData().add(serie);
- pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
- }
- });
- hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
- return hb;
- }
-
- protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
- PropertiesTable table = new PropertiesTable(serie);
-
- table.addSimpleListener(serie.chartProperty(), serie);
- table.addSimpleListener(serie.nameProperty(), serie);
- table.addSimpleListener(serie.dataProperty(), serie);
-
- for (Iterator it = serie.getData().iterator(); it.hasNext();) {
- final XYChart.Data data = (XYChart.Data) it.next();
-
- final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
- final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
-
- data.XValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateX.setValue((Double) data.XValueProperty().getValue());
- }
- });
-
- data.YValueProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- intermediateY.setValue((Double) data.YValueProperty().getValue());
- }
- });
-
- intermediateX.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setXValue(t1);
- }
- });
-
- intermediateY.addListener(new ChangeListener() {
- public void changed(ObservableValue ov, Object t, Object t1) {
- data.setYValue(t1);
- }
- });
-
- table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
- }
-
- return table;
- }
-
- public StackedBarChart getNewChart() {
- StackedBarChart chart = new StackedBarChart(axis1, axis2);
- chart.setTitle("StackedBarChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.apps;
+
+import java.util.Iterator;
+import java.util.Random;
+import javafx.beans.property.DoubleProperty;
+import javafx.beans.property.SimpleDoubleProperty;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.chart.CategoryAxis;
+import javafx.scene.chart.NumberAxis;
+import javafx.scene.chart.StackedBarChart;
+import javafx.scene.chart.XYChart;
+import javafx.scene.control.*;
+import static javafx.scene.control.test.chart.apps.CommonFunctions.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewStackedBarChartApp extends InteroperabilityApp implements ChartIDsInterface {
+
+ public final static String REMOVE_ITEM_POS_TEXT_FIELD_ID = "REMOVE_ITEM_POS_TEXT_FIELD_ID";
+ public final static String REMOVE_BUTTON_ID = "REMOVE_BUTTON_ID";
+ public final static String ADD_ITEM_TEXT_FIELD_ID = "ADD_ITEM_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_POSITION_TEXT_FIELD_ID = "ADD_ITEM_POSITION_TEXT_FIELD_ID";
+ public final static String ADD_ITEM_BUTTON_ID = "ADD_ITEM_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewStackedBarChartApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ScatterChartTestApp");
+ return new NewStackedBarChartApp.StackedBarChartScene();
+ }
+
+ class StackedBarChartScene extends CommonPropertiesScene {
+
+ //StackedBarChart to be tested.
+ StackedBarChart testedStackedBarChart;
+ NumberAxis axis2;
+ ObservableList existingCategories;
+ CategoryAxis axis1;
+ TabPaneWithControl pane;
+
+ public StackedBarChartScene() {
+ super("StackedBarChart", 1300, 800);
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ existingCategories = FXCollections.observableArrayList();
+ existingCategories.addAll("category1", "category2", "category3");
+ axis1 = new CategoryAxis(existingCategories);
+ axis2 = new NumberAxis(0, 100, 10);
+ testedStackedBarChart = getNewChart();
+ testedStackedBarChart.setId(TESTED_CHART_ID);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ //throw new UnsupportedOperationException("Not supported yet.");
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(resetButtonsHBox, getAddItemHBox(), getRemoveDataDialog(), getAddCategoryDialog(), getRemoveCategoryDialog());
+
+ pane = getPaneFor(testedStackedBarChart, CHART_TAB_NAME, axis1, AXIS_1_TAB_NAME, axis2, AXIS_2_TAB_NAME);
+
+ setTestedControlContainerSize(500, 500);
+ setTestedControl(testedStackedBarChart);
+ setPropertiesContent(pane);
+ setControllersContent(vb);
+ }
+
+ public HBox getRemoveDataDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From position");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ testedStackedBarChart.getData().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getRemoveCategoryDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("From index");
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ Button bt = new Button("Remove category!");
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tf.getText());
+ existingCategories.remove(index);
+ axis1.getCategories().remove(index);
+ }
+ });
+ hb.getChildren().addAll(lb, tf, bt);
+ return hb;
+ }
+
+ public HBox getAddCategoryDialog() {
+ HBox hb = new HBox();
+ Label lb = new Label("Category");
+ final TextField tf = new TextField("");
+ tf.setPrefWidth(50);
+
+ Label lind = new Label("to index");
+ final TextField tfind = new TextField("0");
+ tfind.setPrefWidth(50);
+
+ Button bt = new Button("Add!");
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ int index = Integer.parseInt(tfind.getText());
+ existingCategories.add(index, tf.getText());
+ axis1.getCategories().add(index, tf.getText());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, lind, tfind, bt);
+ return hb;
+ }
+
+ public HBox getAddItemHBox() {
+ 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(" min ");
+ final TextField minText = new TextField();
+ minText.setPrefWidth(50);
+ minText.setId(ADDED_SERIES_MIN_VALUE_TEXTFIELD_ID);
+
+ Label maxLabel = new Label(" max ");
+ final TextField maxText = new TextField();
+ maxText.setPrefWidth(50);
+ maxText.setId(ADDED_SERIES_MAX_VALUE_TEXTFIELD_ID);
+
+ Label amountLabel = new Label(" amount ");
+ final TextField amountText = new TextField();
+ amountText.setPrefWidth(50);
+ amountText.setId(ADDED_SERIES_DOTS_COUNT_TEXTFIELD_ID);
+
+ Button bt = new Button("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());
+ int amount = Integer.parseInt(amountText.getText());
+
+ ObservableList list = FXCollections.observableArrayList();
+
+ XYChart.Series serie = new XYChart.Series(serieName, list);
+
+ for (int i = 0; i < amount; i++) {
+ XYChart.Data newData = new XYChart.Data();
+ String category = existingCategories.get(new Random().nextInt(existingCategories.size()));
+ Double value = new Random().nextDouble() * (max - min) + min;
+ newData.setYValue(value);
+ newData.setXValue(category);
+ list.add(newData);
+ }
+
+ testedStackedBarChart.getData().add(serie);
+ pane.addPropertiesTable(serieName, getTableForProperty(serie, min, max).getVisualRepresentation());
+ }
+ });
+ hb.getChildren().addAll(lb, tf, minLabel, minText, maxLabel, maxText, amountLabel, amountText, bt);
+ return hb;
+ }
+
+ protected PropertiesTable getTableForProperty(XYChart.Series serie, double min, double max) {
+ PropertiesTable table = new PropertiesTable(serie);
+
+ table.addSimpleListener(serie.chartProperty(), serie);
+ table.addSimpleListener(serie.nameProperty(), serie);
+ table.addSimpleListener(serie.dataProperty(), serie);
+
+ for (Iterator it = serie.getData().iterator(); it.hasNext();) {
+ final XYChart.Data data = (XYChart.Data) it.next();
+
+ final DoubleProperty intermediateX = new SimpleDoubleProperty(null, "XValue");
+ final DoubleProperty intermediateY = new SimpleDoubleProperty(null, "YValue");
+
+ data.XValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateX.setValue((Double) data.XValueProperty().getValue());
+ }
+ });
+
+ data.YValueProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ intermediateY.setValue((Double) data.YValueProperty().getValue());
+ }
+ });
+
+ intermediateX.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setXValue(t1);
+ }
+ });
+
+ intermediateY.addListener(new ChangeListener() {
+ public void changed(ObservableValue ov, Object t, Object t1) {
+ data.setYValue(t1);
+ }
+ });
+
+ table.addDoublePropertyLine(intermediateY, min, max, (Double) data.getYValue(), data);
+ }
+
+ return table;
+ }
+
+ public StackedBarChart getNewChart() {
+ StackedBarChart chart = new StackedBarChart(axis1, axis2);
+ chart.setTitle("StackedBarChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/chart/manual/PieChartManualApp.java 2016-12-22 11:26:22.069008159 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chart/manual/PieChartManualApp.java 2016-12-22 11:26:22.021007697 +0300
@@ -1,156 +1,155 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.chart.manual;
-
-import javafx.scene.control.test.utils.ptables.WeakPropertyValueController;
-import java.util.Arrays;
-import javafx.collections.FXCollections;
-import javafx.collections.ObservableList;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.scene.chart.PieChart;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.geometry.Side;
-import javafx.scene.layout.HBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-import javafx.scene.layout.VBox;
-import javafx.geometry.Orientation;
-
-/**
- * @author Alexander Kirov
- */
-public class PieChartManualApp extends InteroperabilityApp {
-
- public static void main(String[] args) {
- Utils.launch(PieChartManualApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "PieChartTestApp");
- return new PieChartScene();
- }
-
- class PieChartScene extends CommonPropertiesScene {
-
- //PieChart to be tested.
- PieChart testedPieChart;
- int controlContainerWidth = 400;
- int controlContainerHeight = 400;
- ObservableList data;
- VBox properties;
-
- public PieChartScene() {
- super("PieChart", 900, 630);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- testedPieChart = getNewChart();
- testedPieChart.setPrefSize(controlContainerHeight, controlContainerWidth);
- properties = new VBox(10);
-
- Button addDataButton = new Button("Add data at index 0");
- addDataButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedPieChart.getData().add(0, new PieChart.Data("Added data", Math.random() * 100));
- }
- });
-
- Button removeDataButton = new Button("Remove data from index 0");
- removeDataButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- if (testedPieChart.getData().size() > 0) {
- testedPieChart.getData().remove(0);
- }
- }
- });
-
- Button changeDataButton = new Button("Change data at index 0");
- changeDataButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- if (testedPieChart.getData().size() > 0) {
- PieChart.Data data = testedPieChart.getData().get(0);
- data.setPieValue(Math.max(0, data.getPieValue() + (Math.random() - 0.5) * 200));
- }
- }
- });
-
- Button hardResetButton = ButtonBuilder.create().text("Reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareMainSceneStructure();
- prepareScene();
- }
- });
-
- VBox vb = new VBox(5);
- vb.getChildren().addAll(hardResetButton,
- new Separator(Orientation.HORIZONTAL), new Label("Add new data : "), addDataButton,
- new Separator(Orientation.HORIZONTAL), new Label("Remove existing data : "), removeDataButton,
- new Separator(Orientation.HORIZONTAL), new Label("Change existing data : "), changeDataButton);
-
- addController(new WeakPropertyValueController(testedPieChart.animatedProperty(), testedPieChart));
- addController(new WeakPropertyValueController(testedPieChart.clockwiseProperty(), testedPieChart));
- addController(new WeakPropertyValueController(testedPieChart.legendVisibleProperty(), testedPieChart));
- addController(new WeakPropertyValueController(testedPieChart.startAngleProperty(), testedPieChart, -300.0, 0.0, 300.0));
- addController(new WeakPropertyValueController(testedPieChart.labelLineLengthProperty(), testedPieChart, -20.0, 10.0, 30.0));
- addController(new WeakPropertyValueController(testedPieChart.labelsVisibleProperty(), testedPieChart));
- addController(new WeakPropertyValueController(testedPieChart.titleProperty(), testedPieChart, "New title"));
- addController(new WeakPropertyValueController(testedPieChart.titleSideProperty(), testedPieChart, Arrays.asList(Side.values())));
- addController(new WeakPropertyValueController(testedPieChart.legendSideProperty(), testedPieChart, Arrays.asList(Side.values())));
- addController(new WeakPropertyValueController(testedPieChart.prefWidthProperty(), testedPieChart, 100.0, 400.0, 400.0));
- addController(new WeakPropertyValueController(testedPieChart.prefHeightProperty(), testedPieChart, 100.0, 400.0, 400.0));
-
- setTestedControlContainerSize(400, 400);
- setTestedControl(testedPieChart);
- setControllersContent(vb);
- setPropertiesContent(properties);
- }
-
- private void addController(WeakPropertyValueController controller) {
- properties.getChildren().addAll(new Separator(Orientation.HORIZONTAL), controller);
- }
-
- public PieChart getNewChart() {
- data = FXCollections.observableArrayList();
- for (int i = 0; i < 4; i++) {
- data.add(new PieChart.Data("Data item " + i, 50));
- }
- PieChart chart = new PieChart(data);
- chart.setTitle("PieChart");
- chart.setStyle("-fx-border-color: darkgray;");
- return chart;
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.chart.manual;
+
+import javafx.scene.control.test.utils.ptables.WeakPropertyValueController;
+import java.util.Arrays;
+import javafx.collections.FXCollections;
+import javafx.collections.ObservableList;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.chart.PieChart;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.geometry.Side;
+import javafx.scene.layout.HBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+import javafx.scene.layout.VBox;
+import javafx.geometry.Orientation;
+
+/**
+ * @author Alexander Kirov
+ */
+public class PieChartManualApp extends InteroperabilityApp {
+
+ public static void main(String[] args) {
+ Utils.launch(PieChartManualApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "PieChartTestApp");
+ return new PieChartScene();
+ }
+
+ class PieChartScene extends CommonPropertiesScene {
+
+ //PieChart to be tested.
+ PieChart testedPieChart;
+ int controlContainerWidth = 400;
+ int controlContainerHeight = 400;
+ ObservableList data;
+ VBox properties;
+
+ public PieChartScene() {
+ super("PieChart", 900, 630);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ testedPieChart = getNewChart();
+ testedPieChart.setPrefSize(controlContainerHeight, controlContainerWidth);
+ properties = new VBox(10);
+
+ Button addDataButton = new Button("Add data at index 0");
+ addDataButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ testedPieChart.getData().add(0, new PieChart.Data("Added data", Math.random() * 100));
+ }
+ });
+
+ Button removeDataButton = new Button("Remove data from index 0");
+ removeDataButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ if (testedPieChart.getData().size() > 0) {
+ testedPieChart.getData().remove(0);
+ }
+ }
+ });
+
+ Button changeDataButton = new Button("Change data at index 0");
+ changeDataButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ if (testedPieChart.getData().size() > 0) {
+ PieChart.Data data = testedPieChart.getData().get(0);
+ data.setPieValue(Math.max(0, data.getPieValue() + (Math.random() - 0.5) * 200));
+ }
+ }
+ });
+
+ Button hardResetButton = new Button("Reset");
+ hardResetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareMainSceneStructure();
+ prepareScene();
+ }
+ });
+
+ VBox vb = new VBox(5);
+ vb.getChildren().addAll(hardResetButton,
+ new Separator(Orientation.HORIZONTAL), new Label("Add new data : "), addDataButton,
+ new Separator(Orientation.HORIZONTAL), new Label("Remove existing data : "), removeDataButton,
+ new Separator(Orientation.HORIZONTAL), new Label("Change existing data : "), changeDataButton);
+
+ addController(new WeakPropertyValueController(testedPieChart.animatedProperty(), testedPieChart));
+ addController(new WeakPropertyValueController(testedPieChart.clockwiseProperty(), testedPieChart));
+ addController(new WeakPropertyValueController(testedPieChart.legendVisibleProperty(), testedPieChart));
+ addController(new WeakPropertyValueController(testedPieChart.startAngleProperty(), testedPieChart, -300.0, 0.0, 300.0));
+ addController(new WeakPropertyValueController(testedPieChart.labelLineLengthProperty(), testedPieChart, -20.0, 10.0, 30.0));
+ addController(new WeakPropertyValueController(testedPieChart.labelsVisibleProperty(), testedPieChart));
+ addController(new WeakPropertyValueController(testedPieChart.titleProperty(), testedPieChart, "New title"));
+ addController(new WeakPropertyValueController(testedPieChart.titleSideProperty(), testedPieChart, Arrays.asList(Side.values())));
+ addController(new WeakPropertyValueController(testedPieChart.legendSideProperty(), testedPieChart, Arrays.asList(Side.values())));
+ addController(new WeakPropertyValueController(testedPieChart.prefWidthProperty(), testedPieChart, 100.0, 400.0, 400.0));
+ addController(new WeakPropertyValueController(testedPieChart.prefHeightProperty(), testedPieChart, 100.0, 400.0, 400.0));
+
+ setTestedControlContainerSize(400, 400);
+ setTestedControl(testedPieChart);
+ setControllersContent(vb);
+ setPropertiesContent(properties);
+ }
+
+ private void addController(WeakPropertyValueController controller) {
+ properties.getChildren().addAll(new Separator(Orientation.HORIZONTAL), controller);
+ }
+
+ public PieChart getNewChart() {
+ data = FXCollections.observableArrayList();
+ for (int i = 0; i < 4; i++) {
+ data.add(new PieChart.Data("Data item " + i, 50));
+ }
+ PieChart chart = new PieChart(data);
+ chart.setTitle("PieChart");
+ chart.setStyle("-fx-border-color: darkgray;");
+ return chart;
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/choicebox/NewChoiceBoxApp.java 2016-12-22 11:26:22.261010011 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/choicebox/NewChoiceBoxApp.java 2016-12-22 11:26:22.209009510 +0300
@@ -1,106 +1,107 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.choicebox;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewChoiceBoxApp extends InteroperabilityApp {
-
- public final static String TESTED_CHOICEBOX_ID = "TESTED_CHOICEBOX_ID";
- public final static String RESET_BUTTON_ID = "RESET_CHOICEBOX_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewChoiceBoxApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ChoiceBoxTestApp");
- return new NewChoiceBoxApp.ChoiceBoxScene();
- }
-
- class ChoiceBoxScene extends CommonPropertiesScene {
-
- //VBox which contains tested ChoiceBox.
- Pane pane;
- PropertiesTable tb;
- //ChoiceBox to be tested.
- ChoiceBox testedChoiceBox;
-
- public ChoiceBoxScene() {
- super("ChoiceBox", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- pane = new Pane();
- testedChoiceBox = new ChoiceBox();
- testedChoiceBox.setId(TESTED_CHOICEBOX_ID);
-
- tb = new PropertiesTable(testedChoiceBox);
- PropertyTablesFactory.explorePropertiesList(testedChoiceBox, tb);
- SpecialTablePropertiesProvider.provideForControl(testedChoiceBox, tb);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedChoiceBox);
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- setTestedControl(testedChoiceBox);
- setPropertiesContent(tb);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
- vb.getChildren().addAll(resetButton);
- setControllersContent(vb);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.choicebox;
+
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewChoiceBoxApp extends InteroperabilityApp {
+
+ public final static String TESTED_CHOICEBOX_ID = "TESTED_CHOICEBOX_ID";
+ public final static String RESET_BUTTON_ID = "RESET_CHOICEBOX_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewChoiceBoxApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ChoiceBoxTestApp");
+ return new NewChoiceBoxApp.ChoiceBoxScene();
+ }
+
+ class ChoiceBoxScene extends CommonPropertiesScene {
+
+ //VBox which contains tested ChoiceBox.
+ Pane pane;
+ PropertiesTable tb;
+ //ChoiceBox to be tested.
+ ChoiceBox testedChoiceBox;
+
+ public ChoiceBoxScene() {
+ super("ChoiceBox", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ pane = new Pane();
+ testedChoiceBox = new ChoiceBox();
+ testedChoiceBox.setId(TESTED_CHOICEBOX_ID);
+
+ tb = new PropertiesTable(testedChoiceBox);
+ PropertyTablesFactory.explorePropertiesList(testedChoiceBox, tb);
+ SpecialTablePropertiesProvider.provideForControl(testedChoiceBox, tb);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedChoiceBox);
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ setTestedControl(testedChoiceBox);
+ setPropertiesContent(tb);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+ vb.getChildren().addAll(resetButton);
+ setControllersContent(vb);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/chooser/FXChooser.java 2016-12-22 11:26:22.449011825 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/chooser/FXChooser.java 2016-12-22 11:26:22.401011361 +0300
@@ -33,7 +33,6 @@
import javafx.scene.control.Button;
import javafx.scene.control.Label;
import javafx.scene.control.TextField;
-import javafx.scene.control.TextFieldBuilder;
import javafx.scene.control.Tooltip;
import javafx.scene.layout.GridPane;
import javafx.scene.text.Text;
@@ -59,8 +58,10 @@
public void start(final Stage stage) throws Exception {
try {
extensionFilter = new FileChooser.ExtensionFilter("File with extension (*.extension)", "*.extension");
- initialFileNameTextField = TextFieldBuilder.create().text("").promptText("Initial file name").build();
- titleTextField = TextFieldBuilder.create().text("").promptText("Title").build();
+ initialFileNameTextField = new TextField("");
+ initialFileNameTextField.setPromptText("Initial file name");
+ titleTextField = new TextField("");
+ titleTextField.setPromptText("Title");
errorText = new Label("No errors");
// OPEN FOLDER
--- old/functional/ControlsTests/src/javafx/scene/control/test/colorpicker/ColorPickerApp.java 2016-12-22 11:26:22.641013676 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/colorpicker/ColorPickerApp.java 2016-12-22 11:26:22.589013174 +0300
@@ -1,183 +1,188 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.colorpicker;
-
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.geometry.Pos;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import javafx.scene.paint.Color;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class ColorPickerApp extends InteroperabilityApp {
-
- public final static String TESTED_COLORPICKER_ID = "TESTED_COLORPICKER_ID";
- public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_COLORPICKER_BUTTON_ID";
- public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_COLORPICKER_BUTTON_ID";
- public final static String SET_COLOR_TEXT_FIELD_ID = "SET_COLOR_TEXT_FIELD_ID";
- public final static String SET_COLOR_BUTTON_ID = "SET_COLOR_BUTTON_ID";
- public final static List predefinedColors = new ArrayList();
-
- public static void main(String[] args) {
- Utils.launch(ColorPickerApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ColorPickerTestApp");
- return new ColorPickerScene();
- }
-
- class ColorPickerScene extends CommonPropertiesScene {
-
- //VBox which contain tested color picker.
- Pane pane;
- PropertiesTable tb;
- //Color picker to be tested.
- ColorPicker testedColorPicker;
-
- public ColorPickerScene() {
- super("ColorPicker", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- predefinedColors.add(Color.WHITE);
- predefinedColors.add(Color.BLACK);
- predefinedColors.add(Color.BLUE);
-
- Utils.addBrowser(this);
- pane = new Pane();
- testedColorPicker = new ColorPicker();
- testedColorPicker.setId(TESTED_COLORPICKER_ID);
-
- tb = new PropertiesTable(testedColorPicker);
-
- tb.addStringLine(testedColorPicker.promptTextProperty(), "prompt text");
-
- tb.addBooleanPropertyLine(testedColorPicker.armedProperty());
- tb.addBooleanPropertyLine(testedColorPicker.focusTraversableProperty());
-
- tb.addBooleanPropertyLine(testedColorPicker.visibleProperty());
-
- tb.addObjectEnumPropertyLine(testedColorPicker.blendModeProperty(), Arrays.asList(javafx.scene.effect.BlendMode.values()), testedColorPicker);
- tb.addObjectEnumPropertyLine(testedColorPicker.valueProperty(), predefinedColors, testedColorPicker);
-
- tb.addDoublePropertyLine(testedColorPicker.prefWidthProperty(), -100, 400, 100);
- tb.addDoublePropertyLine(testedColorPicker.prefHeightProperty(), -100, 400, 100);
-
- tb.addDoublePropertyLine(testedColorPicker.rotateProperty(), -100, 400, 100);
-
- tb.addDoublePropertyLine(testedColorPicker.translateXProperty(), -1, 15, 0);
- tb.addDoublePropertyLine(testedColorPicker.scaleXProperty(), -1, 4, 1);
- tb.addDoublePropertyLine(testedColorPicker.scaleYProperty(), -1, 4, 1);
- tb.addDoublePropertyLine(testedColorPicker.scaleZProperty(), -1, 4, 1);
-
- tb.addSimpleListener(testedColorPicker.widthProperty(), testedColorPicker);
- tb.addSimpleListener(testedColorPicker.heightProperty(), testedColorPicker);
-
- tb.addSimpleListener(testedColorPicker.focusedProperty(), testedColorPicker);
- tb.addSimpleListener(testedColorPicker.pressedProperty(), testedColorPicker);
- tb.addSimpleListener(testedColorPicker.showingProperty(), testedColorPicker);
- tb.addSimpleListener(testedColorPicker.sceneProperty(), testedColorPicker);
-
- tb.addStringLine(testedColorPicker.promptTextProperty(), "prompt");
-
- pane.setMinSize(240, 240);
- pane.setPrefSize(240, 240);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedColorPicker);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- tb.refresh();
- ColorPicker newOne = new ColorPicker();
- testedColorPicker.setValue(newOne.getValue());
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
- resetButtonsHBox.setAlignment(Pos.CENTER);
-
- VBox vb1 = new VBox(5);
- vb1.getChildren().addAll(resetButtonsHBox, setColorHbox());
-
- setTestedControl(testedColorPicker);
- setControllersContent(vb1);
- setPropertiesContent(tb);
- }
-
- private HBox setColorHbox() {
- HBox hb = new HBox();
- Label lb = new Label("Set color");
- final TextField colorTf = TextFieldBuilder.create().prefWidth(100).id(SET_COLOR_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Set!").id(SET_COLOR_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
- public void handle(Event t) {
- testedColorPicker.setValue(Color.web(colorTf.getText()));
- }
- });
- hb.getChildren().addAll(lb, colorTf, bt);
- hb.setAlignment(Pos.CENTER);
- return hb;
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.colorpicker;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.scene.paint.Color;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class ColorPickerApp extends InteroperabilityApp {
+
+ public final static String TESTED_COLORPICKER_ID = "TESTED_COLORPICKER_ID";
+ public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_COLORPICKER_BUTTON_ID";
+ public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_COLORPICKER_BUTTON_ID";
+ public final static String SET_COLOR_TEXT_FIELD_ID = "SET_COLOR_TEXT_FIELD_ID";
+ public final static String SET_COLOR_BUTTON_ID = "SET_COLOR_BUTTON_ID";
+ public final static List predefinedColors = new ArrayList();
+
+ public static void main(String[] args) {
+ Utils.launch(ColorPickerApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ColorPickerTestApp");
+ return new ColorPickerScene();
+ }
+
+ class ColorPickerScene extends CommonPropertiesScene {
+
+ //VBox which contain tested color picker.
+ Pane pane;
+ PropertiesTable tb;
+ //Color picker to be tested.
+ ColorPicker testedColorPicker;
+
+ public ColorPickerScene() {
+ super("ColorPicker", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ predefinedColors.add(Color.WHITE);
+ predefinedColors.add(Color.BLACK);
+ predefinedColors.add(Color.BLUE);
+
+ Utils.addBrowser(this);
+ pane = new Pane();
+ testedColorPicker = new ColorPicker();
+ testedColorPicker.setId(TESTED_COLORPICKER_ID);
+
+ tb = new PropertiesTable(testedColorPicker);
+
+ tb.addStringLine(testedColorPicker.promptTextProperty(), "prompt text");
+
+ tb.addBooleanPropertyLine(testedColorPicker.armedProperty());
+ tb.addBooleanPropertyLine(testedColorPicker.focusTraversableProperty());
+
+ tb.addBooleanPropertyLine(testedColorPicker.visibleProperty());
+
+ tb.addObjectEnumPropertyLine(testedColorPicker.blendModeProperty(), Arrays.asList(javafx.scene.effect.BlendMode.values()), testedColorPicker);
+ tb.addObjectEnumPropertyLine(testedColorPicker.valueProperty(), predefinedColors, testedColorPicker);
+
+ tb.addDoublePropertyLine(testedColorPicker.prefWidthProperty(), -100, 400, 100);
+ tb.addDoublePropertyLine(testedColorPicker.prefHeightProperty(), -100, 400, 100);
+
+ tb.addDoublePropertyLine(testedColorPicker.rotateProperty(), -100, 400, 100);
+
+ tb.addDoublePropertyLine(testedColorPicker.translateXProperty(), -1, 15, 0);
+ tb.addDoublePropertyLine(testedColorPicker.scaleXProperty(), -1, 4, 1);
+ tb.addDoublePropertyLine(testedColorPicker.scaleYProperty(), -1, 4, 1);
+ tb.addDoublePropertyLine(testedColorPicker.scaleZProperty(), -1, 4, 1);
+
+ tb.addSimpleListener(testedColorPicker.widthProperty(), testedColorPicker);
+ tb.addSimpleListener(testedColorPicker.heightProperty(), testedColorPicker);
+
+ tb.addSimpleListener(testedColorPicker.focusedProperty(), testedColorPicker);
+ tb.addSimpleListener(testedColorPicker.pressedProperty(), testedColorPicker);
+ tb.addSimpleListener(testedColorPicker.showingProperty(), testedColorPicker);
+ tb.addSimpleListener(testedColorPicker.sceneProperty(), testedColorPicker);
+
+ tb.addStringLine(testedColorPicker.promptTextProperty(), "prompt");
+
+ pane.setMinSize(240, 240);
+ pane.setPrefSize(240, 240);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedColorPicker);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ tb.refresh();
+ ColorPicker newOne = new ColorPicker();
+ testedColorPicker.setValue(newOne.getValue());
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+ resetButtonsHBox.setAlignment(Pos.CENTER);
+
+ VBox vb1 = new VBox(5);
+ vb1.getChildren().addAll(resetButtonsHBox, setColorHbox());
+
+ setTestedControl(testedColorPicker);
+ setControllersContent(vb1);
+ setPropertiesContent(tb);
+ }
+
+ private HBox setColorHbox() {
+ HBox hb = new HBox();
+ Label lb = new Label("Set color");
+ final TextField colorTf = new TextField();
+ colorTf.setPrefWidth(100);
+ colorTf.setId(SET_COLOR_TEXT_FIELD_ID);
+ Button bt = new Button("Set!");
+ bt.setId(SET_COLOR_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+ public void handle(Event t) {
+ testedColorPicker.setValue(Color.web(colorTf.getText()));
+ }
+ });
+ hb.getChildren().addAll(lb, colorTf, bt);
+ hb.setAlignment(Pos.CENTER);
+ return hb;
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/combobox/ComboBoxApp.java 2016-12-22 11:26:22.829015489 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/combobox/ComboBoxApp.java 2016-12-22 11:26:22.781015027 +0300
@@ -167,21 +167,24 @@
// }
// });
- Button applyCustomSelectionModel = ButtonBuilder.create().text("Apply custom selection model").id(APPLY_CUSTOM_SELECTION_MODEL_BUTTON_ID).build();
+ Button applyCustomSelectionModel = new Button("Apply custom selection model");
+ applyCustomSelectionModel.setId(APPLY_CUSTOM_SELECTION_MODEL_BUTTON_ID);
applyCustomSelectionModel.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedComboBox.selectionModelProperty().setValue(selectionModel);
}
});
- Button applyCustomStringConverter = ButtonBuilder.create().text("Apply custom string converter").id(APPLY_CUSTOM_STRING_CONVERTER_BUTTON_ID).build();
+ Button applyCustomStringConverter = new Button("Apply custom string converter");
+ applyCustomStringConverter.setId(APPLY_CUSTOM_STRING_CONVERTER_BUTTON_ID);
applyCustomStringConverter.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedComboBox.setConverter(new CustomStringConverter());
}
});
- Button applyCustomCellFactory = ButtonBuilder.create().text("Apply custom cell factory").id(APPLY_CUSTOM_CELL_FACTORY_BUTTON_ID).build();
+ Button applyCustomCellFactory = new Button("Apply custom cell factory");
+ applyCustomCellFactory.setId(APPLY_CUSTOM_CELL_FACTORY_BUTTON_ID);
applyCustomCellFactory.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedComboBox.setCellFactory(new Callback, ListCell>() {
@@ -193,7 +196,8 @@
}
});
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
hardResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -203,7 +207,8 @@
}
});
- Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build();
+ Button softResetButton = new Button("Soft reset");
+ softResetButton.setId(SOFT_RESET_BUTTON_ID);
softResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
tb.refresh();
@@ -228,11 +233,8 @@
HBox resetButtonsHBox = new HBox();
resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
- Button setAddingElementsOnShowing = ButtonBuilder.create()
- .id(SET_ADDING_ELEMENTS_ON_SHOWING)
- .text("Set adding elements on showing")
- .build();
-
+ Button setAddingElementsOnShowing = new Button("Set adding elements on showing");
+ setAddingElementsOnShowing.setId(SET_ADDING_ELEMENTS_ON_SHOWING);
setAddingElementsOnShowing.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedComboBox.setOnShowing(new EventHandler() {
@@ -246,11 +248,8 @@
}
});
- Button restoreDefaultOnShowingHandler = ButtonBuilder.create()
- .id(RESTORE_ON_SHOWING_EVENT_HANDLER)
- .text("Restore default onShowing handler")
- .build();
-
+ Button restoreDefaultOnShowingHandler = new Button("Restore default onShowing handler");
+ restoreDefaultOnShowingHandler.setId(RESTORE_ON_SHOWING_EVENT_HANDLER);
restoreDefaultOnShowingHandler.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedComboBox.setOnShowing(new EventHandler() {
@@ -261,11 +260,8 @@
}
});
- Button populateComboBoxWithFontSizes = ButtonBuilder.create()
- .id(POPULATE_COMBOBOX_WITH_FONT_SIZES)
- .text("Populate ComboBox with font sizes")
- .build();
-
+ Button populateComboBoxWithFontSizes = new Button("Populate ComboBox with font sizes");
+ populateComboBoxWithFontSizes.setId(POPULATE_COMBOBOX_WITH_FONT_SIZES);
populateComboBoxWithFontSizes.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
@@ -317,10 +313,15 @@
private HBox getAddItemHBox() {
HBox hb = new HBox();
Label lb = new Label("Add item");
- final TextField tf = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_TEXT_FIELD_ID).build();
+ final TextField tf = new TextField();
+ tf.setPrefWidth(50);
+ tf.setId(ADD_ITEM_TEXT_FIELD_ID);
Label atLb = new Label("at pos");
- final TextField tfPos = TextFieldBuilder.create().prefWidth(50).id(ADD_ITEM_POSITION_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_ITEM_BUTTON_ID).build();
+ final TextField tfPos = new TextField();
+ tfPos.setPrefWidth(50);
+ tfPos.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);
+ Button bt = new Button("Add!");
+ bt.setId(ADD_ITEM_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tfPos.getText());
@@ -334,8 +335,11 @@
private HBox getRemoveItemHBox() {
HBox hb = new HBox();
Label lb = new Label("From position");
- final TextField tf = TextFieldBuilder.create().text("0").prefWidth(50).id(REMOVE_ITEM_POS_TEXT_FIELD_ID).build();
- Button bt = ButtonBuilder.create().text("Remove!").id(REMOVE_BUTTON_ID).build();
+ final TextField tf = new TextField("0");
+ tf.setPrefWidth(50);
+ tf.setId(REMOVE_ITEM_POS_TEXT_FIELD_ID);
+ Button bt = new Button("Remove!");
+ bt.setId(REMOVE_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
int index = Integer.parseInt(tf.getText());
@@ -349,7 +353,8 @@
private HBox getSetItemsNullHBox() {
HBox hb = new HBox();
- Button bt = ButtonBuilder.create().text("Set items null").id(SET_ITEMS_NULL_BUTTON_ID).build();
+ Button bt = new Button("Set items null");
+ bt.setId(SET_ITEMS_NULL_BUTTON_ID);
bt.setOnAction(new EventHandler() {
public void handle(Event t) {
((ComboBox) testedComboBox).setItems(null);
--- old/functional/ControlsTests/src/javafx/scene/control/test/datepicker/DatePickerApp.java 2016-12-22 11:26:23.029017418 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/datepicker/DatePickerApp.java 2016-12-22 11:26:22.973016878 +0300
@@ -1,228 +1,229 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.datepicker;
-
-import java.time.DayOfWeek;
-import java.time.LocalDate;
-import java.time.Month;
-import java.time.chrono.Chronology;
-import java.time.format.DateTimeFormatter;
-import java.util.Arrays;
-import javafx.beans.property.ObjectProperty;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.geometry.Pos;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.DateCell;
-import javafx.scene.control.DatePicker;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import javafx.util.Callback;
-import javafx.util.StringConverter;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class DatePickerApp extends InteroperabilityApp {
-
- public final static String TESTED_DATEPICKER_ID = "TESTED_DATEPICKER_ID";
- public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_DATEPICKER_BUTTON_ID";
- public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_DATEPICKER_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(DatePickerApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "DatePickerTestApp");
- return new DatePickerApp.DatePickerScene();
- }
-
- class DatePickerScene extends CommonPropertiesScene {
-
- //VBox which contain tested date picker.
- Pane pane;
- PropertiesTable propertiesTable;
- //Date picker to be tested.
- DatePicker testedDatePicker;
-
- public DatePickerScene() {
- super("DatePicker", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
- pane = new Pane();
- testedDatePicker = new DatePicker();
- testedDatePicker.setId(TESTED_DATEPICKER_ID);
-
- propertiesTable = new PropertiesTable(testedDatePicker);
- propertiesTable.addObjectEnumPropertyLine((ObjectProperty) testedDatePicker.dayCellFactoryProperty(), Arrays.asList(new Callback[]{null, new Callback() {
- public DateCell call(final DatePicker datePicker) {
- return new DateCell() {
- {
- setId("ID");
- }
- };
- }
- @Override public String toString() { return "Cells with ID"; }
- },
- new WorkingDays()}), testedDatePicker);
-
- propertiesTable.addObjectEnumPropertyLine((ObjectProperty) testedDatePicker.converterProperty(),
- Arrays.asList(new StringConverter[]{null, new LocalDateConverter(testedDatePicker)}), testedDatePicker);
-
- PropertyTablesFactory.explorePropertiesList(testedDatePicker, propertiesTable);
- SpecialTablePropertiesProvider.provideForControl(testedDatePicker, propertiesTable);
-
-// propertiesTable.addObjectEnumPropertyLine(testedDatePicker.chronologyProperty(), Arrays.asList(
-// Chronology.of("ISO"), Chronology.of("Minguo"), Chronology.of("ThaiBuddhist"), Chronology.of("Japanese"), Chronology.of("Hijrah-umalqura")));
-
- pane.setMinSize(240, 240);
- pane.setPrefSize(240, 240);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedDatePicker);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- propertiesTable.refresh();
- DatePicker newOne = new DatePicker();
- testedDatePicker.setValue(newOne.getValue());
- testedDatePicker.setConverter(newOne.getConverter());
- testedDatePicker.setDayCellFactory(newOne.getDayCellFactory());
- testedDatePicker.setShowWeekNumbers(newOne.isShowWeekNumbers());
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
- resetButtonsHBox.setAlignment(Pos.CENTER);
-
- VBox vb1 = new VBox(5);
- vb1.getChildren().addAll(resetButtonsHBox);
-
- setTestedControl(testedDatePicker);
- setControllersContent(vb1);
- setPropertiesContent(propertiesTable);
- }
- }
-
- public static class LocalDateConverter extends StringConverter {
-
- public LocalDateConverter(DatePicker testedDatePicker) {
- testedDatePicker.setPromptText(pattern.toLowerCase());
- }
-
- String pattern = "yyyy-MM-dd";
- DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern(pattern);
-
- @Override
- public String toString(LocalDate date) {
- if (date != null) {
- return dateFormatter.format(date);
- } else {
- return "";
- }
- }
-
- @Override
- public LocalDate fromString(String string) {
- if (string != null && !string.isEmpty()) {
- return LocalDate.parse(string, dateFormatter);
- } else {
- return null;
- }
- }
-
- @Override public String toString() { return pattern; }
- }
-
- public static class DummyConverter extends StringConverter {
- @Override public String toString(LocalDate date) { return "Dummy"; }
-
- @Override public LocalDate fromString(String string) {
- return LocalDate.of(2000, Month.JANUARY, 1);
- }
- }
-
- /**
- * Class implements a DateCell factory. It disables days which are sundays.
- */
- public static class WorkingDays implements Callback {
-
- public DateCell call(DatePicker param) {
- return new DateCell() {
-
- @Override
- public void updateItem(LocalDate item, boolean empty) {
- super.updateItem(item, empty);
-
- if (isRestricted(item)) {
- setStyle("-fx-background-color: #ff4444;");
- setDisable(true);
- }
- }
- };
- }
-
- protected static boolean isRestricted(LocalDate item) {
- return DayOfWeek.SUNDAY == item.getDayOfWeek();
- }
-
- @Override public String toString() { return "Except sundays"; }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.datepicker;
+
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.time.Month;
+import java.time.chrono.Chronology;
+import java.time.format.DateTimeFormatter;
+import java.util.Arrays;
+import javafx.beans.property.ObjectProperty;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.geometry.Pos;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.DateCell;
+import javafx.scene.control.DatePicker;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.util.Callback;
+import javafx.util.StringConverter;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class DatePickerApp extends InteroperabilityApp {
+
+ public final static String TESTED_DATEPICKER_ID = "TESTED_DATEPICKER_ID";
+ public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_DATEPICKER_BUTTON_ID";
+ public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_DATEPICKER_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(DatePickerApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "DatePickerTestApp");
+ return new DatePickerApp.DatePickerScene();
+ }
+
+ class DatePickerScene extends CommonPropertiesScene {
+
+ //VBox which contain tested date picker.
+ Pane pane;
+ PropertiesTable propertiesTable;
+ //Date picker to be tested.
+ DatePicker testedDatePicker;
+
+ public DatePickerScene() {
+ super("DatePicker", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+ pane = new Pane();
+ testedDatePicker = new DatePicker();
+ testedDatePicker.setId(TESTED_DATEPICKER_ID);
+
+ propertiesTable = new PropertiesTable(testedDatePicker);
+ propertiesTable.addObjectEnumPropertyLine((ObjectProperty) testedDatePicker.dayCellFactoryProperty(), Arrays.asList(new Callback[]{null, new Callback() {
+ public DateCell call(final DatePicker datePicker) {
+ return new DateCell() {
+ {
+ setId("ID");
+ }
+ };
+ }
+ @Override public String toString() { return "Cells with ID"; }
+ },
+ new WorkingDays()}), testedDatePicker);
+
+ propertiesTable.addObjectEnumPropertyLine((ObjectProperty) testedDatePicker.converterProperty(),
+ Arrays.asList(new StringConverter[]{null, new LocalDateConverter(testedDatePicker)}), testedDatePicker);
+
+ PropertyTablesFactory.explorePropertiesList(testedDatePicker, propertiesTable);
+ SpecialTablePropertiesProvider.provideForControl(testedDatePicker, propertiesTable);
+
+// propertiesTable.addObjectEnumPropertyLine(testedDatePicker.chronologyProperty(), Arrays.asList(
+// Chronology.of("ISO"), Chronology.of("Minguo"), Chronology.of("ThaiBuddhist"), Chronology.of("Japanese"), Chronology.of("Hijrah-umalqura")));
+
+ pane.setMinSize(240, 240);
+ pane.setPrefSize(240, 240);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedDatePicker);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ propertiesTable.refresh();
+ DatePicker newOne = new DatePicker();
+ testedDatePicker.setValue(newOne.getValue());
+ testedDatePicker.setConverter(newOne.getConverter());
+ testedDatePicker.setDayCellFactory(newOne.getDayCellFactory());
+ testedDatePicker.setShowWeekNumbers(newOne.isShowWeekNumbers());
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+ resetButtonsHBox.setAlignment(Pos.CENTER);
+
+ VBox vb1 = new VBox(5);
+ vb1.getChildren().addAll(resetButtonsHBox);
+
+ setTestedControl(testedDatePicker);
+ setControllersContent(vb1);
+ setPropertiesContent(propertiesTable);
+ }
+ }
+
+ public static class LocalDateConverter extends StringConverter {
+
+ public LocalDateConverter(DatePicker testedDatePicker) {
+ testedDatePicker.setPromptText(pattern.toLowerCase());
+ }
+
+ String pattern = "yyyy-MM-dd";
+ DateTimeFormatter dateFormatter = DateTimeFormatter.ofPattern(pattern);
+
+ @Override
+ public String toString(LocalDate date) {
+ if (date != null) {
+ return dateFormatter.format(date);
+ } else {
+ return "";
+ }
+ }
+
+ @Override
+ public LocalDate fromString(String string) {
+ if (string != null && !string.isEmpty()) {
+ return LocalDate.parse(string, dateFormatter);
+ } else {
+ return null;
+ }
+ }
+
+ @Override public String toString() { return pattern; }
+ }
+
+ public static class DummyConverter extends StringConverter {
+ @Override public String toString(LocalDate date) { return "Dummy"; }
+
+ @Override public LocalDate fromString(String string) {
+ return LocalDate.of(2000, Month.JANUARY, 1);
+ }
+ }
+
+ /**
+ * Class implements a DateCell factory. It disables days which are sundays.
+ */
+ public static class WorkingDays implements Callback {
+
+ public DateCell call(DatePicker param) {
+ return new DateCell() {
+
+ @Override
+ public void updateItem(LocalDate item, boolean empty) {
+ super.updateItem(item, empty);
+
+ if (isRestricted(item)) {
+ setStyle("-fx-background-color: #ff4444;");
+ setDisable(true);
+ }
+ }
+ };
+ }
+
+ protected static boolean isRestricted(LocalDate item) {
+ return DayOfWeek.SUNDAY == item.getDayOfWeek();
+ }
+
+ @Override public String toString() { return "Except sundays"; }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/fxcanvas/FXCanvasBrowserApp.java 2016-12-22 11:26:23.229019347 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/fxcanvas/FXCanvasBrowserApp.java 2016-12-22 11:26:23.181018884 +0300
@@ -132,8 +132,6 @@
}
public static void main(String[] args) {
- System.setProperty("proxyHost", "www-proxy.ru.oracle.com");
- System.setProperty("proxyPort", "80");
try {
startAndWaitShell();
} catch (InterruptedException ex) {
--- old/functional/ControlsTests/src/javafx/scene/control/test/labeleds/newapps/LabeledsApp.java 2016-12-22 11:26:23.421021199 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/labeleds/newapps/LabeledsApp.java 2016-12-22 11:26:23.369020698 +0300
@@ -29,7 +29,6 @@
import javafx.geometry.Insets;
import javafx.scene.Scene;
import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
import javafx.scene.control.Label;
import javafx.scene.control.Labeled;
import javafx.scene.control.test.utils.CommonPropertiesScene;
@@ -87,7 +86,8 @@
hb.setPadding(new Insets(5, 5, 5, 5));
hb.setStyle("-fx-border-color : green;");
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
resetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
--- old/functional/ControlsTests/src/javafx/scene/control/test/labeleds/newapps/TextNodeApp.java 2016-12-22 11:26:23.609023012 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/labeleds/newapps/TextNodeApp.java 2016-12-22 11:26:23.557022511 +0300
@@ -1,155 +1,155 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.labeleds.newapps;
-
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.geometry.Orientation;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.CheckBox;
-import javafx.scene.control.Label;
-import javafx.scene.control.Separator;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import javafx.scene.shape.Line;
-import javafx.scene.text.Text;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class TextNodeApp extends InteroperabilityApp {
-
- public final static String TESTED_TEXTNODE_ID = "TESTED_TEXTNODE_ID";
- public final static String RESET_BUTTON_ID = "RESET_LABELED_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(TextNodeApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- return new LabeledScene();
- }
-
- protected class LabeledScene extends Scene {
-
- //Pane which contain tested text control.
- Pane vb3;
- PropertiesTable tb;
- //Text to be tested.
- Text testedControl;
-
- public LabeledScene() {
- super(new HBox(), 800, 600);
-
- prepareScene();
- }
-
- private void prepareScene() {
- vb3 = new Pane();
- testedControl = new Text();
- testedControl.setId(TESTED_TEXTNODE_ID);
-
- tb = new PropertiesTable(testedControl);
- tb.addSimpleListener(testedControl.boundsInLocalProperty(), testedControl);
- tb.addSimpleListener(testedControl.boundsInParentProperty(), testedControl);
- PropertyTablesFactory.explorePropertiesList(testedControl, tb);
- SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
- TabPaneWithControl tabPane = new TabPaneWithControl("Text", tb);
-
- vb3.setMinSize(220, 220);
- vb3.setPrefSize(220, 220);
- vb3.setStyle("-fx-border-color : red;");
- vb3.getChildren().add(testedControl);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- vb.getChildren().addAll(new Label("Pane with tested Text node"), vb3, resetButton, new Separator(Orientation.HORIZONTAL), getDrawLinesHBox());
-
- tb.setStyle("-fx-border-color : yellow;");
-
- //Main scene layout.
- hb.getChildren().addAll(vb, tabPane);
- }
-
- protected HBox getDrawLinesHBox() {
- CheckBox cb = new CheckBox("Show borders");
-
- cb.selectedProperty().addListener(new ChangeListener() {
- public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
- double x = testedControl.getBoundsInParent().getMinX();
- double y = testedControl.getBoundsInParent().getMinY();
-
- double w = testedControl.getBoundsInLocal().getWidth();
- double h = testedControl.getBoundsInLocal().getHeight();
-
- Line line1 = new Line(x, y, x + w, y);
- Line line2 = new Line(x, y, x, y + h);
- Line line3 = new Line(x + w, y, x + w, y + h);
- Line line4 = new Line(x, y + h, x + w, y + h);
-
- line1.setVisible(t1);
- line2.setVisible(t1);
- line3.setVisible(t1);
- line4.setVisible(t1);
-
- vb3.getChildren().clear();
- vb3.getChildren().add(testedControl);
- vb3.getChildren().addAll(line1, line2, line3, line4);
- }
- });
-
- HBox hb = new HBox();
- hb.getChildren().addAll(cb);
- return hb;
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.labeleds.newapps;
+
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.geometry.Orientation;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.CheckBox;
+import javafx.scene.control.Label;
+import javafx.scene.control.Separator;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.scene.shape.Line;
+import javafx.scene.text.Text;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class TextNodeApp extends InteroperabilityApp {
+
+ public final static String TESTED_TEXTNODE_ID = "TESTED_TEXTNODE_ID";
+ public final static String RESET_BUTTON_ID = "RESET_LABELED_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(TextNodeApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ return new LabeledScene();
+ }
+
+ protected class LabeledScene extends Scene {
+
+ //Pane which contain tested text control.
+ Pane vb3;
+ PropertiesTable tb;
+ //Text to be tested.
+ Text testedControl;
+
+ public LabeledScene() {
+ super(new HBox(), 800, 600);
+
+ prepareScene();
+ }
+
+ private void prepareScene() {
+ vb3 = new Pane();
+ testedControl = new Text();
+ testedControl.setId(TESTED_TEXTNODE_ID);
+
+ tb = new PropertiesTable(testedControl);
+ tb.addSimpleListener(testedControl.boundsInLocalProperty(), testedControl);
+ tb.addSimpleListener(testedControl.boundsInParentProperty(), testedControl);
+ PropertyTablesFactory.explorePropertiesList(testedControl, tb);
+ SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
+ TabPaneWithControl tabPane = new TabPaneWithControl("Text", tb);
+
+ vb3.setMinSize(220, 220);
+ vb3.setPrefSize(220, 220);
+ vb3.setStyle("-fx-border-color : red;");
+ vb3.getChildren().add(testedControl);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ vb.getChildren().addAll(new Label("Pane with tested Text node"), vb3, resetButton, new Separator(Orientation.HORIZONTAL), getDrawLinesHBox());
+
+ tb.setStyle("-fx-border-color : yellow;");
+
+ //Main scene layout.
+ hb.getChildren().addAll(vb, tabPane);
+ }
+
+ protected HBox getDrawLinesHBox() {
+ CheckBox cb = new CheckBox("Show borders");
+
+ cb.selectedProperty().addListener(new ChangeListener() {
+ public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
+ double x = testedControl.getBoundsInParent().getMinX();
+ double y = testedControl.getBoundsInParent().getMinY();
+
+ double w = testedControl.getBoundsInLocal().getWidth();
+ double h = testedControl.getBoundsInLocal().getHeight();
+
+ Line line1 = new Line(x, y, x + w, y);
+ Line line2 = new Line(x, y, x, y + h);
+ Line line3 = new Line(x + w, y, x + w, y + h);
+ Line line4 = new Line(x, y + h, x + w, y + h);
+
+ line1.setVisible(t1);
+ line2.setVisible(t1);
+ line3.setVisible(t1);
+ line4.setVisible(t1);
+
+ vb3.getChildren().clear();
+ vb3.getChildren().add(testedControl);
+ vb3.getChildren().addAll(line1, line2, line3, line4);
+ }
+ });
+
+ HBox hb = new HBox();
+ hb.getChildren().addAll(cb);
+ return hb;
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/menubar/NewMenuApp.java 2016-12-22 11:26:23.805024902 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/menubar/NewMenuApp.java 2016-12-22 11:26:23.753024401 +0300
@@ -1,156 +1,163 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.menubar;
-
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.*;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewMenuApp extends InteroperabilityApp {
-
- public final static String TESTED_MENUBAR_ID = "TESTED_MENUBAR_ID";
- public final static String RESET_BUTTON_ID = "RESET_MENUBAR_BUTTON_ID";
- public final String MENUBAR_ADD_INDEX_TEXT_FIELD_ID = "MENUBAR_ADD_INDEX_TEXT_FIELD_ID";
- public final String MENUBAR_ADD_NAME_TEXT_FIELD_ID = "MENUBAR_ADD_NAME_TEXT_FIELD_ID";
- public final String ADD_MENU_BUTTON_ID = "ADD_MENU_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewMenuApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "MenuBarTestApp");
- return new NewMenuApp.MenuBarScene();
- }
-
- class MenuBarScene extends Scene {
-
- Pane pane;
- //MenuBar to be tested.
- MenuBar testedMenuBar;
- TabPaneWithControl tabPane;
-
- public MenuBarScene() {
- super(new HBox(), 800, 600);
-
- prepareScene();
- }
-
- private void prepareScene() {
- pane = new Pane();
- testedMenuBar = MenuBarBuilder.create().id(TESTED_MENUBAR_ID).build();
-
- PropertiesTable tb = new PropertiesTable(testedMenuBar);
- PropertyTablesFactory.explorePropertiesList(testedMenuBar, tb);
- tabPane = new TabPaneWithControl("MenuBar", tb);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedMenuBar);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- final ToggleButton compactStateToggle = new ToggleButton("Compact");
- compactStateToggle.setSelected(true);
- compactStateToggle.selectedProperty().addListener(new ChangeListener() {
-
- public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
- if (t1) {
- compactStateToggle.setText("Compact");
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- MenuBarScene.this.getWindow().setWidth(1200);
- MenuBarScene.this.getWindow().setHeight(700);
- } else {
- compactStateToggle.setText("Free");
- pane.setMinSize(600, 600);
- pane.setPrefSize(600, 600);
- MenuBarScene.this.getWindow().setWidth(800);
- MenuBarScene.this.getWindow().setHeight(600);
- }
- }
- });
-
- vb.getChildren().addAll(new Label("Pane with tested MenuBar"), pane, resetButton, compactStateToggle, getAddTextFieldHbox());
-
- hb.getChildren().addAll(vb, tabPane);
- }
-
- private HBox getAddTextFieldHbox() {
- HBox hb = new HBox();
- Label lb = new Label("Add Menu at pos");
- final TextField tf = TextFieldBuilder.create().id(MENUBAR_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();
- final TextField nameTF = TextFieldBuilder.create().id(MENUBAR_ADD_NAME_TEXT_FIELD_ID).text("Menu").prefWidth(40).build();
-
- Button bt = ButtonBuilder.create().text("Add!").id(ADD_MENU_BUTTON_ID).build();
- bt.setOnAction(new EventHandler() {
-
- public void handle(Event t) {
- Menu menu = new Menu(nameTF.getText());
- int index = Integer.parseInt(tf.getText());
- (testedMenuBar).getMenus().add(index, menu);
- tabPane.addPropertiesTable(nameTF.getText(), NodeControllerFactory.createFullController(menu, tabPane));
- }
- });
- hb.getChildren().addAll(lb, tf, new Label("named"), nameTF, bt);
- return hb;
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.menubar;
+
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.*;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewMenuApp extends InteroperabilityApp {
+
+ public final static String TESTED_MENUBAR_ID = "TESTED_MENUBAR_ID";
+ public final static String RESET_BUTTON_ID = "RESET_MENUBAR_BUTTON_ID";
+ public final String MENUBAR_ADD_INDEX_TEXT_FIELD_ID = "MENUBAR_ADD_INDEX_TEXT_FIELD_ID";
+ public final String MENUBAR_ADD_NAME_TEXT_FIELD_ID = "MENUBAR_ADD_NAME_TEXT_FIELD_ID";
+ public final String ADD_MENU_BUTTON_ID = "ADD_MENU_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewMenuApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "MenuBarTestApp");
+ return new NewMenuApp.MenuBarScene();
+ }
+
+ class MenuBarScene extends Scene {
+
+ Pane pane;
+ //MenuBar to be tested.
+ MenuBar testedMenuBar;
+ TabPaneWithControl tabPane;
+
+ public MenuBarScene() {
+ super(new HBox(), 800, 600);
+
+ prepareScene();
+ }
+
+ private void prepareScene() {
+ pane = new Pane();
+ testedMenuBar = new MenuBar();
+ testedMenuBar.setId(TESTED_MENUBAR_ID);
+
+ PropertiesTable tb = new PropertiesTable(testedMenuBar);
+ PropertyTablesFactory.explorePropertiesList(testedMenuBar, tb);
+ tabPane = new TabPaneWithControl("MenuBar", tb);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedMenuBar);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ final ToggleButton compactStateToggle = new ToggleButton("Compact");
+ compactStateToggle.setSelected(true);
+ compactStateToggle.selectedProperty().addListener(new ChangeListener() {
+
+ public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
+ if (t1) {
+ compactStateToggle.setText("Compact");
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ MenuBarScene.this.getWindow().setWidth(1200);
+ MenuBarScene.this.getWindow().setHeight(700);
+ } else {
+ compactStateToggle.setText("Free");
+ pane.setMinSize(600, 600);
+ pane.setPrefSize(600, 600);
+ MenuBarScene.this.getWindow().setWidth(800);
+ MenuBarScene.this.getWindow().setHeight(600);
+ }
+ }
+ });
+
+ vb.getChildren().addAll(new Label("Pane with tested MenuBar"), pane, resetButton, compactStateToggle, getAddTextFieldHbox());
+
+ hb.getChildren().addAll(vb, tabPane);
+ }
+
+ private HBox getAddTextFieldHbox() {
+ HBox hb = new HBox();
+ Label lb = new Label("Add Menu at pos");
+ final TextField tf = new TextField("0");
+ tf.setId(MENUBAR_ADD_INDEX_TEXT_FIELD_ID);
+ tf.setPrefWidth(40);
+ final TextField nameTF = new TextField("Menu");
+ nameTF.setId(MENUBAR_ADD_NAME_TEXT_FIELD_ID);
+ nameTF.setPrefWidth(40);
+
+ Button bt = new Button("Add!");
+ bt.setId(ADD_MENU_BUTTON_ID);
+ bt.setOnAction(new EventHandler() {
+
+ public void handle(Event t) {
+ Menu menu = new Menu(nameTF.getText());
+ int index = Integer.parseInt(tf.getText());
+ (testedMenuBar).getMenus().add(index, menu);
+ tabPane.addPropertiesTable(nameTF.getText(), NodeControllerFactory.createFullController(menu, tabPane));
+ }
+ });
+ hb.getChildren().addAll(lb, tf, new Label("named"), nameTF, bt);
+ return hb;
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/pagination/PaginationApp.java 2016-12-22 11:26:24.021026986 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/pagination/PaginationApp.java 2016-12-22 11:26:23.961026408 +0300
@@ -1,242 +1,247 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.pagination;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.scene.Node;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.Label;
-import javafx.scene.control.Pagination;
-import javafx.scene.control.test.utils.*;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import javafx.util.Callback;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class PaginationApp extends InteroperabilityApp {
-
- public final static String TESTED_PAGINATION_ID = "TESTED_PAGINATION_ID";
- public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_PAGINATION_BUTTON_ID";
- public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_PAGINATION_BUTTON_ID";
- public final static String SET_NEW_PAGE_FACTORY_BUTTON_ID = "SET_NEW_PAGE_FACTORY_BUTTON_ID";
- public final static String SET_OLD_PAGE_FACTORY_BUTTON_ID = "SET_OLD_PAGE_FACTORY_BUTTON_ID";
- public final static String SET_BULLET_PAGE_INDICATOR_BUTTON_ID = "SET_BULLET_PAGE_INDICATOR_BUTTON_ID";
- public final static String SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID = "SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID";
- public final static String OLD_FACTORY_MARKER = "factory : old";
- public final static String NEW_FACTORY_MARKER = "factory : new";
- public final static String PAGE_INDEX_PREFIX = "PAGE : ";
- public final static int LABELS_PER_PAGE = 10;
-
- public static void main(String[] args) {
- Utils.launch(PaginationApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "PaginationTestApp");
- return new PaginationApp.PaginationScene();
- }
-
- class PaginationScene extends CommonPropertiesScene {
-
- PropertiesTable tb;
- Pagination testedPagination;
- final int i = 10;
- private String[] content;
- private static final int MAX_CONTENT = 2500;
-
- public PaginationScene() {
- super("Pagination", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- Utils.addBrowser(this);
-
- content = new String[MAX_CONTENT];
- for (int i = 0; i < MAX_CONTENT; i++) {
- content[i] = "some text " + i;
- }
-
- testedPagination = new Pagination(i);
- testedPagination.setId(TESTED_PAGINATION_ID);
-
- testedPagination.setPageFactory(new Callback() {
- @Override
- public Node call(Integer pageIndex) {
- return createPage(pageIndex);
- }
- });
-
- tb = new PropertiesTable(testedPagination);
- PropertyTablesFactory.explorePropertiesList(testedPagination, tb);
- SpecialTablePropertiesProvider.provideForControl(testedPagination, tb);
- tb.addDoublePropertyLine(testedPagination.minHeightProperty(), -100, 300, 50, testedPagination);
- tb.addDoublePropertyLine(testedPagination.minWidthProperty(), -100, 300, 50, testedPagination);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareMainSceneStructure();
- prepareScene();
- }
- });
-
- Button setBulletPageIndicatorButton = ButtonBuilder.create().id(SET_BULLET_PAGE_INDICATOR_BUTTON_ID).text("Set bullet").build();
- setBulletPageIndicatorButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- //testedPagination.setStyle(Pagination.STYLE_CLASS_BULLET);
- testedPagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
- }
- });
-
- Button setPageCountToIndeterminateButton = ButtonBuilder.create().id(SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID).text("Set indeterminate\n page count").build();
- setPageCountToIndeterminateButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedPagination.setPageCount(Pagination.INDETERMINATE);
- }
- });
-
- Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build();
- softResetButton.setOnAction(new EventHandler() {
- @Override
- public void handle(ActionEvent t) {
- tb.refresh();
- Pagination newOne = new Pagination(i);
- testedPagination.setCurrentPageIndex(newOne.getCurrentPageIndex());
- testedPagination.setPageCount(newOne.getPageCount());
- testedPagination.setPageFactory(newOne.getPageFactory());
- testedPagination.setMaxPageIndicatorCount(newOne.maxPageIndicatorCountProperty().get());
- }
- });
-
- Button setNewPageFactory = ButtonBuilder.create().id(SET_NEW_PAGE_FACTORY_BUTTON_ID).text("Set new page factory").build();
- setNewPageFactory.setOnAction(new EventHandler() {
- @Override
- public void handle(ActionEvent t) {
- Callback newOne = new Callback() {
- @Override
- public Node call(Integer pageIndex) {
- return createPage2(pageIndex);
- }
- };
-
- Callback oldOne = testedPagination.getPageFactory();
-
- testedPagination.setPageFactory(newOne);
-
- assertTrue(testedPagination.pageFactoryProperty().getValue().equals(newOne));
- assertTrue(testedPagination.getPageFactory().equals(newOne));
- assertFalse(testedPagination.pageFactoryProperty().getValue().equals(oldOne));
- assertFalse(testedPagination.getPageFactory().equals(oldOne));
- }
- });
-
- Button setOldPageFactory = ButtonBuilder.create().id(SET_OLD_PAGE_FACTORY_BUTTON_ID).text("Set old page factory").build();
- setOldPageFactory.setOnAction(new EventHandler() {
- @Override
- public void handle(ActionEvent t) {
- Callback newOne = new Callback() {
- @Override
- public Node call(Integer pageIndex) {
- return createPage(pageIndex);
- }
- };
-
- Callback oldOne = testedPagination.getPageFactory();
-
- testedPagination.setPageFactory(newOne);
-
- assertTrue(testedPagination.pageFactoryProperty().getValue().equals(newOne));
- assertTrue(testedPagination.getPageFactory().equals(newOne));
- assertFalse(testedPagination.pageFactoryProperty().getValue().equals(oldOne));
- assertFalse(testedPagination.getPageFactory().equals(oldOne));
- }
- });
-
- HBox resetButtonsHBox = new HBox();
- resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
- vb.getChildren().addAll(resetButtonsHBox, setNewPageFactory,
- setOldPageFactory, setBulletPageIndicatorButton,
- setPageCountToIndeterminateButton);
- setControllersContent(vb);
- setTestedControl(testedPagination);
- setPropertiesContent(tb);
- }
-
- public VBox createPage(int pageIndex) {
- checkIndexCorrectness(pageIndex);
-
- VBox box = new VBox(5);
- int page = pageIndex * 10;
- for (int i = 0; i < 10; i++) {
- Label l = new Label(PAGE_INDEX_PREFIX + pageIndex + "; " + OLD_FACTORY_MARKER + "; " + content[page + i % MAX_CONTENT]);
- box.getChildren().add(l);
- }
- box.getChildren().addAll(ComponentsFactory.createFormComponent(), ComponentsFactory.createCustomContent(100, 100));
- return box;
- }
-
- public VBox createPage2(int pageIndex) {
- checkIndexCorrectness(pageIndex);
-
- VBox box = new VBox(5);
- int page = pageIndex * 10;
- for (int i = 0; i < LABELS_PER_PAGE; i++) {
- Label l = new Label(PAGE_INDEX_PREFIX + pageIndex + "; " + NEW_FACTORY_MARKER + "; " + content[page + i % MAX_CONTENT]);
- box.getChildren().add(l);
- }
- box.getChildren().addAll(ComponentsFactory.createCustomContent(100, 100));
- return box;
- }
-
- private void checkIndexCorrectness(int index) {
- if (testedPagination.getPageCount() != Pagination.INDETERMINATE) {
- if ((index < 0) || (index > Math.max(testedPagination.getPageCount() - 1, 0))) {
- throw new IllegalArgumentException("Incorrect index : " + index);
- }
- }
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.pagination;
+
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.Label;
+import javafx.scene.control.Pagination;
+import javafx.scene.control.test.utils.*;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import javafx.util.Callback;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class PaginationApp extends InteroperabilityApp {
+
+ public final static String TESTED_PAGINATION_ID = "TESTED_PAGINATION_ID";
+ public final static String HARD_RESET_BUTTON_ID = "HARD_RESET_PAGINATION_BUTTON_ID";
+ public final static String SOFT_RESET_BUTTON_ID = "SOFT_RESET_PAGINATION_BUTTON_ID";
+ public final static String SET_NEW_PAGE_FACTORY_BUTTON_ID = "SET_NEW_PAGE_FACTORY_BUTTON_ID";
+ public final static String SET_OLD_PAGE_FACTORY_BUTTON_ID = "SET_OLD_PAGE_FACTORY_BUTTON_ID";
+ public final static String SET_BULLET_PAGE_INDICATOR_BUTTON_ID = "SET_BULLET_PAGE_INDICATOR_BUTTON_ID";
+ public final static String SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID = "SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID";
+ public final static String OLD_FACTORY_MARKER = "factory : old";
+ public final static String NEW_FACTORY_MARKER = "factory : new";
+ public final static String PAGE_INDEX_PREFIX = "PAGE : ";
+ public final static int LABELS_PER_PAGE = 10;
+
+ public static void main(String[] args) {
+ Utils.launch(PaginationApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "PaginationTestApp");
+ return new PaginationApp.PaginationScene();
+ }
+
+ class PaginationScene extends CommonPropertiesScene {
+
+ PropertiesTable tb;
+ Pagination testedPagination;
+ final int i = 10;
+ private String[] content;
+ private static final int MAX_CONTENT = 2500;
+
+ public PaginationScene() {
+ super("Pagination", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ Utils.addBrowser(this);
+
+ content = new String[MAX_CONTENT];
+ for (int i = 0; i < MAX_CONTENT; i++) {
+ content[i] = "some text " + i;
+ }
+
+ testedPagination = new Pagination(i);
+ testedPagination.setId(TESTED_PAGINATION_ID);
+
+ testedPagination.setPageFactory(new Callback() {
+ @Override
+ public Node call(Integer pageIndex) {
+ return createPage(pageIndex);
+ }
+ });
+
+ tb = new PropertiesTable(testedPagination);
+ PropertyTablesFactory.explorePropertiesList(testedPagination, tb);
+ SpecialTablePropertiesProvider.provideForControl(testedPagination, tb);
+ tb.addDoublePropertyLine(testedPagination.minHeightProperty(), -100, 300, 50, testedPagination);
+ tb.addDoublePropertyLine(testedPagination.minWidthProperty(), -100, 300, 50, testedPagination);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareMainSceneStructure();
+ prepareScene();
+ }
+ });
+
+ Button setBulletPageIndicatorButton = new Button("Set bullet");
+ setBulletPageIndicatorButton.setId(SET_BULLET_PAGE_INDICATOR_BUTTON_ID);
+ setBulletPageIndicatorButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ //testedPagination.setStyle(Pagination.STYLE_CLASS_BULLET);
+ testedPagination.getStyleClass().add(Pagination.STYLE_CLASS_BULLET);
+ }
+ });
+
+ Button setPageCountToIndeterminateButton = new Button("Set indeterminate\n page count");
+ setPageCountToIndeterminateButton.setId(SET_PAGE_COUNT_TO_INDETERMINATE_BUTTON_ID);
+ setPageCountToIndeterminateButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ testedPagination.setPageCount(Pagination.INDETERMINATE);
+ }
+ });
+
+ Button softResetButton = new Button("Soft reset");
+ softResetButton.setId(SOFT_RESET_BUTTON_ID);
+ softResetButton.setOnAction(new EventHandler() {
+ @Override
+ public void handle(ActionEvent t) {
+ tb.refresh();
+ Pagination newOne = new Pagination(i);
+ testedPagination.setCurrentPageIndex(newOne.getCurrentPageIndex());
+ testedPagination.setPageCount(newOne.getPageCount());
+ testedPagination.setPageFactory(newOne.getPageFactory());
+ testedPagination.setMaxPageIndicatorCount(newOne.maxPageIndicatorCountProperty().get());
+ }
+ });
+
+ Button setNewPageFactory = new Button("Set new page factory");
+ setNewPageFactory.setId(SET_NEW_PAGE_FACTORY_BUTTON_ID);
+ setNewPageFactory.setOnAction(new EventHandler() {
+ @Override
+ public void handle(ActionEvent t) {
+ Callback newOne = new Callback() {
+ @Override
+ public Node call(Integer pageIndex) {
+ return createPage2(pageIndex);
+ }
+ };
+
+ Callback oldOne = testedPagination.getPageFactory();
+
+ testedPagination.setPageFactory(newOne);
+
+ assertTrue(testedPagination.pageFactoryProperty().getValue().equals(newOne));
+ assertTrue(testedPagination.getPageFactory().equals(newOne));
+ assertFalse(testedPagination.pageFactoryProperty().getValue().equals(oldOne));
+ assertFalse(testedPagination.getPageFactory().equals(oldOne));
+ }
+ });
+
+ Button setOldPageFactory = new Button("Set old page factory");
+ setOldPageFactory.setId(SET_OLD_PAGE_FACTORY_BUTTON_ID);
+ setOldPageFactory.setOnAction(new EventHandler() {
+ @Override
+ public void handle(ActionEvent t) {
+ Callback newOne = new Callback() {
+ @Override
+ public Node call(Integer pageIndex) {
+ return createPage(pageIndex);
+ }
+ };
+
+ Callback oldOne = testedPagination.getPageFactory();
+
+ testedPagination.setPageFactory(newOne);
+
+ assertTrue(testedPagination.pageFactoryProperty().getValue().equals(newOne));
+ assertTrue(testedPagination.getPageFactory().equals(newOne));
+ assertFalse(testedPagination.pageFactoryProperty().getValue().equals(oldOne));
+ assertFalse(testedPagination.getPageFactory().equals(oldOne));
+ }
+ });
+
+ HBox resetButtonsHBox = new HBox();
+ resetButtonsHBox.getChildren().addAll(hardResetButton, softResetButton);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+ vb.getChildren().addAll(resetButtonsHBox, setNewPageFactory,
+ setOldPageFactory, setBulletPageIndicatorButton,
+ setPageCountToIndeterminateButton);
+ setControllersContent(vb);
+ setTestedControl(testedPagination);
+ setPropertiesContent(tb);
+ }
+
+ public VBox createPage(int pageIndex) {
+ checkIndexCorrectness(pageIndex);
+
+ VBox box = new VBox(5);
+ int page = pageIndex * 10;
+ for (int i = 0; i < 10; i++) {
+ Label l = new Label(PAGE_INDEX_PREFIX + pageIndex + "; " + OLD_FACTORY_MARKER + "; " + content[page + i % MAX_CONTENT]);
+ box.getChildren().add(l);
+ }
+ box.getChildren().addAll(ComponentsFactory.createFormComponent(), ComponentsFactory.createCustomContent(100, 100));
+ return box;
+ }
+
+ public VBox createPage2(int pageIndex) {
+ checkIndexCorrectness(pageIndex);
+
+ VBox box = new VBox(5);
+ int page = pageIndex * 10;
+ for (int i = 0; i < LABELS_PER_PAGE; i++) {
+ Label l = new Label(PAGE_INDEX_PREFIX + pageIndex + "; " + NEW_FACTORY_MARKER + "; " + content[page + i % MAX_CONTENT]);
+ box.getChildren().add(l);
+ }
+ box.getChildren().addAll(ComponentsFactory.createCustomContent(100, 100));
+ return box;
+ }
+
+ private void checkIndexCorrectness(int index) {
+ if (testedPagination.getPageCount() != Pagination.INDETERMINATE) {
+ if ((index < 0) || (index > Math.max(testedPagination.getPageCount() - 1, 0))) {
+ throw new IllegalArgumentException("Incorrect index : " + index);
+ }
+ }
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/scrollbar/ScrollBarApp.java 2016-12-22 11:26:24.221028915 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/scrollbar/ScrollBarApp.java 2016-12-22 11:26:24.161028337 +0300
@@ -66,13 +66,16 @@
@Override
final protected void prepareScene() {
- testedScrollBar = ScrollBarBuilder.create().id(TESTED_SCROLLBAR_ID).build();
+ testedScrollBar = new ScrollBar();
+ testedScrollBar.setFocusTraversable(true);
+ testedScrollBar.setId(TESTED_SCROLLBAR_ID);
tb = new PropertiesTable(testedScrollBar);
PropertyTablesFactory.explorePropertiesList(testedScrollBar, tb);
SpecialTablePropertiesProvider.provideForControl(testedScrollBar, tb);
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
resetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
--- old/functional/ControlsTests/src/javafx/scene/control/test/separator/SeparatorApp.java 2016-12-22 11:26:24.405030689 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/separator/SeparatorApp.java 2016-12-22 11:26:24.353030188 +0300
@@ -1,106 +1,108 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.separator;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class SeparatorApp extends InteroperabilityApp {
-
- public final static String TESTED_SEPARATOR_ID = "TESTED_SEPARATOR_ID";
- public final static String RESET_BUTTON_ID = "RESET_SEPARATOR_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(SeparatorApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "SeparatorTestApp");
- return new SeparatorApp.SeparatorScene();
- }
-
- class SeparatorScene extends CommonPropertiesScene {
-
- //VBox which contains tested separator.
- Pane pane;
- PropertiesTable tb;
- //Separator to be tested.
- Separator testedSeparator;
-
- public SeparatorScene() {
- super("Separator", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- pane = new Pane();
- testedSeparator = SeparatorBuilder.create().id(TESTED_SEPARATOR_ID).build();
-
- tb = new PropertiesTable(testedSeparator);
- PropertyTablesFactory.explorePropertiesList(testedSeparator, tb);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedSeparator);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
- setTestedControl(testedSeparator);
- setControllersContent(resetButton);
- setPropertiesContent(tb);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.separator;
+
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class SeparatorApp extends InteroperabilityApp {
+
+ public final static String TESTED_SEPARATOR_ID = "TESTED_SEPARATOR_ID";
+ public final static String RESET_BUTTON_ID = "RESET_SEPARATOR_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(SeparatorApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "SeparatorTestApp");
+ return new SeparatorApp.SeparatorScene();
+ }
+
+ class SeparatorScene extends CommonPropertiesScene {
+
+ //VBox which contains tested separator.
+ Pane pane;
+ PropertiesTable tb;
+ //Separator to be tested.
+ Separator testedSeparator;
+
+ public SeparatorScene() {
+ super("Separator", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ pane = new Pane();
+ testedSeparator = new Separator();
+ testedSeparator.setId(TESTED_SEPARATOR_ID);
+
+ tb = new PropertiesTable(testedSeparator);
+ PropertyTablesFactory.explorePropertiesList(testedSeparator, tb);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedSeparator);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+ setTestedControl(testedSeparator);
+ setControllersContent(resetButton);
+ setPropertiesContent(tb);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/slider/SliderNewApp.java 2016-12-22 11:26:24.601032580 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/slider/SliderNewApp.java 2016-12-22 11:26:24.553032117 +0300
@@ -28,9 +28,7 @@
import javafx.event.EventHandler;
import javafx.scene.Scene;
import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
import javafx.scene.control.Slider;
-import javafx.scene.control.SliderBuilder;
import javafx.scene.control.test.utils.CommonPropertiesScene;
import javafx.scene.control.test.utils.ptables.PropertiesTable;
import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
@@ -76,13 +74,15 @@
@Override
final protected void prepareScene() {
- testedSlider = SliderBuilder.create().id(TESTED_SLIDER_ID).build();
+ testedSlider = new Slider();
+ testedSlider.setId(TESTED_SLIDER_ID);
tb = new PropertiesTable(testedSlider);
PropertyTablesFactory.explorePropertiesList(testedSlider, tb);
SpecialTablePropertiesProvider.provideForControl(testedSlider, tb);
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
resetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -92,7 +92,8 @@
}
});
- Button setCustomConverter = ButtonBuilder.create().id(APPLY_CUSTOM_LABEL_FORMATTER).text("ApplyCsustomConverter").build();
+ Button setCustomConverter = new Button("ApplyCsustomConverter");
+ setCustomConverter.setId(APPLY_CUSTOM_LABEL_FORMATTER);
setCustomConverter.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
testedSlider.setLabelFormatter(new CustomConverter());
--- old/functional/ControlsTests/src/javafx/scene/control/test/splitpane/SplitPaneApp.java 2016-12-22 11:26:24.789034394 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/splitpane/SplitPaneApp.java 2016-12-22 11:26:24.741033930 +0300
@@ -1,124 +1,128 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.splitpane;
-
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Node;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.*;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class SplitPaneApp extends InteroperabilityApp {
-
- public final static String TESTED_SPLIPANE_ID = "TESTED_SPLIPANE_ID";
- public final static String RESET_BUTTON_ID = "RESET_SPLIPANE_BUTTON_ID";
- public final static String SPLITPANE_ADD_INDEX_TEXT_FIELD_ID = "SPLITPANE_ADD_INDEX_TEXT_FIELD_ID";
-
- public static void main(String[] args) {
- Utils.launch(SplitPaneApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "SplitPaneTestApp");
- return new SplitPaneApp.SplitPaneScene();
- }
-
- class SplitPaneScene extends Scene {
-
- //VBox which contain tested split pane.
- Pane pane;
- //Splipane to be tested.
- SplitPane testedSplitPane;
-
- public SplitPaneScene() {
- super(new HBox(), 800, 600);
-
- prepareScene();
- }
-
- private void prepareScene() {
- pane = new Pane();
- testedSplitPane = SplitPaneBuilder.create().id(TESTED_SPLIPANE_ID).build();
-
- PropertiesTable tb = new PropertiesTable(testedSplitPane);
- PropertyTablesFactory.explorePropertiesList(testedSplitPane, tb);
-
- final TabPaneWithControl tabPane = new TabPaneWithControl("Accordion", tb);
-
- final TextField tf = TextFieldBuilder.create().id(SPLITPANE_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();
-
- HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
-
- @Override
- public void execute(Node node) {
- testedSplitPane.getItems().add(Integer.parseInt(tf.getText()), node);
- tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
- }
- }, tf);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedSplitPane);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- vb.getChildren().addAll(new Label("Pane with tested Accordion"), pane, resetButton, nodeshb);
-
- hb.getChildren().addAll(vb, tabPane);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.splitpane;
+
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.*;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class SplitPaneApp extends InteroperabilityApp {
+
+ public final static String TESTED_SPLIPANE_ID = "TESTED_SPLIPANE_ID";
+ public final static String RESET_BUTTON_ID = "RESET_SPLIPANE_BUTTON_ID";
+ public final static String SPLITPANE_ADD_INDEX_TEXT_FIELD_ID = "SPLITPANE_ADD_INDEX_TEXT_FIELD_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(SplitPaneApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "SplitPaneTestApp");
+ return new SplitPaneApp.SplitPaneScene();
+ }
+
+ class SplitPaneScene extends Scene {
+
+ //VBox which contain tested split pane.
+ Pane pane;
+ //Splipane to be tested.
+ SplitPane testedSplitPane;
+
+ public SplitPaneScene() {
+ super(new HBox(), 800, 600);
+
+ prepareScene();
+ }
+
+ private void prepareScene() {
+ pane = new Pane();
+ testedSplitPane = new SplitPane();
+ testedSplitPane.setId(TESTED_SPLIPANE_ID);
+
+ PropertiesTable tb = new PropertiesTable(testedSplitPane);
+ PropertyTablesFactory.explorePropertiesList(testedSplitPane, tb);
+
+ final TabPaneWithControl tabPane = new TabPaneWithControl("Accordion", tb);
+
+ final TextField tf = new TextField("0");
+ tf.setId(SPLITPANE_ADD_INDEX_TEXT_FIELD_ID);
+ tf.setPrefWidth(40);
+
+ HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
+
+ @Override
+ public void execute(Node node) {
+ testedSplitPane.getItems().add(Integer.parseInt(tf.getText()), node);
+ tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
+ }
+ }, tf);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedSplitPane);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ vb.getChildren().addAll(new Label("Pane with tested Accordion"), pane, resetButton, nodeshb);
+
+ hb.getChildren().addAll(vb, tabPane);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/tableview/NewTableViewApp.java 2016-12-22 11:26:24.989036322 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/tableview/NewTableViewApp.java 2016-12-22 11:26:24.941035859 +0300
@@ -24,10 +24,10 @@
*/
package javafx.scene.control.test.tableview;
-import com.sun.javafx.scene.control.skin.NestedTableColumnHeader;
-import com.sun.javafx.scene.control.skin.TableColumnHeader;
-import com.sun.javafx.scene.control.skin.TableHeaderRow;
-import com.sun.javafx.scene.control.skin.TableViewSkin;
+import javafx.scene.control.skin.NestedTableColumnHeader;
+import javafx.scene.control.skin.TableColumnHeader;
+import javafx.scene.control.skin.TableHeaderRow;
+import javafx.scene.control.skin.TableViewSkin;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
@@ -66,6 +66,8 @@
import static javafx.commons.Consts.*;
import static javafx.commons.Consts.Cell.*;
import javafx.scene.Node;
+import static javafx.scene.control.test.treetable.ResetButtonNames.HARD_RESET_BUTTON_ID;
+import static javafx.scene.control.test.treetable.ResetButtonNames.SOFT_RESET_BUTTON_ID;
import javafx.scene.control.test.utils.ComponentsFactory.MultipleIndexFormComponent.MultipleIndicesAction;
import static org.junit.Assert.assertTrue;
@@ -129,7 +131,8 @@
tabPane = new TabPaneWithControl("TableView", tb);
tabPane.setMinSize(1000, 1000);
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
hardResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -139,7 +142,8 @@
}
});
- Button softResetButton = ButtonBuilder.create().id(SOFT_RESET_BUTTON_ID).text("Soft reset").build();
+ Button softResetButton = new Button("Soft reset");
+ softResetButton.setId(SOFT_RESET_BUTTON_ID);
softResetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
TableView newOne = new TableView();
@@ -327,7 +331,7 @@
public String toString() {
return "CUSTOM " + super.toString();
}
-
+/*
@Override
protected TableHeaderRow createTableHeaderRow() {
return new TableHeaderRow(this) {
@@ -350,6 +354,7 @@
}
};
}
+ */
});
}
});
@@ -456,10 +461,8 @@
hb.getChildren().addAll(cmbEditors, chbCustom, btnSetEditor);
- Button btn = ButtonBuilder.create()
- .text("Set onEdit event hadlers")
- .id(BTN_SET_ON_EDIT_EVENT_HANDLERS)
- .build();
+ Button btn = new Button("Set onEdit event hadlers");
+ btn.setId(BTN_SET_ON_EDIT_EVENT_HANDLERS);
btn.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
@@ -896,4 +899,4 @@
}
return testData;
}
-}
\ No newline at end of file
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/tabpane/NewTabPaneApp.java 2016-12-22 11:26:25.185038213 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/tabpane/NewTabPaneApp.java 2016-12-22 11:26:25.133037711 +0300
@@ -1,274 +1,267 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.tabpane;
-
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.factory.*;
-import javafx.scene.Node;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.*;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory.NodesStorage;
-import static javafx.scene.control.test.utils.ptables.NodesChoserFactory.*;
-import javafx.scene.layout.ColumnConstraints;
-import javafx.scene.layout.GridPane;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewTabPaneApp extends InteroperabilityApp {
-
- public final static String TESTED_TABPANE_ID = "TESTED_TABPANE_ID";
- public final static String RESET_BUTTON_ID = "RESET_TABPANE_BUTTON_ID";
- public final static String RESET_SOFTLY_BUTTON_ID = "RESET_SOFTLY_BUTTON_ID";
- public final static String TABPANE_ADD_INDEX_TEXT_FIELD_ID = "TABPANE_ADD_INDEX_TEXT_FIELD_ID";
- public final static String NEW_TAB_ID_TEXT_FIELD_ID = "TAB_ID";
- public final static String FOCUS_RECEIVING_BUTTON_ID = "FOCUS_RECEIVING_BUTTON_ID";
- public final static String TAB_CLOSE_REQUEST_EVENT = "TAB_CLOSE_REQUEST_EVENT";
- public final static String VETO_CHECKBOX_ID = "VETO_CHECKBOX_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewTabPaneApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "TabPaneTestApp");
- NewTabPaneApp.TabPaneScene tabPaneScene = new NewTabPaneApp.TabPaneScene();
- Utils.addBrowser(tabPaneScene);
- return tabPaneScene;
- }
-
- class TabPaneScene extends CommonPropertiesScene {
-
- //VBox which contain tested TabPane.
- Pane pane;
- //TabPane to be tested.
- TabPane testedTabPane;
- TabPaneWithControl tabPane;
- private PropertiesTable tb;
-
- public TabPaneScene() {
- super("Tab pane tests", 800, 600);
-
- prepareScene();
- }
-
- @Override
- public final void prepareScene() {
- pane = new Pane();
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
-
- testedTabPane = TabPaneBuilder.create().id(TESTED_TABPANE_ID).build();
- pane.getChildren().add(testedTabPane);
-
- tb = new PropertiesTable(testedTabPane);
- PropertyTablesFactory.explorePropertiesList(testedTabPane, tb);
-
- Button btnResetHardly = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- btnResetHardly.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareMainSceneStructure();
- prepareScene();
- }
- });
-
- Button btnResetSoftly = ButtonBuilder.create().id(RESET_SOFTLY_BUTTON_ID).text("Reset softly").build();
- btnResetSoftly.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
-
- tb.refresh();
-
- TabPane newInstance = new TabPane();
- while (testedTabPane.getTabs().size() != 0) {
- testedTabPane.getTabs().remove(0);
- }
-
- testedTabPane.setSide(newInstance.getSide());
- testedTabPane.setPrefHeight(newInstance.getPrefHeight());
- testedTabPane.setMinHeight(newInstance.getMinHeight());
- testedTabPane.setMaxHeight(newInstance.getMaxHeight());
- testedTabPane.setPrefWidth(newInstance.getPrefWidth());
- testedTabPane.setMinWidth(newInstance.getMinWidth());
- testedTabPane.setMaxWidth(newInstance.getMaxWidth());
- testedTabPane.setVisible(newInstance.isVisible());
- testedTabPane.setDisable(newInstance.isDisable());
- testedTabPane.setContextMenu(newInstance.getContextMenu());
-
- tabPane.removePropertiesTablesExceptFirstOnes(1);
- }
- });
-
- tabPane = new TabPaneWithControl("TabPane", tb);
-
-
-
- VBox vb = new VBox();
- vb.setSpacing(5);
- vb.getChildren().addAll(
- btnResetHardly,
- btnResetSoftly,
- getControlsForTabCreation(tabPane),
- getButtonForFocus());
-
- setTestedControl(testedTabPane);
- setControllersContent(vb);
- setPropertiesContent(tabPane);
- }
-
- private Button getButtonForFocus() {
- Button b = new Button("empty button");
- b.setId("FOCUS_RECEIVING_BUTTON_ID");
- return b;
- }
-
- /**
- *
- * @return controls which set parameters and create the new tab
- */
- private Pane getControlsForTabCreation(final TabPaneWithControl tabPane) {
-
- GridPane grid = new GridPane();
-
- grid.setStyle("-fx-border-color:DARKBLUE");
- grid.setHgap(5);
- grid.setVgap(5);
-
- ColumnConstraints column1 = new ColumnConstraints();
- column1.setPercentWidth(40);
- ColumnConstraints column2 = new ColumnConstraints();
- column2.setPercentWidth(60);
-
- grid.getColumnConstraints().addAll(column1, column2);
- //row #1
- grid.add(new Label("Tab ID"), 0, 0);
- final TextField newTabId = TextFieldBuilder.create()
- .id(NEW_TAB_ID_TEXT_FIELD_ID)
- .text("ID")
- .prefWidth(40d)
- .build();
- grid.add(newTabId, 1, 0);
-
- //row #2
- grid.add(new Label("Index"), 0, 1);
- final TextField newTabIndex = TextFieldBuilder.create()
- .id(TABPANE_ADD_INDEX_TEXT_FIELD_ID)
- .text("0")
- .prefWidth(40)
- .build();
- grid.add(newTabIndex, 1, 1);
-
- //row #3
- grid.add(new Label("Content"), 0, 2);
- final ChoiceBox cb = new ChoiceBox();
- cb.setId(NODE_CHOSER_CHOICE_BOX_ID);
- cb.getItems().addAll(ControlsFactory.filteredValues());
- cb.getItems().addAll(Shapes.values());
- cb.getItems().addAll(Panes.values());
- grid.add(cb, 1, 2);
-
- //row #4
- /*
- * If true then there will be created a properties pane
- * for tab content each time a tab is added
- */
- final CheckBox createPropsTab = CheckBoxBuilder
- .create()
- .text("Create additional panes\n with content properties")
- .build();
- grid.add(createPropsTab, 0, 3, 2, 1);
-
- //row #5
- /*
- * If true then there will be created a properties pane
- * for tab content each time a tab is added
- */
- final CheckBox vetoOnClose = CheckBoxBuilder
- .create()
- .text("Veto tab request on close.")
- .id(VETO_CHECKBOX_ID)
- .build();
- grid.add(vetoOnClose, 0, 4, 2, 1);
-
- //row #6
- Button actionButton = new Button("Create new tab");
- actionButton.setId(NODE_CHOOSER_ACTION_BUTTON_ID);
-
- final NodesChoserFactory.NodeAction handler = new NodesChoserFactory.NodeAction() {
- @Override
- public void execute(Node node) {
- Tab tab = new Tab();
-
- tab.setId(newTabId.getText());
- tab.setText(newTabId.getText());
- tab.setContent(node);
-
- final NodesStorage fullController = NodeControllerFactory.createFullController(tab, tabPane);
- fullController.pt.addCounter(TAB_CLOSE_REQUEST_EVENT);
-
- tab.setOnCloseRequest(new EventHandler() {
- private boolean useVeto = vetoOnClose.isSelected();
-
- public void handle(Event t) {
- fullController.pt.incrementCounter(TAB_CLOSE_REQUEST_EVENT);
-
- if (useVeto) {
- t.consume();
- }
- }
- });
-
- tabPane.addPropertiesTable(newTabId.getText(), fullController);
- testedTabPane.getTabs().add(Integer.parseInt(newTabIndex.getText()), tab);
-
- if (createPropsTab.isSelected()) {
- tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
- }
- }
- };
-
- actionButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- handler.execute(cb.getSelectionModel().getSelectedItem().createNode());
- }
- });
- grid.add(actionButton, 0, 5, 2, 1);
-
- return grid;
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.tabpane;
+
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.factory.*;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.*;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory.NodesStorage;
+import static javafx.scene.control.test.utils.ptables.NodesChoserFactory.*;
+import javafx.scene.layout.ColumnConstraints;
+import javafx.scene.layout.GridPane;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewTabPaneApp extends InteroperabilityApp {
+
+ public final static String TESTED_TABPANE_ID = "TESTED_TABPANE_ID";
+ public final static String RESET_BUTTON_ID = "RESET_TABPANE_BUTTON_ID";
+ public final static String RESET_SOFTLY_BUTTON_ID = "RESET_SOFTLY_BUTTON_ID";
+ public final static String TABPANE_ADD_INDEX_TEXT_FIELD_ID = "TABPANE_ADD_INDEX_TEXT_FIELD_ID";
+ public final static String NEW_TAB_ID_TEXT_FIELD_ID = "TAB_ID";
+ public final static String FOCUS_RECEIVING_BUTTON_ID = "FOCUS_RECEIVING_BUTTON_ID";
+ public final static String TAB_CLOSE_REQUEST_EVENT = "TAB_CLOSE_REQUEST_EVENT";
+ public final static String VETO_CHECKBOX_ID = "VETO_CHECKBOX_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewTabPaneApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "TabPaneTestApp");
+ NewTabPaneApp.TabPaneScene tabPaneScene = new NewTabPaneApp.TabPaneScene();
+ Utils.addBrowser(tabPaneScene);
+ return tabPaneScene;
+ }
+
+ class TabPaneScene extends CommonPropertiesScene {
+
+ //VBox which contain tested TabPane.
+ Pane pane;
+ //TabPane to be tested.
+ TabPane testedTabPane;
+ TabPaneWithControl tabPane;
+ private PropertiesTable tb;
+
+ public TabPaneScene() {
+ super("Tab pane tests", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ public final void prepareScene() {
+ pane = new Pane();
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+
+ testedTabPane = new TabPane();
+ testedTabPane.setId(TESTED_TABPANE_ID);
+ pane.getChildren().add(testedTabPane);
+
+ tb = new PropertiesTable(testedTabPane);
+ PropertyTablesFactory.explorePropertiesList(testedTabPane, tb);
+
+ Button btnResetHardly = new Button("Reset");
+ btnResetHardly.setId(RESET_BUTTON_ID);
+ btnResetHardly.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareMainSceneStructure();
+ prepareScene();
+ }
+ });
+
+ Button btnResetSoftly = new Button("Reset softly");
+ btnResetSoftly.setId(RESET_SOFTLY_BUTTON_ID);
+ btnResetSoftly.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+
+ tb.refresh();
+
+ TabPane newInstance = new TabPane();
+ while (testedTabPane.getTabs().size() != 0) {
+ testedTabPane.getTabs().remove(0);
+ }
+
+ testedTabPane.setSide(newInstance.getSide());
+ testedTabPane.setPrefHeight(newInstance.getPrefHeight());
+ testedTabPane.setMinHeight(newInstance.getMinHeight());
+ testedTabPane.setMaxHeight(newInstance.getMaxHeight());
+ testedTabPane.setPrefWidth(newInstance.getPrefWidth());
+ testedTabPane.setMinWidth(newInstance.getMinWidth());
+ testedTabPane.setMaxWidth(newInstance.getMaxWidth());
+ testedTabPane.setVisible(newInstance.isVisible());
+ testedTabPane.setDisable(newInstance.isDisable());
+ testedTabPane.setContextMenu(newInstance.getContextMenu());
+
+ tabPane.removePropertiesTablesExceptFirstOnes(1);
+ }
+ });
+
+ tabPane = new TabPaneWithControl("TabPane", tb);
+
+
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+ vb.getChildren().addAll(
+ btnResetHardly,
+ btnResetSoftly,
+ getControlsForTabCreation(tabPane),
+ getButtonForFocus());
+
+ setTestedControl(testedTabPane);
+ setControllersContent(vb);
+ setPropertiesContent(tabPane);
+ }
+
+ private Button getButtonForFocus() {
+ Button b = new Button("empty button");
+ b.setId("FOCUS_RECEIVING_BUTTON_ID");
+ return b;
+ }
+
+ /**
+ *
+ * @return controls which set parameters and create the new tab
+ */
+ private Pane getControlsForTabCreation(final TabPaneWithControl tabPane) {
+
+ GridPane grid = new GridPane();
+
+ grid.setStyle("-fx-border-color:DARKBLUE");
+ grid.setHgap(5);
+ grid.setVgap(5);
+
+ ColumnConstraints column1 = new ColumnConstraints();
+ column1.setPercentWidth(40);
+ ColumnConstraints column2 = new ColumnConstraints();
+ column2.setPercentWidth(60);
+
+ grid.getColumnConstraints().addAll(column1, column2);
+ //row #1
+ grid.add(new Label("Tab ID"), 0, 0);
+ final TextField newTabId = new TextField("ID");
+ newTabId.setPrefWidth(40d);
+ newTabId.setId(NEW_TAB_ID_TEXT_FIELD_ID);
+ grid.add(newTabId, 1, 0);
+
+ //row #2
+ grid.add(new Label("Index"), 0, 1);
+ final TextField newTabIndex = new TextField("0");
+ newTabIndex.setId(TABPANE_ADD_INDEX_TEXT_FIELD_ID);
+ newTabIndex.setPrefWidth(40);
+ grid.add(newTabIndex, 1, 1);
+
+ //row #3
+ grid.add(new Label("Content"), 0, 2);
+ final ChoiceBox cb = new ChoiceBox();
+ cb.setId(NODE_CHOSER_CHOICE_BOX_ID);
+ cb.getItems().addAll(ControlsFactory.filteredValues());
+ cb.getItems().addAll(Shapes.values());
+ cb.getItems().addAll(Panes.values());
+ grid.add(cb, 1, 2);
+
+ //row #4
+ /*
+ * If true then there will be created a properties pane
+ * for tab content each time a tab is added
+ */
+ final CheckBox createPropsTab = new CheckBox("Create additional panes\n with content properties");
+ grid.add(createPropsTab, 0, 3, 2, 1);
+
+ //row #5
+ /*
+ * If true then there will be created a properties pane
+ * for tab content each time a tab is added
+ */
+ final CheckBox vetoOnClose = new CheckBox("Veto tab request on close.");
+ vetoOnClose.setId(VETO_CHECKBOX_ID);
+ grid.add(vetoOnClose, 0, 4, 2, 1);
+
+ //row #6
+ Button actionButton = new Button("Create new tab");
+ actionButton.setId(NODE_CHOOSER_ACTION_BUTTON_ID);
+
+ final NodesChoserFactory.NodeAction handler = new NodesChoserFactory.NodeAction() {
+ @Override
+ public void execute(Node node) {
+ Tab tab = new Tab();
+
+ tab.setId(newTabId.getText());
+ tab.setText(newTabId.getText());
+ tab.setContent(node);
+
+ final NodesStorage fullController = NodeControllerFactory.createFullController(tab, tabPane);
+ fullController.pt.addCounter(TAB_CLOSE_REQUEST_EVENT);
+
+ tab.setOnCloseRequest(new EventHandler() {
+ private boolean useVeto = vetoOnClose.isSelected();
+
+ public void handle(Event t) {
+ fullController.pt.incrementCounter(TAB_CLOSE_REQUEST_EVENT);
+
+ if (useVeto) {
+ t.consume();
+ }
+ }
+ });
+
+ tabPane.addPropertiesTable(newTabId.getText(), fullController);
+ testedTabPane.getTabs().add(Integer.parseInt(newTabIndex.getText()), tab);
+
+ if (createPropsTab.isSelected()) {
+ tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
+ }
+ }
+ };
+
+ actionButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ handler.execute(cb.getSelectionModel().getSelectedItem().createNode());
+ }
+ });
+ grid.add(actionButton, 0, 5, 2, 1);
+
+ return grid;
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/tabpane/TabPaneApp2.java 2016-12-22 11:26:25.373040026 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/tabpane/TabPaneApp2.java 2016-12-22 11:26:25.325039563 +0300
@@ -32,7 +32,7 @@
import javafx.event.EventHandler;
import javafx.geometry.Side;
import javafx.scene.Scene;
-import javafx.scene.control.ButtonBuilder;
+import javafx.scene.control.Button;
import javafx.scene.control.ChoiceBox;
import javafx.scene.control.ContextMenu;
import javafx.scene.control.Label;
@@ -113,34 +113,34 @@
error = new Label();
error.setId(ERROR_ID);
- controls.getChildren().add(
- ButtonBuilder.create()
- .text(CLEAR_BTN_ID).id(CLEAR_BTN_ID)
- .onAction(new EventHandler() {
- public void handle(ActionEvent t) {
- tabPane.getTabs().clear();
- }
- }).build());
-
- controls.getChildren().add(
- ButtonBuilder.create()
- .text(RESET_BTN_ID).id(RESET_BTN_ID)
- .onAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- reset();
- }
- }).build());
-
- controls.getChildren().add(
- ButtonBuilder.create()
- .text(ADD_SINGLE_BTN_ID).id(ADD_SINGLE_BTN_ID)
- .onAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- tabPane.getTabs().add(new NamedTab(TAB_ITEM + tabPane.getTabs().size()));
- }
- }).build());
+ Button temp;
+
+ temp = new Button(CLEAR_BTN_ID);
+ temp.setId(CLEAR_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ tabPane.getTabs().clear();
+ }
+ });
+ controls.getChildren().add(temp);
+
+ temp = new Button(RESET_BTN_ID);
+ temp.setId(RESET_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ reset();
+ }
+ });
+ controls.getChildren().add(temp);
+
+ temp = new Button(ADD_SINGLE_BTN_ID);
+ temp.setId(ADD_SINGLE_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ tabPane.getTabs().add(new NamedTab(TAB_ITEM + tabPane.getTabs().size()));
+ }
+ });
+ controls.getChildren().add(temp);
HBox add_position_box = new HBox(5);
controls.getChildren().add(add_position_box);
@@ -148,15 +148,14 @@
final TextField add_position = new TextField("0");
add_position.setId(ADD_POS_EDIT_ID);
- add_position_box.getChildren().add(
- ButtonBuilder.create()
- .text(ADD_SINGLE_AT_POS_BTN_ID).id(ADD_SINGLE_AT_POS_BTN_ID)
- .onAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- tabPane.getTabs().add(new NamedTab("Tab " + tabPane.getTabs().size()));
- }
- }).build());
+ temp = new Button(ADD_SINGLE_AT_POS_BTN_ID);
+ temp.setId(ADD_SINGLE_AT_POS_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ tabPane.getTabs().add(new NamedTab("Tab " + tabPane.getTabs().size()));
+ }
+ });
+ add_position_box.getChildren().add(temp);
final Label add_label = new Label("at");
add_position_box.getChildren().add(add_label);
@@ -170,17 +169,16 @@
final TextField disable_position = new TextField("0");
disable_position.setId(DISABLE_POS_EDIT_ID);
- disable_position_box.getChildren().add(
- ButtonBuilder.create()
- .text(DISABLE_SINGLE_AT_POS_BTN_ID).id(DISABLE_SINGLE_AT_POS_BTN_ID)
- .onAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- Integer pos = Integer.valueOf(disable_position.getText());
- Tab tab = tabPane.getTabs().get(pos.intValue());
- tab.setDisable(!tab.isDisable());
- }
- }).build());
+ temp = new Button(DISABLE_SINGLE_AT_POS_BTN_ID);
+ temp.setId(DISABLE_SINGLE_AT_POS_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ Integer pos = Integer.valueOf(disable_position.getText());
+ Tab tab = tabPane.getTabs().get(pos.intValue());
+ tab.setDisable(!tab.isDisable());
+ }
+ });
+ disable_position_box.getChildren().add(temp);
final Label disable_label = new Label("at");
disable_position_box.getChildren().add(disable_label);
@@ -194,15 +192,14 @@
final TextField remove_position = new TextField("0");
remove_position.setId(REMOVE_POS_EDIT_ID);
- remove_position_box.getChildren().add(
- ButtonBuilder.create()
- .text(REMOVE_SINGLE_AT_POS_BTN_ID).id(REMOVE_SINGLE_AT_POS_BTN_ID)
- .onAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- tabPane.getTabs().remove(Integer.valueOf(remove_position.getText()).intValue());
- }
- }).build());
+ temp = new Button(REMOVE_SINGLE_AT_POS_BTN_ID);
+ temp.setId(REMOVE_SINGLE_AT_POS_BTN_ID);
+ temp.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ tabPane.getTabs().remove(Integer.valueOf(remove_position.getText()).intValue());
+ }
+ });
+ remove_position_box.getChildren().add(temp);
final Label remove_label = new Label("at");
remove_position_box.getChildren().add(remove_label);
--- old/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextAreaPropertiesApp.java 2016-12-22 11:26:25.561041839 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextAreaPropertiesApp.java 2016-12-22 11:26:25.513041376 +0300
@@ -1,97 +1,96 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.textinput;
-
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.TextArea;
-import javafx.scene.control.TextField;
-import javafx.scene.layout.Pane;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class TextAreaPropertiesApp extends TextControlApp {
- public static void main(String[] args) {
- Utils.launch(TextAreaPropertiesApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- setTitle();
- return new TextAreaScene();
- }
-
- public class TextAreaScene extends TextInputScene {
-
- @Override
- public void setNewControl() {
- testedTextInput = new TextArea();
- }
-
- @Override
- public void resetControl() {
- TextArea fresh = new TextArea();
- TextArea tested = (TextArea) testedTextInput;
- tested.setPrefWidth(fresh.getPrefWidth());
- tested.setPrefHeight(fresh.getPrefHeight());
- tested.setDisable(fresh.isDisable());
- tested.setEditable(fresh.isEditable());
- tested.setPrefColumnCount(fresh.getPrefColumnCount());
- tested.setPrefRowCount(fresh.getPrefRowCount());
- tested.setText(fresh.getText());
- tested.setFocusTraversable(fresh.isFocusTraversable());
- tested.setWrapText(fresh.isWrapText());
- }
-
- @Override
- public void addControlSpecificButtons(Pane pane) {
- Button button = ButtonBuilder.create().id(ADD_TEXT_BUTTON_ID).text("Add much text").build();
- button.setOnAction(new EventHandler() {
-
- public void handle(Event t) {
- for (int i = 0; i < 1000; i++) {
- TextArea ta = (TextArea) testedTextInput;
- ta.setText(ta.getText() + " some text");
- if (i % 10 == 0) {
- ta.setText(ta.getText() + "\n");
- }
- }
- }
- });
- pane.getChildren().add(button);
- }
-
- @Override
- protected void addControlDependentProperties() {
- TextArea textArea = (TextArea) testedTextInput;
- tb.addSimpleListener(textArea.focusedProperty(), textArea);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.textinput;
+
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.TextArea;
+import javafx.scene.layout.Pane;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class TextAreaPropertiesApp extends TextControlApp {
+ public static void main(String[] args) {
+ Utils.launch(TextAreaPropertiesApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ setTitle();
+ return new TextAreaScene();
+ }
+
+ public class TextAreaScene extends TextInputScene {
+
+ @Override
+ public void setNewControl() {
+ testedTextInput = new TextArea();
+ }
+
+ @Override
+ public void resetControl() {
+ TextArea fresh = new TextArea();
+ TextArea tested = (TextArea) testedTextInput;
+ tested.setPrefWidth(fresh.getPrefWidth());
+ tested.setPrefHeight(fresh.getPrefHeight());
+ tested.setDisable(fresh.isDisable());
+ tested.setEditable(fresh.isEditable());
+ tested.setPrefColumnCount(fresh.getPrefColumnCount());
+ tested.setPrefRowCount(fresh.getPrefRowCount());
+ tested.setText(fresh.getText());
+ tested.setFocusTraversable(fresh.isFocusTraversable());
+ tested.setWrapText(fresh.isWrapText());
+ }
+
+ @Override
+ public void addControlSpecificButtons(Pane pane) {
+ Button button = new Button("Add much text");
+ button.setId(ADD_TEXT_BUTTON_ID);
+ button.setOnAction(new EventHandler() {
+
+ public void handle(Event t) {
+ for (int i = 0; i < 1000; i++) {
+ TextArea ta = (TextArea) testedTextInput;
+ ta.setText(ta.getText() + " some text");
+ if (i % 10 == 0) {
+ ta.setText(ta.getText() + "\n");
+ }
+ }
+ }
+ });
+ pane.getChildren().add(button);
+ }
+
+ @Override
+ protected void addControlDependentProperties() {
+ TextArea textArea = (TextArea) testedTextInput;
+ tb.addSimpleListener(textArea.focusedProperty(), textArea);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextControlApp.java 2016-12-22 11:26:25.745043615 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextControlApp.java 2016-12-22 11:26:25.697043151 +0300
@@ -1,107 +1,108 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.textinput;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public abstract class TextControlApp extends InteroperabilityApp {
-
- public final static String ADD_TEXT_BUTTON_ID = "ADD_TEXT_BUTTON_ID";
- public final static String TESTED_TEXT_INPUT_CONTROL_ID = "TESTED_CONTROL_ID";
- public final static String RESET_BUTTON_ID = "RESET_BUTTON_ID";
-
- public abstract class TextInputScene extends CommonPropertiesScene {
-
- PropertiesTable tb;
- //Control to be tested.
- TextInputControl testedTextInput;
-
- public TextInputScene() {
- super("TextInput", 800, 600);
-
- prepareScene();
- }
-
- public abstract void setNewControl();
-
- public abstract void resetControl();
-
- public abstract void addControlSpecificButtons(Pane pane);
-
- @Override
- final protected void prepareScene() {
- setNewControl();
- tb = new PropertiesTable(testedTextInput);
- testedTextInput.setId(TESTED_TEXT_INPUT_CONTROL_ID);
-
- PropertyTablesFactory.explorePropertiesList(testedTextInput, tb);
- SpecialTablePropertiesProvider.provideForControl(testedTextInput, tb);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("RESET").build();
- resetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- tb.refresh();
- resetControl();
- }
- });
- VBox resetButtonsHBox = new VBox(5);
- resetButtonsHBox.getChildren().addAll(resetButton);
- vb.getChildren().addAll(resetButtonsHBox);
- addControlDependentProperties();
- addControlSpecificButtons(vb);
- setTestedControl(testedTextInput);
- setControllersContent(vb);
- setPropertiesContent(tb);
- }
-
- protected void addControlDependentProperties() {}
- }
-
- protected void setTitle() {
- Utils.setTitleToStage(stage, "TextInputTestApp");
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.textinput;
+
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public abstract class TextControlApp extends InteroperabilityApp {
+
+ public final static String ADD_TEXT_BUTTON_ID = "ADD_TEXT_BUTTON_ID";
+ public final static String TESTED_TEXT_INPUT_CONTROL_ID = "TESTED_CONTROL_ID";
+ public final static String RESET_BUTTON_ID = "RESET_BUTTON_ID";
+
+ public abstract class TextInputScene extends CommonPropertiesScene {
+
+ PropertiesTable tb;
+ //Control to be tested.
+ TextInputControl testedTextInput;
+
+ public TextInputScene() {
+ super("TextInput", 800, 600);
+
+ prepareScene();
+ }
+
+ public abstract void setNewControl();
+
+ public abstract void resetControl();
+
+ public abstract void addControlSpecificButtons(Pane pane);
+
+ @Override
+ final protected void prepareScene() {
+ setNewControl();
+ tb = new PropertiesTable(testedTextInput);
+ testedTextInput.setId(TESTED_TEXT_INPUT_CONTROL_ID);
+
+ PropertyTablesFactory.explorePropertiesList(testedTextInput, tb);
+ SpecialTablePropertiesProvider.provideForControl(testedTextInput, tb);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("RESET");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ tb.refresh();
+ resetControl();
+ }
+ });
+ VBox resetButtonsHBox = new VBox(5);
+ resetButtonsHBox.getChildren().addAll(resetButton);
+ vb.getChildren().addAll(resetButtonsHBox);
+ addControlDependentProperties();
+ addControlSpecificButtons(vb);
+ setTestedControl(testedTextInput);
+ setControllersContent(vb);
+ setPropertiesContent(tb);
+ }
+
+ protected void addControlDependentProperties() {}
+ }
+
+ protected void setTitle() {
+ Utils.setTitleToStage(stage, "TextInputTestApp");
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextFieldPropertiesApp.java 2016-12-22 11:26:25.933045428 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextFieldPropertiesApp.java 2016-12-22 11:26:25.881044926 +0300
@@ -1,106 +1,108 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.textinput;
-
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.scene.Scene;
-import javafx.scene.control.Button;
-import javafx.scene.control.ButtonBuilder;
-import javafx.scene.control.TextField;
-import javafx.scene.layout.Pane;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class TextFieldPropertiesApp extends TextControlApp {
- public final static String SET_ON_ACTION_BUTTON_ID = "SET_ON_ACTION_BUTTON_ID";
- public final static String ON_ACTION_COUNTER = "ON_ACTION_COUNTER";
-
- public static void main(String[] args) {
- Utils.launch(TextFieldPropertiesApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- setTitle();
- return new TextFieldScene();
- }
-
- public class TextFieldScene extends TextInputScene {
-
- @Override
- public void setNewControl() {
- testedTextInput = new TextField();
- }
-
- @Override
- protected void addControlDependentProperties() {
- tb.addCounter(ON_ACTION_COUNTER);
- }
-
- @Override
- public void resetControl() {
- TextField fresh = new TextField();
- TextField tested = (TextField) testedTextInput;
- tested.setPrefWidth(fresh.getPrefWidth());
- tested.setPrefHeight(fresh.getPrefHeight());
- tested.setDisable(fresh.isDisable());
- tested.setEditable(fresh.isEditable());
- tested.setPrefColumnCount(fresh.getPrefColumnCount());
- tested.setText(fresh.getText());
- tested.setPromptText(fresh.getPromptText());
- tested.setFocusTraversable(fresh.isFocusTraversable());
- }
-
- @Override
- public void addControlSpecificButtons(Pane pane) {
- Button setOnActionListenerButton = ButtonBuilder.create().id(SET_ON_ACTION_BUTTON_ID).text("Set on action listener").build();
- setOnActionListenerButton.setOnAction(new EventHandler() {
-
- public void handle(Event t) {
- ((TextField) testedTextInput).onActionProperty().setValue(new EventHandler() {
-
- public void handle(ActionEvent t) {
- tb.incrementCounter(ON_ACTION_COUNTER);
- }
- });
- }
- });
-
- Button addTextButton = ButtonBuilder.create().id(ADD_TEXT_BUTTON_ID).text("Add \"sometext\"").build();
- addTextButton.setOnAction(new EventHandler() {
-
- public void handle(Event t) {
- testedTextInput.setText(testedTextInput.getText() + "some\ntext");
- }
- });
-
- pane.getChildren().addAll(setOnActionListenerButton, addTextButton);
- }
- }
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.textinput;
+
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.scene.Scene;
+import javafx.scene.control.Button;
+import javafx.scene.control.TextField;
+import static javafx.scene.control.test.textinput.TextControlApp.ADD_TEXT_BUTTON_ID;
+import javafx.scene.layout.Pane;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class TextFieldPropertiesApp extends TextControlApp {
+ public final static String SET_ON_ACTION_BUTTON_ID = "SET_ON_ACTION_BUTTON_ID";
+ public final static String ON_ACTION_COUNTER = "ON_ACTION_COUNTER";
+
+ public static void main(String[] args) {
+ Utils.launch(TextFieldPropertiesApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ setTitle();
+ return new TextFieldScene();
+ }
+
+ public class TextFieldScene extends TextInputScene {
+
+ @Override
+ public void setNewControl() {
+ testedTextInput = new TextField();
+ }
+
+ @Override
+ protected void addControlDependentProperties() {
+ tb.addCounter(ON_ACTION_COUNTER);
+ }
+
+ @Override
+ public void resetControl() {
+ TextField fresh = new TextField();
+ TextField tested = (TextField) testedTextInput;
+ tested.setPrefWidth(fresh.getPrefWidth());
+ tested.setPrefHeight(fresh.getPrefHeight());
+ tested.setDisable(fresh.isDisable());
+ tested.setEditable(fresh.isEditable());
+ tested.setPrefColumnCount(fresh.getPrefColumnCount());
+ tested.setText(fresh.getText());
+ tested.setPromptText(fresh.getPromptText());
+ tested.setFocusTraversable(fresh.isFocusTraversable());
+ }
+
+ @Override
+ public void addControlSpecificButtons(Pane pane) {
+ Button setOnActionListenerButton = new Button("Set on action listener");
+ setOnActionListenerButton.setId(SET_ON_ACTION_BUTTON_ID);
+ setOnActionListenerButton.setOnAction(new EventHandler() {
+
+ public void handle(Event t) {
+ ((TextField) testedTextInput).onActionProperty().setValue(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ tb.incrementCounter(ON_ACTION_COUNTER);
+ }
+ });
+ }
+ });
+
+ Button addTextButton = new Button("Add \"sometext\"");
+ addTextButton.setId(ADD_TEXT_BUTTON_ID);
+ addTextButton.setOnAction(new EventHandler() {
+
+ public void handle(Event t) {
+ testedTextInput.setText(testedTextInput.getText() + "some\ntext");
+ }
+ });
+
+ pane.getChildren().addAll(setOnActionListenerButton, addTextButton);
+ }
+ }
}
\ No newline at end of file
--- old/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextInputExternalWrap.java 2016-12-22 11:26:26.125047279 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/textinput/TextInputExternalWrap.java 2016-12-22 11:26:26.077046816 +0300
@@ -25,7 +25,6 @@
package javafx.scene.control.test.textinput;
-import com.sun.javafx.scene.text.HitInfo;
import javafx.scene.Node;
import javafx.scene.control.TextInputControl;
import javafx.scene.control.test.textinput.TextInputChanger.TextInputControlWrapInterface;
--- old/functional/ControlsTests/src/javafx/scene/control/test/toolbar/NewToolbarApp.java 2016-12-22 11:26:26.333049285 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/toolbar/NewToolbarApp.java 2016-12-22 11:26:26.277048745 +0300
@@ -1,148 +1,152 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.Toolbar;
-
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
-import javafx.beans.value.ChangeListener;
-import javafx.beans.value.ObservableValue;
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Node;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.*;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import javafx.scene.shape.Shape;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewToolbarApp extends InteroperabilityApp {
-
- public final static String TESTED_TOOLBAR_ID = "TESTED_TOOLBAR_ID";
- public final static String RESET_BUTTON_ID = "RESET_Toolbar_BUTTON_ID";
- public final String TOOLBAR_ADD_INDEX_TEXT_FIELD_ID = "TOOLBAR_ADD_INDEX_TEXT_FIELD_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewToolbarApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "ToolbarTestApp");
- return new NewToolbarApp.ToolbarScene();
- }
-
- class ToolbarScene extends Scene {
-
- //VBox which contain tested ToolBar.
- Pane pane;
- //Toolbar to be tested.
- ToolBar testedToolbar;
-
- public ToolbarScene() {
- super(new HBox(), 800, 600);
-
- prepareScene();
- }
-
- private void prepareScene() {
- pane = new Pane();
- testedToolbar = ToolBarBuilder.create().id(TESTED_TOOLBAR_ID).build();
-
- PropertiesTable tb = new PropertiesTable(testedToolbar);
- PropertyTablesFactory.explorePropertiesList(testedToolbar, tb);
-
- final TabPaneWithControl tabPane = new TabPaneWithControl("ToolBar", tb);
-
- final TextField tf = TextFieldBuilder.create().id(TOOLBAR_ADD_INDEX_TEXT_FIELD_ID).text("0").prefWidth(40).build();
-
- HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
-
- @Override
- public void execute(Node node) {
- testedToolbar.getItems().add(Integer.parseInt(tf.getText()), node);
- tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
- }
- }, tf);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(testedToolbar);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- final ToggleButton compactStateToggle = new ToggleButton("Compact");
- compactStateToggle.setSelected(true);
- compactStateToggle.selectedProperty().addListener(new ChangeListener() {
-
- public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
- if (t1) {
- compactStateToggle.setText("Compact");
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- ToolbarScene.this.getWindow().setWidth(1200);
- ToolbarScene.this.getWindow().setHeight(700);
- } else {
- compactStateToggle.setText("Free");
- pane.setMinSize(600, 600);
- pane.setPrefSize(600, 600);
- ToolbarScene.this.getWindow().setWidth(800);
- ToolbarScene.this.getWindow().setHeight(600);
- }
- }
- });
-
- vb.getChildren().addAll(new Label("Pane with tested Toolbar"), pane, resetButton, compactStateToggle, nodeshb);
-
- hb.getChildren().addAll(vb, tabPane);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.Toolbar;
+
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.NodesChoserFactory;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
+import javafx.beans.value.ChangeListener;
+import javafx.beans.value.ObservableValue;
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Node;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.*;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import javafx.scene.shape.Shape;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewToolbarApp extends InteroperabilityApp {
+
+ public final static String TESTED_TOOLBAR_ID = "TESTED_TOOLBAR_ID";
+ public final static String RESET_BUTTON_ID = "RESET_Toolbar_BUTTON_ID";
+ public final String TOOLBAR_ADD_INDEX_TEXT_FIELD_ID = "TOOLBAR_ADD_INDEX_TEXT_FIELD_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewToolbarApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "ToolbarTestApp");
+ return new NewToolbarApp.ToolbarScene();
+ }
+
+ class ToolbarScene extends Scene {
+
+ //VBox which contain tested ToolBar.
+ Pane pane;
+ //Toolbar to be tested.
+ ToolBar testedToolbar;
+
+ public ToolbarScene() {
+ super(new HBox(), 800, 600);
+
+ prepareScene();
+ }
+
+ private void prepareScene() {
+ pane = new Pane();
+ testedToolbar = new ToolBar();
+ testedToolbar.setId(TESTED_TOOLBAR_ID);
+
+ PropertiesTable tb = new PropertiesTable(testedToolbar);
+ PropertyTablesFactory.explorePropertiesList(testedToolbar, tb);
+
+ final TabPaneWithControl tabPane = new TabPaneWithControl("ToolBar", tb);
+
+ final TextField tf = new TextField("0");
+ tf.setId(TOOLBAR_ADD_INDEX_TEXT_FIELD_ID);
+ tf.setPrefWidth(40);
+
+ HBox nodeshb = new NodesChoserFactory("Add!", new NodesChoserFactory.NodeAction() {
+
+ @Override
+ public void execute(Node node) {
+ testedToolbar.getItems().add(Integer.parseInt(tf.getText()), node);
+ tabPane.addPropertiesTable(node.getClass().getSimpleName(), NodeControllerFactory.createFullController(node, tabPane));
+ }
+ }, tf);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(testedToolbar);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ final ToggleButton compactStateToggle = new ToggleButton("Compact");
+ compactStateToggle.setSelected(true);
+ compactStateToggle.selectedProperty().addListener(new ChangeListener() {
+
+ public void changed(ObservableValue extends Boolean> ov, Boolean t, Boolean t1) {
+ if (t1) {
+ compactStateToggle.setText("Compact");
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ ToolbarScene.this.getWindow().setWidth(1200);
+ ToolbarScene.this.getWindow().setHeight(700);
+ } else {
+ compactStateToggle.setText("Free");
+ pane.setMinSize(600, 600);
+ pane.setPrefSize(600, 600);
+ ToolbarScene.this.getWindow().setWidth(800);
+ ToolbarScene.this.getWindow().setHeight(600);
+ }
+ }
+ });
+
+ vb.getChildren().addAll(new Label("Pane with tested Toolbar"), pane, resetButton, compactStateToggle, nodeshb);
+
+ hb.getChildren().addAll(vb, tabPane);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/tooltip/NewTooltipApp.java 2016-12-22 11:26:26.529051177 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/tooltip/NewTooltipApp.java 2016-12-22 11:26:26.473050636 +0300
@@ -1,109 +1,111 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.Tooltip;
-
-import javafx.event.ActionEvent;
-import javafx.event.EventHandler;
-import javafx.geometry.Insets;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.Pane;
-import javafx.scene.layout.VBox;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class NewTooltipApp extends InteroperabilityApp {
-
- public final static String TESTED_TOOLTIP_ID = "TESTED_TOOLTIP_ID";
- public final static String RESET_BUTTON_ID = "RESET_Tooltip_BUTTON_ID";
-
- public static void main(String[] args) {
- Utils.launch(NewTooltipApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Utils.setTitleToStage(stage, "TooltipTestApp");
- return new NewTooltipApp.TooltipScene();
- }
-
- class TooltipScene extends CommonPropertiesScene {
-
- //VBox which contain tested tooltip.
- Pane pane;
- PropertiesTable tb;
- //Tooltip to be tested.
- Tooltip testedTooltip;
-
- public TooltipScene() {
- super("Tooltip", 800, 600);
-
- prepareScene();
- }
-
- @Override
- final protected void prepareScene() {
- pane = new Pane();
- testedTooltip = TooltipBuilder.create().id(TESTED_TOOLTIP_ID).build();
-
- tb = new PropertiesTable(testedTooltip);
- PropertyTablesFactory.explorePropertiesList(testedTooltip, tb);
-
- Button button = new Button("Tooltip attached.");
- button.setTooltip(testedTooltip);
-
- pane.setMinSize(220, 220);
- pane.setPrefSize(220, 220);
- pane.setStyle("-fx-border-color : red;");
- pane.getChildren().add(button);
-
- VBox vb = new VBox();
- vb.setSpacing(5);
-
- HBox hb = (HBox) getRoot();
- hb.setPadding(new Insets(5, 5, 5, 5));
- hb.setStyle("-fx-border-color : green;");
-
- Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();
- resetButton.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- HBox hb = (HBox) getRoot();
- hb.getChildren().clear();
- prepareScene();
- }
- });
-
- setControllersContent(resetButton);
- setPropertiesContent(tb);
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.Tooltip;
+
+import javafx.event.ActionEvent;
+import javafx.event.EventHandler;
+import javafx.geometry.Insets;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.Pane;
+import javafx.scene.layout.VBox;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class NewTooltipApp extends InteroperabilityApp {
+
+ public final static String TESTED_TOOLTIP_ID = "TESTED_TOOLTIP_ID";
+ public final static String RESET_BUTTON_ID = "RESET_Tooltip_BUTTON_ID";
+
+ public static void main(String[] args) {
+ Utils.launch(NewTooltipApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Utils.setTitleToStage(stage, "TooltipTestApp");
+ return new NewTooltipApp.TooltipScene();
+ }
+
+ class TooltipScene extends CommonPropertiesScene {
+
+ //VBox which contain tested tooltip.
+ Pane pane;
+ PropertiesTable tb;
+ //Tooltip to be tested.
+ Tooltip testedTooltip;
+
+ public TooltipScene() {
+ super("Tooltip", 800, 600);
+
+ prepareScene();
+ }
+
+ @Override
+ final protected void prepareScene() {
+ pane = new Pane();
+ testedTooltip = new Tooltip();
+ testedTooltip.setId(TESTED_TOOLTIP_ID);
+
+ tb = new PropertiesTable(testedTooltip);
+ PropertyTablesFactory.explorePropertiesList(testedTooltip, tb);
+
+ Button button = new Button("Tooltip attached.");
+ button.setTooltip(testedTooltip);
+
+ pane.setMinSize(220, 220);
+ pane.setPrefSize(220, 220);
+ pane.setStyle("-fx-border-color : red;");
+ pane.getChildren().add(button);
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+
+ HBox hb = (HBox) getRoot();
+ hb.setPadding(new Insets(5, 5, 5, 5));
+ hb.setStyle("-fx-border-color : green;");
+
+ Button resetButton = new Button("Reset");
+ resetButton.setId(RESET_BUTTON_ID);
+ resetButton.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ HBox hb = (HBox) getRoot();
+ hb.getChildren().clear();
+ prepareScene();
+ }
+ });
+
+ setControllersContent(resetButton);
+ setPropertiesContent(tb);
+ }
+ }
+}
--- old/functional/ControlsTests/src/javafx/scene/control/test/treetable/TreeTableNewApp.java 2016-12-22 11:26:26.725053066 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/treetable/TreeTableNewApp.java 2016-12-22 11:26:26.669052526 +0300
@@ -24,10 +24,10 @@
*/
package javafx.scene.control.test.treetable;
-import com.sun.javafx.scene.control.skin.NestedTableColumnHeader;
-import com.sun.javafx.scene.control.skin.TableColumnHeader;
-import com.sun.javafx.scene.control.skin.TableHeaderRow;
-import com.sun.javafx.scene.control.skin.TreeTableViewSkin;
+import javafx.scene.control.skin.NestedTableColumnHeader;
+import javafx.scene.control.skin.TableColumnHeader;
+import javafx.scene.control.skin.TableHeaderRow;
+import javafx.scene.control.skin.TreeTableViewSkin;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
@@ -54,6 +54,7 @@
import javafx.scene.control.cell.ComboBoxTreeTableCell;
import javafx.scene.control.cell.TextFieldTreeTableCell;
import javafx.scene.control.test.tableview.NewTableViewApp;
+import static javafx.scene.control.test.treetable.ResetButtonNames.HARD_RESET_BUTTON_ID;
import javafx.scene.control.test.treeview.TreeViewConstants;
import javafx.scene.control.test.utils.CommonPropertiesScene;
import javafx.scene.control.test.utils.ComponentsFactory.MultipleIndexFormComponent;
@@ -193,7 +194,8 @@
hb.setPadding(new Insets(5, 5, 5, 5));
hb.setStyle("-fx-border-color : green;");
- Button resetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Reset").build();
+ Button resetButton = new Button("Reset");
+ resetButton.setId(HARD_RESET_BUTTON_ID);
resetButton.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
HBox hb = (HBox) getRoot();
@@ -628,7 +630,7 @@
public String toString() {
return "CUSTOM " + super.toString();
}
-
+/*
@Override
protected TableHeaderRow createTableHeaderRow() {
return new TableHeaderRow(this) {
@@ -651,6 +653,7 @@
}
};
}
+*/
});
}
});
@@ -707,8 +710,11 @@
private HBox getScrollToHBox() {
HBox hb = new HBox();
- Button button = ButtonBuilder.create().text("ScrollTo").id(SCROLL_TO_BUTTON_ID).build();
- final TextField tf = TextFieldBuilder.create().text("0").id(SCROLL_TO_TEXT_FIELD_ID).prefWidth(50).build();
+ Button button = new Button("ScrollTo");
+ button.setId(SCROLL_TO_BUTTON_ID);
+ final TextField tf = new TextField("0");
+ tf.setId(SCROLL_TO_TEXT_FIELD_ID);
+ tf.setPrefWidth(50);
button.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
@@ -722,8 +728,12 @@
private HBox getEditHBox() {
HBox hb = new HBox();
- Button button = ButtonBuilder.create().text("Edit").id(EDIT_BUTTON_ID).build();
- final TextField tf = TextFieldBuilder.create().promptText("name").id(EDIT_TEXT_FIELD_ID).prefWidth(50).build();
+ Button button = new Button("Edit");
+ button.setId(EDIT_BUTTON_ID);
+ final TextField tf = new TextField();
+ tf.setPromptText("name");
+ tf.setId(EDIT_TEXT_FIELD_ID);
+ tf.setPrefWidth(50);
button.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
@@ -739,11 +749,8 @@
private VBox setEventHandlersHBox() {
VBox vb = new VBox();
- Button btn = ButtonBuilder.create()
- .text("Set onEdit event hadlers")
- .id(BTN_SET_ON_EDIT_EVENT_HANDLERS)
- .build();
-
+ Button btn = new Button("Set onEdit event hadlers");
+ btn.setId(BTN_SET_ON_EDIT_EVENT_HANDLERS);
btn.setOnAction(new EventHandler() {
final EventHandler eventHandlerOnEditStart = new EventHandler() {
public void handle(Event t) {
@@ -780,11 +787,8 @@
}
});
- Button btnAddFactory = ButtonBuilder.create()
- .text("Set cell factory for editing")
- .id(SET_CELL_FACTORY_FOR_EDITING)
- .build();
-
+ Button btnAddFactory = new Button("Set cell factory for editing");
+ btnAddFactory.setId(SET_CELL_FACTORY_FOR_EDITING);
btnAddFactory.setOnAction(new EventHandler() {
public void handle(ActionEvent t) {
for (Object obj : testedControl.getColumns()) {
--- old/functional/ControlsTests/src/javafx/scene/control/test/treeview/TreeViewNewApp.java 2016-12-22 11:26:26.929055034 +0300
+++ new/functional/ControlsTests/src/javafx/scene/control/test/treeview/TreeViewNewApp.java 2016-12-22 11:26:26.873054494 +0300
@@ -1,555 +1,560 @@
-/*
- * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * This code is free software; you can redistribute it and/or modify it
- * under the terms of the GNU General Public License version 2 only, as
- * published by the Free Software Foundation. Oracle designates this
- * particular file as subject to the "Classpath" exception as provided
- * by Oracle in the LICENSE file that accompanied this code.
- *
- * This code is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
- * version 2 for more details (a copy is included in the LICENSE file that
- * accompanied this code).
- *
- * You should have received a copy of the GNU General Public License version
- * 2 along with this work; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
- *
- * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
- * or visit www.oracle.com if you need additional information or have any
- * questions.
- */
-package javafx.scene.control.test.treeview;
-
-import java.util.ArrayList;
-import static javafx.commons.Consts.BTN_SET_ON_EDIT_EVENT_HANDLERS;
-import javafx.event.ActionEvent;
-import javafx.event.Event;
-import javafx.event.EventHandler;
-import javafx.geometry.Orientation;
-import javafx.scene.Scene;
-import javafx.scene.control.*;
-import javafx.scene.control.test.treetable.ResetButtonNames;
-import static javafx.scene.control.test.treeview.TreeViewConstants.ROOT_NAME;
-import javafx.scene.control.test.utils.CommonPropertiesScene;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
-import javafx.scene.control.test.utils.ptables.NodeControllerFactory.NodesStorage;
-import javafx.scene.control.test.utils.ptables.PropertiesTable;
-import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
-import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
-import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
-import javafx.scene.input.KeyCode;
-import javafx.scene.input.KeyEvent;
-import javafx.scene.layout.HBox;
-import javafx.scene.layout.VBox;
-import javafx.util.Callback;
-import test.javaclient.shared.InteroperabilityApp;
-import test.javaclient.shared.Utils;
-
-/**
- * @author Alexander Kirov
- */
-public class TreeViewNewApp extends InteroperabilityApp implements TreeViewConstants, ResetButtonNames {
-
- public final static String TESTED_TREEVIEW_ID = "TESTED_TREEVIEW_ID";
- public final static String POPULATE_TREE = "POPULATE_TREE";
- public final static String TREE_VIEW_TAB_NAME = "TreeView";
-
- public static void main(String[] args) {
- Utils.launch(TreeViewNewApp.class, args);
- }
-
- @Override
- protected Scene getScene() {
- Scene scene = new TreeViewScene();
- Utils.addBrowser(scene);
- Utils.setTitleToStage(stage, "TreeViewTestApp");
- return scene;
- }
-
- public static TreeItem searchTreeItem(TreeView treeView, String content) {
- if (treeView.getRoot() != null) {
- return recursiveSearch(content, treeView.getRoot());
- }
- return null;
- }
-
- protected static TreeItem recursiveSearch(String content, TreeItem extends Object> itemToStart) {
- if (content.equals(itemToStart.getValue())) {
- return itemToStart;
- } else {
- for (TreeItem child : itemToStart.getChildren()) {
- TreeItem recResult = recursiveSearch(content, child);
- if (recResult != null) {
- return recResult;
- }
- }
- return null;
- }
- }
-
- protected class TreeViewScene extends CommonPropertiesScene {
-
- TreeView testedControl;
- //TabPane with PropertiesTable.
- TabPaneWithControl tabPane;
- PropertiesTable tb;
- //This list contains all properties tables, which were created during testing.
- ArrayList allPropertiesTables;
-
- public TreeViewScene() {
- super("TreeView", 800, 600);
- prepareScene();
- }
-
- protected TreeView getNewTestedControl() {
- TreeView tv = new TreeView(new TreeItem(ROOT_NAME));
- tv.setId(TESTED_TREEVIEW_ID);
- return tv;
- }
-
- @Override
- final protected void prepareScene() {
- testedControl = getNewTestedControl();
- tb = new PropertiesTable(testedControl);
-
- allPropertiesTables = new ArrayList();
- allPropertiesTables.add(tb);
-
- PropertyTablesFactory.explorePropertiesList(testedControl, tb);
- PropertyTablesFactory.explorePropertiesList(testedControl.getSelectionModel(), tb);
- PropertyTablesFactory.explorePropertiesList(testedControl.getFocusModel(), tb);
- SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
-
- tb.addCounter(EDIT_START_COUNTER);
- tb.addCounter(EDIT_COMMIT_COUNTER);
- tb.addCounter(EDIT_CANCEL_COUNTER);
-
- tabPane = new TabPaneWithControl("TreeView", tb);
- getControlOverItem(ROOT_NAME);
-
- Button hardResetButton = ButtonBuilder.create().id(HARD_RESET_BUTTON_ID).text("Hard reset").build();
- hardResetButton.setOnAction(new EventHandler() {
- 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() {
- public void handle(ActionEvent t) {
- refreshProcedure(2);
- testedControl.getRoot().setValue(ROOT_NAME);
- TreeItem someNewOneTreeItem = new TreeItem();
- testedControl.getRoot().setExpanded(someNewOneTreeItem.isExpanded());
- testedControl.getRoot().setGraphic(someNewOneTreeItem.getGraphic());
-
- TreeView someNewOneTreeView = new TreeView();
- testedControl.setDisable(someNewOneTreeView.isDisabled());
- testedControl.setEditable(someNewOneTreeView.isEditable());
- testedControl.setShowRoot(someNewOneTreeView.isShowRoot());
- testedControl.getSelectionModel().setSelectionMode(someNewOneTreeView.getSelectionModel().getSelectionMode());
- testedControl.setMinHeight(someNewOneTreeView.getMinHeight());
- testedControl.setMinWidth(someNewOneTreeView.getMinWidth());
- testedControl.setPrefHeight(someNewOneTreeView.getPrefHeight());
- testedControl.setPrefWidth(someNewOneTreeView.getPrefWidth());
- }
- });
-
- Button populate = new Button("Populate");
- populate.setId(POPULATE_TREE);
- populate.setOnAction(new EventHandler() {
-
- public void handle(ActionEvent t) {
- TreeItem root = new TreeItem("ROOT");
- root.setExpanded(true);
- for (int i = 0; i < 4; i++) {
- TreeItem parent = new TreeItem("item-" + String.valueOf(i));
- parent.setExpanded(true);
- root.getChildren().add(parent);
- for (int j = 0; j < 4; j++) {
- TreeItem child = new TreeItem("item-" + String.valueOf(i) + "-" + String.valueOf(j));
- parent.getChildren().add(child);
- }
- }
- testedControl.setRoot(root);
- }
- });
-
- HBox hboxWithResetButtons = new HBox();
- hboxWithResetButtons.getChildren().addAll(hardResetButton, softResetButton, populate);
-
- Button autosize = new Button("Autosize");
- autosize.setId(AUTOSIZE_BUTTON_ID);
- autosize.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedControl.autosize();
- }
- });
-
- VBox vb = new VBox();
- vb.setSpacing(5);
- //Different action makers.
- vb.getChildren().addAll(hboxWithResetButtons, autosize, new Separator(Orientation.HORIZONTAL),
- getTreeViewAddItemController(), new Separator(Orientation.HORIZONTAL),
- getTreeViewRemoveItemController(), new Separator(Orientation.HORIZONTAL),
- getTabOverItemThroughGetItemMethodController(), new Separator(Orientation.HORIZONTAL),
- getTabOverItemController(), new Separator(Orientation.HORIZONTAL),
- getObjectTitleThroughGetItemMethodController(), new Separator(Orientation.HORIZONTAL),
- getLineOfItemController(), new Separator(Orientation.HORIZONTAL),
- getScrollToHBox(), new Separator(Orientation.HORIZONTAL),
- getEditHBox(), new Separator(Orientation.HORIZONTAL),
- setEventHandlersHBox());
-
- setTestedControl(testedControl);
- setPropertiesContent(tabPane);
- setControllersContent(vb);
- }
-
- /*
- * In this function TabPane with control will be refreshed, and all
- * properties table will be refreshed and cleared.
- */
- private void refreshProcedure(int exceptFirstPropertiesTable) {
- for (int i = allPropertiesTables.size() - 1; i >= 0; i--) {
- allPropertiesTables.get(i).refresh();
- if (i >= exceptFirstPropertiesTable) {
- allPropertiesTables.remove(i);
- }
- }
-
- tabPane.removePropertiesTablesExceptFirstOnes(exceptFirstPropertiesTable);
-
- testedControl.getRoot().getChildren().clear();
- }
-
- protected void getControlOverItem(String name) {
- TreeItem treeItem = searchTreeItem(name);
- NodesStorage node = NodeControllerFactory.createFullController(treeItem, tabPane);
- allPropertiesTables.add(node.pt);
- tabPane.addPropertiesTable(name, node);
- }
-
- protected VBox getTreeViewAddItemController() {
- VBox vb = new VBox(3);
-
- final TextField tfParentName = new TextField();
- tfParentName.setId(ADD_ITEM_PARENT_TEXT_FIELD_ID);
- tfParentName.setPromptText("parent name");
-
- final TextField tfName = new TextField();
- tfName.setId(ADD_ITEM_TEXT_FIELD_ID);
- tfName.setPromptText("new item name");
-
- final TextField tfPosition = new TextField();
- tfPosition.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);;
- tfPosition.setPromptText("position");
- tfPosition.setPrefWidth(50);
-
- Button button = new Button("add to pos");
- button.setId(ADD_ITEM_BUTTON_ID);
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- TreeItem treeItem = searchTreeItem(tfParentName.getText());
- treeItem.getChildren().add(Integer.parseInt(tfPosition.getText()), new TreeItem(tfName.getText()));
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(new Label("Add child to "), tfParentName);
-
- HBox hb2 = new HBox(3);
- hb2.getChildren().addAll(new Label(" named "), tfName);
-
- HBox hb3 = new HBox(3);
- hb3.getChildren().addAll(tfPosition, button);
-
- vb.getChildren().addAll(hb1, hb2, hb3);
-
- return vb;
- }
-
- protected VBox getTreeViewRemoveItemController() {
- VBox vb = new VBox(3);
-
- final TextField tfName = new TextField();
- tfName.setId(REMOVE_ITEM_TEXT_FIELD_ID);
- tfName.setPromptText("new item name");
-
- Button button = new Button("remove!");
- button.setId(REMOVE_ITEM_BUTTON_ID);
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- TreeItem treeItem = searchTreeItem(tfName.getText());
- treeItem.getParent().getChildren().remove(treeItem);
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(new Label("Named item"), tfName);
-
- HBox hb2 = new HBox(3);
- hb2.getChildren().addAll(button);
-
- vb.getChildren().addAll(hb1, hb2);
-
- return vb;
- }
-
- protected VBox getTabOverItemController() {
- final TextField tfParentName = new TextField();
- tfParentName.setId(GET_CONTROL_OVER_TREEITEM_TEXTFIELD_ID);
- tfParentName.setPromptText("item name");
-
- Button button = new Button("get table over");
- button.setId(GET_CONTROL_OVER_TREEITEM_BUTTON_ID);
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- getControlOverItem(tfParentName.getText());
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(tfParentName, button);
-
- VBox vb = new VBox();
- vb.getChildren().addAll(hb1);
- return vb;
- }
-
- protected VBox getObjectTitleThroughGetItemMethodController() {
- final TextField tfParentName = new TextField();
- tfParentName.setPromptText("index");
- tfParentName.setPrefWidth(50);
-
- final TextField content = new TextField();
- content.setPromptText("content");
-
- Button button = new Button("getTreeItem! index:");
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- TreeItem item = testedControl.getTreeItem(Integer.parseInt(tfParentName.getText()));
- if (item == null) {
- content.setText("null");
- } else {
- content.setText(item.getValue().toString());
- }
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(new Label("Get tree item at"), tfParentName);
-
- HBox hb2 = new HBox(3);
- hb2.getChildren().addAll(button, content);
-
- VBox vb = new VBox();
- vb.getChildren().addAll(hb1, hb2);
- return vb;
- }
-
- protected VBox getTabOverItemThroughGetItemMethodController() {
- final TextField tfParentName = new TextField();
- tfParentName.setPromptText("index");
- tfParentName.setPrefWidth(50);
-
- Button button = new Button("get table over");
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- getControlOverItem(testedControl.getTreeItem(Integer.parseInt(tfParentName.getText())).getValue().toString());
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(tfParentName, button);
-
- VBox vb = new VBox();
- vb.getChildren().addAll(hb1);
- return vb;
- }
-
- protected VBox getLineOfItemController() {
- final TextField tfParentName = new TextField();
- tfParentName.setPromptText("name");
-
- final TextField index = new TextField();
- index.setPromptText("found index");
- index.setPrefWidth(50);
-
- Button button = new Button("getRow! index :");
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- int found = testedControl.getRow(searchTreeItem(tfParentName.getText()));
- index.setText(((Integer) found).toString());
- }
- });
-
- HBox hb1 = new HBox(3);
- hb1.getChildren().addAll(new Label("Get index of"), tfParentName);
-
- HBox hb2 = new HBox(3);
- hb2.getChildren().addAll(index, button);
-
- VBox vb = new VBox();
- vb.getChildren().addAll(hb1, hb2);
- return vb;
- }
-
- private HBox getScrollToHBox() {
- HBox hb = new HBox();
- Button button = ButtonBuilder.create().text("ScrollTo").id(SCROLL_TO_BUTTON_ID).build();
- final TextField tf = TextFieldBuilder.create().text("0").id(SCROLL_TO_TEXT_FIELD_ID).prefWidth(50).build();
-
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedControl.scrollTo(Integer.parseInt(tf.getText()));
- }
- });
-
- hb.getChildren().addAll(tf, button);
- return hb;
- }
-
- private HBox getEditHBox() {
- HBox hb = new HBox();
- Button button = ButtonBuilder.create().text("Edit").id(EDIT_BUTTON_ID).build();
- final TextField tf = TextFieldBuilder.create().promptText("name").id(EDIT_TEXT_FIELD_ID).prefWidth(50).build();
-
- button.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedControl.edit(searchTreeItem(tf.getText()));
- }
- });
-
- hb.getChildren().addAll(tf, button);
- return hb;
- }
-
- private VBox setEventHandlersHBox() {
- VBox vb = new VBox();
-
- Button btn = ButtonBuilder.create()
- .text("Set onEdit event hadlers")
- .id(BTN_SET_ON_EDIT_EVENT_HANDLERS)
- .build();
-
- btn.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedControl.setOnEditStart(new EventHandler() {
- public void handle(Event t) {
- tb.incrementCounter(EDIT_START_COUNTER);
- }
- });
-
- testedControl.setOnEditCommit(new EventHandler() {
- public void handle(Event t) {
- tb.incrementCounter(EDIT_COMMIT_COUNTER);
- }
- });
-
- testedControl.setOnEditCancel(new EventHandler() {
- public void handle(Event t) {
- tb.incrementCounter(EDIT_CANCEL_COUNTER);
- }
- });
- }
- });
-
- Button btnAddFactory = ButtonBuilder.create()
- .text("Set cell factory for editing")
- .id(SET_CELL_FACTORY_FOR_EDITING)
- .build();
-
- btnAddFactory.setOnAction(new EventHandler() {
- public void handle(ActionEvent t) {
- testedControl.setCellFactory(new Callback, TreeCell>() {
- @Override
- public TreeCell call(TreeView p) {
- return new TextFieldTreeCellImpl();
- }
- });
- }
- });
-
- vb.getChildren().addAll(btn, btnAddFactory);
- return vb;
- }
-
- private TreeItem searchTreeItem(String content) {
- return TreeViewNewApp.searchTreeItem(testedControl, content);
- }
-
- private final class TextFieldTreeCellImpl extends TreeCell {
-
- private TextField textField;
-
- public TextFieldTreeCellImpl() {
- }
-
- @Override
- public void startEdit() {
- super.startEdit();
-
- if (textField == null) {
- createTextField();
- }
- setText(null);
- setGraphic(textField);
- textField.setText(getString());
- textField.requestFocus();
- }
-
- @Override
- public void cancelEdit() {
- super.cancelEdit();
- setText((String) getItem());
- setGraphic(getTreeItem().getGraphic());
- }
-
- @Override
- public void updateItem(String item, boolean empty) {
- super.updateItem(item, empty);
-
- if (empty) {
- setText(null);
- setGraphic(null);
- } else {
- if (isEditing()) {
- if (textField != null) {
- textField.setText(getString());
- }
- setText(null);
- setGraphic(textField);
- } else {
- setText(getString());
- setGraphic(getTreeItem().getGraphic());
- }
- }
- }
-
- private void createTextField() {
- textField = new TextField(getString());
- textField.setOnKeyReleased(new EventHandler() {
- @Override
- public void handle(KeyEvent t) {
- if (t.getCode() == KeyCode.ENTER) {
- commitEdit(textField.getText());
- } else if (t.getCode() == KeyCode.ESCAPE) {
- cancelEdit();
- }
- }
- });
- }
-
- private String getString() {
- return getItem() == null ? "" : getItem().toString();
- }
- }
- }
-}
+/*
+ * Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.
+ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
+ *
+ * This code is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU General Public License version 2 only, as
+ * published by the Free Software Foundation. Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * This code is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
+ * version 2 for more details (a copy is included in the LICENSE file that
+ * accompanied this code).
+ *
+ * You should have received a copy of the GNU General Public License version
+ * 2 along with this work; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
+ * or visit www.oracle.com if you need additional information or have any
+ * questions.
+ */
+package javafx.scene.control.test.treeview;
+
+import java.util.ArrayList;
+import static javafx.commons.Consts.BTN_SET_ON_EDIT_EVENT_HANDLERS;
+import javafx.event.ActionEvent;
+import javafx.event.Event;
+import javafx.event.EventHandler;
+import javafx.geometry.Orientation;
+import javafx.scene.Scene;
+import javafx.scene.control.*;
+import javafx.scene.control.test.treetable.ResetButtonNames;
+import static javafx.scene.control.test.treetable.ResetButtonNames.HARD_RESET_BUTTON_ID;
+import static javafx.scene.control.test.treetable.ResetButtonNames.SOFT_RESET_BUTTON_ID;
+import static javafx.scene.control.test.treeview.TreeViewConstants.ROOT_NAME;
+import javafx.scene.control.test.utils.CommonPropertiesScene;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory;
+import javafx.scene.control.test.utils.ptables.NodeControllerFactory.NodesStorage;
+import javafx.scene.control.test.utils.ptables.PropertiesTable;
+import javafx.scene.control.test.utils.ptables.PropertyTablesFactory;
+import javafx.scene.control.test.utils.ptables.SpecialTablePropertiesProvider;
+import javafx.scene.control.test.utils.ptables.TabPaneWithControl;
+import javafx.scene.input.KeyCode;
+import javafx.scene.input.KeyEvent;
+import javafx.scene.layout.HBox;
+import javafx.scene.layout.VBox;
+import javafx.util.Callback;
+import test.javaclient.shared.InteroperabilityApp;
+import test.javaclient.shared.Utils;
+
+/**
+ * @author Alexander Kirov
+ */
+public class TreeViewNewApp extends InteroperabilityApp implements TreeViewConstants, ResetButtonNames {
+
+ public final static String TESTED_TREEVIEW_ID = "TESTED_TREEVIEW_ID";
+ public final static String POPULATE_TREE = "POPULATE_TREE";
+ public final static String TREE_VIEW_TAB_NAME = "TreeView";
+
+ public static void main(String[] args) {
+ Utils.launch(TreeViewNewApp.class, args);
+ }
+
+ @Override
+ protected Scene getScene() {
+ Scene scene = new TreeViewScene();
+ Utils.addBrowser(scene);
+ Utils.setTitleToStage(stage, "TreeViewTestApp");
+ return scene;
+ }
+
+ public static TreeItem searchTreeItem(TreeView treeView, String content) {
+ if (treeView.getRoot() != null) {
+ return recursiveSearch(content, treeView.getRoot());
+ }
+ return null;
+ }
+
+ protected static TreeItem recursiveSearch(String content, TreeItem extends Object> itemToStart) {
+ if (content.equals(itemToStart.getValue())) {
+ return itemToStart;
+ } else {
+ for (TreeItem child : itemToStart.getChildren()) {
+ TreeItem recResult = recursiveSearch(content, child);
+ if (recResult != null) {
+ return recResult;
+ }
+ }
+ return null;
+ }
+ }
+
+ protected class TreeViewScene extends CommonPropertiesScene {
+
+ TreeView testedControl;
+ //TabPane with PropertiesTable.
+ TabPaneWithControl tabPane;
+ PropertiesTable tb;
+ //This list contains all properties tables, which were created during testing.
+ ArrayList allPropertiesTables;
+
+ public TreeViewScene() {
+ super("TreeView", 800, 600);
+ prepareScene();
+ }
+
+ protected TreeView getNewTestedControl() {
+ TreeView tv = new TreeView(new TreeItem(ROOT_NAME));
+ tv.setId(TESTED_TREEVIEW_ID);
+ return tv;
+ }
+
+ @Override
+ final protected void prepareScene() {
+ testedControl = getNewTestedControl();
+ tb = new PropertiesTable(testedControl);
+
+ allPropertiesTables = new ArrayList();
+ allPropertiesTables.add(tb);
+
+ PropertyTablesFactory.explorePropertiesList(testedControl, tb);
+ PropertyTablesFactory.explorePropertiesList(testedControl.getSelectionModel(), tb);
+ PropertyTablesFactory.explorePropertiesList(testedControl.getFocusModel(), tb);
+ SpecialTablePropertiesProvider.provideForControl(testedControl, tb);
+
+ tb.addCounter(EDIT_START_COUNTER);
+ tb.addCounter(EDIT_COMMIT_COUNTER);
+ tb.addCounter(EDIT_CANCEL_COUNTER);
+
+ tabPane = new TabPaneWithControl("TreeView", tb);
+ getControlOverItem(ROOT_NAME);
+
+ Button hardResetButton = new Button("Hard reset");
+ hardResetButton.setId(HARD_RESET_BUTTON_ID);
+ hardResetButton.setOnAction(new EventHandler() {
+ 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() {
+ public void handle(ActionEvent t) {
+ refreshProcedure(2);
+ testedControl.getRoot().setValue(ROOT_NAME);
+ TreeItem someNewOneTreeItem = new TreeItem();
+ testedControl.getRoot().setExpanded(someNewOneTreeItem.isExpanded());
+ testedControl.getRoot().setGraphic(someNewOneTreeItem.getGraphic());
+
+ TreeView someNewOneTreeView = new TreeView();
+ testedControl.setDisable(someNewOneTreeView.isDisabled());
+ testedControl.setEditable(someNewOneTreeView.isEditable());
+ testedControl.setShowRoot(someNewOneTreeView.isShowRoot());
+ testedControl.getSelectionModel().setSelectionMode(someNewOneTreeView.getSelectionModel().getSelectionMode());
+ testedControl.setMinHeight(someNewOneTreeView.getMinHeight());
+ testedControl.setMinWidth(someNewOneTreeView.getMinWidth());
+ testedControl.setPrefHeight(someNewOneTreeView.getPrefHeight());
+ testedControl.setPrefWidth(someNewOneTreeView.getPrefWidth());
+ }
+ });
+
+ Button populate = new Button("Populate");
+ populate.setId(POPULATE_TREE);
+ populate.setOnAction(new EventHandler() {
+
+ public void handle(ActionEvent t) {
+ TreeItem root = new TreeItem("ROOT");
+ root.setExpanded(true);
+ for (int i = 0; i < 4; i++) {
+ TreeItem parent = new TreeItem("item-" + String.valueOf(i));
+ parent.setExpanded(true);
+ root.getChildren().add(parent);
+ for (int j = 0; j < 4; j++) {
+ TreeItem child = new TreeItem("item-" + String.valueOf(i) + "-" + String.valueOf(j));
+ parent.getChildren().add(child);
+ }
+ }
+ testedControl.setRoot(root);
+ }
+ });
+
+ HBox hboxWithResetButtons = new HBox();
+ hboxWithResetButtons.getChildren().addAll(hardResetButton, softResetButton, populate);
+
+ Button autosize = new Button("Autosize");
+ autosize.setId(AUTOSIZE_BUTTON_ID);
+ autosize.setOnAction(new EventHandler() {
+ public void handle(ActionEvent t) {
+ testedControl.autosize();
+ }
+ });
+
+ VBox vb = new VBox();
+ vb.setSpacing(5);
+ //Different action makers.
+ vb.getChildren().addAll(hboxWithResetButtons, autosize, new Separator(Orientation.HORIZONTAL),
+ getTreeViewAddItemController(), new Separator(Orientation.HORIZONTAL),
+ getTreeViewRemoveItemController(), new Separator(Orientation.HORIZONTAL),
+ getTabOverItemThroughGetItemMethodController(), new Separator(Orientation.HORIZONTAL),
+ getTabOverItemController(), new Separator(Orientation.HORIZONTAL),
+ getObjectTitleThroughGetItemMethodController(), new Separator(Orientation.HORIZONTAL),
+ getLineOfItemController(), new Separator(Orientation.HORIZONTAL),
+ getScrollToHBox(), new Separator(Orientation.HORIZONTAL),
+ getEditHBox(), new Separator(Orientation.HORIZONTAL),
+ setEventHandlersHBox());
+
+ setTestedControl(testedControl);
+ setPropertiesContent(tabPane);
+ setControllersContent(vb);
+ }
+
+ /*
+ * In this function TabPane with control will be refreshed, and all
+ * properties table will be refreshed and cleared.
+ */
+ private void refreshProcedure(int exceptFirstPropertiesTable) {
+ for (int i = allPropertiesTables.size() - 1; i >= 0; i--) {
+ allPropertiesTables.get(i).refresh();
+ if (i >= exceptFirstPropertiesTable) {
+ allPropertiesTables.remove(i);
+ }
+ }
+
+ tabPane.removePropertiesTablesExceptFirstOnes(exceptFirstPropertiesTable);
+
+ testedControl.getRoot().getChildren().clear();
+ }
+
+ protected void getControlOverItem(String name) {
+ TreeItem treeItem = searchTreeItem(name);
+ NodesStorage node = NodeControllerFactory.createFullController(treeItem, tabPane);
+ allPropertiesTables.add(node.pt);
+ tabPane.addPropertiesTable(name, node);
+ }
+
+ protected VBox getTreeViewAddItemController() {
+ VBox vb = new VBox(3);
+
+ final TextField tfParentName = new TextField();
+ tfParentName.setId(ADD_ITEM_PARENT_TEXT_FIELD_ID);
+ tfParentName.setPromptText("parent name");
+
+ final TextField tfName = new TextField();
+ tfName.setId(ADD_ITEM_TEXT_FIELD_ID);
+ tfName.setPromptText("new item name");
+
+ final TextField tfPosition = new TextField();
+ tfPosition.setId(ADD_ITEM_POSITION_TEXT_FIELD_ID);;
+ tfPosition.setPromptText("position");
+ tfPosition.setPrefWidth(50);
+
+ Button button = new Button("add to pos");
+ button.setId(ADD_ITEM_BUTTON_ID);
+ button.setOnAction(new EventHandler