Search in sources :

Example 1 with BackgroundImage

use of javafx.scene.layout.BackgroundImage in project Smartcity-Smarthouse by TechnionYP5777.

the class MainSystemGuiController method init.

@Override
public void init(final SystemCore model, final URL location, final ResourceBundle __) {
    try {
        // home tab:
        homeTab.setContent(homeTabHBox);
        homePageImageView.setImage(new Image(getClass().getResourceAsStream("/icons/smarthouse-icon-logo.png")));
        homePageImageView.setFitHeight(200);
        // homePageImageView.fitHeightProperty().bind(homeTabHBox.heightProperty().divide(2));
        final BackgroundImage myBI = new BackgroundImage(new Image(getClass().getResourceAsStream("/backgrounds/bg_4.png"), 0, 200, false, false), BackgroundRepeat.REPEAT, BackgroundRepeat.NO_REPEAT, BackgroundPosition.DEFAULT, BackgroundSize.DEFAULT);
        homeTabHBox.setBackground(new Background(myBI));
        // user tab:
        userTab.setContent(createChildPresenter("user information.fxml").getRootViewNode());
        // sensors tab:
        sensorsTab.setContent(createChildPresenter("house_mapping.fxml").getRootViewNode());
        // applications tab:
        appsPresenterInfo = createChildPresenter("application_view.fxml");
        appsTab.setContent(appsPresenterInfo.getRootViewNode());
    } catch (final Exception ¢) {
        ¢.printStackTrace();
    }
}
Also used : BackgroundImage(javafx.scene.layout.BackgroundImage) Background(javafx.scene.layout.Background) BackgroundImage(javafx.scene.layout.BackgroundImage) Image(javafx.scene.image.Image)

Aggregations

Image (javafx.scene.image.Image)1 Background (javafx.scene.layout.Background)1 BackgroundImage (javafx.scene.layout.BackgroundImage)1