\r
public abstract class JalviewJmolBinding implements StructureListener,\r
JmolStatusListener, SequenceStructureBinding,\r
- JmolSelectionListener, ComponentListener, StructureSelectionManagerProvider\r
+ JmolSelectionListener, ComponentListener,\r
+ StructureSelectionManagerProvider\r
\r
{\r
/**\r
\r
public JmolViewer viewer;\r
\r
- public JalviewJmolBinding(StructureSelectionManager ssm, PDBEntry[] pdbentry, SequenceI[][] sequenceIs,\r
- String[][] chains, String protocol)\r
+ public JalviewJmolBinding(StructureSelectionManager ssm,\r
+ PDBEntry[] pdbentry, SequenceI[][] sequenceIs, String[][] chains,\r
+ String protocol)\r
{\r
this.ssm = ssm;\r
this.sequence = sequenceIs;\r
*/\r
}\r
\r
- public JalviewJmolBinding(StructureSelectionManager ssm, JmolViewer viewer2)\r
+ public JalviewJmolBinding(StructureSelectionManager ssm,\r
+ JmolViewer viewer2)\r
{\r
this.ssm = ssm;\r
viewer = viewer2;\r
for (int pdbfnum = 0; pdbfnum < files.length; pdbfnum++)\r
{\r
StructureMapping[] mapping = ssm.getMapping(files[pdbfnum]);\r
- // RACE CONDITION - getMapping only returns Jmol loaded filenames once Jmol callback has completed. \r
+ // RACE CONDITION - getMapping only returns Jmol loaded filenames once\r
+ // Jmol callback has completed.\r
if (mapping == null || mapping.length < 1)\r
continue;\r
\r
}\r
AlignmentI alignment = alignmentv.getAlignment();\r
\r
- for (jalview.structure.StructureMappingcommandSet cpdbbyseq: JmolCommands.getColourBySequenceCommand(ssm, files, sequence, sr, fr, alignment))\r
- for (String cbyseq : cpdbbyseq.commands) {\r
- evalStateCommand(cbyseq);\r
- }\r
+ for (jalview.structure.StructureMappingcommandSet cpdbbyseq : JmolCommands\r
+ .getColourBySequenceCommand(ssm, files, sequence, sr, fr,\r
+ alignment))\r
+ for (String cbyseq : cpdbbyseq.commands)\r
+ {\r
+ evalStateCommand(cbyseq);\r
+ }\r
}\r
- \r
+\r
public boolean isColourBySequence()\r
{\r
return colourBySequence;\r
String mset[] = new String[viewer.getModelCount()];\r
_modelFileNameMap = new int[mset.length];\r
int j = 1;\r
- String m=viewer.getModelFileName(0);\r
- if (m!=null)\r
+ String m = viewer.getModelFileName(0);\r
+ if (m != null)\r
{\r
- try {\r
+ try\r
+ {\r
mset[0] = new File(m).getAbsolutePath();\r
- } catch (AccessControlException x) {\r
+ } catch (AccessControlException x)\r
+ {\r
// usually not allowed to do this in applet, so keep raw handle\r
mset[0] = m;\r
- //System.err.println("jmolBinding: Using local file string from Jmol: "+m); \r
+ // System.err.println("jmolBinding: Using local file string from Jmol: "+m);\r
}\r
}\r
for (int i = 1; i < mset.length; i++)\r
{\r
- m=viewer.getModelFileName(i);\r
- if (m!=null) {\r
- try {\r
+ m = viewer.getModelFileName(i);\r
+ if (m != null)\r
+ {\r
+ try\r
+ {\r
mset[j] = new File(m).getAbsolutePath();\r
- } catch (AccessControlException x) {\r
+ } catch (AccessControlException x)\r
+ {\r
// usually not allowed to do this in applet, so keep raw handle\r
mset[j] = m;\r
- //System.err.println("jmolBinding: Using local file string from Jmol: "+m); \r
+ // System.err.println("jmolBinding: Using local file string from Jmol: "+m);\r
}\r
}\r
_modelFileNameMap[j] = i; // record the model index for the filename\r
try\r
{\r
// recover PDB filename for the model hovered over.\r
- int _mp=_modelFileNameMap.length-1,\r
- mnumber=new Integer(mdlId).intValue() - 1;\r
- while(mnumber<_modelFileNameMap[_mp])\r
+ int _mp = _modelFileNameMap.length - 1, mnumber = new Integer(mdlId)\r
+ .intValue() - 1;\r
+ while (mnumber < _modelFileNameMap[_mp])\r
{\r
_mp--;\r
}\r
pdbfilename = modelFileNames[_mp];\r
- if (pdbfilename==null) {pdbfilename=new File(viewer\r
- .getModelFileName(mnumber)).getAbsolutePath();\r
+ if (pdbfilename == null)\r
+ {\r
+ pdbfilename = new File(viewer.getModelFileName(mnumber))\r
+ .getAbsolutePath();\r
}\r
- \r
+\r
} catch (Exception e)\r
{\r
}\r
else\r
{\r
File fl;\r
- if (matches = (fl=new File(pdbentry[pe].getFile())).equals(new File(fileName)))\r
+ if (matches = (fl = new File(pdbentry[pe].getFile()))\r
+ .equals(new File(fileName)))\r
{\r
foundEntry = true;\r
// TODO: Jmol can in principle retrieve from CLASSLOADER but\r
} catch (Error e)\r
{\r
}\r
- //Explicitly map to the filename used by Jmol ;\r
- pdb = ssm.setMapping(sequence[pe], chains[pe],\r
- fileName, protocol);\r
- //pdbentry[pe].getFile(), protocol);\r
+ // Explicitly map to the filename used by Jmol ;\r
+ pdb = ssm.setMapping(sequence[pe], chains[pe], fileName,\r
+ protocol);\r
+ // pdbentry[pe].getFile(), protocol);\r
\r
}\r
}\r
String commandOptions, final Container consolePanel,\r
String buttonsToShow)\r
{\r
- if (commandOptions==null) {
- commandOptions="";
- }
+ if (commandOptions == null)\r
+ {\r
+ commandOptions = "";\r
+ }\r
viewer = JmolViewer.allocateViewer(renderPanel,\r
(jmolfileio ? new SmarterJmolAdapter() : null), htmlName\r
+ ((Object) this).toString(), documentBase, codeBase,\r
chains[pe] = null;\r
}\r
}\r
+\r
/**\r
* \r
* @param pdbfile\r
- * @return text report of alignment between pdbfile and any associated alignment sequences\r
+ * @return text report of alignment between pdbfile and any associated\r
+ * alignment sequences\r
*/\r
public String printMapping(String pdbfile)\r
{\r
return ssm.printMapping(pdbfile);\r
}\r
+\r
@Override\r
public void resizeInnerPanel(String data)\r
{\r
// Jalview doesn't honour resize panel requests\r
- \r
+\r
}\r
}\r