[Bprocessor-commit] gl/src/net/sourceforge/bprocessor/gl/tool AbstractTool.java,1.2,1.3 DrawTool.jav
Status: Pre-Alpha
Brought to you by:
henryml
From: Jesper P. <je...@us...> - 2005-07-28 06:56:04
|
Update of /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9078/src/net/sourceforge/bprocessor/gl/tool Modified Files: AbstractTool.java DrawTool.java Log Message: Use new facades in model Index: AbstractTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/AbstractTool.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** AbstractTool.java 27 Jul 2005 11:04:32 -0000 1.2 --- AbstractTool.java 28 Jul 2005 06:55:56 -0000 1.3 *************** *** 257,261 **** Vertex v = new Vertex("V" + vertexNum); vertexNum++; ! VertexFacade.getInstance().add(v); v.setX(coord[0]); --- 257,261 ---- Vertex v = new Vertex("V" + vertexNum); vertexNum++; ! v = VertexFacade.getInstance().create(v); v.setX(coord[0]); *************** *** 263,266 **** --- 263,268 ---- v.setZ(coord[2]); + VertexFacade.getInstance().update(v); + Notification n = new Notification(Notification.VERTEX_CREATED, v.getId()); Notifier.getInstance().sendNotification(n); *************** *** 284,287 **** --- 286,291 ---- v.setZ(coord[2]); + VertexFacade.getInstance().update(v); + Notification n = new Notification(Notification.VERTEX_MODIFIED, v.getId()); Notifier.getInstance().sendNotification(n); *************** *** 296,303 **** */ protected void removeVertex(Vertex v) { - VertexFacade.getInstance().remove(v); - Notification n = new Notification(Notification.VERTEX_DELETED, v.getId()); Notifier.getInstance().sendNotification(n); } --- 300,307 ---- */ protected void removeVertex(Vertex v) { Notification n = new Notification(Notification.VERTEX_DELETED, v.getId()); Notifier.getInstance().sendNotification(n); + + VertexFacade.getInstance().remove(v); } *************** *** 311,319 **** Edge e = new Edge("E" + edgeNum); edgeNum++; ! EdgeFacade.getInstance().add(e); e.setTo(to); e.setFrom(from); Notification n = new Notification(Notification.EDGE_CREATED, e.getId()); Notifier.getInstance().sendNotification(n); --- 315,325 ---- Edge e = new Edge("E" + edgeNum); edgeNum++; ! e = EdgeFacade.getInstance().create(e); e.setTo(to); e.setFrom(from); + EdgeFacade.getInstance().update(e); + Notification n = new Notification(Notification.EDGE_CREATED, e.getId()); Notifier.getInstance().sendNotification(n); *************** *** 327,330 **** --- 333,338 ---- */ protected void updateEdge(Edge e) { + EdgeFacade.getInstance().update(e); + Notification n = new Notification(Notification.EDGE_MODIFIED, e.getId()); Notifier.getInstance().sendNotification(n); *************** *** 339,346 **** Surface s = new Surface("S" + surfaceNum); surfaceNum++; ! SurfaceFacade.getInstance().add(s); s.setEdges(set); Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); Notifier.getInstance().sendNotification(n); --- 347,356 ---- Surface s = new Surface("S" + surfaceNum); surfaceNum++; ! s = SurfaceFacade.getInstance().create(s); s.setEdges(set); + SurfaceFacade.getInstance().update(s); + Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); Notifier.getInstance().sendNotification(n); Index: DrawTool.java =================================================================== RCS file: /cvsroot/bprocessor/gl/src/net/sourceforge/bprocessor/gl/tool/DrawTool.java,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** DrawTool.java 27 Jul 2005 10:59:56 -0000 1.3 --- DrawTool.java 28 Jul 2005 06:55:56 -0000 1.4 *************** *** 116,120 **** if (to != null) { // we have to change excisting surface ! removeVertex(activeEdge.getTo()); activeEdge.setTo(to); updateEdge(activeEdge); --- 116,125 ---- if (to != null) { // we have to change excisting surface ! Vertex old = activeEdge.getTo(); ! ! activeEdge.setTo(null); ! updateEdge(activeEdge); ! removeVertex(old); ! activeEdge.setTo(to); updateEdge(activeEdge); *************** *** 138,142 **** Vertex from = vertexCollide(coord); if (from == null) { - log.info("[addEdge] made new from"); from = createVertex(coord); } --- 143,146 ---- |