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