import javax.swing.JCheckBoxMenuItem;
import javax.swing.JInternalFrame;
-import javax.swing.JMenu;
import javax.swing.JPanel;
import javax.swing.JSplitPane;
import javax.swing.SwingUtilities;
{
super.initMenus();
- viewerActionMenu = new JMenu(MessageManager.getString("label.jmol"));
+ viewerActionMenu.setText(MessageManager.getString("label.jmol"));
viewerColour
.setText(MessageManager.getString("label.colour_with_jmol"));
return "Chimera";
}
+ /**
+ * Override superclass method to make the 'Chimera' menu always visible, but
+ * 'Superpose with...' only enabled if there is more than one structure shown
+ */
@Override
public void updateTitleAndMenus()
{
super.updateTitleAndMenus();
viewerActionMenu.setVisible(true);
+ viewSelectionMenu.setEnabled(false);
+ if (getBinding().getPdbFile().length > 1
+ && getBinding().getSequence().length > 1)
+ {
+ viewSelectionMenu.setEnabled(true);
+ }
}
}
protected boolean allChainsSelected = false;
+ protected JMenu viewSelectionMenu;
+
/**
* Default constructor
*/
@Override
public void itemStateChanged(ItemEvent e)
{
- alignStructs.setEnabled(_alignwith.size() > 0);
+ alignStructs.setEnabled(!_alignwith.isEmpty());
alignStructs.setToolTipText(MessageManager.formatMessage(
"label.align_structures_using_linked_alignment_views",
new String[] { String.valueOf(_alignwith.size()) }));
}
};
- JMenu alpanels = new ViewSelectionMenu(
+ viewSelectionMenu = new ViewSelectionMenu(
MessageManager.getString("label.superpose_with"), this,
_alignwith, handler);
handler.itemStateChanged(null);
- viewerActionMenu.add(alpanels);
+ viewerActionMenu.add(viewSelectionMenu);
viewerActionMenu.addMenuListener(new MenuListener()
{
@Override
}
});
- viewerActionMenu = new JMenu();
+ viewerActionMenu = new JMenu(); // text set in sub-classes
viewerActionMenu.setVisible(false);
viewerActionMenu.add(alignStructs);
colourMenu = new JMenu();