functional/ControlsTests/src/javafx/scene/control/test/scrollbar/ScrollBarApp.java

Print this page




  49     }
  50 
  51     @Override
  52     protected Scene getScene() {
  53         Utils.setTitleToStage(stage, "ScrollBarTestApp");
  54         return new ScrollBarScene();
  55     }
  56 
  57     class ScrollBarScene extends CommonPropertiesScene {
  58 
  59         PropertiesTable tb;
  60         ScrollBar testedScrollBar;
  61 
  62         public ScrollBarScene() {
  63             super("ScrollBar", 800, 600);
  64             prepareScene();
  65         }
  66 
  67         @Override
  68         final protected void prepareScene() {
  69             testedScrollBar = ScrollBarBuilder.create().id(TESTED_SCROLLBAR_ID).build();


  70 
  71             tb = new PropertiesTable(testedScrollBar);
  72             PropertyTablesFactory.explorePropertiesList(testedScrollBar, tb);
  73             SpecialTablePropertiesProvider.provideForControl(testedScrollBar, tb);
  74 
  75             Button resetButton = ButtonBuilder.create().id(RESET_BUTTON_ID).text("Reset").build();

  76             resetButton.setOnAction(new EventHandler<ActionEvent>() {
  77                 public void handle(ActionEvent t) {
  78                     HBox hb = (HBox) getRoot();
  79                     hb.getChildren().clear();
  80                     prepareMainSceneStructure();
  81                     prepareScene();
  82                 }
  83             });
  84 
  85             setControllersContent(resetButton);
  86             setTestedControl(testedScrollBar);
  87             setPropertiesContent(tb);
  88         }
  89     }
  90 }


  49     }
  50 
  51     @Override
  52     protected Scene getScene() {
  53         Utils.setTitleToStage(stage, "ScrollBarTestApp");
  54         return new ScrollBarScene();
  55     }
  56 
  57     class ScrollBarScene extends CommonPropertiesScene {
  58 
  59         PropertiesTable tb;
  60         ScrollBar testedScrollBar;
  61 
  62         public ScrollBarScene() {
  63             super("ScrollBar", 800, 600);
  64             prepareScene();
  65         }
  66 
  67         @Override
  68         final protected void prepareScene() {
  69             testedScrollBar = new ScrollBar();
  70             testedScrollBar.setFocusTraversable(true);
  71             testedScrollBar.setId(TESTED_SCROLLBAR_ID);
  72 
  73             tb = new PropertiesTable(testedScrollBar);
  74             PropertyTablesFactory.explorePropertiesList(testedScrollBar, tb);
  75             SpecialTablePropertiesProvider.provideForControl(testedScrollBar, tb);
  76 
  77             Button resetButton = new Button("Reset");
  78             resetButton.setId(RESET_BUTTON_ID);
  79             resetButton.setOnAction(new EventHandler<ActionEvent>() {
  80                 public void handle(ActionEvent t) {
  81                     HBox hb = (HBox) getRoot();
  82                     hb.getChildren().clear();
  83                     prepareMainSceneStructure();
  84                     prepareScene();
  85                 }
  86             });
  87 
  88             setControllersContent(resetButton);
  89             setTestedControl(testedScrollBar);
  90             setPropertiesContent(tb);
  91         }
  92     }
  93 }