* @param pdbResNum
* @param chain
* @param pdbfile
+ * @return
*/
- public void mouseOverStructure(int pdbResNum, String chain,
+ public String mouseOverStructure(int pdbResNum, String chain,
String pdbfile)
{
AtomSpec atomSpec = new AtomSpec(pdbfile, chain, pdbResNum, 0);
List<AtomSpec> atoms = Collections.singletonList(atomSpec);
- mouseOverStructure(atoms);
+ return mouseOverStructure(atoms);
}
/**
*
* @param atoms
*/
- public void mouseOverStructure(List<AtomSpec> atoms)
+ public String mouseOverStructure(List<AtomSpec> atoms)
{
if (listeners == null)
{
// old or prematurely sent event
- return;
+ return null;
}
boolean hasSequenceListener = false;
for (int i = 0; i < listeners.size(); i++)
}
if (!hasSequenceListener)
{
- return;
+ return null;
}
SearchResultsI results = findAlignmentPositionsForStructurePositions(
atoms);
+ String result = null;
for (Object li : listeners)
{
if (li instanceof SequenceListener)
{
- ((SequenceListener) li).highlightSequence(results);
+ String s = ((SequenceListener) li).highlightSequence(results);
+ if (s != null)
+ {
+ result = s;
+ }
}
}
+ return result;
}
/**
}
/**
+ * Answers a (possibly empty) list of structure to sequence mappings matching
+ * the given pdb and chain ids
+ *
+ * @param pdbId
+ * @param chain
+ * @return
+ */
+ public List<StructureMapping> getMappingForChain(String pdbId,
+ String chain)
+ {
+ List<StructureMapping> result = new ArrayList<>();
+ for (StructureMapping sm : mappings)
+ {
+ if (sm.pdbid.equals(pdbId) && sm.pdbchain.equals(chain))
+ {
+ result.add(sm);
+ }
+ }
+ return result;
+ }
+
+ /**
* Returns a readable description of all mappings for the given pdbfile to any
* of the given sequences
*