*/
package jalview.jbgui;
+import jalview.bin.Cache;
+import jalview.gui.JvSwingUtils;
import jalview.schemes.ColourSchemeProperty;
import jalview.util.MessageManager;
public JCheckBoxMenuItem showSeqFeaturesHeight = new JCheckBoxMenuItem();
- JMenuItem chooseAnnotations = new JMenuItem();
-
JMenuItem deleteGroups = new JMenuItem();
JMenuItem createGroup = new JMenuItem();
JMenuItem showAllhidden = new JMenuItem();
+ protected JMenuItem showAllAnnotations = new JMenuItem();
+
+ protected JMenuItem hideAllAnnotations = new JMenuItem();
+
protected JCheckBoxMenuItem hiddenMarkers = new JCheckBoxMenuItem();
JMenuItem invertColSel = new JMenuItem();
}
} catch (Exception e)
{
+ System.err.println(e.toString());
}
if (!new jalview.util.Platform().isAMac())
}
});
removeRedundancyMenuItem.setText(MessageManager
- .getString("action.remove_redundancy"));
+ .getString("action.remove_redundancy").concat("..."));
removeRedundancyMenuItem.setAccelerator(javax.swing.KeyStroke
.getKeyStroke(java.awt.event.KeyEvent.VK_D, Toolkit
.getDefaultToolkit().getMenuShortcutKeyMask(), false));
annotationPanelMenuItem.setActionCommand("");
annotationPanelMenuItem.setText(MessageManager
.getString("label.show_annotations"));
- annotationPanelMenuItem.setState(jalview.bin.Cache.getDefault(
- "SHOW_ANNOTATIONS", true));
- annotationPanelMenuItem
- .addActionListener(new java.awt.event.ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent e)
- {
- annotationPanelMenuItem_actionPerformed(e);
- }
- });
+ annotationPanelMenuItem.setState(Cache.getDefault("SHOW_ANNOTATIONS",
+ true));
+ annotationPanelMenuItem.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotationPanelMenuItem_actionPerformed(e);
+ }
+ });
+ /*
+ * Show/hide all annotations only enabled if annotation panel is shown
+ */
+ showAllAnnotations.setText(MessageManager
+ .getString("label.show_all_annotations"));
+ showAllAnnotations.setEnabled(annotationPanelMenuItem.getState());
+ showAllAnnotations.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showAllAnnotations_actionPerformed();
+ }
+ });
+ hideAllAnnotations.setText(MessageManager
+ .getString("label.hide_all_annotations"));
+ hideAllAnnotations.setEnabled(annotationPanelMenuItem.getState());
+ hideAllAnnotations.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hideAllAnnotations_actionPerformed();
+ }
+ });
colourTextMenuItem.setText(MessageManager
.getString("label.colour_text"));
colourTextMenuItem
findMenuItem.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
java.awt.event.KeyEvent.VK_F, Toolkit.getDefaultToolkit()
.getMenuShortcutKeyMask(), false));
+ findMenuItem.setToolTipText(JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("label.find_tip")));
findMenuItem.addActionListener(new java.awt.event.ActionListener()
{
@Override
showSeqFeatures_actionPerformed(actionEvent);
}
});
- chooseAnnotations.setText(MessageManager
- .getString("label.choose_annotations") + "...");
- chooseAnnotations.addActionListener(new ActionListener()
- {
- @Override
- public void actionPerformed(ActionEvent actionEvent)
- {
- chooseAnnotations_actionPerformed();
- }
- });
/*
* showSeqFeaturesHeight.setText("Vary Sequence Feature Height");
* showSeqFeaturesHeight.addActionListener(new ActionListener() { public
}
});
delete.setText(MessageManager.getString("action.delete"));
- delete.setAccelerator(javax.swing.KeyStroke.getKeyStroke(
- java.awt.event.KeyEvent.VK_BACK_SPACE, 0, false));
delete.addActionListener(new java.awt.event.ActionListener()
{
@Override
showAllhidden_actionPerformed(e);
}
});
-
hiddenMarkers.setText(MessageManager
.getString("action.show_hidden_markers"));
hiddenMarkers.addActionListener(new ActionListener()
viewMenu.addSeparator();
viewMenu.add(followHighlightMenuItem);
viewMenu.add(annotationPanelMenuItem);
+ viewMenu.add(showAllAnnotations);
+ viewMenu.add(hideAllAnnotations);
autoAnnMenu.add(applyAutoAnnotationSettings);
autoAnnMenu.add(showConsensusHistogram);
autoAnnMenu.add(showSequenceLogo);
viewMenu.add(autoAnnMenu);
viewMenu.addSeparator();
viewMenu.add(showSeqFeatures);
- viewMenu.add(chooseAnnotations);
// viewMenu.add(showSeqFeaturesHeight);
viewMenu.add(openFeatureSettings);
}
/**
- * Action on menu item "Show/hide sequence annotations..."
+ * Action on clicking Show all annotations.
+ */
+ protected void showAllAnnotations_actionPerformed()
+ {
+ setAllAnnotationsVisibility(true);
+ }
+
+ /**
+ * Action on clicking Hide all annotations.
+ */
+ protected void hideAllAnnotations_actionPerformed()
+ {
+ setAllAnnotationsVisibility(false);
+ }
+
+ /**
+ * Set the visibility of all annotations to true or false.
+ *
+ * @param visible
*/
- protected void chooseAnnotations_actionPerformed()
+ protected void setAllAnnotationsVisibility(boolean visible)
{
}