public void init(IpssProject project, String aDocName) {
   setFilepath(project.getProjectPath());
   setDocName(aDocName);
   // pack the form and display
   pack();
   setLocationRelativeTo(parentFrame);
   setSize(new Dimension(629, 243));
   setVisible(true);
 }
Example #2
0
  /** @see java.awt.event.ActionListener#actionPerformed(ActionEvent) */
  public void actionPerformed(ActionEvent e) {

    IpssProject curproj = graphpad.getCurrentProject();
    String newname =
        JOptionPane.showInputDialog(Translator.getString("ProjectName"), curproj.getProjectName());

    if (newname == null) return;

    if (!newname.equals(curproj.getProjectName())) {
      if (!Utilities.renameFile(
          curproj.getProjectPath(),
          curproj.getParentPath() + System.getProperty("file.separator") + newname)) {
        JOptionPane.showMessageDialog(
            this.getGraphpad().getFrame(),
            "Project already exists",
            "ERROR",
            JOptionPane.ERROR_MESSAGE);
        return;
      }
    }
    curproj.setProjectName(newname);
  }