Author: mes
Date: 2011-01-18 16:11:19 -0800 (Tue, 18 Jan 2011)
New Revision: 23503
Modified:
core3/swing-util/trunk/src/main/java/org/cytoscape/util/swing/JMenuTracker.java
Log:
fixed a bug that disallowed submenus with the same names
Modified:
core3/swing-util/trunk/src/main/java/org/cytoscape/util/swing/JMenuTracker.java
===================================================================
---
core3/swing-util/trunk/src/main/java/org/cytoscape/util/swing/JMenuTracker.java
2011-01-19 00:07:05 UTC (rev 23502)
+++
core3/swing-util/trunk/src/main/java/org/cytoscape/util/swing/JMenuTracker.java
2011-01-19 00:11:19 UTC (rev 23503)
@@ -119,12 +119,14 @@
StringTokenizer st = new StringTokenizer(menu_string, ".");
JMenu parent_menu = null;
JMenu menu = null;
+ String menu_key = null;
while (st.hasMoreTokens()) {
String menu_token = st.nextToken();
+ menu_key = menu_key == null ? menu_token : menu_key +
"." + menu_token;
- if (menuMap.containsKey(menu_token)) {
- menu = menuMap.get(menu_token);
+ if (menuMap.containsKey(menu_key)) {
+ menu = menuMap.get(menu_key);
} else {
menu = new JMenu(menu_token);
@@ -139,7 +141,7 @@
else
throw new IllegalStateException("we
have no root popup menu or menu bar!");
- menuMap.put(menu_token, menu);
+ menuMap.put(menu_key, menu);
}
parent_menu = menu;
--
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.