[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/treeview GenericTreeView.java, 1.149, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2010-05-21 07:29:02
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18752/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java SpaceTreeView.java Log Message: Added scripts to spaces Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.149 retrieving revision 1.150 diff -C2 -d -r1.149 -r1.150 *** GenericTreeView.java 20 May 2010 10:58:39 -0000 1.149 --- GenericTreeView.java 21 May 2010 07:28:54 -0000 1.150 *************** *** 38,41 **** --- 38,42 ---- import org.apache.log4j.Logger; + import net.sourceforge.bprocessor.model.Command; import net.sourceforge.bprocessor.model.Item; import net.sourceforge.bprocessor.model.Attribute; *************** *** 728,731 **** --- 729,733 ---- CompositeNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); + add(new ScriptContainer("Scripts", space.getScripts(), false)); if (Project.doDisplayGeometry()) { add(new GeometryNode("Geometry", space)); *************** *** 750,753 **** --- 752,756 ---- ((GenericNode)getChildAt(inx++)).update(space); } + ((GenericNode)getChildAt(inx++)).update(space.getScripts()); int placement = inx; *************** *** 981,984 **** --- 984,1028 ---- /** + * Script container + */ + public class ScriptContainer extends CompositeNode { + /** + * Constructor for ScriptContainer + * @param name The name + * @param scripts The scripts + * @param sort boolean + */ + public ScriptContainer(String name, Collection scripts, boolean sort) { + super(name, scripts, sort); + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + return new ScriptNode((Command) entity); + } + + /** + * Return icon + * @return Icon + */ + public ImageIcon icon() { + return surfacegroupicon; + } + } + + /** + * ScriptNode + */ + public class ScriptNode extends EntityNode { + /** + * Constructor for ScriptNode + * @param command The command + */ + public ScriptNode(Command command) { + super(command); + } + } + + /** * SurfaceContainer */ Index: SpaceTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SpaceTreeView.java,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** SpaceTreeView.java 26 Apr 2010 09:30:33 -0000 1.35 --- SpaceTreeView.java 21 May 2010 07:28:54 -0000 1.36 *************** *** 35,38 **** --- 35,39 ---- root.add(new ProjectNode(p)); root.add(new ConstructorContainer("Constructors", p.getConstructors())); + root.add(new ScriptContainer("Scripts", p.world().getScripts(), false)); root.add(new ComponentContainer("Catalog", p.getCatalogObjects())); if (Project.SENSE) { *************** *** 54,60 **** ((GenericNode)root.getChildAt(0)).update(p); ((GenericNode)root.getChildAt(1)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(2)).update(p.getCatalogObjects()); if (Project.SENSE) { ! ((GenericNode)root.getChildAt(3)).update(p.sensor()); } } catch (ArrayIndexOutOfBoundsException e) { --- 55,62 ---- ((GenericNode)root.getChildAt(0)).update(p); ((GenericNode)root.getChildAt(1)).update(p.getConstructors()); ! ((GenericNode)root.getChildAt(2)).update(p.world().getScripts()); ! ((GenericNode)root.getChildAt(3)).update(p.getCatalogObjects()); if (Project.SENSE) { ! ((GenericNode)root.getChildAt(4)).update(p.sensor()); } } catch (ArrayIndexOutOfBoundsException e) { |