*/
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;
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()
* along with Jalview. If not, see <http://www.gnu.org/licenses/>.
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
-package jalview.gui;
+package jalview.jbgui;
import javax.swing.JOptionPane;
import com.formdev.flatlaf.extras.FlatDesktop;
+import jalview.gui.Desktop;
import jalview.util.MessageManager;
public class APQHandlers
{
- private static boolean setAPQHandlers = false;
+ protected static boolean setAPQHandlers = false;
- protected static boolean setAPQHandlers(
- jalview.gui.Desktop jalviewDesktop)
+ public static boolean setAPQHandlers(GDesktop desktop)
{
FlatDesktop.setAboutHandler(() -> {
- jalviewDesktop.aboutMenuItem_actionPerformed(null);
+ desktop.aboutMenuItem_actionPerformed(null);
});
FlatDesktop.setPreferencesHandler(() -> {
- jalviewDesktop.preferences_actionPerformed(null);
+ desktop.preferences_actionPerformed(null);
});
FlatDesktop.setQuitHandler(response -> {
boolean confirmQuit = jalview.bin.Cache
*/
package jalview.jbgui;
-import jalview.api.AlignmentViewPanel;
-import jalview.io.FileFormatException;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-
import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
+import jalview.api.AlignmentViewPanel;
+import jalview.bin.Cache;
+import jalview.io.FileFormatException;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
/**
* DOCUMENT ME!
*
*/
private void jbInit() throws Exception
{
+ /**
+ * 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));
+ }
+
setName("jalview-desktop");
FileMenu.setText(MessageManager.getString("action.file"));
HelpMenu.setText(MessageManager.getString("action.help"));
FileMenu.add(loadState);
FileMenu.addSeparator();
FileMenu.add(quit);
- HelpMenu.add(aboutMenuItem);
+ if (!APQHandlers.setAPQHandlers)
+ {
+ HelpMenu.add(aboutMenuItem);
+ }
HelpMenu.add(documentationMenuItem);
- if (!Platform.isAMacAndNotJS() || specversion < 11)
+ if (!APQHandlers.setAPQHandlers)
{
toolsMenu.add(preferences);
}