[Bprocessor-commit] gui/src/net/sourceforge/bprocessor/gui/actions CreateConstructionSpaceActionList
Status: Pre-Alpha
Brought to you by:
henryml
From: Jesper P. <je...@us...> - 2005-07-28 06:55:01
|
Update of /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8893/src/net/sourceforge/bprocessor/gui/actions Modified Files: CreateConstructionSpaceActionListener.java CreateConstructorActionListener.java CreateElementActionListener.java CreateFunctionalSpaceActionListener.java CreatePartActionListener.java CreateSurfaceActionListener.java ToolsDetachActionListener.java ToolsJoinActionListener.java Log Message: Use the new facades and relationships in model Index: ToolsDetachActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsDetachActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToolsDetachActionListener.java 11 Jul 2005 08:42:23 -0000 1.1 --- ToolsDetachActionListener.java 28 Jul 2005 06:54:41 -0000 1.2 *************** *** 568,571 **** --- 568,572 ---- fs.getSurfaces().remove(s); + fsf.update(fs); } else if (rsname.equals(ELEMENTS)) { ElementFacade ef = ElementFacade.getInstance(); *************** *** 573,576 **** --- 574,578 ---- fs.getElements().remove(e); + fsf.update(fs); } } else if (lsname.equals(CONSTRUCTION_SPACES)) { *************** *** 583,586 **** --- 585,589 ---- cs.getSurfaces().remove(s); + csf.update(cs); } else if (rsname.equals(ELEMENTS)) { ElementFacade ef = ElementFacade.getInstance(); *************** *** 588,591 **** --- 591,595 ---- cs.getElements().remove(e); + csf.update(cs); } } else if (lsname.equals(ELEMENTS)) { *************** *** 598,601 **** --- 602,606 ---- e.getSurfaces().remove(s); + ef.update(e); } else if (rsname.equals(PARTS)) { PartFacade pf = PartFacade.getInstance(); *************** *** 603,606 **** --- 608,612 ---- e.getParts().remove(p); + ef.update(e); } } else if (lsname.equals(PARTS)) { *************** *** 613,616 **** --- 619,623 ---- p.getSurfaces().remove(s); + pf.update(p); } } Index: CreateElementActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateElementActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreateElementActionListener.java 11 Jul 2005 08:40:21 -0000 1.2 --- CreateElementActionListener.java 28 Jul 2005 06:54:40 -0000 1.3 *************** *** 49,53 **** Element el = new Element(result.trim()); ! ef.add(el); Notification n = new Notification(Notification.ELEMENT_CREATED, el.getId()); --- 49,53 ---- Element el = new Element(result.trim()); ! el = ef.create(el); Notification n = new Notification(Notification.ELEMENT_CREATED, el.getId()); Index: ToolsJoinActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/ToolsJoinActionListener.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ToolsJoinActionListener.java 11 Jul 2005 08:41:59 -0000 1.1 --- ToolsJoinActionListener.java 28 Jul 2005 06:54:41 -0000 1.2 *************** *** 25,28 **** --- 25,29 ---- import java.awt.event.ItemListener; import java.util.Collection; + import java.util.HashSet; import java.util.Iterator; import java.util.Vector; *************** *** 370,389 **** --- 371,406 ---- FunctionalSpace fs = fsf.findById(rsvalue.getId()); + if (fs.getSurfaces() == null) { + fs.setSurfaces(new HashSet()); + } fs.getSurfaces().add(s); + fsf.update(fs); } else if (rsname.equals(CONSTRUCTION_SPACES)) { ConstructionSpaceFacade csf = ConstructionSpaceFacade.getInstance(); ConstructionSpace cs = csf.findById(rsvalue.getId()); + if (cs.getSurfaces() == null) { + cs.setSurfaces(new HashSet()); + } cs.getSurfaces().add(s); + csf.update(cs); } else if (rsname.equals(ELEMENTS)) { ElementFacade ef = ElementFacade.getInstance(); Element e = ef.findById(rsvalue.getId()); + if (e.getSurfaces() == null) { + e.setSurfaces(new HashSet()); + } e.getSurfaces().add(s); + ef.update(e); } else if (rsname.equals(PARTS)) { PartFacade pf = PartFacade.getInstance(); Part p = pf.findById(rsvalue.getId()); + if (p.getSurfaces() == null) { + p.setSurfaces(new HashSet()); + } p.getSurfaces().add(s); + pf.update(p); } } else if (lsname.equals(ELEMENTS)) { *************** *** 395,404 **** --- 412,429 ---- FunctionalSpace fs = fsf.findById(rsvalue.getId()); + if (fs.getElements() == null) { + fs.setElements(new HashSet()); + } fs.getElements().add(e); + fsf.update(fs); } else if (rsname.equals(CONSTRUCTION_SPACES)) { ConstructionSpaceFacade csf = ConstructionSpaceFacade.getInstance(); ConstructionSpace cs = csf.findById(rsvalue.getId()); + if (cs.getElements() == null) { + cs.setElements(new HashSet()); + } cs.getElements().add(e); + csf.update(cs); } } else if (lsname.equals(PARTS)) { *************** *** 410,414 **** --- 435,443 ---- Element e = ef.findById(rsvalue.getId()); + if (e.getParts() == null) { + e.setParts(new HashSet()); + } e.getParts().add(p); + ef.update(e); } } Index: CreatePartActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreatePartActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreatePartActionListener.java 11 Jul 2005 08:40:21 -0000 1.2 --- CreatePartActionListener.java 28 Jul 2005 06:54:40 -0000 1.3 *************** *** 49,53 **** Part p = new Part(result.trim()); ! pf.add(p); Notification n = new Notification(Notification.PART_CREATED, p.getId()); --- 49,53 ---- Part p = new Part(result.trim()); ! p = pf.create(p); Notification n = new Notification(Notification.PART_CREATED, p.getId()); Index: CreateConstructionSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructionSpaceActionListener.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CreateConstructionSpaceActionListener.java 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- CreateConstructionSpaceActionListener.java 28 Jul 2005 06:54:40 -0000 1.2 *************** *** 50,54 **** ConstructionSpace cs = new ConstructionSpace(result.trim()); ! csf.add(cs); Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, cs.getId()); --- 50,54 ---- ConstructionSpace cs = new ConstructionSpace(result.trim()); ! cs = csf.create(cs); Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, cs.getId()); Index: CreateConstructorActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateConstructorActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreateConstructorActionListener.java 18 Jul 2005 09:27:51 -0000 1.2 --- CreateConstructorActionListener.java 28 Jul 2005 06:54:40 -0000 1.3 *************** *** 48,52 **** s.setConstructor(true); ! sf.add(s); } } --- 48,52 ---- s.setConstructor(true); ! s = sf.create(s); } } Index: CreateFunctionalSpaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateFunctionalSpaceActionListener.java,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** CreateFunctionalSpaceActionListener.java 27 Jun 2005 09:32:23 -0000 1.1.1.1 --- CreateFunctionalSpaceActionListener.java 28 Jul 2005 06:54:40 -0000 1.2 *************** *** 50,54 **** FunctionalSpace fs = new FunctionalSpace(result.trim()); ! fsf.add(fs); Notification n = new Notification(Notification.FUNCTIONAL_SPACE_CREATED, fs.getId()); --- 50,54 ---- FunctionalSpace fs = new FunctionalSpace(result.trim()); ! fs = fsf.create(fs); Notification n = new Notification(Notification.FUNCTIONAL_SPACE_CREATED, fs.getId()); Index: CreateSurfaceActionListener.java =================================================================== RCS file: /cvsroot/bprocessor/gui/src/net/sourceforge/bprocessor/gui/actions/CreateSurfaceActionListener.java,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** CreateSurfaceActionListener.java 1 Jul 2005 11:29:00 -0000 1.2 --- CreateSurfaceActionListener.java 28 Jul 2005 06:54:40 -0000 1.3 *************** *** 49,53 **** Surface s = new Surface(result.trim()); ! sf.add(s); Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); --- 49,53 ---- Surface s = new Surface(result.trim()); ! s = sf.create(s); Notification n = new Notification(Notification.SURFACE_CREATED, s.getId()); |