[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model Project.java, 1.143, 1.144
Status: Pre-Alpha
Brought to you by:
henryml
From: rimestad <rim...@us...> - 2007-11-26 18:11:36
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv25358/src/net/sourceforge/bprocessor/model Modified Files: Project.java Log Message: moved try catch on library save and added a addlibrarycomponent to project Index: Project.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/Project.java,v retrieving revision 1.143 retrieving revision 1.144 diff -C2 -d -r1.143 -r1.144 *** Project.java 19 Nov 2007 09:20:41 -0000 1.143 --- Project.java 26 Nov 2007 18:11:36 -0000 1.144 *************** *** 135,147 **** functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; - try { - library = Persistence.loadLibrary(); - } catch (Exception e) { - library = new LinkedList(); - } } catch (Exception e) { log.error("Error loading classification " + e); e.printStackTrace(); } } return instance; --- 135,148 ---- functionalClas = (Classification)loaded[1]; classificationTypes = (Collection<ClassificationType>)loaded[2]; } catch (Exception e) { log.error("Error loading classification " + e); e.printStackTrace(); } + try { + library = Persistence.loadLibrary(); + } catch (Exception e) { + log.error("Error loading library " + e); + library = new LinkedList(); + } } return instance; *************** *** 1051,1060 **** /** ! * Add a lib obj to til list of lib objects ! * @param lo the library object to add */ public void addCalalogObject(Component lo) { if (!catalog.contains(lo)) { catalog.add(lo); lo.getSpace().setOwner(this.world); } --- 1052,1062 ---- /** ! * Add a component to til list of catalog objects ! * @param lo the component object to add */ public void addCalalogObject(Component lo) { if (!catalog.contains(lo)) { catalog.add(lo); + lo.setId(new Long(catalog.size())); lo.getSpace().setOwner(this.world); } *************** *** 1062,1067 **** /** ! * Return the program library objects ! * @return the lib objs */ public static Collection<Component> getLibraryObjects() { --- 1064,1086 ---- /** ! * Add a component to til list of library objects ! * @param lo the component to add ! */ ! public void addLibraryObject(Component lo) { ! if (!library.contains(lo)) { ! library.add(lo); ! lo.setId(new Long(library.size())); ! lo.getSpace().setOwner(null); ! try { ! Persistence.saveLibrary(); ! } catch (Exception e) { ! log.error("Could not save library due to:" + e); ! } ! } ! } ! ! /** ! * Return the program library components ! * @return the program library components */ public static Collection<Component> getLibraryObjects() { |