/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
*/
package jalview.appletgui;
+import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.SequenceGroup;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.ColourSchemeI;
oldgroupColours = new Hashtable();
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- if (sg.cs != null)
+ if (sg.getColourScheme() != null)
{
- oldgroupColours.put(sg, sg.cs);
+ oldgroupColours.put(sg, sg.getColourScheme());
}
else
{
slider.addAdjustmentListener(this);
slider.addMouseListener(this);
- if (av.getAlignment().getAlignmentAnnotation() == null)
+ AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
+ if (anns == null)
{
return;
}
// seqAssociated.setState(acg.isSeqAssociated());
}
- Vector list = new Vector();
+ Vector<String> list = new Vector<String>();
int index = 1;
- for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
+ for (int i = 0; i < anns.length; i++)
{
- String label = av.getAlignment().getAlignmentAnnotation()[i].label;
+ String label = anns[i].label;
+ if (anns[i].sequenceRef != null)
+ {
+ label = label + "_" + anns[i].sequenceRef.getName();
+ }
if (!list.contains(label))
{
list.addElement(label);
}
threshold.addItem(MessageManager
- .getString("label.threshold_feature_no_thereshold"));
+ .getString("label.threshold_feature_no_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_above_thereshold"));
+ .getString("label.threshold_feature_above_threshold"));
threshold.addItem(MessageManager
- .getString("label.threshold_feature_below_thereshold"));
+ .getString("label.threshold_feature_below_threshold"));
if (oldcs instanceof AnnotationColourGradient)
{
default:
throw new Error(
MessageManager
- .getString("error.implementation_error_dont_know_thereshold_annotationcolourgradient"));
+ .getString("error.implementation_error_dont_know_threshold_annotationcolourgradient"));
}
thresholdIsMin.setState(acg.thresholdIsMinMax);
thresholdValue.setText("" + acg.getAnnotationThreshold());
Checkbox thresholdIsMin = new Checkbox();
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == thresholdValue)
}
else if (evt.getSource() == ok)
{
- changeColour();
frame.setVisible(false);
}
else if (evt.getSource() == cancel)
}
}
+ @Override
public void itemStateChanged(ItemEvent evt)
{
if (evt.getSource() == currentColours)
changeColour();
}
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
if (!adjusting)
AnnotationColourGradient acg = null;
if (currentColours.getState())
{
- acg = new AnnotationColourGradient(currentAnnotation,
- av.getGlobalColourScheme(), aboveThreshold);
}
else
{
for (SequenceGroup sg : ap.av.getAlignment().getGroups())
{
- if (sg.cs == null)
+ if (sg.getColourScheme() == null)
{
continue;
}
if (currentColours.getState())
{
- sg.cs = new AnnotationColourGradient(currentAnnotation, sg.cs,
- aboveThreshold);
+ sg.setColourScheme(new AnnotationColourGradient(
+ currentAnnotation, sg.getColourScheme(), aboveThreshold));
}
else
{
- sg.cs = new AnnotationColourGradient(currentAnnotation,
- minColour.getBackground(), maxColour.getBackground(),
- aboveThreshold);
+ sg.setColourScheme(new AnnotationColourGradient(
+ currentAnnotation, minColour.getBackground(), maxColour
+ .getBackground(), aboveThreshold));
}
}
Object cs = oldgroupColours.get(sg);
if (cs instanceof ColourSchemeI)
{
- sg.cs = (ColourSchemeI) cs;
+ sg.setColourScheme((ColourSchemeI) cs);
}
else
{
// probably the "null" string we set it to if it was null originally.
- sg.cs = null;
+ sg.setColourScheme(null);
}
}
}
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
}
+ @Override
public void mousePressed(MouseEvent evt)
{
}
+ @Override
public void mouseReleased(MouseEvent evt)
{
ap.paintAlignment(true);
}
+ @Override
public void mouseEntered(MouseEvent evt)
{
}
+ @Override
public void mouseExited(MouseEvent evt)
{
}