import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureRenderer;
-import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.datamodel.StructureViewerModel;
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(
- MessageManager.getString("label.fetch_chimera_attributes"));
+ fetchAttributes = new JMenu(
+ MessageManager.formatMessage("label.fetch_viewer_attributes",getViewerName()));
fetchAttributes.setToolTipText(
- MessageManager.getString("label.fetch_chimera_attributes_tip"));
+ MessageManager.formatMessage("label.fetch_viewer_attributes_tip",getViewerName()));
fetchAttributes.addMouseListener(new MouseAdapter()
{
});
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
// todo pull up?
int count = jmb.sendFeaturesToViewer(getAlignmentPanel());
statusBar.setText(
- MessageManager.formatMessage("label.attributes_set", count));
+ MessageManager.formatMessage("label.attributes_set", count, getViewerName()));
}
/**
initChimera();
} catch (Exception ex)
{
- Cache.log.error("Couldn't open Chimera viewer!", ex);
+ Console.error("Couldn't open Chimera viewer!", ex);
}
}
int num = -1;
oomerror);
} catch (Exception ex)
{
- Cache.log.error(
+ Console.error(
"Couldn't open " + pe.getFile() + " in Chimera viewer!",
ex);
} finally
{
- Cache.log.debug("File locations are " + files);
+ Console.debug("File locations are " + files);
}
}
}
/*
* ensure that any newly discovered features (e.g. RESNUM)
- * are added to any open feature settings dialog
+ * are notified to the FeatureRenderer (and added to any
+ * open feature settings dialog)
*/
FeatureRenderer fr = getBinding().getFeatureRenderer(null);
if (fr != null)
}
@Override
- protected void fitToWindow_actionPerformed()
- {
- jmb.focusView();
- }
-
- @Override
public ViewerType getViewerType()
{
return ViewerType.CHIMERA;