Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31136
Modified Files:
SurfacesTreeView.java
Log Message:
commented out some code to avoid bugs (read: ugly fix)
Index: SurfacesTreeView.java
===================================================================
RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/treeview/SurfacesTreeView.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** SurfacesTreeView.java 30 Aug 2005 13:08:21 -0000 1.3
--- SurfacesTreeView.java 12 Sep 2005 18:15:13 -0000 1.4
***************
*** 10,15 ****
import net.sourceforge.bprocessor.kernel.notification.NotificationListener;
import net.sourceforge.bprocessor.kernel.notification.Notifier;
! import net.sourceforge.bprocessor.model.Surface;
! import net.sourceforge.bprocessor.model.SurfaceFacade;
import java.awt.event.MouseEvent;
--- 10,15 ----
import net.sourceforge.bprocessor.kernel.notification.NotificationListener;
import net.sourceforge.bprocessor.kernel.notification.Notifier;
! //import net.sourceforge.bprocessor.model.Surface;
! //import net.sourceforge.bprocessor.model.SurfaceFacade;
import java.awt.event.MouseEvent;
***************
*** 60,72 ****
if (type.equals(Notification.SURFACE_CREATED)) {
! SurfaceFacade sf = SurfaceFacade.getInstance();
! Surface s = sf.findById(n.getObject());
!
! RootNode rn = (RootNode)getModel().getRoot();
! SurfaceNode sn = new SurfaceNode(n.getObject(), s.getName(), rn);
! rn.add(sn);
!
! TreePath tp = new TreePath(new Object[] {rn});
! getModel().valueForPathChanged(tp, sn);
} else if (type.equals(Notification.SURFACE_DELETED)) {
Long deletedId = n.getObject();
--- 60,80 ----
if (type.equals(Notification.SURFACE_CREATED)) {
! /*
! commenting this code out to prevent exceptions raised by the
! "findById" call. It works, but I honestly dont know why!
! My guess is the id of the surface created(the one in the notification)
! can be a surface that is not yet
! in the database, thus causing findById to fail.
!
! SurfaceFacade sf = SurfaceFacade.getInstance();
! Surface s = sf.findById(n.getObject());
!
! RootNode rn = (RootNode)getModel().getRoot();
! SurfaceNode sn = new SurfaceNode(n.getObject(), s.getName(), rn);
! rn.add(sn);
!
! TreePath tp = new TreePath(new Object[] {rn});
! getModel().valueForPathChanged(tp, sn);
! */
} else if (type.equals(Notification.SURFACE_DELETED)) {
Long deletedId = n.getObject();
|