*/
package jalview.gui;
-import java.util.Locale;
-
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.util.Hashtable;
import java.util.List;
import java.util.ListIterator;
+import java.util.Locale;
import java.util.Vector;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import javax.swing.JComboBox;
import javax.swing.JComponent;
import javax.swing.JDesktopPane;
+import javax.swing.JFrame;
import javax.swing.JInternalFrame;
import javax.swing.JLabel;
import javax.swing.JMenuItem;
private static final String EXPERIMENTAL_FEATURES = "EXPERIMENTAL_FEATURES";
- protected static final String CONFIRM_KEYBOARD_QUIT = "CONFIRM_KEYBOARD_QUIT";
+ public static final String CONFIRM_KEYBOARD_QUIT = "CONFIRM_KEYBOARD_QUIT";
public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
}
}
- /**
- * APQHandlers sets handlers for About, Preferences and Quit actions
- * peculiar to macOS's application menu. APQHandlers will check to see if a
- * handler is supported before setting it.
- */
- try
- {
- APQHandlers.setAPQHandlers(this);
- } catch (Exception e)
- {
- System.out.println("Cannot set APQHandlers");
- // e.printStackTrace();
- } catch (Throwable t)
- {
- jalview.bin.Console
- .warn("Error setting APQHandlers: " + t.toString());
- jalview.bin.Console.trace(Cache.getStackTraceString(t));
- }
setIconImages(ChannelProperties.getIconList());
addWindowListener(new WindowAdapter()
int w, int h, boolean resizable, boolean ignoreMinSize)
{
+ JFrame extFrame = new JFrame();
+ extFrame.setContentPane(frame);
// TODO: allow callers to determine X and Y position of frame (eg. via
// bounds object).
// TODO: consider fixing method to update entries in the window submenu with
// the current window title
- frame.setTitle(title);
- if (frame.getWidth() < 1 || frame.getHeight() < 1)
+ extFrame.setTitle(title);
+ if (extFrame.getWidth() < 1 || extFrame.getHeight() < 1)
{
- frame.setSize(w, h);
+ extFrame.setSize(w, h);
}
// THIS IS A PUBLIC STATIC METHOD, SO IT MAY BE CALLED EVEN IN
// A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
if (!ignoreMinSize)
{
- frame.setMinimumSize(
+ extFrame.setMinimumSize(
new Dimension(DEFAULT_MIN_WIDTH, DEFAULT_MIN_HEIGHT));
// Set default dimension for Alignment Frame window.
// I did this here in order not to miss out on any Alignment frame.
if (frame instanceof AlignFrame)
{
- frame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH,
+ extFrame.setMinimumSize(new Dimension(ALIGN_FRAME_DEFAULT_MIN_WIDTH,
ALIGN_FRAME_DEFAULT_MIN_HEIGHT));
}
}
setKeyBindings(frame);
- desktop.add(frame);
+ // desktop.add(frame);
windowMenu.add(menuItem);
- frame.toFront();
+ extFrame.pack();
+ extFrame.setVisible(true);
+ extFrame.toFront();
try
{
- frame.setSelected(true);
- frame.requestFocus();
- } catch (java.beans.PropertyVetoException ve)
- {
+ extFrame.requestFocus();
} catch (java.lang.ClassCastException cex)
{
jalview.bin.Console.warn(