protected void fileSaveXML() { JFileChooser chooser = null; if (currentFile == null) { chooser = new JFileChooser(startDirectory); } else { chooser = new JFileChooser(currentFile); } int returnVal = chooser.showSaveDialog(gw); if (returnVal == JFileChooser.APPROVE_OPTION) { currentFile = chooser.getSelectedFile(); generalXML.saveGraph(currentFile); } }
protected void fileOpenXML() { JFileChooser chooser = null; if (currentFile == null) { chooser = new JFileChooser(startDirectory); } else { chooser = new JFileChooser(currentFile); } int returnVal = chooser.showOpenDialog(gw); if (returnVal == JFileChooser.APPROVE_OPTION) { currentFile = chooser.getSelectedFile(); generalXML.loadGraph(currentFile); } gp.update(gp.getGraphics()); }
protected void fileSaveSimple() { JFileChooser chooser = null; if (currentFile == null) { chooser = new JFileChooser(startDirectory); } else { chooser = new JFileChooser(currentFile); if (!currentFile.isDirectory()) { chooser.setSelectedFile(currentFile); } } int returnVal = chooser.showSaveDialog(gw); if (returnVal == JFileChooser.APPROVE_OPTION) { currentFile = chooser.getSelectedFile(); graph.saveSimple(currentFile); } }