Author: mmichaud
Date: 2009-04-03 08:27:18 -0700 (Fri, 03 Apr 2009)
New Revision: 16457

Modified:
   
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/AbstractGuiHandler.java
Log:


Modified: 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/AbstractGuiHandler.java
===================================================================
--- 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/AbstractGuiHandler.java
      2009-04-03 12:03:08 UTC (rev 16456)
+++ 
core3/work-swing-impl/trunk/src/main/java/org/cytoscape/work/internal/tunables/AbstractGuiHandler.java
      2009-04-03 15:27:18 UTC (rev 16457)
@@ -6,6 +6,7 @@
 import java.awt.event.ActionListener;
 import java.lang.reflect.Field;
 import java.util.LinkedList;
+import java.util.List;
 
 import javax.swing.JPanel;
 import javax.swing.event.ChangeEvent;
@@ -25,34 +26,44 @@
     private String depName;
     private String depState;
 
-       private java.util.List<Guihandler> deps;
+    private String depUnState;
+    
+       private List<Guihandler> deps;
 
        protected AbstractGuiHandler(Field f, Object o, Tunable t) {
-               super(f,o,t);   
+               super(f,o,t);
         String s = t.dependsOn();
-        if ( !s.equals("") ) {
-            depName = s.substring(0,s.indexOf("="));
-            depState = s.substring(s.indexOf("=") + 1);
-        }
+                if ( !s.equals("") ) {
+                       if(!s.contains("!=")){
+                               depName = s.substring(0,s.indexOf("="));
+                               depState = s.substring(s.indexOf("=") + 1);
+                               depUnState = "";
+                       }
+                       else {
+                               depName = s.substring(0,s.indexOf("!"));
+                               depUnState = s.substring(s.indexOf("=")+1);
+                               depState = "";
+                       }
+               }
        
                deps = new LinkedList<Guihandler>();
                panel = new JPanel();
        }
 
        public void actionPerformed(ActionEvent ae) {
+               notifyDependents();
                handle();
-               notifyDependents();
        }
 
        public void stateChanged(ChangeEvent e){
-               handle();
+//             handle();
                notifyDependents();
        }
        
     public void valueChanged(ListSelectionEvent le) {
        boolean ok = le.getValueIsAdjusting();
        if(!ok){
-               handle();
+//             handle();
                notifyDependents();
        }
     }
@@ -88,11 +99,25 @@
                // if the dependency name matches ...
         if ( depName.equals(name) ) {
                        // ... and the state matches, then enable 
-                       if ( depState.equals(state) )
-                               setEnabledContainer(true,panel); 
+               if(depState!=""){
+                       if ( depState.equals(state) ){
+                               setEnabledContainer(true,panel);
+                               handle();}
                        // ... and the state doesn't match, then disable 
-                       else    
-                               setEnabledContainer(false,panel); 
+                       else{
+                               setEnabledContainer(false,panel);
+                       }
+               }
+               else {
+                       if ( !depUnState.equals(state) ){
+                               setEnabledContainer(true,panel);
+                               handle();
+                       }
+                       // ... and the state doesn't match, then disable 
+                       else{
+                               setEnabledContainer(false,panel);
+                       }
+               }
                }
 
         return;


--~--~---------~--~----~------------~-------~--~----~
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