// ////////////////////////////////
// /StructureListener
@Override
- public String[] getPdbFile()
+ public String[] getStructureFiles()
{
return new String[] { pdbentry.getFile() };
}
// ////////////////////////////////
// /StructureListener
@Override
- public String[] getPdbFile()
+ public String[] getStructureFiles()
{
return new String[] { pdbentry.getFile() };
}
public void closeViewer()
{
// remove listeners for all structures in viewer
- getSsm().removeStructureViewerListener(this, this.getPdbFile());
+ getSsm().removeStructureViewerListener(this, this.getStructureFiles());
viewer.dispose();
lastCommand = null;
viewer = null;
* get the distinct structure files modelled
* (a file with multiple chains may map to multiple sequences)
*/
- String[] files = getPdbFile();
+ String[] files = getStructureFiles();
if (!waitForFileLoad(files))
{
return null;
private int getModelNum(String modelFileName)
{
- String[] mfn = getPdbFile();
+ String[] mfn = getStructureFiles();
if (mfn == null)
{
return -1;
// ////////////////////////////////
// /StructureListener
- @Override
- public synchronized String[] getPdbFile()
+ // @Override
+ public synchronized String[] getPdbFilex()
{
if (viewer == null)
{
return modelFileNames;
}
+ @Override
+ public synchronized String[] getStructureFiles()
+ {
+ List<String> mset = new ArrayList<String>();
+ if (viewer == null)
+ {
+ return new String[0];
+ }
+
+ if (modelFileNames == null)
+ {
+ int modelCount = viewer.ms.mc;
+ String filePath = null;
+ for (int i = 0; i < modelCount; ++i)
+ {
+ filePath = viewer.ms.getModelFileName(i);
+ if (!mset.contains(filePath))
+ {
+ mset.add(filePath);
+ }
+ }
+ modelFileNames = mset.toArray(new String[mset.size()]);
+ }
+
+ return modelFileNames;
+ }
/**
* map from string to applet
*/
chainNames = new ArrayList<String>();
chainFile = new Hashtable<String, String>();
boolean notifyLoaded = false;
- String[] modelfilenames = getPdbFile();
+ String[] modelfilenames = getStructureFiles();
// first check if we've lost any structures
if (oldmodels != null && oldmodels.length > 0)
{
*/
public void closeViewer(boolean closeChimera)
{
- getSsm().removeStructureViewerListener(this, this.getPdbFile());
+ getSsm().removeStructureViewerListener(this, this.getStructureFiles());
if (closeChimera)
{
viewer.exitChimera();
int[] _refStructure, ColumnSelection[] _hiddenCols)
{
StringBuilder allComs = new StringBuilder(128);
- String[] files = getPdbFile();
+ String[] files = getStructureFiles();
if (!waitForFileLoad(files))
{
* to the Chimera command 'list models type molecule', see
* ChimeraManager.getModelList().
*/
- List<ChimeraModel> maps = chimeraMaps.get(getPdbFile()[pdbfnum]);
+ List<ChimeraModel> maps = chimeraMaps.get(getStructureFiles()[pdbfnum]);
boolean hasSubModels = maps != null && maps.size() > 1;
return "#" + String.valueOf(pdbfnum) + (hasSubModels ? ".1" : "");
}
// ////////////////////////////////
// /StructureListener
@Override
- public synchronized String[] getPdbFile()
+ public synchronized String[] getStructureFiles()
{
if (viewer == null)
{
return 0;
}
- String[] files = getPdbFile();
+ String[] files = getStructureFiles();
if (files == null)
{
return 0;
int waitFor = 35;
int waitTotal = 0;
while (addingStructures ? lastnotify >= jmb.getLoadNotifiesHandled()
- : !(jmb.isFinishedInit() && jmb.getPdbFile() != null && jmb
- .getPdbFile().length == files.size()))
+ : !(jmb.isFinishedInit() && jmb.getStructureFiles() != null && jmb
+ .getStructureFiles().length == files.size()))
{
try
{
// System.err.println("finished: " + jmb.isFinishedInit()
// + "; loaded: " + Arrays.toString(jmb.getPdbFile())
// + "; files: " + files.toString());
- jmb.getPdbFile();
+ jmb.getStructureFiles();
break;
}
}
String pdbid = "";
try
{
- String[] filesInViewer = jmb.getPdbFile();
+ String[] filesInViewer = jmb.getStructureFiles();
// TODO: replace with reference fetching/transfer code (validate PDBentry
// as a DBRef?)
Pdb pdbclient = new Pdb();
{
// TODO: cope with multiple PDB files in view
in = new BufferedReader(
- new FileReader(getBinding().getPdbFile()[0]));
+ new FileReader(getBinding().getStructureFiles()[0]));
File outFile = chooser.getSelectedFile();
PrintWriter out = new PrintWriter(new FileOutputStream(outFile));
* enable 'Superpose with' if more than one mapped structure
*/
viewSelectionMenu.setEnabled(false);
- if (getBinding().getPdbFile().length > 1
+ if (getBinding().getStructureFiles().length > 1
&& getBinding().getSequence().length > 1)
{
viewSelectionMenu.setEnabled(true);
}
@Override
- public String[] getPdbFile()
+ public String[] getStructureFiles()
{
return modelSet;
}
* handles messages for, or null if generic listener (only used by
* removeListener method)
*/
- public String[] getPdbFile();
+ public String[] getStructureFiles();
/**
* Called by StructureSelectionManager to inform viewer to highlight given
if (listeners.elementAt(i) instanceof StructureListener)
{
sl = (StructureListener) listeners.elementAt(i);
- for (String pdbfile : sl.getPdbFile())
+ for (String pdbfile : sl.getStructureFiles())
{
pdbs.remove(pdbfile);
}
BitSet matched, SuperposeData[] structures)
{
int refStructure = -1;
- String[] files = getPdbFile();
+ String[] files = getStructureFiles();
if (files == null)
{
return -1;
{
return;
}
- String[] files = getPdbFile();
+ String[] files = getStructureFiles();
SequenceRenderer sr = getSequenceRenderer(alignmentv);
* (or possibly 52-145 to 1-94 - see JAL-2319)
*/
StructureSelectionManager ssm = binding.getSsm();
- String pdbFile = binding.getPdbFile()[0];
+ String pdbFile = binding.getStructureFiles()[0];
StructureMapping[] mappings = ssm.getMapping(pdbFile);
assertTrue(mappings[0].getMappingDetailsOutput().contains("SIFTS"),
"Failed to perform SIFTS mapping");
testee = new AAStructureBindingModel(ssm, pdbFiles, seqs, null)
{
@Override
- public String[] getPdbFile()
+ public String[] getStructureFiles()
{
return new String[] { "INLINE1YCS", "INLINE3A6S", "INLINE1OOT" };
}
/*
* create a data bean to hold data per structure file
*/
- SuperposeData[] structs = new SuperposeData[testee.getPdbFile().length];
+ SuperposeData[] structs = new SuperposeData[testee.getStructureFiles().length];
for (int i = 0; i < structs.length; i++)
{
structs[i] = testee.new SuperposeData(al.getWidth());