[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Surface.java,1.62,1.63 Space.java,1.1
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2006-01-04 14:30:19
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21879/src/net/sourceforge/bprocessor/model Modified Files: Surface.java Space.java Project.java Log Message: Replaced created/remove/modified from Notifier with changed/update Index: Surface.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Surface.java,v retrieving revision 1.62 retrieving revision 1.63 diff -C2 -d -r1.62 -r1.63 *** Surface.java 22 Dec 2005 10:35:01 -0000 1.62 --- Surface.java 4 Jan 2006 14:30:07 -0000 1.63 *************** *** 533,538 **** } } ! Project.getInstance().update(this); ! Project.getInstance().update(hole); } --- 533,538 ---- } } ! changed(); ! hole.changed(); } *************** *** 616,620 **** } } ! Project.getInstance().update(this); } --- 616,620 ---- } } ! changed(); } *************** *** 700,704 **** backDomain.addSurface(this); } ! Project.getInstance().update(this); } } --- 700,704 ---- backDomain.addSurface(this); } ! changed(); } } *************** *** 727,731 **** frontDomain.addSurface(this); } ! Project.getInstance().update(this); } } --- 727,731 ---- frontDomain.addSurface(this); } ! changed(); } } Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** Space.java 3 Jan 2006 10:52:57 -0000 1.11 --- Space.java 4 Jan 2006 14:30:07 -0000 1.12 *************** *** 137,141 **** } surfaces.add(surface); ! Project.getInstance().update(this); } --- 137,141 ---- } surfaces.add(surface); ! changed(); } *************** *** 149,153 **** if (s != null && s.contains(surface)) { s.remove(surface); ! Project.getInstance().update(this); return true; } --- 149,153 ---- if (s != null && s.contains(surface)) { s.remove(surface); ! changed(); return true; } Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** Project.java 3 Jan 2006 13:23:22 -0000 1.14 --- Project.java 4 Jan 2006 14:30:07 -0000 1.15 *************** *** 14,20 **** import java.util.Set; - import net.sourceforge.bprocessor.kernel.notification.Notification; - import net.sourceforge.bprocessor.kernel.notification.Notifier; - import org.apache.log4j.Logger; /** --- 14,17 ---- *************** *** 87,90 **** --- 84,88 ---- public void clear() { DatabaseFacade.getInstance().clear(); + changed(this); } /** *************** *** 97,108 **** /** - * Update an attribute - * @param a The attribute - */ - public void update(Attribute a) { - DatabaseFacade.getInstance().update(a); - } - - /** * Remove an attribute * @param a The attribute --- 95,98 ---- *************** *** 140,145 **** public void intern(ConstructionSpace c) { DatabaseFacade.getInstance().intern((Object) c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, c.getId()); ! Notifier.getInstance().sendNotification(n); } --- 130,134 ---- public void intern(ConstructionSpace c) { DatabaseFacade.getInstance().intern((Object) c); ! changed(this); } *************** *** 149,153 **** */ public void remove(ConstructionSpace c) { - // setting references to this space to null Set surfaces = c.getSurfaces(); if (surfaces != null) { --- 138,141 ---- *************** *** 158,167 **** if (back == c) { surface.setBackDomain(null); - update(surface); } else { Space front = surface.getFrontDomain(); if (front == c) { surface.setFrontDomain(null); - update(surface); } } --- 146,153 ---- *************** *** 169,174 **** } DatabaseFacade.getInstance().remove(c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_DELETED, c.getId()); ! Notifier.getInstance().sendNotification(n); } --- 155,159 ---- } DatabaseFacade.getInstance().remove(c); ! changed(this); } *************** *** 191,212 **** /** - * Update the Domain - * @param domain The domain to update - */ - public void update(Space domain) { - if (domain instanceof ConstructionSpace) { - DatabaseFacade.getInstance().update((ConstructionSpace)domain); - Notification n = new Notification(Notification.CONSTRUCTION_SPACE_MODIFIED, domain.getId()); - Notifier.getInstance().sendNotification(n); - } else if (domain instanceof FunctionalSpace) { - DatabaseFacade.getInstance().update((FunctionalSpace)domain); - Notification n = new Notification(Notification.FUNCTIONAL_SPACE_MODIFIED, domain.getId()); - Notifier.getInstance().sendNotification(n); - } else { - log.error("Unsupported type: " + domain.getClass().getName()); - } - } - - /** * Find all domains * @return the set of all domains --- 176,179 ---- *************** *** 231,246 **** public void intern(Edge e) { DatabaseFacade.getInstance().intern((Object) e); ! Notification n = new Notification(Notification.EDGE_CREATED, e.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update an edge ! * @param e The edge ! */ ! public void update(Edge e) { ! DatabaseFacade.getInstance().update(e); ! Notification n = new Notification(Notification.EDGE_MODIFIED, e.getId()); ! Notifier.getInstance().sendNotification(n); } --- 198,202 ---- public void intern(Edge e) { DatabaseFacade.getInstance().intern((Object) e); ! changed(this); } *************** *** 251,256 **** public void remove(Edge e) { DatabaseFacade.getInstance().remove(e); ! Notification n = new Notification(Notification.EDGE_DELETED, e.getId()); ! Notifier.getInstance().sendNotification(n); } --- 207,211 ---- public void remove(Edge e) { DatabaseFacade.getInstance().remove(e); ! changed(this); } *************** *** 278,283 **** public void intern(FunctionalSpace f) { DatabaseFacade.getInstance().intern((Object) f); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_CREATED, f.getId()); ! Notifier.getInstance().sendNotification(n); } --- 233,237 ---- public void intern(FunctionalSpace f) { DatabaseFacade.getInstance().intern((Object) f); ! changed(this); } *************** *** 287,291 **** */ public void remove(Space space) { - // setting references to this space to null Set surfaces = space.getSurfaces(); if (surfaces != null) { --- 241,244 ---- *************** *** 307,312 **** } DatabaseFacade.getInstance().remove(space); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DELETED, space.getId()); ! Notifier.getInstance().sendNotification(n); } --- 260,264 ---- } DatabaseFacade.getInstance().remove(space); ! changed(this); } *************** *** 316,320 **** */ public void remove(FunctionalSpace f) { - // setting references to this space to null Set surfaces = f.getSurfaces(); if (surfaces != null) { --- 268,271 ---- *************** *** 336,341 **** } DatabaseFacade.getInstance().remove(f); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DELETED, f.getId()); ! Notifier.getInstance().sendNotification(n); } --- 287,291 ---- } DatabaseFacade.getInstance().remove(f); ! changed(this); } *************** *** 363,378 **** public void intern(Surface s) { DatabaseFacade.getInstance().intern((Object) s); ! Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update a surface ! * @param s The surface ! */ ! public void update(Surface s) { ! DatabaseFacade.getInstance().update(s); ! Notification n = new Notification(Notification.SURFACE_MODIFIED, s.getId()); ! Notifier.getInstance().sendNotification(n); } --- 313,317 ---- public void intern(Surface s) { DatabaseFacade.getInstance().intern((Object) s); ! changed(this); } *************** *** 382,406 **** */ public void remove(Surface s) { - // to make it safe to remove a surface we need to remove it - //from any domain to which it belongs. - Space back = s.getBackDomain(); if (back != null) { ! if (back.removeSurface(s)) { ! update(back); ! } s.setBackDomain(null); } Space front = s.getFrontDomain(); if (front != null) { ! if (front.removeSurface(s)) { ! update(front); ! } s.setFrontDomain(null); } - DatabaseFacade.getInstance().remove(s); ! Notification n = new Notification(Notification.SURFACE_DELETED, s.getId()); ! Notifier.getInstance().sendNotification(n); } --- 321,336 ---- */ public void remove(Surface s) { Space back = s.getBackDomain(); if (back != null) { ! back.removeSurface(s); s.setBackDomain(null); } Space front = s.getFrontDomain(); if (front != null) { ! front.removeSurface(s); s.setFrontDomain(null); } DatabaseFacade.getInstance().remove(s); ! changed(this); } *************** *** 428,445 **** public void intern(Vertex v) { DatabaseFacade.getInstance().intern((Object) v); ! Notification n = new Notification(Notification.VERTEX_CREATED, v.getId()); ! Notifier.getInstance().sendNotification(n); ! } ! ! /** ! * Update a vertex ! * @param v The vertex ! */ ! public void update(Vertex v) { ! DatabaseFacade.getInstance().update(v); ! Notification n = new Notification(Notification.VERTEX_MODIFIED, v.getId()); ! Notifier.getInstance().sendNotification(n); } ! /** * Remove a vertex --- 358,364 ---- public void intern(Vertex v) { DatabaseFacade.getInstance().intern((Object) v); ! changed(this); } ! /** * Remove a vertex *************** *** 448,453 **** public void remove(Vertex v) { DatabaseFacade.getInstance().remove(v); ! Notification n = new Notification(Notification.VERTEX_DELETED, v.getId()); ! Notifier.getInstance().sendNotification(n); } --- 367,371 ---- public void remove(Vertex v) { DatabaseFacade.getInstance().remove(v); ! changed(this); } |