[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model MemoryFacade.java,1.4,1.5 Space.java,
Status: Pre-Alpha
Brought to you by:
henryml
From: Michael L. <he...@us...> - 2005-12-11 17:27:27
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31544/src/net/sourceforge/bprocessor/model Modified Files: MemoryFacade.java Space.java Project.java DatabaseFacade.java Removed Files: Part.java Element.java Log Message: Removed part and element --- Part.java DELETED --- Index: DatabaseFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/DatabaseFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** DatabaseFacade.java 15 Nov 2005 18:58:30 -0000 1.4 --- DatabaseFacade.java 11 Dec 2005 17:27:19 -0000 1.5 *************** *** 97,113 **** /** - * Find all elements - * @return The elements - */ - public abstract Set getElements(); - - /** - * Find a element by id - * @param id The id - * @return The element - */ - public abstract Element findElementById(Long id); - - /** * Find all functional spaces * @return The functional spaces --- 97,100 ---- *************** *** 123,139 **** /** - * Find all parts - * @return The parts - */ - public abstract Set getParts(); - - /** - * Find a part by id - * @param id The id - * @return The part - */ - public abstract Part findPartById(Long id); - - /** * Find all surfaces * @return The surfaces --- 110,113 ---- Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Project.java 5 Dec 2005 07:53:46 -0000 1.8 --- Project.java 11 Dec 2005 17:27:19 -0000 1.9 *************** *** 80,99 **** /** ! * Create a construction space ! * @param c The construction space */ ! public void intern(ConstructionSpace c) { ! DatabaseFacade.getInstance().intern((Object) c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, c.getId()); Notifier.getInstance().sendNotification(n); } ! /** ! * Update a construction space * @param c The construction space */ ! public void update(ConstructionSpace c) { ! DatabaseFacade.getInstance().update(c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_MODIFIED, c.getId()); Notifier.getInstance().sendNotification(n); } --- 80,99 ---- /** ! * Create a space ! * @param space The space */ ! public void intern(Space space) { ! DatabaseFacade.getInstance().intern((Object) space); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, space.getId()); Notifier.getInstance().sendNotification(n); } ! /** ! * Create a construction space * @param c The construction space */ ! public void intern(ConstructionSpace c) { ! DatabaseFacade.getInstance().intern((Object) c); ! Notification n = new Notification(Notification.CONSTRUCTION_SPACE_CREATED, c.getId()); Notifier.getInstance().sendNotification(n); } *************** *** 159,169 **** Notification n = new Notification(Notification.FUNCTIONAL_SPACE_MODIFIED, domain.getId()); Notifier.getInstance().sendNotification(n); - } else if (domain instanceof Element) { - update((Element)domain); - - } else if (domain instanceof Part) { - DatabaseFacade.getInstance().update((Part)domain); - Notification n = new Notification(Notification.PART_MODIFIED, domain.getId()); - Notifier.getInstance().sendNotification(n); } else { log.error("Unsupported type: " + domain.getClass().getName()); --- 159,162 ---- *************** *** 236,286 **** /** - * Intern an element - * @param e The element - */ - public void intern(Element e) { - DatabaseFacade.getInstance().intern((Object) e); - Notification n = new Notification(Notification.ELEMENT_CREATED, e.getId()); - Notifier.getInstance().sendNotification(n); - } - - /** - * Update an element - * @param e The element - */ - public void update(Element e) { - DatabaseFacade.getInstance().update(e); - Notification n = new Notification(Notification.ELEMENT_MODIFIED, e.getId()); - Notifier.getInstance().sendNotification(n); - } - - /** - * Remove an element - * @param e The element - */ - public void remove(Element e) { - DatabaseFacade.getInstance().remove(e); - Notification n = new Notification(Notification.ELEMENT_DELETED, e.getId()); - Notifier.getInstance().sendNotification(n); - } - - /** - * Find all elements - * @return The elements - */ - public Set getElements() { - return DatabaseFacade.getInstance().getElements(); - } - - /** - * Find a element by id - * @param id The id - * @return The element - */ - public Element findElementById(Long id) { - return DatabaseFacade.getInstance().findElementById(id); - } - - /** * Intern a functional space * @param f The functional space --- 229,232 ---- *************** *** 293,302 **** /** ! * Update a functional space ! * @param f The functional space */ ! public void update(FunctionalSpace f) { ! DatabaseFacade.getInstance().update(f); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_MODIFIED, f.getId()); Notifier.getInstance().sendNotification(n); } --- 239,267 ---- /** ! * Remove a space ! * @param space The space to remove */ ! public void remove(Space space) { ! // setting references to this space to null ! Set surfaces = space.getSurfaces(); ! if (surfaces != null) { ! Iterator surfIt = surfaces.iterator(); ! while (surfIt.hasNext()) { ! Surface surface = (Surface)surfIt.next(); ! Domain back = surface.getBackDomain(); ! if (back == space) { ! surface.setBackDomain(null); ! DatabaseFacade.getInstance().update(surface); ! } else { ! Domain front = surface.getFrontDomain(); ! if (front == space) { ! surface.setFrontDomain(null); ! DatabaseFacade.getInstance().update(surface); ! } ! } ! } ! } ! DatabaseFacade.getInstance().remove(space); ! Notification n = new Notification(Notification.FUNCTIONAL_SPACE_DELETED, space.getId()); Notifier.getInstance().sendNotification(n); } *************** *** 349,397 **** /** - * Intern a part - * @param p The part - */ - public void intern(Part p) { - DatabaseFacade.getInstance().intern((Object) p); - Notification n = new Notification(Notification.PART_CREATED, p.getId()); - Notifier.getInstance().sendNotification(n); - } - - /** - * Update a part - * @param p The part - */ - public void update(Part p) { - DatabaseFacade.getInstance().update(p); - } - - /** - * Remove a part - * @param p The part - */ - public void remove(Part p) { - DatabaseFacade.getInstance().remove(p); - Notification n = new Notification(Notification.PART_DELETED, p.getId()); - Notifier.getInstance().sendNotification(n); - } - - /** - * Find all parts - * @return The parts - */ - public Set getParts() { - return DatabaseFacade.getInstance().getParts(); - } - - /** - * Find a part by id - * @param id The id - * @return The part - */ - public Part findPartById(Long id) { - return DatabaseFacade.getInstance().findPartById(id); - } - - /** * Intern a surface * @param s The surface --- 314,317 ---- Index: Space.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Space.java,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Space.java 28 Nov 2005 22:23:49 -0000 1.6 --- Space.java 11 Dec 2005 17:27:19 -0000 1.7 *************** *** 20,24 **** * column="DOMAIN_ID" */ ! public abstract class Space extends Domain { /** The logger */ private static Logger log = Logger.getLogger(Space.class); --- 20,24 ---- * column="DOMAIN_ID" */ ! public class Space extends Domain { /** The logger */ private static Logger log = Logger.getLogger(Space.class); *************** *** 40,43 **** --- 40,51 ---- /** + * Constructor for space + * @param name The name + */ + public Space(String name) { + super(); + setName(name); + } + /** * Get the space id * @return The space id Index: MemoryFacade.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/MemoryFacade.java,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** MemoryFacade.java 15 Nov 2005 18:58:30 -0000 1.4 --- MemoryFacade.java 11 Dec 2005 17:27:19 -0000 1.5 *************** *** 218,238 **** /** - * Get all elements - * @return The elements - */ - public Set getElements() { - return filter(domains.values(), Element.class); - } - - /** - * Find element by id - * @param id the ID - * @return The element - */ - public Element findElementById(Long id) { - return (Element) domains.get(id); - } - - /** * Get all functional spaces * @return the Functional spaces --- 218,221 ---- *************** *** 252,272 **** /** - * Get all parts - * @return The parts - */ - public Set getParts() { - return filter(domains.values(), Part.class); - } - - /** - * Find part by id - * @param id The id - * @return The part - */ - public Part findPartById(Long id) { - return (Part) domains.get(id); - } - - /** * Get all surfaces * @return The surfaces --- 235,238 ---- --- Element.java DELETED --- |