Author: pwang
Date: 2011-09-13 15:27:13 -0700 (Tue, 13 Sep 2011)
New Revision: 26785

Modified:
   
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/ExitAction.java
Log:
On Win/Linux, use ctrl-Q to quit Cytoscape

Modified: 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/ExitAction.java
===================================================================
--- 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/ExitAction.java
        2011-09-13 22:00:15 UTC (rev 26784)
+++ 
core3/impl/trunk/swing-application-impl/src/main/java/org/cytoscape/internal/actions/ExitAction.java
        2011-09-13 22:27:13 UTC (rev 26785)
@@ -42,6 +42,7 @@
 
 import java.awt.event.ActionEvent;
 import java.awt.event.KeyEvent;
+import java.awt.event.InputEvent;
 
 import javax.swing.KeyStroke;
 
@@ -67,8 +68,18 @@
        this.shutdown = shutdown;
        setPreferredMenu("File");
 
-       // TODO: need to create special case for Mac to use apple key.
-       setAcceleratorKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_Q, 
KeyEvent.VK_CONTROL));
+       String osName = System.getProperty("os.name").toLowerCase();
+       //boolean isMacOs = osName.startsWith("mac os x");
+       
+       if (osName.indexOf("mac") != -1) {    
+               // TODO: need to create special case for Mac to use apple key.
+               // do mac-specific things here
+               //setAcceleratorKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_C, 
InputEvent.META_MASK)); 
+               setAcceleratorKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_Q, 
KeyEvent.VK_CONTROL));
+       }
+       else {
+               setAcceleratorKeyStroke(KeyStroke.getKeyStroke(KeyEvent.VK_Q, 
InputEvent.CTRL_MASK));           
+       }
        setMenuGravity(1000.0f);
     }
 

-- 
You received this message because you are subscribed to the Google Groups 
"cytoscape-cvs" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/cytoscape-cvs?hl=en.

Reply via email to