- showFeatures = true;
- if (fr == null)
- {
- fr = new jalview.appletgui.FeatureRenderer(ap.av);
- }
-
- fr.transferSettings(ap.seqPanel.seqCanvas.getFeatureRenderer());
- }
-
- StringBuffer command = new StringBuffer();
-
- int lastPos = -1;
- for (int s = 0; s < sequence.length; s++)
- {
- for (int m = 0; m < mapping.length; m++)
- {
- if (mapping[m].getSequence() == sequence[s]
- && ap.av.alignment.findIndex(sequence[s])>-1)
- {
- for (int r = 0; r < sequence[s].getLength(); r++)
- {
- int pos = mapping[m].getPDBResNum(
- sequence[s].findPosition(r));
-
- if (pos < 1 || pos==lastPos)
- continue;
-
- lastPos = pos;
-
- Color col = sr.getResidueBoxColour(sequence[s], r);
-
- if (showFeatures)
- col = fr.findFeatureColour(col, sequence[s], r);
-
- if (command.toString().endsWith(":" + mapping[m].getChain()+
- ";color["
- + col.getRed() + ","
- + col.getGreen() + ","
- + col.getBlue() + "]"))
- {
- command = condenseCommand(command.toString(), pos);
- continue;
- }
-
- command.append(";select " + pos);
-
- if (!mapping[m].getChain().equals(" "))
- {
- command.append(":" + mapping[m].getChain());
- }
-
- command.append(";color["
- + col.getRed() + ","
- + col.getGreen() + ","
- + col.getBlue() + "]");
-
- }
- break;
- }
- }
- }
-
- if (lastCommand == null || !lastCommand.equals(command.toString()))
- viewer.evalStringQuiet(command.toString());
-
- lastCommand = command.toString();
- }
-
- StringBuffer condenseCommand(String command, int pos)
- {
-
- StringBuffer sb = new StringBuffer(command.substring(0, command.lastIndexOf("select")+7));
-
- command = command.substring(sb.length());
-
- String start;
-
- if (command.indexOf("-") > -1)
- {
- start = command.substring(0,command.indexOf("-"));
- }
- else
- {
- start = command.substring(0, command.indexOf(":"));
- }
-
- sb.append(start+"-"+pos+command.substring(command.indexOf(":")));
-
- return sb;
- }
-
- /////////////////////////////////
- //JmolStatusListener
-
- public String eval(String strEval)
- {
- // System.out.println(strEval);
- //"# 'eval' is implemented only for the applet.";
- return null;
- }
-
- public void createImage(String file, String type, int quality)
- {}
-
- public void setCallbackFunction(String callbackType,
- String callbackFunction)
- {}
-
- public void notifyFileLoaded(String fullPathName, String fileName,
- String modelName, Object clientFile,
- String errorMsg)
- {
- if(errorMsg!=null)
- {
- fileLoadingError = errorMsg;