Redesign the UI.

This commit is contained in:
huanghongxun
2015-08-31 21:06:35 +08:00
parent 981a11d98b
commit f9968580af
9 changed files with 154 additions and 107 deletions

View File

@@ -32,7 +32,7 @@ public class TaskWindow extends javax.swing.JDialog
implements ProgressProviderListener, Runnable, DoingDoneListener<Task> {
private static final TaskWindow instance = new TaskWindow();
public static TaskWindow getInstance() {
instance.clean();
return instance;
@@ -67,8 +67,7 @@ public class TaskWindow extends javax.swing.JDialog
}
public void clean() {
if (isVisible())
throw new RuntimeException("This error should not appear, please contact the author.");
if (isVisible()) return;
taskList = null;
taskList = new TaskList();
taskList.addTaskListener(this);
@@ -163,6 +162,7 @@ public class TaskWindow extends javax.swing.JDialog
}//GEN-LAST:event_btnCancelActionPerformed
private void formWindowClosed(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosed
if(taskList == null) return;
tasks.clear();
if (!this.failReasons.isEmpty()) {
@@ -171,8 +171,7 @@ public class TaskWindow extends javax.swing.JDialog
}
if (!suc) {
if (taskList != null)
SwingUtilities.invokeLater(taskList::abort);
SwingUtilities.invokeLater(taskList::abort);
HMCLog.log("Tasks have been canceled by user.");
}
}//GEN-LAST:event_formWindowClosed