[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/treeview GenericTreeView.java, 1.130, 1.
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-12-10 23:10:09
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv16854/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: experiment with display of envelope in treeview Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.130 retrieving revision 1.131 diff -C2 -d -r1.130 -r1.131 *** GenericTreeView.java 10 Dec 2007 18:45:06 -0000 1.130 --- GenericTreeView.java 10 Dec 2007 23:10:08 -0000 1.131 *************** *** 450,453 **** --- 450,461 ---- /** + * + * @param label Object + */ + public ContainerNode(Object label) { + super(label); + } + + /** * Constructor for ContainerNode * @param content User collection to put in *************** *** 459,462 **** --- 467,471 ---- this.content = content; this.sort = sort; + insertChildren(content); } *************** *** 637,644 **** private void makeContainerContent(Space space) { Set surfaces = space.getEnvelope(); ! add(new SurfaceContainer("Envelope", surfaces, false)); String lvlstr = Space.levelToString(space.getLevel() + 1); add(new ElementContainer(lvlstr + "s", space.getElements())); ! add(new GeometryNode("Geometry", space)); ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); --- 646,655 ---- private void makeContainerContent(Space space) { Set surfaces = space.getEnvelope(); ! add(new EnvelopeContainer("Envelope", space)); String lvlstr = Space.levelToString(space.getLevel() + 1); add(new ElementContainer(lvlstr + "s", space.getElements())); ! if (Project.doDisplayGeometry()) { ! add(new GeometryNode("Geometry", space)); ! } ContainerNode cn = new ConstructorContainer("Constructors", space.getConstructors()); add(cn); *************** *** 683,691 **** Space space = (Space)userObject; if (space.isContainer()) { ! ((GenericNode)getChildAt(0)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(1)).update(s.getElements()); ! ((GenericNode)getChildAt(2)).update(s); ! ((GenericNode)getChildAt(3)).update(s.getConstructors()); ! int placement = 4; if (s.getModellor() != null) { if (getChildCount() >= placement + 1) { --- 694,705 ---- Space space = (Space)userObject; if (space.isContainer()) { ! int inx = 0; ! ((GenericNode)getChildAt(inx++)).update(s.getEnvelope()); ! ((GenericNode)getChildAt(inx++)).update(s.getElements()); ! if (Project.doDisplayGeometry()) { ! ((GenericNode)getChildAt(inx++)).update(s); ! } ! ((GenericNode)getChildAt(inx++)).update(s.getConstructors()); ! int placement = inx; if (s.getModellor() != null) { if (getChildCount() >= placement + 1) { *************** *** 783,786 **** --- 797,838 ---- /** + * SurfaceNode + */ + public class EnvelopeNode extends EntityNode { + private Space space; + + /** + * Constructor for SurfaceNode + * @param surface The surface + * @param space Space + */ + public EnvelopeNode(Surface surface, Space space) { + super(surface); + this.space = space; + } + + /** + * {@inheritDoc} + */ + public String toString() { + Surface surface = (Surface) userObject; + Space other; + if (surface.getBackDomain() == space) { + other = surface.getFrontDomain(); + } else { + other = surface.getBackDomain(); + } + return surface.getName() + ": " + other.getDisplayName(); + } + + /** + * {@inheritDoc} + */ + public ImageIcon icon() { + return surfaceicon; + } + } + + /** * ConstructorNode */ *************** *** 900,904 **** public SurfaceContainer(String name, Collection surfaces, boolean sort) { super(name, surfaces, sort); - insertChildren(surfaces); } --- 952,955 ---- *************** *** 918,921 **** --- 969,1003 ---- /** + * SurfaceContainer + */ + public class EnvelopeContainer extends ContainerNode { + private Space space; + /** + * Constructor for SurfaceContainer + * @param name The name + * @param space Space + */ + public EnvelopeContainer(String name, Space space) { + super(name); + this.space = space; + this.content = space.getEnvelope(); + insertChildren(content); + } + + /** {@inheritDoc} */ + public EntityNode nodeFor(Object entity) { + return new EnvelopeNode((Surface) entity, space); + } + + /** + * Return icon + * @return Icon + */ + public ImageIcon icon() { + return surfacegroupicon; + } + } + + /** * ElementContainer */ *************** *** 928,932 **** public ElementContainer(String name, Collection elements) { super(name, elements, true); - insertChildren(elements); } --- 1010,1013 ---- *************** *** 991,995 **** public MaterialContainer(Object label, Collection<Material> object, boolean sort) { super(label, object, sort); - insertChildren(object); } --- 1072,1075 ---- *************** *** 1005,1009 **** /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new EntityNode((Material) entity); } --- 1085,1089 ---- /** {@inheritDoc} */ public EntityNode nodeFor(Object entity) { ! return new EntityNode(entity); } *************** *** 1040,1044 **** public ConstructorContainer(String name, Collection<Constructor> constructors) { super(name, constructors, true); - insertChildren(constructors); } --- 1120,1123 ---- *************** *** 1069,1073 **** public EdgeContainer(String name, Collection<Edge> edges, boolean sort) { super(name, edges, sort); - insertChildren(edges); } --- 1148,1151 ---- *************** *** 1096,1100 **** public ProjectNode(Project p) { super(p, p.getSpaces(), true); - insertChildren(p.getSpaces()); } --- 1174,1177 ---- *************** *** 1133,1137 **** public ComponentContainer(String name, Collection<Component> content) { super(name, content, false); - insertChildren(content); } --- 1210,1213 ---- *************** *** 1208,1212 **** public CameraNode(Camera c) { super(c, c.getClipplanes(), true); - insertChildren(c.getClipplanes()); } --- 1284,1287 ---- *************** *** 1236,1240 **** public VertexContainer(String name, Collection vertices, boolean sort) { super(name, vertices, sort); - insertChildren(vertices); } --- 1311,1314 ---- *************** *** 1264,1268 **** public ParameterBlockNode(String name, ParameterBlock object) { super(name, object.getAttributes(), true); - insertChildren(object.getAttributes()); } --- 1338,1341 ---- *************** *** 1325,1329 **** public ConstraintContainer(String name, Collection constraints) { super(name, constraints, true); - insertChildren(constraints); } } --- 1398,1401 ---- *************** *** 1340,1344 **** public RelationContainer(List<Relation> relations) { super("Relations", relations, true); - insertChildren(relations); } } --- 1412,1415 ---- |