e.printStackTrace();
}
+ JMenuItem menuItem;
if (seq != null)
{
sequenceMenu.setText(sequence.getName());
- JMenuItem menuItem;
if (seq.getDatasetSequence().getPDBId() != null
&& seq.getDatasetSequence().getPDBId().size() > 0)
{
});
add(menuItem);
}
-
+ }
+ }
+ // for the case when no sequences are even visible
+ if (ap.av.hasHiddenRows) {
+ {
menuItem = new JMenuItem("Reveal All");
menuItem.addActionListener(new ActionListener()
{
SequenceGroup sg = ap.av.getSelectionGroup();
- if (sg != null)
+ if (sg != null&& sg.getSize()>0)
{
groupName.setText("Name: "+sg.getName());
groupName.setText("Edit name and description of current group.");
}
// Add a 'show all structures' for the current selection
Hashtable<String, PDBEntry> pdbe=new Hashtable<String,PDBEntry>();
+ SequenceI sqass=null;
for (SequenceI sq: ap.av.getSequenceSelection())
{
Vector<PDBEntry> pes = (Vector<PDBEntry>) sq.getDatasetSequence().getPDBId();
for (PDBEntry pe: pes)
{
pdbe.put(pe.getId(), pe);
+ if (sqass==null)
+ {
+ sqass = sq;
+ }
}
}
}
{
final PDBEntry[] pe = pdbe.values().toArray(new PDBEntry[pdbe.size()]);
final JMenuItem gpdbview;
- structureMenu.add(gpdbview=new JMenuItem("View "+pdbe.size()+" structures."));
+ if (pdbe.size()==1)
+ {
+ structureMenu.add(gpdbview=new JMenuItem("View structure for "+sqass.getDisplayId(false)));
+ } else {
+ structureMenu.add(gpdbview=new JMenuItem("View all "+pdbe.size()+" structures."));
+ }
+ gpdbview.setToolTipText("Open a new Jmol view with all structures associated with the current selection and superimpose them using the alignment.");
gpdbview.addActionListener(new ActionListener()
{
structureMenu.setVisible(false);
}
- if (links != null && links.size() > 0)
+ if (seq !=null && links != null && links.size() > 0)
{
JMenu linkMenu = new JMenu("Link");