VisClient/org/hfbk/vis/visnode/VisScript.java

Go to the documentation of this file.
00001 package org.hfbk.vis.visnode;
00002 
00003 import org.dronus.graph.Node;
00004 import org.hfbk.util.Scripter.ScriptFunction;
00005 import org.hfbk.vis.VisClientScripter;
00006 import org.lwjgl.util.vector.Vector3f;
00007 
00008 public class VisScript extends VisNode {
00009         
00010         String script;
00011         
00012         VisClientScripter scripter;
00013         
00014         public VisScript(Node node, Vector3f position) {
00015                 super(node, position);
00016                 script=node.text;
00017                 
00018                 radius=Float.POSITIVE_INFINITY;
00019         }
00020         
00021         public void renderSelf() {
00022                 if (scripter==null && script!=null){
00023                         scripter= new VisClientScripter(getRoot().client);
00024                         scripter.put("node",this);
00025                         scripter.evaluate(";"+script+";\n");
00026                 }
00027                 
00028                 ScriptFunction renderFunc=scripter.getFunction("render");
00029                 if(renderFunc!=null)
00030                         renderFunc.call();
00031         }
00032 }

Generated on Tue Apr 7 17:57:22 2009 for visclient by  doxygen 1.5.1