Java Code Examples for javafx.scene.layout.VBoxBuilder

The following examples show how to use javafx.scene.layout.VBoxBuilder. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
Source Project: marathonv5   Source File: ColorPickerSample.java    License: Apache License 2.0 6 votes vote down vote up
public ColorPickerSample() {
    final ColorPicker colorPicker = new ColorPicker(Color.GRAY);
    ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build();

    final Text coloredText = new Text("Colors");
    Font font = new Font(53);
    coloredText.setFont(font);
    final Button coloredButton = new Button("Colored Control");
    Color c = colorPicker.getValue();
    coloredText.setFill(c);
    coloredButton.setStyle(createRGBString(c));

    colorPicker.setOnAction(new EventHandler() {

        public void handle(Event t) {
            Color newColor = colorPicker.getValue();
            coloredText.setFill(newColor);                          
            coloredButton.setStyle(createRGBString(newColor));
        }
    });

    VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build();        
    VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build();
    getChildren().add(outerVBox);
}
 
Example 2
Source Project: marathonv5   Source File: ColorPickerSample.java    License: Apache License 2.0 6 votes vote down vote up
public ColorPickerSample() {
    final ColorPicker colorPicker = new ColorPicker(Color.GRAY);
    ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build();

    final Text coloredText = new Text("Colors");
    Font font = new Font(53);
    coloredText.setFont(font);
    final Button coloredButton = new Button("Colored Control");
    Color c = colorPicker.getValue();
    coloredText.setFill(c);
    coloredButton.setStyle(createRGBString(c));

    colorPicker.setOnAction(new EventHandler() {

        public void handle(Event t) {
            Color newColor = colorPicker.getValue();
            coloredText.setFill(newColor);                          
            coloredButton.setStyle(createRGBString(newColor));
        }
    });

    VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build();        
    VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build();
    getChildren().add(outerVBox);
}
 
Example 3
Source Project: SONDY   Source File: GlobalUI.java    License: GNU General Public License v3.0 6 votes vote down vote up
public void about(){
    final Stage stage = new Stage();
    stage.setResizable(false);
    stage.initModality(Modality.WINDOW_MODAL);
    stage.initStyle(StageStyle.UTILITY);
    stage.setTitle("About SONDY");
    WebView webView = new WebView();
    webView.getEngine().loadContent(getReferences());
    webView.setMaxWidth(Main.columnWidthLEFT);
    webView.setMinWidth(Main.columnWidthLEFT);
    webView.setMaxHeight(Main.columnWidthLEFT);
    webView.setMinHeight(Main.columnWidthLEFT);
    Scene scene = new Scene(VBoxBuilder.create().children(new Label("SONDY "+Main.version),new Label("Main developper: Adrien Guille <[email protected]>"),webView).alignment(Pos.CENTER).padding(new Insets(10)).spacing(3).build());
    scene.getStylesheets().add("resources/fr/ericlab/sondy/css/GlobalStyle.css");
    stage.setScene(scene);
    stage.show();
}
 
Example 4
Source Project: marathonv5   Source File: SearchBoxSample.java    License: Apache License 2.0 5 votes vote down vote up
public SearchBoxSample() {
    String searchBoxCss = SearchBoxSample.class.getResource("SearchBox.css").toExternalForm();
    VBox vbox = VBoxBuilder.create().build();
    vbox.getStylesheets().add(searchBoxCss);
    vbox.setPrefWidth(200);
    vbox.setMaxWidth(Control.USE_PREF_SIZE);
    vbox.getChildren().add(new SearchBox());
    getChildren().add(vbox);
}
 
Example 5
Source Project: marathonv5   Source File: InsetTextButtonSample.java    License: Apache License 2.0 5 votes vote down vote up
public InsetTextButtonSample() {

        String insetTextCss = InsetTextButtonSample.class.getResource("InsetTextButton.css").toExternalForm();
        VBox vbox = VBoxBuilder.create().id("insettextvbox").spacing(10).padding(new Insets(10)).children(
                ButtonBuilder.create().text("Inset Text Button").id("button1").build(),
                ButtonBuilder.create().text("Plain Text Button").id("button2").build()).build();

        vbox.getStylesheets().add(insetTextCss);
        getChildren().add(vbox);
    }
 
