Threshold single element
authoramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:25:27 +0000 (15:25 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 15 Feb 2006 15:25:27 +0000 (15:25 +0000)
src/jalview/gui/AnnotationColourChooser.java
src/jalview/gui/AnnotationLabels.java
src/jalview/gui/AnnotationPanel.java

index 06040a6..25eee10 100755 (executable)
@@ -221,9 +221,9 @@ public class AnnotationColourChooser
     else if(threshold.getSelectedItem().equals("Below Threshold"))\r
       aboveThreshold = AnnotationColourGradient.BELOW_THRESHOLD;\r
 \r
-    if(aboveThreshold!=AnnotationColourGradient.NO_THRESHOLD && aa.graphLines==null)\r
+    if(aboveThreshold!=AnnotationColourGradient.NO_THRESHOLD && aa.threshold==null)\r
    {\r
-     aa.addGraphLine(new jalview.datamodel.GraphLine((aa.graphMax-aa.graphMin)/2f, "Threshold", Color.black));\r
+     aa.setThreshold(new jalview.datamodel.GraphLine((aa.graphMax-aa.graphMin)/2f, "Threshold", Color.black));\r
    }\r
 \r
     AnnotationColourGradient acg = new AnnotationColourGradient(aa,\r
index 1068980..bffa89a 100755 (executable)
@@ -449,7 +449,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
 \r
                 if (aa[i].graph>0)\r
                 {\r
-                  if (aa[i].graphLines != null)\r
+                /*  if (aa[i].graphLines != null)\r
                   {\r
                     for (int gl = 0; gl < aa[i].graphLines.size(); gl++)\r
                     {\r
@@ -470,7 +470,7 @@ public class AnnotationLabels extends JPanel implements MouseListener,
                                  graphExtras);\r
                       g2.setStroke(new BasicStroke());\r
                     }\r
-                  }\r
+                  }*/\r
                     y += ((2 * aa[i].height) / 3);\r
                 }\r
                 else\r
index f30c41c..41479aa 100755 (executable)
@@ -364,8 +364,7 @@ public class AnnotationPanel extends JPanel implements MouseListener,
                 else if(aa[i].graph>0)\r
                 {\r
                   if(SwingUtilities.isRightMouseButton(evt)\r
-                      && aa[i].graphLines!=null\r
-                       && aa[i].graphLines.size()>0)\r
+                      && aa[i].threshold!=null)\r
                   {\r
                     SliderPanel sp = new SliderPanel(aa[i], ap);\r
                     return;\r
@@ -978,21 +977,18 @@ public class AnnotationPanel extends JPanel implements MouseListener,
       g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2);\r
 \r
 \r
-      if(aa.graphLines!=null)\r
+      if(aa.threshold!=null)\r
       {\r
-        for(int l=0; l<aa.graphLines.size(); l++)\r
-        {\r
-          g.setColor(aa.getGraphLine(l).colour);\r
+          g.setColor(aa.threshold.colour);\r
           Graphics2D g2 = (Graphics2D)g;\r
           g2.setStroke(new BasicStroke(1,\r
                                         BasicStroke.CAP_SQUARE,\r
                                         BasicStroke.JOIN_ROUND, 3f,\r
                                         new float[] { 5f, 3f }, 0f));\r
 \r
-          y2 = (int)(y - ((aa.getGraphLine(l).value-min) / range)*graphHeight);\r
+          y2 = (int)(y - ((aa.threshold.value-min) / range)*graphHeight);\r
           g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2);\r
           g2.setStroke(new BasicStroke());\r
-        }\r
       }\r
 \r
       eRes = Math.min(eRes, aa.annotations.length);\r
@@ -1023,21 +1019,18 @@ public class AnnotationPanel extends JPanel implements MouseListener,
 \r
       float range = max - min;\r
 \r
-      if(aa.graphLines!=null)\r
+      if(aa.threshold!=null)\r
       {\r
-        for(int l=0; l<aa.graphLines.size(); l++)\r
-        {\r
-          g.setColor(aa.getGraphLine(l).colour);\r
+          g.setColor(aa.threshold.colour);\r
           Graphics2D g2 = (Graphics2D)g;\r
           g2.setStroke(new BasicStroke(1,\r
                                         BasicStroke.CAP_SQUARE,\r
                                         BasicStroke.JOIN_ROUND, 3f,\r
                                         new float[] { 5f, 3f }, 0f));\r
 \r
-          y2 = (int)(y - ((aa.getGraphLine(l).value-min) / range)*aa.graphHeight);\r
+          y2 = (int)(y - ((aa.threshold.value-min) / range)*aa.graphHeight);\r
           g.drawLine(x-av.charWidth,y2,(eRes-sRes+1)*av.charWidth,y2);\r
           g2.setStroke(new BasicStroke());\r
-        }\r
       }\r
 \r
       y1 = y2 = y;\r