|
@@ -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
|
}
|