import jalview.schemes.*;
-public class AppletJmol extends EmbmenuFrame implements
+public class AppletJmol extends EmbmenuFrame implements
// StructureListener,
KeyListener, ActionListener, ItemListener, SequenceStructureBinding
renderPanel = new RenderPanel();
embedMenuIfNeeded(renderPanel);
this.add(renderPanel, BorderLayout.CENTER);
- jmb.allocateViewer(renderPanel,
- "jalviewJmol", ap.av.applet.getDocumentBase(), ap.av.applet
- .getCodeBase(), "");
+ try
+ {
+ jmb.allocateViewer(renderPanel, "jalviewJmol",
+ ap.av.applet.getDocumentBase(), ap.av.applet.getCodeBase(),
+ "");
+ } catch (Exception e)
+ {
+ System.err
+ .println("Couldn't create a jmol viewer. Args to allocate viewer were:\nDocumentBase="
+ + ap.av.applet.getDocumentBase()
+ + "\nCodebase="
+ + ap.av.applet.getCodeBase());
+ e.printStackTrace();
+ dispose();
+ return;
+ }
jmb.newJmolPopup(true, "Jmol", true);
this.addWindowListener(new WindowAdapter()
throw new Exception(
"Invalid datasource. Could not obtain Reader.");
}
- jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(), freader);
+ jmb.viewer.openReader(pdbentry.getFile(), pdbentry.getId(),
+ freader);
} catch (Exception e)
{
// give up!
jalview.bin.JalviewLite.addFrame(this, jmb.getViewerTitle(), 400, 400);
}
- /**
- * create a new binding between structures in an existing jmol viewer instance
- * and an alignpanel with sequences that have existing PDBFile entries. Note,
- * this does not open a new Jmol window, or modify the display of the
- * structures in the original jmol window.
- *
- * @param viewer2
- * @param alignPanel
- * @param seqs
- * - sequences to search for associations
- */
- public AppletJmol(JmolViewer viewer2, AlignmentPanel alignPanel,
- SequenceI[] seqs)
- {
-
- // TODO Auto-generated constructor stub
- }
-
public void loadInline(String string)
{
loadedInline = true;
}
/**
- * tick or untick the seqColour menu entry depending upon if it was selected or not.
+ * tick or untick the seqColour menu entry depending upon if it was selected
+ * or not.
+ *
* @param itm
*/
private void setEnabled(MenuItem itm)
{
- seqColour.setState(itm==seqColour);
- jmb.setColourBySequence(itm==seqColour);
+ seqColour.setState(itm == seqColour);
+ jmb.setColourBySequence(itm == seqColour);
}
public void itemStateChanged(ItemEvent evt)
if (evt.getSource() == seqColour)
{
setEnabled(seqColour);
- jmb
- .colourBySequence(ap.av.getShowSequenceFeatures(),
- ap.av.alignment);
+ jmb.colourBySequence(ap.av.getShowSequenceFeatures(), ap.av.alignment);
}
else if (!allChainsSelected)
centerViewer();
}
}
}
-/*
- @Override
- public Color getColour(int atomIndex, int pdbResNum, String chain,
- String pdbId)
- {
- return jmb.getColour(atomIndex, pdbResNum, chain, pdbId);
- }
- @Override
- public String[] getPdbFile()
- {
- return jmb.getPdbFile();
- }
-
- @Override
- public void highlightAtom(int atomIndex, int pdbResNum, String chain,
- String pdbId)
- {
- jmb.highlightAtom(atomIndex, pdbResNum, chain, pdbId);
-
- }
-
- @Override
- public void mouseOverStructure(int atomIndex, String strInfo)
- {
- jmb.mouseOverStructure(atomIndex, strInfo);
-
- }
-*/
+ /*
+ * @Override public Color getColour(int atomIndex, int pdbResNum, String
+ * chain, String pdbId) { return jmb.getColour(atomIndex, pdbResNum, chain,
+ * pdbId); }
+ *
+ * @Override public String[] getPdbFile() { return jmb.getPdbFile(); }
+ *
+ * @Override public void highlightAtom(int atomIndex, int pdbResNum, String
+ * chain, String pdbId) { jmb.highlightAtom(atomIndex, pdbResNum, chain,
+ * pdbId);
+ *
+ * }
+ *
+ * @Override public void mouseOverStructure(int atomIndex, String strInfo) {
+ * jmb.mouseOverStructure(atomIndex, strInfo);
+ *
+ * }
+ */
public void setJalviewColourScheme(UserColourScheme ucs)
{
jmb.setJalviewColourScheme(ucs);