< prev index next >

functional/FXCssTests/src/test/css/controls/ControlsCSSApp.java

Print this page




  85             else if (style.name().equals(styleName)) {
  86                 createPage(pageWithSlot, page, style);
  87             }
  88         }
  89     }
  90 
  91     private void createPage(ScrollablePageWithSlots pageWithSlot, ControlPage page, Style style) {
  92         Pane slot = new Pane();
  93         slot.setPrefSize(page.slotWidth, page.slotHeight);
  94         final Node control = page.factory.createControl();
  95         Pane innerPane = new Pane();
  96         innerPane.setLayoutX(ControlPage.INNER_PANE_SHIFT);
  97         innerPane.setLayoutY(ControlPage.INNER_PANE_SHIFT);
  98         innerPane.setPrefSize(page.slotWidth - ControlPage.INNER_PANE_SHIFT, page.slotHeight - ControlPage.INNER_PANE_SHIFT);
  99         innerPane.setMaxSize(page.slotWidth - ControlPage.INNER_PANE_SHIFT, page.slotHeight - ControlPage.INNER_PANE_SHIFT);
 100         slot.getChildren().add(innerPane);
 101         style.decorate(control, innerPane);
 102         if (control instanceof Text) {
 103             control.relocate(0, 0); // workaround RT-24670
 104         }
 105         if (showButtons) {
 106             style.setStyle(control);
 107         }
 108         pageWithSlot.add(new StyleTestNode(style, control, innerPane));
 109     }
 110 
 111     public interface ControlFactory {
 112 
 113         /**
 114          * @return current control instance
 115          */
 116         public Node createControl();
 117     }
 118 
 119     @Override
 120     protected TestNode setup() {
 121         URL css = ControlsCSSApp.class.getResource("/test/css/resources/style.css");
 122         combinedTestChooserPresenter.getScene().getStylesheets().add(css.toExternalForm());
 123         if (showButtons) {
 124             for (ControlPage page : ControlPage.filteredValues()) {
 125                 createPages(page, rootTestNode);
 126             }
 127         }




  85             else if (style.name().equals(styleName)) {
  86                 createPage(pageWithSlot, page, style);
  87             }
  88         }
  89     }
  90 
  91     private void createPage(ScrollablePageWithSlots pageWithSlot, ControlPage page, Style style) {
  92         Pane slot = new Pane();
  93         slot.setPrefSize(page.slotWidth, page.slotHeight);
  94         final Node control = page.factory.createControl();
  95         Pane innerPane = new Pane();
  96         innerPane.setLayoutX(ControlPage.INNER_PANE_SHIFT);
  97         innerPane.setLayoutY(ControlPage.INNER_PANE_SHIFT);
  98         innerPane.setPrefSize(page.slotWidth - ControlPage.INNER_PANE_SHIFT, page.slotHeight - ControlPage.INNER_PANE_SHIFT);
  99         innerPane.setMaxSize(page.slotWidth - ControlPage.INNER_PANE_SHIFT, page.slotHeight - ControlPage.INNER_PANE_SHIFT);
 100         slot.getChildren().add(innerPane);
 101         style.decorate(control, innerPane);
 102         if (control instanceof Text) {
 103             control.relocate(0, 0); // workaround RT-24670
 104         }



 105         pageWithSlot.add(new StyleTestNode(style, control, innerPane));
 106     }
 107 
 108     public interface ControlFactory {
 109 
 110         /**
 111          * @return current control instance
 112          */
 113         public Node createControl();
 114     }
 115 
 116     @Override
 117     protected TestNode setup() {
 118         URL css = ControlsCSSApp.class.getResource("/test/css/resources/style.css");
 119         combinedTestChooserPresenter.getScene().getStylesheets().add(css.toExternalForm());
 120         if (showButtons) {
 121             for (ControlPage page : ControlPage.filteredValues()) {
 122                 createPages(page, rootTestNode);
 123             }
 124         }


< prev index next >