/*
 * Copyright 2016 Speedment, Inc..
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.speedment.internal.ui.util;

import com.speedment.Speedment;
import com.speedment.component.UserInterfaceComponent;
import static com.speedment.util.StaticClassUtil.instanceNotAllowed;
import javafx.scene.Scene;
import javafx.scene.image.Image;
import javafx.stage.Stage;

/**
 *
 * @author Emil Forslund
 */
public final class BrandUtil {
    
    public static void applyBrand(Speedment speedment, Stage stage) {
        applyBrand(speedment, stage, stage.getScene());
    }
    
    public static void applyBrand(Speedment speedment, Stage stage, Scene scene) {
        final UserInterfaceComponent.Brand brand = speedment
            .getUserInterfaceComponent()
            .getBrand();

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

        speedment
            .getUserInterfaceComponent()
            .stylesheetFiles()
            .forEachOrdered(scene.getStylesheets()::add);
    }
    
    /**
     * Utility classes should not be instantiated.
     */
    private BrandUtil() {
        instanceNotAllowed(getClass());
    }
}
@@ -1211,45 +1211,23 @@
 nent
-.Brand brand = speedment%0A            
+ ui = speedment
 .get
@@ -1242,32 +1242,33 @@
 rfaceComponent()
+;
 %0A            .ge
@@ -1256,28 +1256,69 @@
 ();%0A        
-    
+final UserInterfaceComponent.Brand brand = ui
 .getBrand();
@@ -1473,71 +1473,10 @@
     
-speedment%0A            .getUserInterfaceComponent()%0A            
+ui
 .sty

Make applyBrand()method nicer