e.printStackTrace();
}
- if (Platform.isWin()) //!Platform.isAMacAndNotJS())
+ if (Platform.allowMnemonics())
{
+ //BH was !Platform.isAMacAndNotJS()) i.e. "JS or not Mac"
+ // but here we want just not a Mac, period, right?
FileMenu.setMnemonic('F');
inputLocalFileMenuItem.setMnemonic('L');
- VamsasMenu.setMnemonic('V');
+ VamsasMenu.setMnemonic('V');
inputURLMenuItem.setMnemonic('U');
inputTextboxMenuItem.setMnemonic('C');
quit.setMnemonic('Q');
package jalview.util;
import java.awt.Toolkit;
-import java.awt.event.InputEvent;
import java.awt.event.MouseEvent;
import javax.swing.SwingUtilities;
public class Platform
{
- private static Boolean isNoJSMac = null, isNoJSWin = null, isMac = null, isWin = null;
+ private static boolean isJS = /** @j2sNative true || */false;
+ private static Boolean isNoJSMac = null, isNoJSWin = null,
+ isMac = null, isWin = null;
+
private static Boolean isHeadless = null;
/**
* added to group mouse events into Windows and nonWindows (mac, unix, linux)
* @return
*/
- public static boolean isMac()
+ public static boolean isMac()
{
return (isMac == null ? (isMac = (System.getProperty("os.name").indexOf("Mac") >= 0)) : isMac);
}
}
/**
+ *
+ * @return true if HTML5 JavaScript
+ */
+ public static boolean isJS()
+ {
+ return isJS;
+ }
+
+ /**
* sorry folks - Macs really are different
*
* BH: disabled for SwingJS -- will need to check key-press issues
*/
public static boolean isAMacAndNotJS()
{
- return (isNoJSMac == null ? (isNoJSMac = /** @j2sNative false && */isMac()) : isNoJSMac);
+ return (isNoJSMac == null ? (isNoJSMac = !isJS && isMac()) : isNoJSMac);
}
/**
*/
public static boolean isWindowsAndNotJS()
{
- return (isNoJSWin == null ? (isNoJSWin = /** @j2sNative false && */isWin()) : isNoJSWin);
+ return (isNoJSWin == null ? (isNoJSWin = !isJS && isWin()) : isNoJSWin);
}
/**
// was !isAMac(), but that is true also for Linux and Unix and JS
return isWin() && SwingUtilities.isMiddleMouseButton(e);
}
+
+ public static boolean allowMnemonics()
+ {
+ return !isMac();
+ }
}