Author: akuchinsky
Date: 2008-09-24 05:56:30 -0700 (Wed, 24 Sep 2008)
New Revision: 14950
Modified:
csplugins/trunk/agilent/kuchinsky/BubbleRouter/src/cytoscape/bubbleRouter/BubbleRouterPlugin.java
Log:
map control-click on Mac platform to context menu
Modified:
csplugins/trunk/agilent/kuchinsky/BubbleRouter/src/cytoscape/bubbleRouter/BubbleRouterPlugin.java
===================================================================
---
csplugins/trunk/agilent/kuchinsky/BubbleRouter/src/cytoscape/bubbleRouter/BubbleRouterPlugin.java
2008-09-23 23:49:26 UTC (rev 14949)
+++
csplugins/trunk/agilent/kuchinsky/BubbleRouter/src/cytoscape/bubbleRouter/BubbleRouterPlugin.java
2008-09-24 12:56:30 UTC (rev 14950)
@@ -207,6 +207,12 @@
private static final String REGION_NETWORK_ATT = "__Region_network";
private int viewID = 0;
+
+ /**
+ * String used to compare against os.name System property -
+ * to determine if we are running on Windows platform.
+ */
+ static final String MAC_OS_ID = "mac";
/**
* Constructor
@@ -598,7 +604,8 @@
* @see
java.awt.event.MouseListener#mousePressed(java.awt.event.MouseEvent)
*/
public void mousePressed(MouseEvent e) {
- if (e.getButton() == MouseEvent.BUTTON3) {
+ if ((e.getButton() == MouseEvent.BUTTON3) ||
+ (e.isControlDown() && (isMacPlatform()))) {
setRegionSelection(e);
processRegionContextMenu(e);
} else {
@@ -909,6 +916,17 @@
}
/**
+ * Routine which determines if we are running on mac platform
+ *
+ * @return boolean
+ */
+ private boolean isMacPlatform() {
+ String os = System.getProperty("os.name");
+
+ return os.regionMatches(true, 0, MAC_OS_ID, 0,
MAC_OS_ID.length());
+ }
+
+ /**
* Upon mouse release, calculate rectangular dimensions, create
LayoutRegion
* object, and send region to LayoutRegionManager, add to a prefab
canvas
*/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---