package jalview.appletgui;
import java.util.*;
-
import java.awt.*;
import java.awt.event.*;
{
editName();
}
+ else if (source == makeReferenceSeq)
+ {
+ makeReferenceSeq_actionPerformed();
+ }
else if (source == sequenceDetails)
{
showSequenceDetails();
toLower.addActionListener(this);
editMenu.add(toggleCase);
seqMenu.add(sequenceName);
+ seqMenu.add(makeReferenceSeq);
// seqMenu.add(sequenceDetails);
if (!ap.av.applet.useXtrnalSviewer)
repGroup.addActionListener(this);
revealAll.addActionListener(this);
revealSeq.addActionListener(this);
+ makeReferenceSeq.addActionListener(this);
}
void refresh()
getGroup().setDisplayText(showText.getState());
refresh();
}
+ public void makeReferenceSeq_actionPerformed()
+ {
+ if (!ap.av.getAlignment().hasSeqrep())
+ {
+ // initialise the display flags so the user sees something happen
+ ap.av.setDisplayReferenceSeq(true);
+ ap.av.setColourByReferenceSeq(true);
+ ap.av.getAlignment().setSeqrep(seq);
+ }
+ else
+ {
+ if (ap.av.getAlignment().getSeqrep() == seq)
+ {
+ ap.av.getAlignment().setSeqrep(null);
+ }
+ else
+ {
+ ap.av.getAlignment().setSeqrep(seq);
+ }
+ }
+ refresh();
+ }
public void showNonconserved_itemStateChanged()
{
package jalview.gui;
import java.util.*;
-
import java.awt.*;
import java.awt.event.*;
JMenuItem sequenceDetails = new JMenuItem();
JMenuItem sequenceSelDetails = new JMenuItem();
+
+ JMenuItem makeReferenceSeq = new JMenuItem();
SequenceI sequence;
if (seq != null)
{
sequenceMenu.setText(sequence.getName());
+ if (seq == ap.av.getAlignment().getSeqrep())
+ {
+ makeReferenceSeq.setText("Unmark representative");
+ } else {
+ makeReferenceSeq.setText("Mark as representative");
+ }
if (seq.getDatasetSequence().getPDBId() != null
&& seq.getDatasetSequence().getPDBId().size() > 0)
}
// structureMenu.remove(colStructureMenu);
}
-
if (ap.av.getAlignment().isNucleotide() == true)
{
AlignmentAnnotation[] aa = ap.av.getAlignment()
}
}
}
-
}
menuItem = new JMenuItem("Hide Sequences");
editSequence_actionPerformed(actionEvent);
}
});
-
+ makeReferenceSeq.setText("Mark as representative");
+ makeReferenceSeq.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ makeReferenceSeq_actionPerformed(actionEvent);
+
+ }
+ });
/*
* annotationMenuItem.setText("By Annotation");
* annotationMenuItem.addActionListener(new ActionListener() { public void
groupMenu.add(jMenu1);
sequenceMenu.add(sequenceName);
sequenceMenu.add(sequenceDetails);
+ sequenceMenu.add(makeReferenceSeq);
colourMenu.add(textColour);
colourMenu.add(noColourmenuItem);
colourMenu.add(clustalColour);
});
}
+ protected void makeReferenceSeq_actionPerformed(ActionEvent actionEvent)
+ {
+ if (!ap.av.getAlignment().hasSeqrep())
+ {
+ // initialise the display flags so the user sees something happen
+ ap.av.setDisplayReferenceSeq(true);
+ ap.av.setColourByReferenceSeq(true);
+ ap.av.getAlignment().setSeqrep(sequence);
+ }
+ else
+ {
+ if (ap.av.getAlignment().getSeqrep() == sequence)
+ {
+ ap.av.getAlignment().setSeqrep(null);
+ }
+ else
+ {
+ ap.av.getAlignment().setSeqrep(sequence);
+ }
+ }
+ refresh();
+ }
+
protected void sequenceSelectionDetails_actionPerformed()
{
createSequenceDetailsReport(ap.av.getSequenceSelection());