Skip to content

Commit

Permalink
Create specific branding methods
Browse files Browse the repository at this point in the history
Sometimes you don't want the branding to apply to the entire stage but
only one scene.
  • Loading branch information
Emil Forslund committed Mar 29, 2016
1 parent 94acdfa commit 66f9227
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/java/com/speedment/internal/ui/util/BrandUtil.java
Expand Up @@ -33,14 +33,22 @@ public static void applyBrand(Speedment speedment, Stage stage) {
}

public static void applyBrand(Speedment speedment, Stage stage, Scene scene) {
applyBrandToStage(speedment, stage);
applyBrandToScene(speedment, scene);
}

public static void applyBrandToStage(Speedment speedment, Stage stage) {
final UserInterfaceComponent ui = speedment.getUserInterfaceComponent();
final UserInterfaceComponent.Brand brand = ui.getBrand();

stage.setTitle(brand.title());
brand.logoSmall()
.map(Image::new)
.ifPresent(stage.getIcons()::add);

}

public static void applyBrandToScene(Speedment speedment, Scene scene) {
final UserInterfaceComponent ui = speedment.getUserInterfaceComponent();
ui.stylesheetFiles()
.forEachOrdered(scene.getStylesheets()::add);
}
Expand Down

0 comments on commit 66f9227

Please sign in to comment.