[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/treeview GenericTreeView.java, 1.79, 1.8
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2007-03-08 14:47:27
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19174/src/net/sourceforge/bprocessor/gui/treeview Modified Files: GenericTreeView.java Log Message: Genericityfied insertChildren/removeChildren too Index: GenericTreeView.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/GenericTreeView.java,v retrieving revision 1.79 retrieving revision 1.80 diff -C2 -d -r1.79 -r1.80 *** GenericTreeView.java 8 Mar 2007 14:38:28 -0000 1.79 --- GenericTreeView.java 8 Mar 2007 14:47:26 -0000 1.80 *************** *** 446,451 **** * @param children the children to remove */ ! protected void removeChildren(Collection children) { ! Object[] rem = new Object[children.size()]; int[] indices = new int[children.size()]; int i = 0; --- 446,451 ---- * @param children the children to remove */ ! protected void removeChildren(Collection<GenericNode> children) { ! GenericNode[] rem = new GenericNode[children.size()]; int[] indices = new int[children.size()]; int i = 0; *************** *** 459,463 **** } for (int k = 0; k < rem.length; k++) { ! this.remove((GenericNode)rem[k]); } if (rem.length > 0) { --- 459,463 ---- } for (int k = 0; k < rem.length; k++) { ! this.remove(rem[k]); } if (rem.length > 0) { *************** *** 502,513 **** * @param entities collection of Entity */ ! public void insertChildren(Collection entities) { LinkedList sorted = new LinkedList(entities); Entity.sort(sorted); int[] ins = new int[sorted.size()]; int i = 0; ! Iterator iter = sorted.iterator(); ! while (iter.hasNext()) { ! this.add(new EntityNode(iter.next())); ins[i] = this.getChildCount() - 1; i++; --- 502,512 ---- * @param entities collection of Entity */ ! public void insertChildren(Collection<Entity> entities) { LinkedList sorted = new LinkedList(entities); Entity.sort(sorted); int[] ins = new int[sorted.size()]; int i = 0; ! for (Entity current : entities) { ! this.add(new EntityNode(current)); ins[i] = this.getChildCount() - 1; i++; |