MenuItem item = new MenuItem(label);
item.addActionListener(new java.awt.event.ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
ap.alignFrame.showURL(url, target);
linkMenu.add(item);
}
+ @Override
public void itemStateChanged(ItemEvent evt)
{
if (evt.getSource() == abovePIDColour)
}
}
+ @Override
public void actionPerformed(ActionEvent evt)
{
Object source = evt.getSource();
void hideSequences(boolean representGroup)
{
- SequenceGroup sg = ap.av.getSelectionGroup();
- if (sg == null || sg.getSize() < 1)
- {
- ap.av.hideSequence(new SequenceI[] { seq });
- return;
- }
-
- ap.av.setSelectionGroup(null);
-
- if (representGroup)
- {
- ap.av.hideRepSequences(seq, sg);
-
- return;
- }
-
- int gsize = sg.getSize();
- SequenceI[] hseqs;
-
- hseqs = new SequenceI[gsize];
-
- int index = 0;
- for (int i = 0; i < gsize; i++)
- {
- hseqs[index++] = sg.getSequenceAt(i);
- }
-
- ap.av.hideSequence(hseqs);
- ap.av.sendSelection();
+ ap.av.hideSequences(seq, representGroup);
}
/**
void hideSequences(boolean representGroup)
{
- SequenceGroup sg = ap.av.getSelectionGroup();
- if (sg == null || sg.getSize() < 1)
- {
- ap.av.hideSequence(new SequenceI[] { sequence });
- return;
- }
-
- ap.av.setSelectionGroup(null);
-
- if (representGroup)
- {
- ap.av.hideRepSequences(sequence, sg);
-
- return;
- }
-
- int gsize = sg.getSize();
- SequenceI[] hseqs = sg.getSequences().toArray(new SequenceI[gsize]);
-
- ap.av.hideSequence(hseqs);
- // refresh(); TODO: ? needed ?
- ap.av.sendSelection();
+ ap.av.hideSequences(sequence, representGroup);
}
public void copy_actionPerformed()
}
/**
+ * Hides the specified sequence, or the sequences it represents
+ *
+ * @param sequence
+ * the sequence to hide, or keep as representative
+ * @param representGroup
+ * if true, hide the current selection group except for the
+ * representative sequence
+ */
+ public void hideSequences(SequenceI sequence, boolean representGroup)
+ {
+ if (selectionGroup == null || selectionGroup.getSize() < 1)
+ {
+ hideSequence(new SequenceI[] { sequence });
+ return;
+ }
+
+ if (representGroup)
+ {
+ hideRepSequences(sequence, selectionGroup);
+ setSelectionGroup(null);
+ return;
+ }
+
+ int gsize = selectionGroup.getSize();
+ SequenceI[] hseqs = selectionGroup.getSequences().toArray(
+ new SequenceI[gsize]);
+
+ hideSequence(hseqs);
+ setSelectionGroup(null);
+ sendSelection();
+ }
+
+ /**
* Set visibility for any annotations for the given sequence.
*
* @param sequenceI