Desktop.getDesktop().propertyChange(evt);
}
+
+ /**
+ * BH 2018
+ *
+ * @return true if we have any features
+ */
+ @Override
+ protected boolean haveAlignmentFeatures() {
+ AlignmentI alignment = getViewport().getAlignment();
+
+ for (int i = 0; i < alignment.getHeight(); i++)
+ {
+ SequenceI seq = alignment.getSequenceAt(i);
+ for (String group : seq.getFeatures().getFeatureGroups(true))
+ {
+ if (group != null)return true;
+ }
+ }
+ return false;
+ }
+
/**
* initalise the alignframe from the underlying viewport data and the
* configurations
protected JCheckBoxMenuItem normaliseSequenceLogo = new JCheckBoxMenuItem();
protected JCheckBoxMenuItem applyAutoAnnotationSettings = new JCheckBoxMenuItem();
+
+ protected JMenuItem openFeatureSettings;
private SequenceAnnotationOrder annotationSortOrder;
addMenuActionAndAccelerator(keyStroke, closeMenuItem, al);
JMenu editMenu = new JMenu(MessageManager.getString("action.edit"));
- JMenu viewMenu = new JMenu(MessageManager.getString("action.view"));
+ JMenu viewMenu = new JMenu(MessageManager.getString("action.view")) {
+
+ public void setPopupMenuVisible(boolean b) {
+ if (b) {
+ System.out.println("openFeatureSettings " + haveAlignmentFeatures());
+ openFeatureSettings.setEnabled(haveAlignmentFeatures());
+ }
+ super.setPopupMenuVisible(b);
+ }
+
+ };
JMenu annotationsMenu = new JMenu(
MessageManager.getString("action.annotations"));
JMenu showMenu = new JMenu(MessageManager.getString("action.show"));
}
});
- JMenuItem openFeatureSettings = new JMenuItem(
+ openFeatureSettings = new JMenuItem(
MessageManager.getString("action.feature_settings"));
+ openFeatureSettings.setEnabled(false);
openFeatureSettings.addActionListener(new ActionListener()
{
@Override
// selectMenu.add(listenToViewSelections);
}
+ protected boolean haveAlignmentFeatures()
+ {
+ // because gAlignFrame is not an abstract class -- see AlignFrame
+ return false;
+ }
+
protected void loadVcf_actionPerformed()
{
}