Пример #1
0
 protected void fileNew() {
   if (currentFile != null) {
     if (!currentFile.isDirectory()) {
       currentFile = currentFile.getParentFile();
     }
   }
   graph.clear();
   gp.update(gp.getGraphics());
 }
Пример #2
0
 protected void fileSave() {
   if (currentFile == null) {
     fileSaveAs();
   } else {
     if (currentFile.isDirectory()) {
       fileSaveAs();
     } else {
       graph.saveAll(currentFile);
       gp.update(gp.getGraphics());
     }
   }
 }
Пример #3
0
  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());
  }