[Bprocessor-commit] model/src/net/sourceforge/bprocessor/model/xml PersistenceManager.java,1.26,1.27
Status: Pre-Alpha
Brought to you by:
henryml
|
From: Michael L. <he...@us...> - 2006-03-20 09:09:34
|
Update of /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25274/src/net/sourceforge/bprocessor/model/xml Modified Files: PersistenceManager.java Log Message: First version of Undo implemented Index: PersistenceManager.java =================================================================== RCS file: /cvsroot/bprocessor/model/src/net/sourceforge/bprocessor/model/xml/PersistenceManager.java,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** PersistenceManager.java 10 Mar 2006 16:41:37 -0000 1.26 --- PersistenceManager.java 20 Mar 2006 09:09:31 -0000 1.27 *************** *** 78,89 **** /** ! * This method loads the Bprocessor document from a file ! * @param file The input file ! * @exception Exception Thrown if an exception occurs */ ! public static void load(File file) throws Exception { ! FileInputStream fis = new FileInputStream(file); ! Bprocessor bp = loadFile(fis); ! mapper = new HashMap(); --- 78,85 ---- /** ! * This method internalizes a b-processor document ! * @param bp XML */ ! public static void internalize(Bprocessor bp) { mapper = new HashMap(); *************** *** 101,105 **** loadRefEdge(bp.getEdge()); loadRefVertex(bp.getVertex()); ! fis.close(); } --- 97,111 ---- loadRefEdge(bp.getEdge()); loadRefVertex(bp.getVertex()); ! } ! ! /** ! * This method loads the Bprocessor document from a file ! * @param file The input file ! * @exception Exception Thrown if an exception occurs ! */ ! public static void load(File file) throws Exception { ! FileInputStream fis = new FileInputStream(file); ! Bprocessor bp = loadFile(fis); ! internalize(bp); fis.close(); } *************** *** 360,370 **** } /** ! * This method saves the Bprocessor document to a file ! * @param file The output file ! * @exception Exception Thrown if an exception occurs */ ! public static void save(File file) throws Exception { ! FileOutputStream fos = new FileOutputStream(file); Bprocessor bp = new BprocessorImpl(); --- 366,375 ---- } + /** ! * This method externalizes the B-model to an XML structure. ! * @return XML */ ! public static Bprocessor externalize() { Bprocessor bp = new BprocessorImpl(); *************** *** 394,398 **** saveRefSurface(bp, project.getSurfaces()); saveRefVertex(bp, project.getVertices()); ! saveFile(bp, fos); --- 399,415 ---- saveRefSurface(bp, project.getSurfaces()); saveRefVertex(bp, project.getVertices()); ! ! return bp; ! } ! ! /** ! * This method saves the Bprocessor document to a file ! * @param file The output file ! * @exception Exception Thrown if an exception occurs ! */ ! public static void save(File file) throws Exception { ! FileOutputStream fos = new FileOutputStream(file); ! Bprocessor bp = externalize(); ! saveFile(bp, fos); |