*/
package jalview.appletgui;
+import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.SequenceGroup;
import jalview.schemes.AnnotationColourGradient;
import jalview.schemes.ColourSchemeI;
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);
Checkbox thresholdIsMin = new Checkbox();
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == thresholdValue)
}
}
+ @Override
public void itemStateChanged(ItemEvent evt)
{
if (evt.getSource() == currentColours)
changeColour();
}
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
if (!adjusting)
}
+ @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)
{
}
slider.addAdjustmentListener(this);
slider.addMouseListener(this);
- if (av.getAlignment().getAlignmentAnnotation() == null)
+ AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
+ if (anns == null)
{
return;
}
setOldColumnSelection(av.getColumnSelection());
adjusting = true;
- 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);
this.validate();
}
+ @Override
@SuppressWarnings("unchecked")
public void reset()
{
}
+ @Override
public void adjustmentValueChanged(AdjustmentEvent evt)
{
if (!adjusting)
});
}
+ @Override
public void valueChanged(boolean updateAllAnnotation)
{
if (slider.isEnabled())
}
}
+ @Override
public void actionPerformed(ActionEvent evt)
{
if (evt.getSource() == thresholdValue)
}
- public Vector getAnnotationItems(boolean isSeqAssociated)
- {
- Vector list = new Vector();
- int index = 1;
- int[] anmap = new int[av.getAlignment().getAlignmentAnnotation().length];
- for (int i = 0; i < av.getAlignment().getAlignmentAnnotation().length; i++)
- {
- if (av.getAlignment().getAlignmentAnnotation()[i].sequenceRef == null)
- {
- if (isSeqAssociated)
- {
- continue;
- }
- }
- else
- {
- enableSeqAss = true;
- }
- String label = av.getAlignment().getAlignmentAnnotation()[i].label;
- // add associated sequence ID if available
- if (!isSeqAssociated
- && av.getAlignment().getAlignmentAnnotation()[i].sequenceRef != null)
- {
- label = label
- + "_"
- + av.getAlignment().getAlignmentAnnotation()[i].sequenceRef
- .getName();
- }
- // make label unique
- if (!list.contains(label))
- {
- anmap[list.size()] = i;
- list.add(label);
-
- }
- else
- {
- if (!isSeqAssociated)
- {
- anmap[list.size()] = i;
- list.add(label + "_" + (index++));
- }
- }
- }
- this.annmap = new int[list.size()];
- System.arraycopy(anmap, 0, this.annmap, 0, this.annmap.length);
- return list;
- }
-
protected int getSelectedThresholdItem(int indexValue)
{
int selectedThresholdItem = -1;
}
String label = av.getAlignment().getAlignmentAnnotation()[i].label;
// add associated sequence ID if available
- if (!isSeqAssociated
- && av.getAlignment().getAlignmentAnnotation()[i].sequenceRef != null)
+ if (av.getAlignment().getAlignmentAnnotation()[i].sequenceRef != null)
{
label = label
+ "_"
{
anmap[list.size()] = i;
list.add(label);
-
}
else
{