package com.odelia.javafx import javafx.scene.Group import javafx.scene.Scene import groovyx.javafx.factory.* import insidefx.undecorator.UndecoratorScene /** * * @author bgoetzmann */ class UndecoratedSceneFactory extends SceneFactory { UndecoratedSceneFactory() { super(Scene) } UndecoratedSceneFactory(Class beanClass) { super(beanClass) } public Object newInstance(FactoryBuilderSupport builder, Object name, Object value, Map attributes) throws InstantiationException, IllegalAccessException { Scene scene if (checkValue(name, value)) { scene = value } else { def root = attributes.remove("root") if(root == null) { root = new Group() syntheticRoot = true } scene = new UndecoratorScene(builder.primaryStage, root) } def id = attributes.remove("id") if(id != null) builder.getVariables().put(id, scene) return scene } }