rev 8703 : RT-40186: Update copyright header for files modified in 2015

   1 /*
   2  * Copyright (c) 2008, 2015, Oracle and/or its affiliates.
   3  * All rights reserved. Use is subject to license terms.
   4  *
   5  * This file is available and licensed under the following license:
   6  *
   7  * Redistribution and use in source and binary forms, with or without
   8  * modification, are permitted provided that the following conditions
   9  * are met:
  10  *
  11  *  - Redistributions of source code must retain the above copyright
  12  *    notice, this list of conditions and the following disclaimer.
  13  *  - Redistributions in binary form must reproduce the above copyright
  14  *    notice, this list of conditions and the following disclaimer in
  15  *    the documentation and/or other materials provided with the distribution.
  16  *  - Neither the name of Oracle Corporation nor the names of its
  17  *    contributors may be used to endorse or promote products derived
  18  *    from this software without specific prior written permission.
  19  *
  20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  31  */
  32 package modena;
  33 
  34 import java.util.ArrayList;
  35 import java.util.HashMap;
  36 import java.util.List;
  37 import java.util.Map;
  38 import javafx.collections.ObservableList;
  39 import javafx.geometry.HPos;
  40 import javafx.geometry.Insets;
  41 import javafx.geometry.Orientation;
  42 import javafx.geometry.Pos;
  43 import javafx.geometry.Side;
  44 import javafx.geometry.VPos;
  45 import javafx.scene.Node;
  46 import javafx.scene.control.*;
  47 import javafx.scene.layout.GridPane;
  48 import javafx.scene.layout.HBox;
  49 import javafx.scene.layout.Priority;
  50 import javafx.scene.layout.VBox;
  51 import javafx.scene.paint.Color;
  52 import javafx.scene.web.HTMLEditor;
  53 
  54 import static modena.SamplePageChartHelper.*;
  55 import static modena.SamplePageHelpers.*;
  56 import static modena.SamplePageTableHelper.*;
  57 import static modena.SamplePageTreeHelper.createTreeView;
  58 import static modena.SamplePageTreeTableHelper.createTreeTableView;
  59 
  60 /**
  61  * Page showing every control in every state.
  62  */
  63 public class SamplePage extends GridPane {
  64     private int rowIndex = 0;
  65     private Map<String, Node> content = new HashMap<>();
  66     private List<Section> sections = new ArrayList<>();
  67 
  68     public SamplePage() {
  69         setVgap(25);
  70         setHgap(15);
  71         setPadding(new Insets(15));
  72         newSection("Label:",
  73                 new Label("Label"),
  74                 withState(new Label("Disabled"), "disabled"));
  75         newSection("Button:",
  76                 new Button("Button"),
  77                 withState(new Button("Hover"), "hover"),
  78                 withState(new Button("Armed"), "armed"),
  79                 withState(new Button("Focused"), "focused"),
  80                 withState(new Button("Focused & Hover"), "focused, hover"),
  81                 withState(new Button("Focused & Armed"), "focused, armed"),
  82                 withState(new Button("Disabled"), "disabled"));
  83         Button defaultButton = new Button("Button");
  84         defaultButton.setDefaultButton(true);
  85         newSection("Default Button:",
  86                 defaultButton,
  87                 withState(new Button("Hover"), "default, hover"),
  88                 withState(new Button("Armed"), "default, armed"),
  89                 withState(new Button("Focused"), "default, focused"),
  90                 withState(new Button("Focused & Hover"), "default, focused, hover"),
  91                 withState(new Button("Focused & Armed"), "default, focused, armed"),
  92                 withState(new Button("Disabled"), "default, disabled"));
  93         Button b1 = new Button("Button");
  94         b1.setStyle("-fx-base: #f3622d;");
  95         Button b2 = new Button("Button");
  96         b2.setStyle("-fx-base: #fba71b;");
  97         Button b3 = new Button("Button");
  98         b3.setStyle("-fx-base: #57b757;");
  99         Button b4 = new Button("Button");
 100         b4.setStyle("-fx-base: #41a9c9;");
 101         Button b5 = new Button("Button");
 102         b5.setStyle("-fx-base: #888;");
 103         newSection("Nice Colors:", b1, b2, b3, b4, b5);
 104         newSection("Greys:",0,
 105                 createGreyButton(0),
 106                 createGreyButton(0.1),
 107                 createGreyButton(0.2),
 108                 createGreyButton(0.3),
 109                 createGreyButton(0.4),
 110                 createGreyButton(0.5),
 111                 createGreyButton(0.6),
 112                 createGreyButton(0.7),
 113                 createGreyButton(0.8),
 114                 createGreyButton(0.9),
 115                 createGreyButton(1));
 116         ToggleGroup tg1 = new ToggleGroup();
 117         ToggleGroup tg2 = new ToggleGroup();
 118         ToggleGroup tg3 = new ToggleGroup();
 119         ToggleGroup tg4 = new ToggleGroup();
 120 
 121         ToggleButton left1 = new ToggleButton("Left");
 122         left1.getStyleClass().add("left-pill");
 123         left1.setToggleGroup(tg1);
 124         ToggleButton center1 = new ToggleButton("Center");
 125         center1.getStyleClass().add("center-pill");
 126         center1.setToggleGroup(tg1);
 127         ToggleButton right1 = new ToggleButton("Right");
 128         right1.getStyleClass().add("right-pill");
 129         right1.setToggleGroup(tg1);
 130 
 131         ToggleButton left2 = new ToggleButton("Left");
 132         left2.getStyleClass().add("left-pill");
 133         left2.setToggleGroup(tg2);
 134         left2.setSelected(true);
 135         ToggleButton center2 = new ToggleButton("Center");
 136         center2.getStyleClass().add("center-pill");
 137         center2.setToggleGroup(tg2);
 138         ToggleButton right2 = new ToggleButton("Right");
 139         right2.getStyleClass().add("right-pill");
 140         right2.setToggleGroup(tg2);
 141 
 142         ToggleButton left3 = new ToggleButton("Left");
 143         left3.getStyleClass().add("left-pill");
 144         left3.setToggleGroup(tg3);
 145         ToggleButton center3 = new ToggleButton("Center");
 146         center3.getStyleClass().add("center-pill");
 147         center3.setToggleGroup(tg3);
 148         center3.setSelected(true);
 149         ToggleButton right3 = new ToggleButton("Right");
 150         right3.getStyleClass().add("right-pill");
 151         right3.setToggleGroup(tg3);
 152 
 153         ToggleButton left4 = new ToggleButton("Left");
 154         left4.getStyleClass().add("left-pill");
 155         left4.setToggleGroup(tg4);
 156         ToggleButton center4 = new ToggleButton("Center");
 157         center4.getStyleClass().add("center-pill");
 158         center4.setToggleGroup(tg4);
 159         ToggleButton right4 = new ToggleButton("Right");
 160         right4.getStyleClass().add("right-pill");
 161         right4.setToggleGroup(tg4);
 162         right4.setSelected(true);
 163 
 164         newSection("Pill Toggle\nButtons:",
 165                 new HBox(left1, center1, right1),
 166                 new HBox(left2, center2, right2),
 167                 new HBox(left3, center3, right3),
 168                 new HBox(left4, center4, right4)
 169         );
 170 
 171         ToggleGroup tg5 = new ToggleGroup();
 172         ToggleGroup tg6 = new ToggleGroup();
 173         ToggleGroup tg7 = new ToggleGroup();
 174         ToggleGroup tg8 = new ToggleGroup();
 175 
 176         ToggleButton left5 = new ToggleButton("#");
 177         left5.getStyleClass().add("left-pill");
 178         left5.setToggleGroup(tg5);
 179         ToggleButton center5 = new ToggleButton("#");
 180         center5.getStyleClass().add("center-pill");
 181         center5.setToggleGroup(tg5);
 182         ToggleButton right5 = new ToggleButton("#");
 183         right5.getStyleClass().add("right-pill");
 184         right5.setToggleGroup(tg5);
 185 
 186         ToggleButton left5_1 = new ToggleButton("L");
 187         left5_1.getStyleClass().add("left-pill");
 188         left5_1.setToggleGroup(tg5);
 189         withState(left5_1, "focused");
 190         ToggleButton center5_1 = new ToggleButton("C");
 191         center5_1.getStyleClass().add("center-pill");
 192         center5_1.setToggleGroup(tg5);
 193         ToggleButton right5_1 = new ToggleButton("R");
 194         right5_1.getStyleClass().add("right-pill");
 195         right5_1.setToggleGroup(tg5);
 196 
 197         ToggleButton left5_2 = new ToggleButton("L");
 198         left5_2.getStyleClass().add("left-pill");
 199         left5_2.setToggleGroup(tg5);
 200         ToggleButton center5_2 = new ToggleButton("C");
 201         center5_2.getStyleClass().add("center-pill");
 202         center5_2.setToggleGroup(tg5);
 203         withState(center5_2, "focused");
 204         ToggleButton right5_2 = new ToggleButton("R");
 205         right5_2.getStyleClass().add("right-pill");
 206         right5_2.setToggleGroup(tg5);
 207 
 208         ToggleButton left5_3 = new ToggleButton("L");
 209         left5_3.getStyleClass().add("left-pill");
 210         left5_3.setToggleGroup(tg5);
 211         ToggleButton center5_3 = new ToggleButton("C");
 212         center5_3.getStyleClass().add("center-pill");
 213         center5_3.setToggleGroup(tg5);
 214         ToggleButton right5_3 = new ToggleButton("R");
 215         right5_3.getStyleClass().add("right-pill");
 216         right5_3.setToggleGroup(tg5);
 217         withState(right5_3, "focused");
 218 
 219         ToggleButton left6 = new ToggleButton("L");
 220         left6.getStyleClass().add("left-pill");
 221         left6.setToggleGroup(tg6);
 222         left6.setSelected(true);
 223         withState(left6, "focused");
 224         ToggleButton center6 = new ToggleButton("C");
 225         center6.getStyleClass().add("center-pill");
 226         center6.setToggleGroup(tg6);
 227         ToggleButton right6 = new ToggleButton("R");
 228         right6.getStyleClass().add("right-pill");
 229         right6.setToggleGroup(tg6);
 230 
 231         ToggleButton left7 = new ToggleButton("L");
 232         left7.getStyleClass().add("left-pill");
 233         left7.setToggleGroup(tg7);
 234         ToggleButton center7 = new ToggleButton("C");
 235         center7.getStyleClass().add("center-pill");
 236         center7.setToggleGroup(tg7);
 237         center7.setSelected(true);
 238         withState(center7, "focused");
 239         ToggleButton right7 = new ToggleButton("R");
 240         right7.getStyleClass().add("right-pill");
 241         right7.setToggleGroup(tg7);
 242 
 243         ToggleButton left8 = new ToggleButton("L");
 244         left8.getStyleClass().add("left-pill");
 245         left8.setToggleGroup(tg8);
 246         ToggleButton center8 = new ToggleButton("C");
 247         center8.getStyleClass().add("center-pill");
 248         center8.setToggleGroup(tg8);
 249         ToggleButton right8 = new ToggleButton("R");
 250         right8.getStyleClass().add("right-pill");
 251         right8.setToggleGroup(tg8);
 252         right8.setSelected(true);
 253         withState(right8, "focused");
 254 
 255         newSection("Pill Toggle\nButtons\nFocused:",
 256                 new HBox(left5, center5, right5),
 257                 new HBox(left5_1, center5_1, right5_1),
 258                 new HBox(left5_2, center5_2, right5_2),
 259                 new HBox(left5_3, center5_3, right5_3),
 260                 new HBox(left6, center6, right6),
 261                 new HBox(left7, center7, right7),
 262                 new HBox(left8, center8, right8)
 263         );
 264         newSection("ToggleButton:",
 265                 new ToggleButton("Button"),
 266                 withState(new ToggleButton("Hover"), "hover"),
 267                 withState(new ToggleButton("Armed"), "armed"),
 268                 withState(new ToggleButton("Focused"), "focused"),
 269                 withState(new ToggleButton("Focused & Hover"), "focused, hover"),
 270                 withState(new ToggleButton("Focused & Armed"), "focused, armed"),
 271                 withState(new ToggleButton("Disabled"), "disabled"));
 272         newSection("ToggleButton Selected:",
 273                 withState(new ToggleButton("Button"), "selected"),
 274                 withState(new ToggleButton("Hover"), "selected, hover"),
 275                 withState(new ToggleButton("Armed"), "selected, armed"),
 276                 withState(new ToggleButton("Focused"), "selected, focused"),
 277                 withState(new ToggleButton("Focused & Hover"), "selected, focused, hover"),
 278                 withState(new ToggleButton("Focused & Armed"), "selected, focused, armed"),
 279                 withState(new ToggleButton("Disabled"), "selected, disabled"));
 280         newSection("CheckBox:",
 281                 new CheckBox("CheckBox"),
 282                 withState(new CheckBox("Hover"), "hover"),
 283                 withState(new CheckBox("Armed"), "armed"),
 284                 withState(new CheckBox("Focused"), "focused"),
 285                 withState(new CheckBox("Focused & Hover"), "focused, hover"),
 286                 withState(new CheckBox("Focused & Armed"), "focused, armed"),
 287                 withState(new CheckBox("Disabled"), "disabled"));
 288         newSection("CheckBox Selected:",
 289                 withState(new CheckBox("CheckBox"), "selected"),
 290                 withState(new CheckBox("Hover"), "selected, hover"),
 291                 withState(new CheckBox("Armed"), "selected, armed"),
 292                 withState(new CheckBox("Focused"), "selected, focused"),
 293                 withState(new CheckBox("Focused & Hover"), "selected, focused, hover"),
 294                 withState(new CheckBox("Focused & Armed"), "selected, focused, armed"),
 295                 withState(new CheckBox("Disabled"), "selected, disabled"));
 296 
 297         CheckBox checkB = new CheckBox("CheckBox");
 298         checkB.setSelected(true);
 299         checkB.setIndeterminate(true);
 300         checkB.setAllowIndeterminate(true);
 301         newSection("CheckBox\nIndeterminate:",
 302                 checkB,
 303                 withState(new CheckBox("Hover"), "indeterminate, selected, hover"),
 304                 withState(new CheckBox("Armed"), "indeterminate, selected, armed"),
 305                 withState(new CheckBox("Focused"), "indeterminate, selected, focused"),
 306                 withState(new CheckBox("Focused & Hover"), "indeterminate, selected, focused, hover"),
 307                 withState(new CheckBox("Focused & Armed"), "indeterminate, selected, focused, armed"),
 308                 withState(new CheckBox("Disabled"), "indeterminate, selected, disabled"));
 309         newSection("RadioButton:",
 310                 new RadioButton("RadioButton"),
 311                 withState(new RadioButton("Hover"), "hover"),
 312                 withState(new RadioButton("Armed"), "armed"),
 313                 withState(new RadioButton("Focused"), "focused"),
 314                 withState(new RadioButton("Focused & Hover"), "focused, hover"),
 315                 withState(new RadioButton("Focused & Armed"), "focused, armed"),
 316                 withState(new RadioButton("Disabled"), "disabled"));
 317         newSection("RadioButton\nSelected:",
 318                 withState(new RadioButton("RadioButton"), "selected"),
 319                 withState(new RadioButton("Hover"), "selected, hover"),
 320                 withState(new RadioButton("Armed"), "selected, armed"),
 321                 withState(new RadioButton("Focused"), "selected, focused"),
 322                 withState(new RadioButton("Focused & Hover"), "selected, focused, hover"),
 323                 withState(new RadioButton("Focused & Armed"), "selected, focused, armed"),
 324                 withState(new RadioButton("Disabled"), "selected, disabled"));
 325         newSection("HyperLink:",
 326                 new Hyperlink("Hyperlink"),
 327                 withState(new Hyperlink("Visited"), "visited"),
 328                 withState(new Hyperlink("Hover"), "hover"),
 329                 withState(new Hyperlink("Armed"), "armed"),
 330                 withState(new Hyperlink("Focused"), "focused"),
 331                 withState(new Hyperlink("F & Visited"), "focused, visited"),
 332                 withState(new Hyperlink("F & Hover"), "focused, hover"),
 333                 withState(new Hyperlink("F & Armed"), "focused, armed"),
 334                 withState(new Hyperlink("Disabled"), "disabled"));
 335         ObservableList<String> choiceBoxLongList = sampleItems(200);
 336         choiceBoxLongList.add(100, "Long List");
 337         ChoiceBox<String> cb1 = new ChoiceBox<String>(sampleItems());
 338         cb1.setValue("Item A");
 339         ChoiceBox<String> cb2 = new ChoiceBox<String>(choiceBoxLongList);
 340         cb2.setValue("Long List");
 341         ChoiceBox<String> cb3 = new ChoiceBox<String>(sampleItems());
 342         cb3.setValue("Item B");
 343         ChoiceBox<String> cb4 = new ChoiceBox<String>(sampleItems());
 344         cb4.setValue("Item B");
 345         ChoiceBox<String> cb5 = new ChoiceBox<String>(sampleItems());
 346         cb5.setValue("Item B");
 347         ChoiceBox<String> cb6 = new ChoiceBox<String>(sampleItems());
 348         cb6.setValue("Item C");
 349         cb6.setDisable(true);
 350         newSection(
 351                 "ChoiceBox:", cb1, cb2,
 352                 withState(cb3, "hover"),
 353                 withState(cb4,"showing"),
 354                 withState(cb5,"focused"),
 355                 cb6);
 356         ChoiceBox<String> c1 = new ChoiceBox<String>(sampleItems());
 357         c1.setValue("Item A");
 358         ChoiceBox<String> c2 = new ChoiceBox<String>(choiceBoxLongList);
 359         c2.setValue("Long List");
 360         ChoiceBox<String> c3 = new ChoiceBox<String>(sampleItems());
 361         c3.setValue("Item B");
 362         ChoiceBox<String> c4 = new ChoiceBox<String>(sampleItems());
 363         c4.setValue("Item B");
 364         ChoiceBox<String> c5 = new ChoiceBox<String>(sampleItems());
 365         c5.setValue("Item B");
 366         ChoiceBox<String> c6 = new ChoiceBox<String>(sampleItems());
 367         c6.setValue("Item C");
 368         c6.setDisable(true);
 369         newSection(
 370                 "ChoiceBox:", c1, c2,
 371                 withState(c3, "hover"),
 372                 withState(c4, "showing"),
 373                 withState(c5,"focused"),
 374                 c6);
 375         ComboBox<String> com1 = new ComboBox<String>(sampleItems());
 376         com1.setValue("Item A");
 377         com1.setEditable(true);
 378         ComboBox<String> com2 = new ComboBox<String>(sampleItems());
 379         com2.setValue("Item B");
 380         com2.setEditable(true);
 381         ComboBox<String> com3 = new ComboBox<String>(sampleItems());
 382         com3.setValue("Item B");
 383         com3.setEditable(true);
 384         newSection(
 385                 "ComboBox\nEditable:", com1,
 386                 withState(com2, "editable", ".arrow-button", "hover"),
 387                 withState(com3, "editable", ".arrow-button", "pressed"));
 388         ComboBox<String> co1 = new ComboBox<String>(sampleItems());
 389         co1.setValue("Item B");
 390         co1.setEditable(true);
 391         ComboBox<String> co2 = new ComboBox<String>(sampleItems());
 392         co2.setValue("Item C");
 393         co2.setEditable(true);
 394         co2.setDisable(true);
 395         newSection(
 396                 "ComboBox\nEditable\n(More):",
 397                 withState(co1, "editable,contains-focus", ".text-field", "focused"),
 398                 co2);
 399         String[] spinnerStyles = new String[] {
 400                 "default",
 401                 Spinner.STYLE_CLASS_ARROWS_ON_RIGHT_HORIZONTAL,
 402                 Spinner.STYLE_CLASS_ARROWS_ON_LEFT_VERTICAL,
 403                 Spinner.STYLE_CLASS_ARROWS_ON_LEFT_HORIZONTAL,
 404                 Spinner.STYLE_CLASS_SPLIT_ARROWS_VERTICAL,
 405                 Spinner.STYLE_CLASS_SPLIT_ARROWS_HORIZONTAL
 406         };
 407         for (String style: spinnerStyles) {
 408             final Spinner[] spinners = new Spinner[3];
 409             for (int i=0; i<spinners.length; i++) {
 410                 spinners[i] = new Spinner();
 411                 spinners[i].getStyleClass().add(style);
 412                 spinners[i].setValueFactory(new SpinnerValueFactory.IntegerSpinnerValueFactory(5, 10));
 413             }
 414             spinners[2].setDisable(true);
 415             newSection(
 416                     "Spinner ("+style+"):",
 417                     spinners[0],
 418                     withState(spinners[1], "focused"),
 419                     spinners[2]
 420             );
 421         }
 422         newSection("Color Picker:", new ColorPicker(Color.RED), withState(new ColorPicker(Color.RED), "hover"),
 423                 withState(new ColorPicker(Color.RED), "showing"), withState(new ColorPicker(Color.RED), "focused"),
 424                 withState(new ColorPicker(Color.RED), "disabled"));
 425         ColorPicker cp1 = new ColorPicker(Color.RED);
 426         cp1.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON);
 427         ColorPicker cp2 = new ColorPicker(Color.RED);
 428         cp2.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON);
 429         ColorPicker cp3 = new ColorPicker(Color.RED);
 430         cp3.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON);
 431         ColorPicker cp4 = new ColorPicker(Color.RED);
 432         cp4.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON);
 433         ColorPicker cp5 = new ColorPicker(Color.RED);
 434         cp5.getStyleClass().add(ColorPicker.STYLE_CLASS_SPLIT_BUTTON);
 435         newSection(
 436                 "Color Picker\n Split Button:", cp1,
 437                 withState(cp2, "hover"),
 438                 withState(cp3,"showing"),
 439                 withState(cp4, "focused"),
 440                 withState(cp5,"disabled"));
 441         MenuButton mb1 = new MenuButton();
 442         mb1.getItems().addAll(createMenuItems(20));
 443         mb1.setText("right");
 444         mb1.setPopupSide(Side.RIGHT);
 445         MenuButton mb2 = new MenuButton();
 446         mb2.getItems().addAll(createMenuItems(20));
 447         mb2.setText("normal");
 448         MenuButton mb3 = new MenuButton();
 449         mb3.getItems().addAll(createMenuItems(20));
 450         mb3.setText("hover");
 451         MenuButton mb4 = new MenuButton();
 452         mb4.getItems().addAll(createMenuItems(20));
 453         mb4.setText("armed");
 454         MenuButton mb5 = new MenuButton();
 455         mb5.getItems().addAll(createMenuItems(20));
 456         mb5.setText("focused");
 457         MenuButton mb6 = new MenuButton();
 458         mb6.getItems().addAll(createMenuItems(20));
 459         mb6.setText("disabled");
 460         newSection("MenuButton:", mb1, mb2,
 461                 withState(mb3, "openvertically, hover"),
 462                 withState(mb4, "openvertically, armed"),
 463                 withState(mb5, "openvertically, focused"),
 464                 withState(mb6, "openvertically, disabled"));
 465         SplitMenuButton splitmb1 = new SplitMenuButton(createMenuItems(20));
 466         splitmb1.setText("right");
 467         splitmb1.setPopupSide(Side.RIGHT);
 468         SplitMenuButton splitmb2 = new SplitMenuButton(createMenuItems(20));
 469         splitmb2.setText("normal");
 470         SplitMenuButton splitmb3 = new SplitMenuButton(createMenuItems(20));
 471         splitmb3.setText("hover");
 472         SplitMenuButton splitmb4 = new SplitMenuButton(createMenuItems(20));
 473         splitmb4.setText("armed");
 474         newSection(
 475                 "SplitMenuButton:", splitmb1, splitmb2,
 476                 withState(splitmb3, "openvertically",".label", "hover"),
 477                 withState(splitmb4,"armed,openvertically",".label", "armed"));
 478         SplitMenuButton splitmb_m1 = new SplitMenuButton(createMenuItems(20));
 479         splitmb_m1.setText("arrow hover");
 480         SplitMenuButton splitmb_m2 = new SplitMenuButton(createMenuItems(20));
 481         splitmb_m2.setText("showing");
 482         SplitMenuButton splitmb_m3 = new SplitMenuButton(createMenuItems(20));
 483         splitmb_m3.setText("focused");
 484         SplitMenuButton splitmb_m4 = new SplitMenuButton(createMenuItems(20));
 485         splitmb_m4.setText("disabled");
 486         newSection(
 487                 "SplitMenuButton\nnMore:",
 488                 withState(splitmb_m1, "openvertically", ".arrow-button", "hover"),
 489                 withState(splitmb_m2, "openvertically,showing"),
 490                 withState(splitmb_m3, "openvertically,focused"),
 491                 withState(splitmb_m4, "openvertically,disabled"));
 492         newSection(
 493                 "DatePicker:",
 494                 new DatePicker(),
 495                 withState(new DatePicker(),"hover"),
 496                 withState(new DatePicker(), "showing"),
 497                 withState(new DatePicker(), "focused"),
 498                 withState(new DatePicker(), "disabled"));
 499         Slider s1 = new Slider(0, 100, 50);
 500         s1.setMaxWidth(90);
 501         Slider s2 = new Slider(0, 100, 50);
 502         s2.setMaxWidth(90);
 503         Slider s3 = new Slider(0, 100, 50);
 504         s3.setMaxWidth(90);
 505         Slider s4 = new Slider(0, 100, 50);
 506         s4.setMaxWidth(90);
 507         Slider s5 = new Slider(0, 100, 50);
 508         s5.setShowTickLabels(true);
 509         s5.setShowTickMarks(true);
 510         newDetailedSection(
 511                 new String[]{"Slider (H):", "normal", "hover", "pressed", "disabled", "tickmarks"},
 512                 withState(s1, null),
 513                 withState(s2, null, ".thumb", "hover"),
 514                 withState(s3, null, ".thumb", "hover, pressed"),
 515                 withState(s4, "disabled"),
 516                 s5);
 517         newDetailedSection(
 518                 new String[]{"Slider (H) Focused:", "normal", "hover", "pressed"},
 519                 withState(new Slider(0, 100, 50), "focused"),
 520                 withState(new Slider(0, 100, 50), "focused", ".thumb", "hover"),
 521                 withState(new Slider(0, 100, 50), "focused", ".thumb", "hover, pressed"));
 522         Slider s_v1 = new Slider(0, 100, 50);
 523         s_v1.setOrientation(Orientation.VERTICAL);
 524         Slider s_v2 = new Slider(0, 100, 50);
 525         s_v2.setOrientation(Orientation.VERTICAL);
 526         Slider s_v3 = new Slider(0, 100, 50);
 527         s_v3.setOrientation(Orientation.VERTICAL);
 528         Slider s_v4 = new Slider(0, 100, 50);
 529         s_v4.setOrientation(Orientation.VERTICAL);
 530         Slider s_v5 = new Slider(0, 100, 50);
 531         s_v5.setOrientation(Orientation.VERTICAL);
 532         s_v5.setShowTickLabels(true);
 533         s_v5.setShowTickMarks(true);
 534         newSection("Slider - V:",
 535                 s_v1,
 536                 withState(s_v2, null, ".thumb", "hover"),
 537                 withState(s_v3, null, ".thumb", "hover, pressed"),
 538                 withState(s_v4, "disabled"),
 539                 s_v5);
 540         ScrollBar sb1 = new ScrollBar();
 541         sb1.setMinWidth(30);
 542         sb1.setPrefWidth(30);
 543         ScrollBar sb2 = new ScrollBar();
 544         sb2.setVisibleAmount(60);
 545         sb1.setMax(100);
 546         newDetailedSection(
 547                 new String[]{"Scrollbar - H: ", "normal", "focused", "small", "big thumb"},
 548                 new ScrollBar(),
 549                 withState(new ScrollBar(), "focused"), sb1, sb2);
 550         ScrollBar sb3 = new ScrollBar();
 551         sb3.setOrientation(Orientation.VERTICAL);
 552         ScrollBar sb4 = new ScrollBar();
 553         sb4.setOrientation(Orientation.VERTICAL);
 554         ScrollBar sb5 = new ScrollBar();
 555         sb5.setMinHeight(30);
 556         sb5.setPrefHeight(30);
 557         sb5.setOrientation(Orientation.VERTICAL);
 558         ScrollBar sb6 = new ScrollBar();
 559         sb6.setOrientation(Orientation.VERTICAL);
 560         ScrollBar sb7 = new ScrollBar();
 561         sb7.setOrientation(Orientation.VERTICAL);
 562         ScrollBar sb8 = new ScrollBar();
 563         sb8.setOrientation(Orientation.VERTICAL);
 564         ScrollBar sb9 = new ScrollBar();
 565         sb9.setOrientation(Orientation.VERTICAL);
 566         newDetailedSection(
 567                 new String[]{"Scrollbar - V: ", "normal", "focused", "small", "btn hover", "btn pressed", ".thumb hover", ".thumb pressed"},
 568                 withState(sb3, "vertical"),
 569                 withState(sb4, "focused"),
 570                 withState(sb5, "vertical"),
 571                 withState(sb6, "vertical", ".decrement-button", "hover"),
 572                 withState(sb7, "vertical", ".decrement-button", "pressed"),
 573                 withState(sb8, "vertical", ".thumb", "hover"),
 574                 withState(sb9, "vertical", ".thumb", "pressed")
 575         );
 576         ScrollPane scrollPane = new ScrollPane(scrollPaneContent());
 577         scrollPane.setMinWidth(40);
 578         scrollPane.setPrefWidth(40);
 579         scrollPane.setMinHeight(40);
 580         scrollPane.setPrefHeight(40);
 581         newDetailedSection(
 582                 new String[] {"ScrollPane: ", "normal", "small", "focused", "empty"},
 583                 new ScrollPane(scrollPaneContent()),
 584                 scrollPane,
 585                 withState(new ScrollPane(scrollPaneContent()), "focused"),
 586                 new ScrollPane()
 587         );
 588         ScrollPane scrollPaneVbar = new ScrollPane(scrollPaneContent());
 589         scrollPaneVbar.setVbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
 590         ScrollPane scrollPaneHbar = new ScrollPane(scrollPaneContent());
 591         scrollPaneHbar.setHbarPolicy(ScrollPane.ScrollBarPolicy.NEVER);
 592         newDetailedSection(
 593                 new String[] {"ScrollPane H/V: ", "H Bar", "V bar"},
 594                 scrollPaneVbar,
 595                 scrollPaneHbar);
 596         Separator sep1 = new Separator();
 597         sep1.setPrefWidth(100);
 598         Separator sep2 = new Separator(Orientation.VERTICAL);
 599         sep2.setPrefHeight(50);
 600         newDetailedSection(
 601                 new String[]{"Separator: ", "horizontal", "vertical"},
 602                 sep1, sep2);
 603         ProgressBar pb1 = new ProgressBar(0.6);
 604         pb1.setPrefWidth(200);
 605         ProgressBar pb2 = new ProgressBar(0.2);
 606         pb2.setPrefWidth(200);
 607         ProgressBar pb3 = new ProgressBar(-1);
 608         pb3.setPrefWidth(200);
 609         newDetailedSection(
 610                 new String[] {"ProgressBar: ", "normal", "disabled", "indeterminate"},
 611                 pb1,
 612                 withState(pb2, "disabled"),
 613                 pb3);
 614         newDetailedSection(
 615                 new String[] {"ProgressIndicator: ", "normal 0%", "normal 60%", "normal 100%", "disabled"},
 616                 new ProgressIndicator(0),
 617                 new ProgressIndicator(0.6),
 618                 new ProgressIndicator(1),
 619                 withState(new ProgressIndicator(0.5), "disabled"));
 620         ProgressIndicator pi1 = new ProgressIndicator(-1);
 621         pi1.setMaxWidth(USE_PREF_SIZE);
 622         pi1.setMaxHeight(USE_PREF_SIZE);
 623         ProgressIndicator pi2 = new ProgressIndicator(-1);
 624         pi2.setPrefWidth(30);
 625         pi2.setPrefHeight(30);
 626         ProgressIndicator pi3 = new ProgressIndicator(-1);
 627         pi3.setPrefWidth(60);
 628         pi3.setPrefHeight(60);
 629         ProgressIndicator pi4 = new ProgressIndicator(-1);
 630         pi4.setMaxWidth(USE_PREF_SIZE);
 631         pi4.setMaxHeight(USE_PREF_SIZE);
 632         pi4.setDisable(true);
 633         newDetailedSection(
 634                 new String[]{"ProgressIndicator\nIndeterminate: ", "normal", "small", "large", "disabled"},
 635                 pi1, pi2, pi3, pi4);
 636         TextField textF = new TextField();
 637         textF.setPromptText("Prompt Text");
 638         newSection(
 639                 "TextField:",
 640                 new TextField("TextField"),
 641                 textF,
 642                 withState(new TextField("Focused"), "focused"),
 643                 withState(new TextField("Disabled"), "disabled"));
 644         PasswordField pField1 = new PasswordField();
 645         pField1.setText("Password");
 646         PasswordField pField2 = new PasswordField();
 647         pField2.setPromptText("Prompt Text");
 648         PasswordField pField3 = new PasswordField();
 649         pField3.setText("Password");
 650         PasswordField pField4 = new PasswordField();
 651         pField4.setText("Password");
 652         newSection(
 653                 "PasswordField:",
 654                 pField1,
 655                 pField2,
 656                 withState(pField3, "focused"),
 657                 withState(pField4, "disabled"));
 658         TextArea tArea1 = new TextArea("TextArea");
 659         tArea1.setPrefColumnCount(10);
 660         tArea1.setPrefRowCount(2);
 661         TextArea tArea2 = new TextArea("Many Lines of\nText.\n#3\n#4\n#5\n#6\n#7\n#8\n#9\n#10");
 662         tArea2.setPrefColumnCount(10);
 663         tArea2.setPrefRowCount(5);
 664         TextArea tArea3 = new TextArea("Many Lines of\nText.\n#3\n#4\n#5\n#6\n#7\n#8\n#9\n#10");
 665         tArea3.setPrefColumnCount(6);
 666         tArea3.setPrefRowCount(5);
 667         TextArea tArea4 = new TextArea("Prompt Text");
 668         tArea4.setPrefColumnCount(10);
 669         tArea4.setPrefRowCount(2);
 670 
 671         TextArea tArea5 = new TextArea("Focused");
 672         tArea5.setPrefColumnCount(7);
 673         tArea5.setPrefRowCount(2);
 674         TextArea tArea6 = new TextArea("Disabled");
 675         tArea6.setPrefColumnCount(8);
 676         tArea6.setPrefRowCount(2);
 677         newSection(
 678                 "TextArea:",
 679                 tArea1, tArea2, tArea3, tArea4,
 680                 withState(tArea5, "focused"),
 681                 withState(tArea6, "disabled"));
 682         newSection(
 683                 "HTMLEditor:",
 684                 new HTMLEditor() {{
 685                     setHtmlText("Hello <b>Bold</b> Text");
 686                     setPrefSize(650, 120);
 687                 }});
 688         newSection(
 689                 "HTMLEditor\nFocused:",
 690                 withState(new HTMLEditor() {{
 691                     setHtmlText("<i>Focused</i>");
 692                     setPrefSize(650, 120);
 693                 }}, "focused")
 694                 );
 695         newDetailedSection(
 696                 new String[] { "ToolBar (H|TOP):", "normal", "overflow", "disabled" },
 697                 createToolBar(Side.TOP, false, false),
 698                 createToolBar(Side.TOP, true, false),
 699                 createToolBar(Side.TOP, false, true)
 700         );
 701         newDetailedSection(
 702                 new String[] { "ToolBar (H|BOTTOM):", "normal", "overflow", "disabled" },
 703                 createToolBar(Side.BOTTOM, false, false),
 704                 createToolBar(Side.BOTTOM, true, false),
 705                 createToolBar(Side.BOTTOM, false, true)
 706         );
 707         newDetailedSection(
 708                 new String[] { "ToolBar (V|LEFT):", "normal", "overflow", "disabled" },
 709                 createToolBar(Side.LEFT, false, false),
 710                 createToolBar(Side.LEFT, true, false),
 711                 createToolBar(Side.LEFT, false, true)
 712         );
 713         newDetailedSection(
 714                 new String[] {"ToolBar (V|RIGHT):", "normal", "overflow", "disabled"},
 715                 createToolBar(Side.RIGHT,false,false),
 716                 createToolBar(Side.RIGHT,true,false),
 717                 createToolBar(Side.RIGHT,false,true)
 718                 );
 719         newSection(
 720                 "Tabs\n(Top):",
 721                 wrapBdr(createTabPane(4, 250, 100, null, false, false, Side.TOP)),
 722                 wrapBdr(withState(createTabPane(5, 200, 100, "Tab Disabled &\nMany Tabs", false, true, Side.TOP), null, ".tab", "disabled")),
 723                 wrapBdr(withState(createTabPane(5, 200, 100, "Disabled", false, false, Side.TOP), "disabled"))
 724         );
 725         newSection(
 726                 "Tabs Floating\n(Top):",
 727                 createTabPane(4, 250, 100, null, true, false, Side.TOP),
 728                 withState(createTabPane(5, 200, 100, "Tab Disabled &\nMany Tabs", true, true, Side.TOP), null, ".tab", "disabled"),
 729                 withState(createTabPane(5, 200, 100, "Disabled", true, false, Side.TOP), "disabled")
 730                 );
 731         newSection(
 732                 "Tabs\n(Bottom):",
 733                 wrapBdr(createTabPane(4, 250, 100, null, false, false, Side.BOTTOM)),
 734                 wrapBdr(withState(createTabPane(5, 200, 100, "Tab Disabled &\nMany Tabs", false, true, Side.BOTTOM), null, ".tab", "disabled")),
 735                 wrapBdr(withState(createTabPane(5, 200, 100, "Disabled", false, false, Side.BOTTOM), "disabled"))
 736                 );
 737         newSection(
 738                 "Tabs Floating\n(Bottom):",
 739                 createTabPane(4, 250, 100, null, true, false, Side.BOTTOM),
 740                 withState(createTabPane(5, 200, 100, "Tab Disabled &\nMany Tabs", true, true, Side.BOTTOM), null, ".tab", "disabled"),
 741                 withState(createTabPane(5, 200, 100, "Disabled", true, false, Side.BOTTOM), "disabled")
 742                 );
 743         newSection(
 744                 "Tabs\n(Left):",
 745                 wrapBdr(createTabPane(4, 250, 250, null, false, false, Side.LEFT)),
 746                 wrapBdr(withState(createTabPane(5, 200, 250, "Tab Disabled &\nMany Tabs", false, true, Side.LEFT), null, ".tab", "disabled")),
 747                 wrapBdr(withState(createTabPane(5, 200, 250, "Disabled", false, false, Side.LEFT), "disabled"))
 748                 );
 749         newSection(
 750                 "Tabs Floating\n(Left):",
 751                 createTabPane(4, 250, 250, null, true, false, Side.LEFT),
 752                 withState(createTabPane(5, 200, 250, "Tab Disabled &\nMany Tabs", true, true, Side.LEFT), null, ".tab", "disabled"),
 753                 withState(createTabPane(5, 200, 250, "Disabled", true, false, Side.LEFT), "disabled")
 754                 );
 755         newSection(
 756                 "Tabs\n(Right):",
 757                 wrapBdr(createTabPane(4, 250, 250, null, false, false, Side.RIGHT)),
 758                 wrapBdr(withState(createTabPane(5, 200, 250, "Tab Disabled &\nMany Tabs", false, true, Side.RIGHT), null, ".tab", "disabled")),
 759                 wrapBdr(withState(createTabPane(5, 200, 250, "Disabled", false, false, Side.RIGHT), "disabled"))
 760                 );
 761         newSection(
 762                 "Tabs Floating\n(Right):",
 763                 createTabPane(4, 250, 250, null, true, false, Side.RIGHT),
 764                 withState(createTabPane(5, 200, 250, "Tab Disabled &\nMany Tabs", true, true, Side.RIGHT), null, ".tab", "disabled"),
 765                 withState(createTabPane(5, 200, 250, "Disabled", true, false, Side.RIGHT), "disabled")
 766         );
 767         TitledPane tPane = new TitledPane("Not Collapsible", new Label("Content\nLine2."));
 768         tPane.setCollapsible(false);
 769         newDetailedSection(
 770                 new String[]{"TitledPane:", "normal", "not collapsible", "hover", "focused", "disabled"},
 771                 new TitledPane("Title", new Label("Content\nLine2.")),
 772                 tPane,
 773                 withState(new TitledPane("Title", new Label("Content\nLine2.")), "hover"),
 774                 withState(new TitledPane("Title", new Label("Content\nLine2.")), "focused"),
 775                 withState(new TitledPane("Title", new Label("Content\nLine2.")), "disabled")
 776         );
 777         newDetailedSection(
 778                 new String[] {"Accordion:", "normal", "hover", "focused", "disabled"},
 779                 createAccordion(),
 780                 withState(createAccordion(), null, ".titled-pane", "hover"),
 781                 withState(createAccordion(), null, ".titled-pane", "focused"),
 782                 withState(createAccordion(), "disabled")
 783                 );
 784         newDetailedSection(
 785                 new String[] {"SplitPane (H):", "simple", "many", "complex"},
 786                 createSplitPane(2, false, null),
 787                 createSplitPane(4, false, null),
 788                 createSplitPane(2, false, createSplitPane(2, true, null))
 789                 );
 790         newDetailedSection(
 791                 new String[] {"SplitPane (V):", "simple", "many", "complex"},
 792                 createSplitPane(2,true,null),
 793                 createSplitPane(4,true,null),
 794                 createSplitPane(2,true,createSplitPane(2,false,null))
 795                 );
 796         newDetailedSection(
 797                 new String[] {"Pagination:", "simple", "infinate"},
 798                 createPagination(5, false, true),
 799                 createPagination(Integer.MAX_VALUE, false, true)
 800                 );
 801         newDetailedSection(
 802                 new String[] {"Pagination\nBullet Style:", "simple", "infinate"},
 803                 createPagination(5, true, true),
 804                 createPagination(Integer.MAX_VALUE, true, true)
 805                 );
 806         newSection(
 807                 "Pagination\nNo Arrows:",
 808                 createPagination(Integer.MAX_VALUE, false, false)
 809         );
 810         newDetailedSection(
 811                 new String[] { "ListView\n2 items\nsingle selection:", "normal", "focused", "disabled" },
 812                 createListView(3, false, false, false),
 813                 withState(createListView(3, false, false, false), "focused"),
 814                 createListView(3, false, true, false)
 815         );
 816         newDetailedSection(
 817                 new String[] {"ListView\n10,000 items\nmultiple selection:","normal", "focused", "disabled"},
 818                 createListView(10000, true, false, false),
 819                 withState(createListView(10000, true, false, false), "focused"),
 820                 createListView(10000, true, true, false)
 821                 );
 822         newDetailedSection(
 823                 new String[] {"ListView (H)\n10,000 items\nmultiple selection:","normal", "focused", "disabled"},
 824                 createListView(10000, true, false, true),
 825                 withState(createListView(10000, true, false, true), "focused"),
 826                 createListView(10000, true, true, true)
 827                 );
 828         newSection(
 829                 "TableView Simple:\n(Row Selection)",
 830                 createTableViewSimple(550, true, false),
 831                 withState(createTableViewSimple(150, true, false), "focused")
 832         );
 833         newSection(
 834                 "TableView Simple:\n(Constrained Resize)",
 835                 createTableViewSimple(550, true, true),
 836                 withState(createTableViewSimple(150, true, true), "focused")
 837         );
 838         newSection(
 839                 "TableView:\n(Row Selection)",
 840                 createTableView(550, true),
 841                 withState(createTableView(150, true), "focused")
 842         );
 843         newSection(
 844                 "TableView:\n(Cell Selection)",
 845                 createTableView(550, false),
 846                 withState(createTableView(150, false), "focused")
 847                 );
 848         newSection(
 849                 "TreeView:",
 850                 createTreeView(350),
 851                 withState(createTreeView(350), "focused")
 852                 );
 853         newSection(
 854                 "TreeTableView:\n" +
 855                         "(Row Selection)",
 856                 createTreeTableView(550, false),
 857                 withState(createTreeTableView(200, false), "focused")
 858                 );
 859         newSection(
 860                 "TreeTableView:\n(Cell Selection)",
 861                 createTreeTableView(550, true),
 862                 withState(createTreeTableView(200, true), "focused")
 863                 );
 864         ListView<String> lv = new ListView<>();
 865         lv.setPrefWidth(150);
 866         lv.setPrefHeight(100);
 867         TableView tv = new TableView();
 868         tv.setPrefWidth(150);
 869         tv.setPrefHeight(100);
 870         TreeView treev = new TreeView();
 871         treev.setPrefWidth(150);
 872         treev.setPrefHeight(100);
 873         newDetailedSection(
 874                 new String[]{"Empty:", "ListView", "TableView", "TreeView", "TreeTableView"},
 875                 lv, tv, treev,
 876                 new TreeTableView() {{
 877                     setPrefSize(150, 100);
 878                 }});
 879         Label label1 = new Label("This is a simple Tooltip.");
 880         label1.getStyleClass().add("tooltip");
 881         Label label2 = new Label("This is a simple Tooltip\nwith graphic.", createGraphic());
 882         label2.getStyleClass().add("tooltip");
 883         VBox vb = new VBox(4);
 884         vb.setFillWidth(true);
 885         Button button1 = new Button("Hover over me");
 886         button1.setTooltip(new Tooltip("This is a simple Tooltip."));
 887         Button button2 = new Button("me too");
 888         button2.setTooltip(new Tooltip("This is a simple Tooltip\nwith more than one line."));
 889         Button button3 = new Button("or me");
 890         Tooltip tip = new Tooltip("This is a simple Tooltip\nwith graphic.");
 891         tip.setGraphic(createGraphic());
 892         button3.setTooltip(tip);
 893         vb.getChildren().addAll(button1, button2, button3);
 894 
 895         newDetailedSection(
 896                 new String[]{"ToolTip:", "inline", "inline + graphic", "popup"},
 897                 label1, label2, vb);
 898         newSection(
 899                 "MenuBar & ContextMenu:",
 900                 createMenuBar(),
 901                 createContextMenu()
 902                 );
 903         newSection(
 904                 "Menus:",
 905                 createInlineMenu(false),
 906                 createInlineMenu(true)
 907                 );
 908         newSection(
 909                 "AreaChart:",
 910                 createAreaChart(false)
 911                 );
 912         newSection(
 913                 "StackedAreaChart:",
 914                 createAreaChart(true)
 915                 );
 916         newSection(
 917                 "BarChart\nSimple:",
 918                 createBarChart(false,true)
 919                 );
 920         newSection(
 921                 "BarChart:",
 922                 createBarChart(false, false)
 923                 );
 924         newSection(
 925                 "BarChart\n(H, Simple):",
 926                 createBarChart(true, true)
 927                 );
 928         newSection(
 929                 "BarChart\n(H):",
 930                 createBarChart(true, false)
 931                 );
 932         newSection(
 933                 "StackedBarChart\nSimple:",
 934                 createStackedBarChart(false,true)
 935                 );
 936         newSection(
 937                 "StackedBarChart\n(H, Simple):",
 938                 createStackedBarChart(true, true)
 939         );
 940         newSection(
 941                 "BubbleChart:",
 942                 createBubbleChart(false)
 943         );
 944         newSection(
 945                 "BubbleChart\nTop & Right Axis:",
 946                 createBubbleChart(true)
 947         );
 948         newSection(
 949                 "LineChart:",
 950                 createLineChart()
 951         );
 952         newSection(
 953                 "PieChar:",
 954                 createPieChart()
 955         );
 956         newSection(
 957                 "ScatterChart:",
 958                 createScatterChart()
 959         );
 960     }
 961 
 962     public List<Section> getSections() {
 963         return sections;
 964     }
 965 
 966     private void newSection(String name, Node ...children) {
 967         newSection(name, 10, children);
 968     }
 969 
 970     private void newSection(String name, int spacing, Node ...children) {
 971         Label sectionLabel = new Label(name);
 972         sectionLabel.getStyleClass().add("section-label");
 973         sectionLabel.setMaxSize(Double.MAX_VALUE,Double.MAX_VALUE);
 974         HBox box = new HBox(spacing);
 975         box.getStyleClass().add("section-border");
 976         box.getChildren().addAll(children);
 977         setConstraints(sectionLabel, 0, rowIndex, 1, 1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS, Priority.ALWAYS);
 978         setConstraints(box, 1, rowIndex++);
 979         getChildren().addAll(sectionLabel, box);
 980         sections.add(new Section(name, sectionLabel, box));
 981         content.put(name, box);
 982     }
 983 
 984     private void newDetailedSection(String[] labels, Node ...children) {
 985         Label sectionLabel = new Label(labels[0]);
 986         sectionLabel.getStyleClass().add("section-label");
 987         sectionLabel.setMaxSize(Double.MAX_VALUE, Double.MAX_VALUE);
 988         HBox hbox = new HBox(10);
 989         for (int n = 0; n < children.length; n++ ) {
 990             VBox vbox = new VBox(10);
 991             vbox.getStyleClass().add("section-border");
 992             vbox.setAlignment(Pos.CENTER);
 993             Label stateLabel = new Label(labels[n+1]);
 994             stateLabel.getStyleClass().add("section-label");
 995             vbox.getChildren().add(stateLabel);
 996             vbox.getChildren().add(children[n]);
 997             hbox.getChildren().addAll(vbox);
 998         }
 999         setConstraints(sectionLabel, 0, rowIndex,1,1, HPos.CENTER, VPos.CENTER, Priority.ALWAYS,Priority.ALWAYS);
1000         setConstraints(hbox, 1, rowIndex++);
1001         getChildren().addAll(sectionLabel, hbox);
1002         sections.add(new Section(labels[0], sectionLabel, hbox));
1003         content.put(labels[0], hbox);
1004     }
1005 
1006     public Map<String, Node> getContent() {
1007         return content;
1008     }
1009 
1010     public static class Section {
1011         public final String name;
1012         public final Label label;
1013         public final Node box;
1014 
1015         public Section(String name, Label label, Node box) {
1016             this.name = name;
1017             this.label = label;
1018             this.box = box;
1019         }
1020 
1021         @Override public String toString() {
1022             return name.replaceAll("\n"," ");
1023         }
1024     }
1025 }
--- EOF ---