X-Git-Url: http://source.jalview.org/gitweb/?p=jalview.git;a=blobdiff_plain;f=src%2Fjalview%2Fext%2Fjmol%2FJalviewJmolBinding.java;h=96dfcfe9bf257f402d60fe34d1b63297151c7733;hp=5de554bbcf1246f9efc15d70cf17563bc28e7ebf;hb=3d0101179759ef157b088ea135423cd909512d9f;hpb=7c70cb09e9de68ab567e38520d6d09f0c17a3939 diff --git a/src/jalview/ext/jmol/JalviewJmolBinding.java b/src/jalview/ext/jmol/JalviewJmolBinding.java index 5de554b..96dfcfe 100644 --- a/src/jalview/ext/jmol/JalviewJmolBinding.java +++ b/src/jalview/ext/jmol/JalviewJmolBinding.java @@ -225,8 +225,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel HiddenColumns hiddenCols) { superposeStructures(new AlignmentI[] { alignment }, - new int[] { refStructure }, - new HiddenColumns[] { hiddenCols }); + new int[] + { refStructure }, new HiddenColumns[] { hiddenCols }); } /** @@ -279,18 +279,16 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel int refStructure = _refStructure[a]; AlignmentI alignment = _alignment[a]; HiddenColumns hiddenCols = _hiddenCols[a]; - if (a > 0 - && selectioncom.length() > 0 - && !selectioncom.substring(selectioncom.length() - 1).equals( - "|")) + if (a > 0 && selectioncom.length() > 0 && !selectioncom + .substring(selectioncom.length() - 1).equals("|")) { selectioncom.append("|"); } // process this alignment if (refStructure >= files.length) { - System.err.println("Invalid reference structure value " - + refStructure); + System.err.println( + "Invalid reference structure value " + refStructure); refStructure = -1; } @@ -332,8 +330,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel int nmatched = matched.cardinality(); if (nmatched < 4) { - return (MessageManager.formatMessage( -"label.insufficient_residues", + return (MessageManager.formatMessage("label.insufficient_residues", nmatched)); } @@ -429,7 +426,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel command.append(".1} {"); command.append(Integer.toString(1 + refStructure)); // conformation=1 excludes alternate locations for CA (JAL-1757) - command.append(".1} SUBSET {(*.CA | *.P) and conformation=1} ATOMS "); + command.append( + ".1} SUBSET {(*.CA | *.P) and conformation=1} ATOMS "); // for (int s = 0; s < 2; s++) // { @@ -461,7 +459,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // System.out.println("Select regions:\n" + selectioncom.toString()); evalStateCommand("select *; cartoons off; backbone; select (" + selectioncom.toString() + "); cartoons; "); - // evalStateCommand("select *; backbone; select "+selcom.toString()+"; cartoons; center "+selcom.toString()); + // evalStateCommand("select *; backbone; select "+selcom.toString()+"; + // cartoons; center "+selcom.toString()); } return null; @@ -549,7 +548,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } @Override - public float[][][] functionXYZ(String functionName, int nx, int ny, int nz) + public float[][][] functionXYZ(String functionName, int nx, int ny, + int nz) { // TODO Auto-generated method stub return null; @@ -622,9 +622,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } catch (AccessControlException x) { // usually not allowed to do this in applet - System.err - .println("jmolBinding: Using local file string from Jmol: " - + m); + System.err.println( + "jmolBinding: Using local file string from Jmol: " + m); } if (filePath.indexOf("/file:") != -1) { @@ -647,7 +646,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel } catch (AccessControlException x) { // usually not allowed to do this in applet, so keep raw handle - // System.err.println("jmolBinding: Using local file string from Jmol: "+m); + // System.err.println("jmolBinding: Using local file string from + // Jmol: "+m); } } @@ -693,6 +693,7 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel return modelFileNames; } + /** * map from string to applet */ @@ -703,8 +704,6 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel return null; } - - // /////////////////////////////// // JmolStatusListener @@ -827,14 +826,14 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // handle insertion codes if (alocsep != -1) { - pdbResNum = Integer.parseInt(strInfo.substring( - strInfo.indexOf("]") + 1, alocsep)); + pdbResNum = Integer.parseInt( + strInfo.substring(strInfo.indexOf("]") + 1, alocsep)); } else { - pdbResNum = Integer.parseInt(strInfo.substring( - strInfo.indexOf("]") + 1, chainSeparator)); + pdbResNum = Integer.parseInt( + strInfo.substring(strInfo.indexOf("]") + 1, chainSeparator)); } String chainId; @@ -856,13 +855,14 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel { chainSeparator1 = strInfo.indexOf(".", mdlSep); } - String mdlId = (chainSeparator1 > -1) ? strInfo.substring(mdlSep + 1, - chainSeparator1) : strInfo.substring(mdlSep + 1); + String mdlId = (chainSeparator1 > -1) + ? strInfo.substring(mdlSep + 1, chainSeparator1) + : strInfo.substring(mdlSep + 1); try { // recover PDB filename for the model hovered over. - int _mp = _modelFileNameMap.length - 1, mnumber = new Integer(mdlId) - .intValue() - 1; + int _mp = _modelFileNameMap.length - 1, + mnumber = new Integer(mdlId).intValue() - 1; while (mnumber < _modelFileNameMap[_mp]) { _mp--; @@ -903,7 +903,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel * } } */ - public void notifyAtomPicked(int atomIndex, String strInfo, String strData) + public void notifyAtomPicked(int atomIndex, String strInfo, + String strData) { /** * this implements the toggle label behaviour copied from the original @@ -986,8 +987,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel sendConsoleEcho((String) data[1]); break; case MESSAGE: - sendConsoleMessage((data == null) ? ((String) null) - : (String) data[1]); + sendConsoleMessage( + (data == null) ? ((String) null) : (String) data[1]); break; case ERROR: // System.err.println("Ignoring error callback."); @@ -1000,8 +1001,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel case CLICK: default: - System.err.println("Unhandled callback " + type + " " - + data[1].toString()); + System.err.println( + "Unhandled callback " + type + " " + data[1].toString()); break; } } catch (Exception e) @@ -1110,8 +1111,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // calculate essential attributes for the pdb data imported inline. // prolly need to resolve modelnumber properly - for now just use our // 'best guess' - pdbfile = viewer.getData("" + (1 + _modelFileNameMap[modelnum]) - + ".0", "PDB"); + pdbfile = viewer.getData( + "" + (1 + _modelFileNameMap[modelnum]) + ".0", "PDB"); } // search pdbentries and sequences to find correct pdbentry for this // model @@ -1167,8 +1168,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // add an entry for every chain in the model for (int i = 0; i < pdb.getChains().size(); i++) { - String chid = new String(pdb.getId() + ":" - + pdb.getChains().elementAt(i).id); + String chid = new String( + pdb.getId() + ":" + pdb.getChains().elementAt(i).id); chainFile.put(chid, fileName); chainNames.add(chid); } @@ -1200,7 +1201,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel // } if (!isLoadingFromArchive()) { - viewer.evalStringQuiet("model *; select backbone;restrict;cartoon;wireframe off;spacefill off"); + viewer.evalStringQuiet( + "model *; select backbone;restrict;cartoon;wireframe off;spacefill off"); } // register ourselves as a listener and notify the gui that it needs to // update itself. @@ -1280,8 +1282,9 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel false); for (String resName : residueSet) { - char res = resName.length() == 3 ? ResidueProperties - .getSingleCharacterCode(resName) : resName.charAt(0); + char res = resName.length() == 3 + ? ResidueProperties.getSingleCharacterCode(resName) + : resName.charAt(0); Color col = cs.findColour(res, 0, null, null, 0f); command.append("select " + resName + ";color[" + col.getRed() + "," + col.getGreen() + "," + col.getBlue() + "];"); @@ -1360,8 +1363,8 @@ public abstract class JalviewJmolBinding extends AAStructureBindingModel commandOptions = ""; } viewer = (Viewer) JmolViewer.allocateViewer(renderPanel, - (jmolfileio ? new SmarterJmolAdapter() : null), htmlName - + ((Object) this).toString(), documentBase, codeBase, + (jmolfileio ? new SmarterJmolAdapter() : null), + htmlName + ((Object) this).toString(), documentBase, codeBase, commandOptions, this); viewer.setJmolStatusListener(this); // extends JmolCallbackListener