}
}
<<<<<<< HEAD
private static class Launcher extends AbstractAction implements Swing {
private String[] args;
private Set instances = new TreeSet();
private Launcher(String[] args) {
super("New Application Instance");
this.args = args;
}
@Override
public void actionPerformed(ActionEvent e) {
new Thread(this).start(); // todo: this whole launcher should change
}
@Override
public void run() {
final File storageDirectory = StorageFinder.getStorageDirectory(args);
if (storageDirectory == null) return;
try {
int instance = 1;
while (instances.contains(String.valueOf(instance))) instance++;
Application application = new Application(storageDirectory, this, String.valueOf(instance));
application.home.setVisible(true);
application.allFrames.restore();
}
catch (StorageException e) {
JOptionPane.showMessageDialog(null, "Unable to create the storage directory");
e.printStackTrace();
=======
// private static class Launcher extends AbstractAction implements Runnable {
// private String[] args;
// private Set instances = new TreeSet();
//
// private Launcher(String[] args) {
// super("New Application Instance");
// this.args = args;
// }
//
// @Override
// public void actionPerformed(ActionEvent e) {
// Exec.swingAny(this);
// }
//
// @Override
// public void run() {
// final File storageDirectory = StorageFinder.getStorageDirectory(args);
// if (storageDirectory == null) return;
// try {
// int instance = 1;
// while (instances.contains(String.valueOf(instance))) instance++;
// Application application = new Application(storageDirectory, this, String.valueOf(instance));
// application.home.setVisible(true);
// application.allFrames.restore();
// }
// catch (StorageException e) {
// JOptionPane.showMessageDialog(null, "Unable to create the storage directory");
// e.printStackTrace();
// }
// }
// }
// todo: this is for later. just one instance now
private static Set instances = new TreeSet();
public static void main(final String[] args) throws StorageException {
EventQueue.invokeLater(new Runnable() {
@Override
public void run() {
final File storageDirectory = StorageFinder.getStorageDirectory(args);
if (storageDirectory == null) return;
try {
int instance = 1;
while (instances.contains(String.valueOf(instance))) instance++;
Application application = new Application(storageDirectory, String.valueOf(instance));
application.home.setVisible(true);
application.allFrames.restore();
}
catch (StorageException e) {
JOptionPane.showMessageDialog(null, "Unable to create the storage directory");
e.printStackTrace();
}
>>>>>>> 254b37fd35a1505e17ec6e55b91c1e0691681949
}
});
} |