package jalview.ext.jmol;
import jalview.api.FeatureRenderer;
-import jalview.datamodel.AlignmentI;
-import jalview.datamodel.HiddenColumns;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.SequenceI;
import jalview.gui.IProgressIndicator;
import jalview.io.DataSourceType;
import jalview.io.StructureFile;
import jalview.structure.AtomSpec;
-import jalview.structure.StructureCommandsI.SuperposeData;
+import jalview.structure.StructureCommand;
+import jalview.structure.StructureCommandI;
import jalview.structure.StructureSelectionManager;
import jalview.structures.models.AAStructureBindingModel;
-import jalview.util.MessageManager;
import java.awt.Container;
import java.awt.event.ComponentEvent;
import java.io.File;
import java.net.URL;
import java.util.ArrayList;
-import java.util.BitSet;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
}
@Override
- public List<String> executeCommand(String command, boolean getReply)
+ public List<String> executeCommand(StructureCommandI command,
+ boolean getReply)
{
if (command == null)
{
return null;
}
+ String cmd = command.getCommand();
jmolHistory(false);
- if (lastCommand == null || !lastCommand.equals(command))
+ if (lastCommand == null || !lastCommand.equals(cmd))
{
- jmolViewer.evalStringQuiet(command + "\n");
+ jmolViewer.evalStringQuiet(cmd + "\n");
}
jmolHistory(true);
- lastCommand = command;
+ lastCommand = cmd;
return null;
}
sb.append(";set hoverLabel \"").append(toks.nextToken()).append(" ")
.append(toks.nextToken());
sb.append("|").append(label).append("\"");
- executeCommand(sb.toString(), false);
+ executeCommand(new StructureCommand(sb.toString()), false);
}
}
}
if (matches)
{
- // add an entry for every chain in the model
- for (int i = 0; i < pdb.getChains().size(); i++)
- {
- String chid = pdb.getId() + ":"
- + pdb.getChains().elementAt(i).id;
- addChainFile(chid, fileName);
- getChainNames().add(chid);
- }
+ stashFoundChains(pdb, fileName);
notifyLoaded = true;
}
}
}
@Override
- protected int getModelNoForFile(String pdbFile)
+ protected String getModelIdForFile(String pdbFile)
{
if (modelFileNames == null)
{
- return -1;
+ return "";
}
for (int i = 0; i < modelFileNames.length; i++)
{
if (modelFileNames[i].equalsIgnoreCase(pdbFile))
{
- return i;
+ return String.valueOf(i);
}
}
- return -1;
+ return "";
}
@Override
{
return ViewerType.JMOL;
}
+
+ @Override
+ protected String getModelId(int pdbfnum, String file)
+ {
+ return String.valueOf(pdbfnum + 1);
+ }
}