Author: scooter
Date: 2011-06-09 21:46:57 -0700 (Thu, 09 Jun 2011)
New Revision: 25707

Modified:
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
   
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/commands/ClusterMakerCommandHandler.java
Log:
Fixes for clusterMaker commands


Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
     2011-06-10 02:58:25 UTC (rev 25706)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/algorithms/EdgeAttributeHandler.java
     2011-06-10 04:46:57 UTC (rev 25707)
@@ -77,6 +77,7 @@
        private EdgeWeightConverter converter = null;
        private boolean supportAdjustments = false;
        private Double edgeCutOff = null;
+       private Double setEdgeCutOff = null;
        private String[] attributeArray = new String[1];
        private List<EdgeWeightConverter>converters = null;
 
@@ -233,6 +234,7 @@
                // just update the histogram, if it's up
                if (tunable.getName().equals("edgeCutOff")) {
                        edgeCutOff = (Double) tunable.getValue();
+                       setEdgeCutOff = edgeCutOff;
                        if (histo != null) {
                                // No backs!
                                histo.removeHistoChangeListener(this);
@@ -250,13 +252,23 @@
                Tunable t = clusterProperties.get("edgeHistogram");
                t.clearFlag(Tunable.IMMUTABLE);
 
+               // System.out.println("edgeCutOff = "+edgeCutOff);
                this.matrix = new DistanceMatrix(dataAttribute, selectedOnly, 
converter);
                double dataArray[] = matrix.getEdgeValues();
                double range = matrix.getMaxWeight() - matrix.getMinWeight();
+               // System.out.println("Max weight = "+matrix.getMaxWeight());
+               // System.out.println("Min weight = "+matrix.getMinWeight());
                edgeCutOffTunable.setUpperBound(matrix.getMaxWeight());
                edgeCutOffTunable.setLowerBound(matrix.getMinWeight());
-               edgeCutOffTunable.setValue(matrix.getMinWeight());
-               edgeCutOff = (Double) edgeCutOffTunable.getValue();
+               if (setEdgeCutOff == null || 
+                   setEdgeCutOff > matrix.getMaxWeight() || setEdgeCutOff < 
matrix.getMinWeight()) {
+                       edgeCutOffTunable.setValue(matrix.getMinWeight());
+                       edgeCutOff = (Double) edgeCutOffTunable.getValue();
+               } else {
+                       edgeCutOffTunable.setValue(setEdgeCutOff);
+                       edgeCutOff = (Double) edgeCutOffTunable.getValue();
+               }
+               // System.out.println("edgeCutOff (2) = "+edgeCutOff);
 
                if (histo != null) {
                        histo.updateData(dataArray);

Modified: 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/commands/ClusterMakerCommandHandler.java
===================================================================
--- 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/commands/ClusterMakerCommandHandler.java
 2011-06-10 02:58:25 UTC (rev 25706)
+++ 
csplugins/trunk/ucsf/scooter/clusterMaker/src/clusterMaker/commands/ClusterMakerCommandHandler.java
 2011-06-10 04:46:57 UTC (rev 25707)
@@ -91,6 +91,7 @@
                                        } else {
                                                
target.setValue(value.toString());
                                        }
+                                       target.updateValueListeners();
                                } catch (Exception e) {
                                        throw new Exception("Unable to parse 
value for "+
                                                             t.getName()+": 
"+value.toString());

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