public static final String CHIMERAX_PATH = "CHIMERAX_PATH";
+ public static final String PYMOL_PATH = "PYMOL_PATH";
+
public static final String SORT_ANNOTATIONS = "SORT_ANNOTATIONS";
public static final String SHOW_AUTOCALC_ABOVE = "SHOW_AUTOCALC_ABOVE";
boolean isChimeraX = viewerType.equals(ViewerType.CHIMERAX.name());
if (viewerType.equals(ViewerType.JMOL.name()))
{
- chimeraPath.setText("");
+ structureViewerPath.setText("");
}
else
{
- chimeraPath.setText(Cache
+ structureViewerPath.setText(Cache
.getDefault(isChimeraX ? CHIMERAX_PATH : CHIMERA_PATH, ""));
}
- chimeraPath.addActionListener(new ActionListener()
+ structureViewerPath.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(ActionEvent e)
Cache.setProperty(structViewer.getSelectedItem()
.equals(ViewerType.CHIMERAX.name())
? CHIMERAX_PATH
- : CHIMERA_PATH, chimeraPath.getText());
+ : CHIMERA_PATH, structureViewerPath.getText());
}
}
});
Boolean.toString(useRnaView.isSelected()));
Cache.applicationProperties.setProperty(STRUCT_FROM_PDB,
Boolean.toString(structFromPdb.isSelected()));
+ String viewer = structViewer.getSelectedItem().toString();
+ String viewerPath = structureViewerPath.getText();
Cache.applicationProperties.setProperty(STRUCTURE_DISPLAY,
- structViewer.getSelectedItem().toString());
- boolean isChimeraX = structViewer.getSelectedItem().toString()
- .equals(ViewerType.CHIMERAX.name());
- Cache.setOrRemove(isChimeraX ? CHIMERAX_PATH : CHIMERA_PATH,
- chimeraPath.getText());
+ viewer);
+ if (viewer.equals(ViewerType.CHIMERA.name()))
+ {
+ Cache.setOrRemove(CHIMERA_PATH, viewerPath);
+ }
+ else if (viewer.equals(ViewerType.CHIMERAX.name()))
+ {
+ Cache.setOrRemove(CHIMERAX_PATH, viewerPath);
+ }
+ else if (viewer.equals(ViewerType.PYMOL.name()))
+ {
+ Cache.setOrRemove(PYMOL_PATH, viewerPath);
+ }
Cache.applicationProperties.setProperty("MAP_WITH_SIFTS",
Boolean.toString(siftsMapping.isSelected()));
SiftsSettings.setMapWithSifts(siftsMapping.isSelected());
*/
private boolean validateChimeraPath()
{
- if (chimeraPath.getText().trim().length() > 0)
+ if (structureViewerPath.getText().trim().length() > 0)
{
- File f = new File(chimeraPath.getText());
+ File f = new File(structureViewerPath.getText());
if (!f.canExecute())
{
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
}
/**
- * If Chimera or ChimeraX is selected, check it can be found on default or
- * user-specified path, if not show a warning/help dialog.
+ * If Chimera or ChimeraX or Pymol is selected, check it can be found on
+ * default or user-specified path, if not show a warning/help dialog
*/
@Override
protected void structureViewer_actionPerformed(String selectedItem)
{
if (selectedItem.equals(ViewerType.JMOL.name()))
{
- chimeraPath.setEnabled(false);
- chimeraPathLabel.setEnabled(false);
+ structureViewerPath.setEnabled(false);
+ structureViewerPathLabel.setEnabled(false);
return;
}
boolean found = false;
- chimeraPath.setEnabled(true);
- chimeraPathLabel.setEnabled(true);
- chimeraPathLabel.setText(MessageManager
+ structureViewerPath.setEnabled(true);
+ structureViewerPathLabel.setEnabled(true);
+ structureViewerPathLabel.setText(MessageManager
.formatMessage("label.chimera_path", selectedItem));
/*
* Try user-specified and standard paths for Chimera executable
*/
boolean isChimeraX = selectedItem.equals(ViewerType.CHIMERAX.name());
- chimeraPath.setText(Cache
+ structureViewerPath.setText(Cache
.getDefault(isChimeraX ? CHIMERAX_PATH : CHIMERA_PATH, ""));
List<String> paths = StructureManager.getChimeraPaths(isChimeraX);
- paths.add(0, chimeraPath.getText());
+ paths.add(0, structureViewerPath.getText());
for (String path : paths)
{
if (new File(path.trim()).canExecute())