Search in sources :

Example 81 with Background

use of javafx.scene.layout.Background in project Board-Instrumentation-Framework by intel.

the class Demo method init.

@Override
public void init() {
    frontPanel = new StackPane();
    frontPanel.setBackground(new Background(new BackgroundFill(Color.AQUAMARINE, CornerRadii.EMPTY, Insets.EMPTY)));
    flipPanel = new FlipPanel(Orientation.VERTICAL);
    flipPanel.getFront().getChildren().add(initFront(flipPanel, frontPanel));
    flipPanel.getBack().getChildren().add(initBack(flipPanel, frontPanel));
    flipPanel.addEventHandler(FlipEvent.FLIP_TO_FRONT_FINISHED, event -> System.out.println("Flip to front finished"));
    flipPanel.addEventHandler(FlipEvent.FLIP_TO_BACK_FINISHED, event -> System.out.println("Flip to back finished"));
}
Also used : Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) StackPane(javafx.scene.layout.StackPane)

Example 82 with Background

use of javafx.scene.layout.Background in project Board-Instrumentation-Framework by intel.

the class Demo method initBack.

private Pane initBack(final FlipPanel flipPanel, final StackPane FRONT_PANEL) {
    Region backButton = new Region();
    backButton.getStyleClass().add("back-button");
    backButton.addEventHandler(MouseEvent.MOUSE_CLICKED, EVENT -> flipPanel.flipToFront());
    ToggleGroup group = new ToggleGroup();
    final RadioButton standardGreen = new RadioButton("Green");
    standardGreen.setToggleGroup(group);
    standardGreen.setSelected(true);
    standardGreen.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.GREEN, CornerRadii.EMPTY, Insets.EMPTY))));
    final RadioButton amber = new RadioButton("Red");
    amber.setToggleGroup(group);
    amber.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.RED, CornerRadii.EMPTY, Insets.EMPTY))));
    final RadioButton blueDarkBlue = new RadioButton("Blue");
    blueDarkBlue.setToggleGroup(group);
    blueDarkBlue.setOnAction(event -> FRONT_PANEL.setBackground(new Background(new BackgroundFill(Color.BLUE, CornerRadii.EMPTY, Insets.EMPTY))));
    VBox componentsBack = new VBox(backButton, standardGreen, amber, blueDarkBlue);
    componentsBack.setSpacing(10);
    StackPane back = new StackPane();
    back.setPadding(new Insets(20, 20, 20, 20));
    back.getStyleClass().add("panel");
    back.getChildren().addAll(componentsBack);
    return back;
}
Also used : Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) ToggleGroup(javafx.scene.control.ToggleGroup) BackgroundFill(javafx.scene.layout.BackgroundFill) Region(javafx.scene.layout.Region) RadioButton(javafx.scene.control.RadioButton) VBox(javafx.scene.layout.VBox) StackPane(javafx.scene.layout.StackPane)

Example 83 with Background

use of javafx.scene.layout.Background in project Board-Instrumentation-Framework by intel.

the class Demo method start.

@Override
public void start(Stage stage) {
    BorderPane pane = new BorderPane(flipPanel);
    pane.setPrefSize(400, 250);
    pane.setPadding(new Insets(50, 50, 50, 50));
    pane.setBackground(new Background(new BackgroundFill(Color.rgb(68, 68, 68), CornerRadii.EMPTY, Insets.EMPTY)));
    PerspectiveCamera camera = new PerspectiveCamera(false);
    camera.setFieldOfView(20);
    Scene scene = new Scene(pane);
    scene.setCamera(camera);
    scene.getStylesheets().add(Demo.class.getResource("styles.css").toExternalForm());
    stage.setTitle("FlipPanel Demo");
    stage.setScene(scene);
    stage.show();
}
Also used : BorderPane(javafx.scene.layout.BorderPane) Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) PerspectiveCamera(javafx.scene.PerspectiveCamera) Scene(javafx.scene.Scene)

Example 84 with Background

use of javafx.scene.layout.Background in project Board-Instrumentation-Framework by intel.

the class DemoAvGauge method start.

@Override
public void start(Stage stage) throws Exception {
    HBox pane = new HBox();
    pane.setPadding(new Insets(10, 10, 10, 10));
    pane.setSpacing(10);
    pane.getChildren().addAll(gauge);
    pane.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY)));
    final Scene scene = new Scene(pane, Color.BLACK);
    // scene.setFullScreen(true);
    stage.setTitle("AvGauge");
    stage.setScene(scene);
    stage.show();
    timer.start();
    calcNoOfNodes(scene.getRoot());
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) Scene(javafx.scene.Scene)

Example 85 with Background

use of javafx.scene.layout.Background in project Board-Instrumentation-Framework by intel.

the class Demo method start.

@Override
public void start(Stage stage) {
    HBox lcd = new HBox();
    lcd.setPadding(new Insets(15, 15, 15, 15));
    lcd.setBackground(new Background(new BackgroundFill(Color.BLACK, CornerRadii.EMPTY, Insets.EMPTY)));
    lcd.setSpacing(10);
    lcd.setAlignment(Pos.CENTER);
    lcd.setFillHeight(false);
    HBox.setMargin(seg3, new Insets(0, 20, 0, 0));
    lcd.getChildren().addAll(seg0, seg1, seg2, seg3);
    /*
        for (int i = 0 ; i < 256 ; i++) {
            System.out.println(i + "   :   " + Character.toString((char) i));
        }
        */
    StackPane pane = new StackPane();
    pane.getChildren().setAll(lcd);
    Scene scene = new Scene(pane, Color.BLACK);
    stage.setTitle("SevenSegment DemoGauge");
    stage.setScene(scene);
    stage.show();
    timer.start();
}
Also used : HBox(javafx.scene.layout.HBox) Insets(javafx.geometry.Insets) Background(javafx.scene.layout.Background) BackgroundFill(javafx.scene.layout.BackgroundFill) Scene(javafx.scene.Scene) StackPane(javafx.scene.layout.StackPane)

Aggregations

Background (javafx.scene.layout.Background)86 BackgroundFill (javafx.scene.layout.BackgroundFill)82 Insets (javafx.geometry.Insets)30 CornerRadii (javafx.scene.layout.CornerRadii)24 Scene (javafx.scene.Scene)18 StackPane (javafx.scene.layout.StackPane)15 Color (javafx.scene.paint.Color)15 Label (javafx.scene.control.Label)14 Border (javafx.scene.layout.Border)14 BorderStroke (javafx.scene.layout.BorderStroke)14 BorderWidths (javafx.scene.layout.BorderWidths)12 Pane (javafx.scene.layout.Pane)12 Text (javafx.scene.text.Text)9 BorderPane (javafx.scene.layout.BorderPane)8 Region (javafx.scene.layout.Region)8 HBox (javafx.scene.layout.HBox)7 ArrayList (java.util.ArrayList)6 MouseEvent (javafx.scene.input.MouseEvent)6 VBox (javafx.scene.layout.VBox)6 Rectangle (javafx.scene.shape.Rectangle)5