</head>
<body>
<p><strong>The Chimera Viewer</strong></p>
-<p>Since Jalview 2.8.2, <a href="https://www.cgl.ucsf.edu/chimera/">Chimera</a>
+<p>Since Jalview 2.8.2, <a href="http://www.cgl.ucsf.edu/chimera/">Chimera</a> (http://www.cgl.ucsf.edu/chimera/)
has been integrated into Jalview for interactively viewing structures
opened by entries in the <strong>"Structure"</strong> submenu in the <a href="../menus/popupMenu.html">sequence
id pop-up menu</a> (if you can't see this, then you need to <a
([RES]Num:Chain). Moving the mouse over an
associated residue in an alignment window highlights the associated
atoms in the displayed structures. For comprehensive details of Chimera's commands, refer to the tool's Help menu.</p>
-<p>Basic screen operations (see <a href="https://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html">Chimera help</a> for full details).
+<p>Basic screen operations (see <a href="http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html">Chimera help</a>
+(http://www.cgl.ucsf.edu/chimera/current/docs/UsersGuide/mouse.html) for full details).
<table border="1">
<tr>
<td><strong>Action</strong></td>
</p>
The
<a href="jmol.html">Jmol viewer</a> has been included since Jalview
- 2.3. Jalview 2.8.2 included support for
- <a href="https://www.cgl.ucsf.edu/chimera/">Chimera</a>, provided it is
+ 2.3. Jalview 2.8.2 included support for <a href="chimera.html">Chimera</a>, provided it is
installed and can be launched by Jalview. The default viewer can be
configured in the
<a href="preferences.html#structure">Structure tab</a> in the
label.chimera_path = Path to Chimera program
label.chimera_path_tip = Jalview will first try any path entered here, else standard installation locations.<br>Double-click to browse for file.
label.invalid_chimera_path = Chimera path not found or not executable
+label.chimera_missing = Chimera structure viewer not found.<br/>Please enter the path to Chimera (if installed),<br/>or download and install UCSF Chimera.
label.min_colour = Minimum Colour
label.max_colour = Maximum Colour
label.use_original_colours = Use Original Colours
StructureSettings defaultSettings = null;
// TODO: [Optional] Change priority of Chimera paths
- public List<String> getChimeraPaths()
+ public static List<String> getChimeraPaths()
{
List<String> pathList = new ArrayList<String>();
// if no network is available and the settings have been modified by the
// user, check for a
// path to chimera
- if (defaultSettings != null)
- {
- String defaultPath = defaultSettings.getChimeraPath();
- if (defaultPath != null && !defaultPath.equals(""))
- {
- pathList.add(defaultPath);
- return pathList;
- }
- }
+ //
+ // For Jalview, Preferences/Cache plays this role instead
+ // if (defaultSettings != null)
+ // {
+ // String defaultPath = defaultSettings.getChimeraPath();
+ // if (defaultPath != null && !defaultPath.equals(""))
+ // {
+ // pathList.add(defaultPath);
+ // return pathList;
+ // }
+ // }
/*
* Jalview addition: check if path set in user preferences.
String userPath = Cache.getDefault(Preferences.CHIMERA_PATH, null);
if (userPath != null)
{
- pathList.add(userPath);
+ pathList.add(0, userPath);
}
// Add default installation paths
}
}
- boolean debug = true;
+ boolean debug = false;
private void log(String message)
{
private void viewerCommandHistory(boolean enable)
{
- log("(Not yet implemented) History "
- + ((debug || enable) ? "on" : "off"));
+ // log("(Not yet implemented) History "
+ // + ((debug || enable) ? "on" : "off"));
}
public void loadInline(String string)
{
public enum HelpId
{
- Home("home"), SequenceFeatureSettings("seqfeatures.settings");
+ Home("home"), SequenceFeatureSettings("seqfeatures.settings"), StructureViewer(
+ "viewingpdbs");
private String id;
import jalview.analysis.AnnotationSorter.SequenceAnnotationOrder;
import jalview.bin.Cache;
+import jalview.gui.Help.HelpId;
import jalview.gui.StructureViewer.Viewer;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
import java.awt.event.MouseEvent;
import java.io.File;
import java.util.Collection;
+import java.util.List;
import java.util.StringTokenizer;
import java.util.Vector;
+import javax.help.HelpSetException;
import javax.swing.JColorChooser;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
+import ext.edu.ucsf.rbvi.strucviz2.StructureManager;
+
/**
* DOCUMENT ME!
*
}
/**
- * Do any necessary validation before saving settings.
+ * Do any necessary validation before saving settings. Return focus to the
+ * first tab which fails validation.
*
* @return
*/
return true;
}
+ /**
+ * If Chimera 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(Viewer.CHIMERA.name()))
+ {
+ return;
+ }
+ boolean found = false;
+
+ /*
+ * Try user-specified and standard paths for Chimera executable.
+ */
+ List<String> paths = StructureManager.getChimeraPaths();
+ paths.add(0, chimeraPath.getText());
+ for (String path : paths)
+ {
+ if (new File(path.trim()).canExecute())
+ {
+ found = true;
+ break;
+ }
+ }
+ if (!found)
+ {
+ String[] options =
+ { "OK", "Help" };
+ int showHelp = JOptionPane.showInternalOptionDialog(
+ Desktop.desktop,
+ JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("label.chimera_missing")),
+ "", JOptionPane.YES_NO_OPTION,
+ JOptionPane.WARNING_MESSAGE, null, options, options[0]);
+ if (showHelp == JOptionPane.NO_OPTION)
+ {
+ try
+ {
+ Help.showHelpWindow(HelpId.StructureViewer);
+ } catch (HelpSetException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ }
+
}
structViewer.setBounds(new Rectangle(160, ypos, 120, height));
structViewer.addItem(Viewer.JMOL.name());
structViewer.addItem(Viewer.CHIMERA.name());
+ structViewer.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ structureViewer_actionPerformed((String) structViewer
+ .getSelectedItem());
+ }
+ });
structureTab.add(structViewer);
ypos += lineSpacing;
}
/**
+ * Action on choosing a structure viewer from combobox options.
+ *
+ * @param selectedItem
+ */
+ protected void structureViewer_actionPerformed(String selectedItem)
+ {
+ }
+
+ /**
* Show a dialog for the user to choose a file. Returns the chosen path, or
* null on Cancel.
*