Thread: [Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/treeview GenericTreeView.java, 1.112, 1.
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2007-09-27 08:33:36
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25056/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: First step in space propagation Refactored GenericTreeView sorting of children Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.112 retrieving revision 1.113 diff -C2 -d -r1.112 -r1.113 *** GenericTreeView.java 23 Sep 2007 18:20:22 -0000 1.112 --- GenericTreeView.java 27 Sep 2007 08:33:17 -0000 1.113 *************** *** 442,445 **** --- 442,446 ---- public class ContainerNode extends GenericNode { protected Collection< ? extends Entity> content; + private boolean sort; /** *************** *** 447,454 **** * @param object User collection to put in * @param label The label for the container node */ ! public ContainerNode(Object label, Collection< ? extends Entity> object) { super(label); this.content = object; } --- 448,457 ---- * @param object User collection to put in * @param label The label for the container node + * @param sort Sort the children? */ ! public ContainerNode(Object label, Collection< ? extends Entity> object, boolean sort) { super(label); this.content = object; + this.sort = sort; } *************** *** 525,529 **** } if (elements.size() > 0) { ! this.insertChildren(elements, true); } if (children.size() > 0) { --- 528,532 ---- } if (elements.size() > 0) { ! this.insertChildren(elements); } if (children.size() > 0) { *************** *** 538,544 **** * Insert a collection of Entity into this node * @param entities collection of Entity - * @param sort boolean that is true if the entities should be sorted */ ! public void insertChildren(Collection<? extends Entity> entities, boolean sort) { LinkedList<Entity> sorted = new LinkedList<Entity>(entities); if (sort) { --- 541,546 ---- * Insert a collection of Entity into this node * @param entities collection of Entity */ ! public void insertChildren(Collection<? extends Entity> entities) { LinkedList<Entity> sorted = new LinkedList<Entity>(entities); if (sort) { *************** *** 817,821 **** if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new ContainerNode("Relations", system.relations())); update(system); } --- 819,823 ---- if (constructor instanceof CoordinateSystem) { CoordinateSystem system = (CoordinateSystem) constructor; ! add(new ContainerNode("Relations", system.relations(), true)); update(system); } *************** *** 930,935 **** */ public SurfaceContainer(String name, Collection surfaces) { ! super(name, surfaces); ! insertChildren(surfaces, true); } --- 932,937 ---- */ public SurfaceContainer(String name, Collection surfaces) { ! super(name, surfaces, true); ! insertChildren(surfaces); } *************** *** 958,963 **** */ public ElementContainer(String name, Collection elements) { ! super(name, elements); ! insertChildren(elements, true); } --- 960,965 ---- */ public ElementContainer(String name, Collection elements) { ! super(name, elements, true); ! insertChildren(elements); } *************** *** 986,990 **** */ public GeometryContainer(String name, Space space) { ! super(name, null); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); --- 988,992 ---- */ public GeometryContainer(String name, Space space) { ! super(name, null, false); add(new SurfaceContainer("Surfaces", space.getSurfaces())); add(new EdgeContainer("Edges", space.getEdges())); *************** *** 1018,1023 **** */ public ConstructorContainer(String name, Collection constructors) { ! super(name, constructors); ! insertChildren(constructors, true); } --- 1020,1025 ---- */ public ConstructorContainer(String name, Collection constructors) { ! super(name, constructors, true); ! insertChildren(constructors); } *************** *** 1046,1051 **** */ public EdgeContainer(String name, Collection edges) { ! super(name, edges); ! insertChildren(edges, true); } --- 1048,1053 ---- */ public EdgeContainer(String name, Collection edges) { ! super(name, edges, true); ! insertChildren(edges); } *************** *** 1073,1078 **** */ public ProjectNode(Project p) { ! super(p, p.getSpaces()); ! insertChildren(p.getSpaces(), true); } --- 1075,1080 ---- */ public ProjectNode(Project p) { ! super(p, p.getSpaces(), true); ! insertChildren(p.getSpaces()); } *************** *** 1109,1113 **** */ public CameraNode(Camera c) { ! super(c, c.getClipplanes()); update(c); } --- 1111,1115 ---- */ public CameraNode(Camera c) { ! super(c, c.getClipplanes(), true); update(c); } *************** *** 1140,1145 **** */ public VertexContainer(String name, Collection vertices) { ! super(name, vertices); ! insertChildren(vertices, true); } --- 1142,1147 ---- */ public VertexContainer(String name, Collection vertices) { ! super(name, vertices, true); ! insertChildren(vertices); } *************** *** 1168,1173 **** */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object.getAttributes()); ! insertChildren(object.getAttributes(), true); } --- 1170,1175 ---- */ public ParameterBlockNode(String name, ParameterBlock object) { ! super(name, object.getAttributes(), true); ! insertChildren(object.getAttributes()); } *************** *** 1229,1233 **** */ public ConstraintContainer(String name, Collection constraints) { ! super(name, constraints); update(constraints); } --- 1231,1235 ---- */ public ConstraintContainer(String name, Collection constraints) { ! super(name, constraints, true); update(constraints); } *************** *** 1244,1248 **** */ public RelationContainer(List<Relation> relations) { ! super("Relations", relations); update(relations); } --- 1246,1250 ---- */ public RelationContainer(List<Relation> relations) { ! super("Relations", relations, true); update(relations); } *************** *** 1259,1263 **** */ public TransformationContainer(String name, Stack transforms) { ! super(name, transforms); update(transforms); } --- 1261,1265 ---- */ public TransformationContainer(String name, Stack transforms) { ! super(name, transforms, false); update(transforms); } |