Example 6
Source Project: marathonv5   Source File: SearchBoxSample.java    License: Apache License 2.0 5 votes vote down vote up
public SearchBoxSample() {
    String searchBoxCss = SearchBoxSample.class.getResource("SearchBox.css").toExternalForm();
    VBox vbox = VBoxBuilder.create().build();
    vbox.getStylesheets().add(searchBoxCss);
    vbox.setPrefWidth(200);
    vbox.setMaxWidth(Control.USE_PREF_SIZE);
    vbox.getChildren().add(new SearchBox());
    getChildren().add(vbox);
}
 
Example 7
Source Project: marathonv5   Source File: InsetTextButtonSample.java    License: Apache License 2.0 5 votes vote down vote up
public InsetTextButtonSample() {

        String insetTextCss = InsetTextButtonSample.class.getResource("InsetTextButton.css").toExternalForm();
        VBox vbox = VBoxBuilder.create().id("insettextvbox").spacing(10).padding(new Insets(10)).children(
                ButtonBuilder.create().text("Inset Text Button").id("button1").build(),
                ButtonBuilder.create().text("Plain Text Button").id("button2").build()).build();

        vbox.getStylesheets().add(insetTextCss);
        getChildren().add(vbox);
    }
 
Example 8
Source Project: netbeans   Source File: ColorPickerDemo.java    License: Apache License 2.0 5 votes vote down vote up
private void init(Stage primaryStage) {
    Group root = new Group();
    primaryStage.setScene(new Scene(root));
    final ColorPicker colorPicker = new ColorPicker(Color.GRAY);
    ToolBar standardToolbar = ToolBarBuilder.create().items(colorPicker).build();

    final Text coloredText = new Text("Colors");
    Font font = new Font(53);
    coloredText.setFont(font);
    final Button coloredButton = new Button("Colored Control");
    Color c = colorPicker.getValue();
    coloredText.setFill(c);
    coloredButton.setStyle(createRGBString(c));

    colorPicker.setOnAction(new EventHandler<ActionEvent>() {

        @Override
        public void handle(ActionEvent t) {
            Color newColor = colorPicker.getValue();
            coloredText.setFill(newColor);                          
            coloredButton.setStyle(createRGBString(newColor));
        }
    });

    VBox coloredObjectsVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(20).children(coloredText, coloredButton).build();        
    VBox outerVBox = VBoxBuilder.create().alignment(Pos.CENTER).spacing(150).padding(new Insets(0, 0, 120, 0)).children(standardToolbar, coloredObjectsVBox).build();
    root.getChildren().add(outerVBox);
}
 
Example 9
Source Project: marathonv5   Source File: StyledToolBarSample.java    License: Apache License 2.0 3 votes vote down vote up
public StyledToolBarSample() {
    ToolBar standardToolbar = createToolBar("standard");

    String styledToolBarCss = StyledToolBarSample.class.getResource("StyledToolBar.css").toExternalForm();
    
    ToolBar darkToolbar = createToolBar("dark");        
    darkToolbar.getStylesheets().add(styledToolBarCss);

    ToolBar blueToolbar = createToolBar("blue");
    blueToolbar.getStylesheets().add(styledToolBarCss);

    getChildren().add(VBoxBuilder.create().spacing(10).padding(new Insets(10)).children(standardToolbar, darkToolbar, blueToolbar).build());
}
 
Example 10
Source Project: marathonv5   Source File: StyledToolBarSample.java    License: Apache License 2.0 3 votes vote down vote up
public StyledToolBarSample() {
    ToolBar standardToolbar = createToolBar("standard");

    String styledToolBarCss = StyledToolBarSample.class.getResource("StyledToolBar.css").toExternalForm();
    
    ToolBar darkToolbar = createToolBar("dark");        
    darkToolbar.getStylesheets().add(styledToolBarCss);

    ToolBar blueToolbar = createToolBar("blue");
    blueToolbar.getStylesheets().add(styledToolBarCss);

    getChildren().add(VBoxBuilder.create().spacing(10).padding(new Insets(10)).children(standardToolbar, darkToolbar, blueToolbar).build());
}