[kepler-dev] Kepler/Ptolemy on the Mac

higgins@nceas.ucsb.edu higgins at nceas.ucsb.edu
Thu May 13 07:35:26 PDT 2004


Hi All,

I have been investigating the use of Kepler/Ptolemy on the Mac. I did find
some threads on Mac use (especial concerning the single button mouse), but I
was still having some problems. In particular, one can find in the
'ActorEditorGraphController' class the code fragment

        if (UIManager.getLookAndFeel().getName().startsWith("MacOS")) {
            // On the Mac, do not override Control-Click, which is
            // used to bring up the context menu
            _linkCreator.setMouseFilter(_metaFilter);
        } else {
            _linkCreator.setMouseFilter(_controlFilter);
        }

Note the 'getName()' call and the string comparison to "MacOS". Unfortunately,
a test on my Mac (OS version 10.3.3) shows that the getName method returns 
"Mac OS X Aqua" (note the spaces!). Due to the spaces, the names do not match 
and the Mac is NEVER detected!

Apple suggests in their tech note 2042 (http://developer.apple.com/
documentation/Java/Conceptual/Java131Development/x_platform/
chapter_5_section_5.html) that the statement

System.getProperty("mrj.version")

should be used to detect a mac, with any non-null result indicating that the 
machine is a mac. This approach is independent of the string value which may 
change.

I did try changing the Kepler code to correct this detection problem. I was 
able to get it to properly detect my Mac, but it still does not popup the 
context menu using the control key + click. Anyone have any ideas?

Incidently, a 2 button mouse plugged into the Mac USB port does work OK with 
current code.

Dan Higgins
NCEAS


-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/



More information about the Kepler-dev mailing list