}
// /////////////////////////////////////////
- // The following public methods maybe called
+ // The following public methods may be called
// externally, eg via javascript in HTML page
/*
* (non-Javadoc)
}
}
- /*
- * (non-Javadoc)
- *
+ /**
+ * Callable from javascript to register a javascript function to pass events
+ * to a structure viewer.
+ *
+ * @param listener
+ * the name of a javascript function
+ * @param modelSet
+ * a token separated list of PDB file names listened for
* @see jalview.bin.JalviewLiteJsApi#setStructureListener(java.lang.String,
- * java.lang.String)
+ * java.lang.String)
*/
public void setStructureListener(String listener, String modelSet)
{
/**
* init method for Jalview Applet
*/
+ @Override
public void init()
{
- // remove any handlers that might be hanging around from an earlier instance
+ debug = TRUE.equalsIgnoreCase(getParameter("debug"));
try
{
if (debug)
ex.printStackTrace();
}
}
- /**
- * turn on extra applet debugging
- */
- debug = TRUE.equalsIgnoreCase(getParameter("debug"));
+
if (debug)
{
-
System.err.println("JalviewLite Version " + getVersion());
System.err.println("Build Date : " + getBuildDate());
System.err.println("Installation : " + getInstallation());
-
}
String externalsviewer = getParameter("externalstructureviewer");
if (externalsviewer != null)
{
AlignmentI al1 = af.viewport.getAlignment();
AlignmentI al2 = af2.viewport.getAlignment();
- if (AlignmentUtils.isMappable(al1, al2))
+ AlignmentI cdna = al1.isNucleotide() ? al1 : al2;
+ AlignmentI prot = al1.isNucleotide() ? al2 : al1;
+ if (AlignmentUtils.mapProteinAlignmentToCdna(prot, cdna))
{
+ al2.alignAs(al1);
SplitFrame sf = new SplitFrame(af, af2);
sf.addToDisplay(embedded, JalviewLite.this);
return;
/**
* Discovers whether the given file is in the Applet Archive
*
- * @param file
+ * @param f
* String
* @return boolean
*/
- boolean inArchive(String file)
+ boolean inArchive(String f)
{
// This might throw a security exception in certain browsers
// Netscape Communicator for instance.
try
{
- boolean rtn = (getClass().getResourceAsStream("/" + file) != null);
+ boolean rtn = (getClass().getResourceAsStream("/" + f) != null);
if (debug)
{
- System.err.println("Resource '" + file + "' was "
- + (rtn ? "" : "not") + " located by classloader.");
+ System.err.println("Resource '" + f + "' was "
+ + (rtn ? "" : "not ") + "located by classloader.");
}
return rtn;
} catch (Exception ex)
{
- System.out.println("Exception checking resources: " + file + " "
+ System.out.println("Exception checking resources: " + f + " "
+ ex);
return false;
}
* @param separator
* @return elements separated by separator
*/
- public String[] separatorListToArray(String list, String separator)
+ public static String[] separatorListToArray(String list, String separator)
{
+ // TODO use StringUtils version (slightly different...)
int seplen = separator.length();
if (list == null || list.equals("") || list.equals(separator))
{
* @param separator
* @return concatenated string
*/
- public String arrayToSeparatorList(String[] list, String separator)
+ public static String arrayToSeparatorList(String[] list, String separator)
{
+ // TODO use StringUtils version
StringBuffer v = new StringBuffer();
if (list != null && list.length > 0)
{