[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Constraint.java, 1.3, 1.4 Line.java,
Status: Pre-Alpha
Brought to you by:
henryml
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv9629/src/net/sourceforge/bprocessor/model Modified Files: Constraint.java Line.java Camera.java Space.java Point.java Project.java CoordinateSystem.java Log Message: Changed the Tree view to update by recursive calls to keep selection and all open paths, as well as refactoring of the generictreeview structure Made all remove methods private in the model and let delete methods call remove and afterwards make a changed event. Index: CoordinateSystem.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/CoordinateSystem.java,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** CoordinateSystem.java 8 Sep 2006 13:25:59 -0000 1.27 --- CoordinateSystem.java 29 Sep 2006 14:57:24 -0000 1.28 *************** *** 310,314 **** */ public void delete() { ! getOwner().delete(this); } --- 310,314 ---- */ public void delete() { ! getOwner().remove(this); } Index: Camera.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Camera.java,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** Camera.java 29 Aug 2006 08:49:25 -0000 1.22 --- Camera.java 29 Sep 2006 14:57:24 -0000 1.23 *************** *** 99,102 **** --- 99,107 ---- new double[]{c.roll[0], c.roll[1], c.roll[2]}, c.getType()); this.setFocalwidth(c.getFocalwidth()); + Iterator clips = c.getClipplanes().iterator(); + while(clips.hasNext()) { + ClippingPlane clip = (ClippingPlane)clips.next(); + this.addClipplane(clip); + } } Index: Point.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Point.java,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** Point.java 18 Sep 2006 14:10:07 -0000 1.10 --- Point.java 29 Sep 2006 14:57:24 -0000 1.11 *************** *** 49,53 **** */ public void delete() { ! getOwner().delete(this); } --- 49,53 ---- */ public void delete() { ! getOwner().remove(this); } Index: Constraint.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Constraint.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Constraint.java 12 Apr 2006 14:29:27 -0000 1.3 --- Constraint.java 29 Sep 2006 14:57:24 -0000 1.4 *************** *** 121,125 **** */ public void delete() { ! Project.getInstance().remove(this); } } --- 121,125 ---- */ public void delete() { ! Project.getInstance().delete(this); } } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.75 retrieving revision 1.76 diff -C2 -d -r1.75 -r1.76 *** Project.java 26 Sep 2006 09:52:24 -0000 1.75 --- Project.java 29 Sep 2006 14:57:24 -0000 1.76 *************** *** 243,251 **** Object next = iter.next(); if (next instanceof Edge) { ! world.delete((Edge)next); } else if (next instanceof Surface) { ! delete((Surface)next); } else if (next instanceof Vertex) { ! world.delete((Vertex)next); } else if (next instanceof Space) { remove((Space)next); --- 243,251 ---- Object next = iter.next(); if (next instanceof Edge) { ! remove((Edge)next); } else if (next instanceof Surface) { ! remove((Surface)next); } else if (next instanceof Vertex) { ! remove((Vertex)next); } else if (next instanceof Space) { remove((Space)next); *************** *** 268,278 **** /** ! * Remove a constraint * @param constraint The constraint to remove */ ! public void remove(Constraint constraint) { constraints.remove(constraint); constraint.setId(null); - changed(this); } --- 268,286 ---- /** ! * Remove a constraint and call change * @param constraint The constraint to remove */ ! public void delete(Constraint constraint) { ! remove(constraint); ! changed(this); ! } ! ! /** ! * Remove a constraint dont call change ! * @param constraint The constraint to remove ! */ ! private void remove(Constraint constraint) { constraints.remove(constraint); constraint.setId(null); } *************** *** 369,372 **** --- 377,381 ---- public void add(Space space) { world.add(space); + changed(this); } *************** *** 409,426 **** */ public void delete(Edge edge) { ! world.delete(edge); changed(this); } ! ! /** ! * Remove an edge * @param edge The edge */ ! public void remove(Edge edge) { ! world.delete(edge); ! changed(this); } ! /** * Find all edges --- 418,437 ---- */ public void delete(Edge edge) { ! remove(edge); changed(this); } ! /** ! * Remove an Edge * @param edge The edge */ ! private void remove(Edge edge) { ! if (edge.getOwner() != null) { ! edge.getOwner().delete(edge); ! } else { ! log.warn("Owner were null on " + edge); ! } } ! /** * Find all edges *************** *** 432,444 **** /** ! * Remove a space * @param space The space to remove */ ! public void remove(Space space) { ! world.remove(space); } /** ! * Delete a space * @param space The space to delete */ --- 443,459 ---- /** ! * Remove a space dont call changed * @param space The space to remove */ ! private void remove(Space space) { ! if (space.getOwner() != null) { ! space.getOwner().remove(space); ! } else { ! log.warn("Owner were null on " + space); ! } } /** ! * Delete a space and call changed * @param space The space to delete */ *************** *** 478,484 **** * @param surface The surface */ ! public void remove(Surface surface) { ! world.remove(surface); ! changed(this); } --- 493,498 ---- * @param surface The surface */ ! private void remove(Surface surface) { ! surface.delete(); } *************** *** 488,492 **** */ public void delete(Surface surface) { ! surface.delete(); changed(this); } --- 502,506 ---- */ public void delete(Surface surface) { ! remove(surface); changed(this); } *************** *** 520,537 **** /** ! * Remove a vertex * @param vertex The vertex */ ! public void remove(Vertex vertex) { ! world.remove(vertex); ! changed(this); } /** ! * Delete a vertex * @param vertex The vertex to delete */ public void delete(Vertex vertex) { ! world.delete(vertex); changed(this); } --- 534,552 ---- /** ! * Remove a vertex dont call changed * @param vertex The vertex */ ! private void remove(Vertex vertex) { ! if (vertex.getOwner() != null) { ! vertex.getOwner().delete(vertex); ! } } /** ! * Delete a vertex and call changed * @param vertex The vertex to delete */ public void delete(Vertex vertex) { ! remove(vertex); changed(this); } *************** *** 555,572 **** /** ! * Remove a material * @param material The material */ ! public void remove(Material material) { world.remove(material); - changed(this); } /** ! * Delete a material * @param material The material to delete */ public void delete(Material material) { ! world.delete(material); changed(this); } --- 570,586 ---- /** ! * Remove a material dont call changed * @param material The material */ ! private void remove(Material material) { world.remove(material); } /** ! * Delete a material call changed * @param material The material to delete */ public void delete(Material material) { ! remove(material); changed(this); } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.68 retrieving revision 1.69 diff -C2 -d -r1.68 -r1.69 *** Space.java 29 Sep 2006 07:13:00 -0000 1.68 --- Space.java 29 Sep 2006 14:57:24 -0000 1.69 *************** *** 428,434 **** */ public void remove(Constructor c) { ! constructors.remove(c.getId()); ! c.setId(null); ! c.setOwner(null); } --- 428,436 ---- */ public void remove(Constructor c) { ! if (c.getId() != null && c != Project.getInstance().getActiveCoordinateSystem()) { ! constructors.remove(c.getId()); ! c.setId(null); ! c.setOwner(null); ! } } *************** *** 444,457 **** /** - * Delete a constructor - * @param c The constructor - */ - public void delete(Constructor c) { - if (c.getId() != null && c != Project.getInstance().getActiveCoordinateSystem()) { - remove(c); - } - } - - /** * Return the constructors * @return The constructors --- 446,449 ---- Index: Line.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Line.java,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** Line.java 18 Sep 2006 14:35:47 -0000 1.25 --- Line.java 29 Sep 2006 14:57:24 -0000 1.26 *************** *** 115,119 **** */ public void delete() { ! getOwner().delete(this); } --- 115,119 ---- */ public void delete() { ! getOwner().remove(this); } |