private int myHeight = 150;
- /**
+ private JMenuItem writeFeatures=null;
+
+ private JMenu fetchAttributes=null;
+/**
* Initialise menu options.
*/
@Override
savemenu.setVisible(false); // not yet implemented
viewMenu.add(fitToWindow);
- JMenuItem writeFeatures = new JMenuItem(
+ writeFeatures = new JMenuItem(
MessageManager.getString("label.create_viewer_attributes"));
writeFeatures.setToolTipText(MessageManager
.getString("label.create_viewer_attributes_tip"));
});
viewerActionMenu.add(writeFeatures);
- final JMenu fetchAttributes = new JMenu(
+ fetchAttributes = new JMenu(
MessageManager.getString("label.fetch_chimera_attributes"));
fetchAttributes.setToolTipText(
MessageManager.getString("label.fetch_chimera_attributes_tip"));
});
viewerActionMenu.add(fetchAttributes);
}
-
+ @Override
+ protected void buildActionMenu()
+ {
+ super.buildActionMenu();
+ // add these back in after menu is refreshed
+ viewerActionMenu.add(writeFeatures);
+ viewerActionMenu.add(fetchAttributes);
+
+ };
/**
* Query the structure viewer for its residue attribute names and add them as
* items off the attributes menu
{
return "PyMOL";
}
-
+ JMenuItem writeFeatures = null;
@Override
protected void initMenus()
{
savemenu.setVisible(false); // not yet implemented
viewMenu.add(fitToWindow);
- JMenuItem writeFeatures = new JMenuItem(
+ writeFeatures = new JMenuItem(
MessageManager.getString("label.create_viewer_attributes"));
writeFeatures.setToolTipText(MessageManager
.getString("label.create_viewer_attributes_tip"));
});
viewerActionMenu.add(writeFeatures);
}
+
+ @Override
+ protected void buildActionMenu()
+ {
+ super.buildActionMenu();
+ viewerActionMenu.add(writeFeatures);
+ }
protected void sendFeaturesToPymol()
{
_alignwith.add(ap);
}
;
+ // TODO: refactor to allow concrete classes to register buttons for adding
+ // here
+ // currently have to override to add buttons back in after they are cleared
+ // in this loop
for (Component c : viewerActionMenu.getMenuComponents())
{
if (c != alignStructs)
@Override
public boolean hasViewerActionsMenu()
{
- return viewerActionMenu!=null && viewerActionMenu.isEnabled() && viewerActionMenu.getItemCount()>0 && viewerActionMenu.isVisible();
+ return viewerActionMenu != null && viewerActionMenu.isEnabled()
+ && viewerActionMenu.getItemCount() > 0
+ && viewerActionMenu.isVisible();
}
}