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;
JMenuItem createGroupMenuItem = new JMenuItem();
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(MessageManager.getString("action.hide_sequences"));\r
buildGroupURLMenu(sg, groupLinks);
}
// Add a 'show all structures' for the current selection
- Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>();
+ Hashtable<String, PDBEntry> pdbe = new Hashtable<String, PDBEntry>(),reppdb=new Hashtable<String,PDBEntry>();
SequenceI sqass = null;
for (SequenceI sq : ap.av.getSequenceSelection())
{
.getPDBId();
if (pes != null)
{
+ reppdb.put(pes.get(0).getId(),pes.get(0));
for (PDBEntry pe : pes)
{
pdbe.put(pe.getId(), pe);
if (pdbe.size() > 0)
{
final PDBEntry[] pe = pdbe.values().toArray(
- new PDBEntry[pdbe.size()]);
- final JMenuItem gpdbview;
+ new PDBEntry[pdbe.size()]),pr = reppdb.values().toArray(
+ new PDBEntry[reppdb.size()]);
+ final JMenuItem gpdbview,rpdbview;
if (pdbe.size() == 1)
{
structureMenu.add(gpdbview = new JMenuItem(MessageManager.formatMessage("label.view_structure_for", new String[]{sqass.getDisplayId(false)})));\r
}
else
{
- structureMenu.add(gpdbview = new JMenuItem(MessageManager.formatMessage("label.view_all_structures", new String[]{new Integer(pdbe.size()).toString()})));\r
+ structureMenu.add(gpdbview = new JMenuItem(MessageManager.formatMessage("label.view_all_structures", new String[]{new Integer(pdbe.size()).toString()}))); \r
}
gpdbview.setToolTipText(MessageManager.getString("label.open_new_jmol_view_with_all_structures_associated_current_selection_superimpose_using_alignment"));\r
gpdbview.addActionListener(new ActionListener()
new AppJmol(ap, pe, ap.av.collateForPDB(pe));
}
});
+ if (reppdb.size()>1 && reppdb.size()<pdbe.size())
+ {
+ structureMenu.add(rpdbview = new JMenuItem(MessageManager.formatMessage("label.view_all_representative_structures", new String[]{new Integer(reppdb.size()).toString()})));
+ rpdbview.setToolTipText(MessageManager.getString("label.open_new_jmol_view_with_all_representative_structures_associated_current_selection_superimpose_using_alignment"));
+ rpdbview.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ new AppJmol(ap, pr, ap.av.collateForPDB(pr));
+ }
+ });
+ }
}
}
else
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());