xworker.javafx.scene.shape.SphereActions Maven / Gradle / Ivy
package xworker.javafx.scene.shape;
import javafx.scene.shape.Sphere;
import org.xmeta.ActionContext;
import org.xmeta.Thing;
import xworker.javafx.beans.property.PropertyFactory;
public class SphereActions {
static{
PropertyFactory.regist(Sphere.class, "radiusProperty", o -> {
Sphere obj = (Sphere) o;
return obj.radiusProperty();
});
}
public static void init(Sphere node, Thing thing, ActionContext actionContext){
Shape3DActions.init(node, thing, actionContext);
if(thing.valueExists("radius")){
node.setRadius(thing.getDouble("radius"));
}
}
public static Sphere create(ActionContext actionContext){
Thing self = actionContext.getObject("self");
Sphere node = new Sphere();
init(node, self, actionContext);
actionContext.g().put(self.getMetadata().getName(), node);
actionContext.peek().put("parent", node);
for(Thing child : self.getChilds()){
child.doAction("create", actionContext);
}
return node;
}
}