|
@@ -55,7 +55,6 @@ import java.awt.event.WindowEvent;
|
55
|
55
|
import java.awt.event.WindowFocusListener;
|
56
|
56
|
import java.awt.event.WindowListener;
|
57
|
57
|
import java.lang.reflect.InvocationTargetException;
|
58
|
|
-import java.util.concurrent.Callable;
|
59
|
58
|
|
60
|
59
|
import javax.swing.ImageIcon;
|
61
|
60
|
import javax.swing.JFrame;
|
|
@@ -188,19 +187,12 @@ public final class MainFrame extends JFrame implements WindowListener,
|
188
|
187
|
* @return Frame manager size.
|
189
|
188
|
*/
|
190
|
189
|
public int getFrameManagerSize() {
|
191
|
|
- return UIUtilities.invokeAndWait(new Callable<Integer>() {
|
192
|
|
-
|
193
|
|
- /** {@inheritDoc} */
|
194
|
|
- @Override
|
195
|
|
- public Integer call() {
|
196
|
|
- if (position == FramemanagerPosition.LEFT || position
|
197
|
|
- == FramemanagerPosition.RIGHT) {
|
198
|
|
- return frameManagerPanel.getWidth();
|
199
|
|
- } else {
|
200
|
|
- return frameManagerPanel.getHeight();
|
201
|
|
- }
|
202
|
|
- }
|
203
|
|
- });
|
|
190
|
+ if (position == FramemanagerPosition.LEFT
|
|
191
|
+ || position == FramemanagerPosition.RIGHT) {
|
|
192
|
+ return frameManagerPanel.getWidth();
|
|
193
|
+ } else {
|
|
194
|
+ return frameManagerPanel.getHeight();
|
|
195
|
+ }
|
204
|
196
|
}
|
205
|
197
|
|
206
|
198
|
/**
|
|
@@ -209,14 +201,7 @@ public final class MainFrame extends JFrame implements WindowListener,
|
209
|
201
|
* @return The active window
|
210
|
202
|
*/
|
211
|
203
|
public TextFrame getActiveFrame() {
|
212
|
|
- return UIUtilities.invokeAndWait(new Callable<TextFrame>() {
|
213
|
|
-
|
214
|
|
- /** {@inheritDoc} */
|
215
|
|
- @Override
|
216
|
|
- public TextFrame call() {
|
217
|
|
- return activeFrame;
|
218
|
|
- }
|
219
|
|
- });
|
|
204
|
+ return activeFrame;
|
220
|
205
|
}
|
221
|
206
|
|
222
|
207
|
/** {@inheritDoc} */
|
|
@@ -228,11 +213,18 @@ public final class MainFrame extends JFrame implements WindowListener,
|
228
|
213
|
/** {@inheritDoc}. */
|
229
|
214
|
@Override
|
230
|
215
|
public void setTitle(final String title) {
|
231
|
|
- if (title == null || activeFrame == null) {
|
232
|
|
- super.setTitle(getTitlePrefix());
|
233
|
|
- } else {
|
234
|
|
- super.setTitle(getTitlePrefix() + " - " + title);
|
235
|
|
- }
|
|
216
|
+ UIUtilities.invokeLater(new Runnable() {
|
|
217
|
+
|
|
218
|
+ /** {@inheritDoc}. */
|
|
219
|
+ @Override
|
|
220
|
+ public void run() {
|
|
221
|
+ if (title == null || activeFrame == null) {
|
|
222
|
+ MainFrame.super.setTitle(getTitlePrefix());
|
|
223
|
+ } else {
|
|
224
|
+ MainFrame.super.setTitle(getTitlePrefix() + " - " + title);
|
|
225
|
+ }
|
|
226
|
+ }
|
|
227
|
+ });
|
236
|
228
|
}
|
237
|
229
|
|
238
|
230
|
/**
|