Browse Source

Add mig info version to info panel, issue 2148; issue 2451

tags/0.6.3m1rc1
Gregory Holmes 15 years ago
parent
commit
e741777fe8

+ 13
- 0
src/com/dmdirc/addons/ui_swing/components/frames/TextFrame.java View File

@@ -76,6 +76,7 @@ import java.util.Date;
76 76
 import java.util.LinkedList;
77 77
 import java.util.List;
78 78
 
79
+import java.util.concurrent.atomic.AtomicBoolean;
79 80
 import javax.swing.BorderFactory;
80 81
 import javax.swing.Icon;
81 82
 import javax.swing.JComponent;
@@ -126,6 +127,8 @@ public abstract class TextFrame extends JInternalFrame implements Window,
126 127
     private Window inputWindow;
127 128
     /** Swing controller. */
128 129
     private SwingController controller;
130
+    /** Are we maximising/restoring? */
131
+    private AtomicBoolean maximiseRestoreInProgress = new AtomicBoolean(false);
129 132
 
130 133
     /** Click types. */
131 134
     public enum MouseClickType {
@@ -562,6 +565,9 @@ public abstract class TextFrame extends JInternalFrame implements Window,
562 565
     public void internalFrameActivated(final InternalFrameEvent event) {
563 566
         LOGGER.finer(getName() + ": internalFrameActivated()");
564 567
 
568
+        if (maximiseRestoreInProgress.get()) {
569
+            return;
570
+        }
565 571
         new LoggingSwingWorker() {
566 572
 
567 573
             /** {@inheritDoc} */
@@ -582,6 +588,9 @@ public abstract class TextFrame extends JInternalFrame implements Window,
582 588
      */
583 589
     @Override
584 590
     public void internalFrameDeactivated(final InternalFrameEvent event) {
591
+        if (maximiseRestoreInProgress.get()) {
592
+            return;
593
+        }
585 594
         new LoggingSwingWorker() {
586 595
 
587 596
             /** {@inheritDoc} */
@@ -1028,6 +1037,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
1028 1037
                         return;
1029 1038
                     }
1030 1039
 
1040
+                    maximiseRestoreInProgress.set(true);
1031 1041
                     LOGGER.finest("maximise(): About to set icon");
1032 1042
                     setIcon(false);
1033 1043
                     LOGGER.finest("maximise(): About to set visible");
@@ -1038,6 +1048,7 @@ public abstract class TextFrame extends JInternalFrame implements Window,
1038 1048
                 } catch (PropertyVetoException ex) {
1039 1049
                     Logger.userError(ErrorLevel.LOW, "Unable to minimise frame");
1040 1050
                 }
1051
+                maximiseRestoreInProgress.set(false);
1041 1052
 
1042 1053
                 LOGGER.finest("maximise(): Done running");
1043 1054
             }
@@ -1058,12 +1069,14 @@ public abstract class TextFrame extends JInternalFrame implements Window,
1058 1069
                         return;
1059 1070
                     }
1060 1071
 
1072
+                    maximiseRestoreInProgress.set(true);
1061 1073
                     setIcon(false);
1062 1074
                     //setVisible(true);
1063 1075
                     setMaximum(false);
1064 1076
                 } catch (PropertyVetoException ex) {
1065 1077
                     Logger.userError(ErrorLevel.LOW, "Unable to minimise frame");
1066 1078
                 }
1079
+                maximiseRestoreInProgress.set(false);
1067 1080
             }
1068 1081
         });
1069 1082
     }

+ 2
- 0
src/com/dmdirc/addons/ui_swing/dialogs/about/InfoPanel.java View File

@@ -37,6 +37,7 @@ import javax.swing.SwingUtilities;
37 37
 import javax.swing.UIManager;
38 38
 import javax.swing.text.html.HTMLDocument;
39 39
 import javax.swing.text.html.HTMLEditorKit;
40
+import net.miginfocom.layout.LayoutUtil;
40 41
 import net.miginfocom.swing.MigLayout;
41 42
 
42 43
 /** Info panel. */
@@ -73,6 +74,7 @@ public final class InfoPanel extends JPanel {
73 74
                 "<b>Java version: </b>" + Info.getJavaVersion() + "<br>" +
74 75
                 "<b>OS Version: </b>" + Info.getOSVersion() + "<br>" +
75 76
                 "<b>Look and Feel: </b>" + SwingController.getLookAndFeel() + "<br>" +
77
+                "<b>MiG Layout version: </b>" + LayoutUtil.getVersion() + "<br>" +
76 78
                 "</html>");
77 79
         infoPane.setEditable(false);
78 80
         scrollPane.setViewportView(infoPane);

+ 1
- 1
src/com/dmdirc/addons/ui_swing/framemanager/tree/Tree.java View File

@@ -117,7 +117,7 @@ public class Tree extends JTree implements MouseMotionListener,
117 117
      */
118 118
     public void setTreePath(final TreePath path) {
119 119
         this.path = path;
120
-        UIUtilities.invokeAndWait(new Runnable() {
120
+        UIUtilities.invokeLater(new Runnable() {
121 121
 
122 122
             @Override
123 123
             public void run() {

+ 2
- 2
src/com/dmdirc/addons/ui_swing/framemanager/tree/TreeFrameManager.java View File

@@ -149,7 +149,7 @@ public final class TreeFrameManager implements FrameManager,
149 149
     /** {@inheritDoc} */
150 150
     @Override
151 151
     public void delWindow(final FrameContainer window) {
152
-        UIUtilities.invokeAndWait(new Runnable() {
152
+        UIUtilities.invokeLater(new Runnable() {
153 153
 
154 154
             /** {@inheritDoc} */
155 155
             @Override
@@ -183,7 +183,7 @@ public final class TreeFrameManager implements FrameManager,
183 183
      */
184 184
     public void addWindow(final TreeViewNode parent,
185 185
             final FrameContainer window) {
186
-        UIUtilities.invokeAndWait(new Runnable() {
186
+        UIUtilities.invokeLater(new Runnable() {
187 187
 
188 188
             /** {@inheritDoc} */
189 189
             @Override

Loading…
Cancel
Save