try
{
ret[0] = param;
- DataSourceType protocol = resolveFileProtocol(app,
- ret);
+ DataSourceType protocol = resolveFileProtocol(app, ret);
JPredFile predictions = new JPredFile(ret[0], protocol);
JnetAnnotationMaker.add_annotation(predictions,
app.getViewport().getAlignment(), 0, false);
if (param != null)
{
ret[0] = param;
- DataSourceType protocol = resolveFileProtocol(app,
- ret);
+ DataSourceType protocol = resolveFileProtocol(app, ret);
param = ret[0];
if (new AnnotationFile().annotateAlignmentView(app.getViewport(),
param, protocol))
String param = app.getParameter("hidefeaturegroups");
if (param != null)
{
- app.setFeatureGroupState(
- separatorListToArray(param, separator), false);
+ app.setFeatureGroupState(separatorListToArray(param, separator),
+ false);
// app.setFeatureGroupStateOn(newAlignFrame, param, false);
}
// show specific groups
if (param != null)
{
ret[0] = param;
- DataSourceType protocol = resolveFileProtocol(app,
- ret);
+ DataSourceType protocol = resolveFileProtocol(app, ret);
result = app.parseFeaturesFile(ret[0], protocol);
}
}
String[] ret = new String[1];
+
/**
* Load a tree for the alignment if specified by parameter. Returns true if a
* tree was loaded, else false.
{
if (debug)
{
- System.out.println("Tree parameter did not resolve to a valid tree.");
+ System.out.println(
+ "Tree parameter did not resolve to a valid tree.");
}
}
} catch (Exception ex)
codebase.length() - localfile.length()) + targetPath;
return resolvedPath;
}
-
+
/*
* get URL path and strip off any trailing file e.g.
* www.jalview.org/examples/index.html#applets?a=b is trimmed to
{
directoryPath = directoryPath.substring(0, lastSeparator + 1);
}
-
+
if (targetPath.startsWith("/"))
{
/*
{
resolvedPath = directoryPath + targetPath;
}
- if (JalviewLite.debug)
- {
- System.err.println(
- "resolveUrlForLocalOrAbsolute returning " + resolvedPath);
- }
+ // if (debug)
+ // {
+ // System.err.println(
+ // "resolveUrlForLocalOrAbsolute returning " + resolvedPath);
+ // }
return resolvedPath;
}
retPath[0] = path.substring(5);
return DataSourceType.PASTE;
}
-
+
/*
* is it a URL?
*/
{
return DataSourceType.URL;
}
-
+
/*
* try relative to document root
*/
URL documentBase = app.getDocumentBase();
- String withDocBase = resolveUrlForLocalOrAbsolute(path,
- documentBase);
+ String withDocBase = resolveUrlForLocalOrAbsolute(path, documentBase);
if (HttpUtils.isValidUrl(withDocBase))
{
// if (debug)
retPath[0] = withDocBase;
return DataSourceType.URL;
}
-
+
/*
* try relative to codebase (if different to document base)
*/
URL codeBase = app.getCodeBase();
- String withCodeBase = resolveUrlForLocalOrAbsolute(path,
- codeBase);
+ String withCodeBase = resolveUrlForLocalOrAbsolute(path, codeBase);
if (!withCodeBase.equals(withDocBase)
&& HttpUtils.isValidUrl(withCodeBase))
{
* @param jalviewApp
* @return
*/
- public String getPastedSequence(JalviewApp jalviewApp) {
+ public String getPastedSequence(JalviewApp jalviewApp)
+ {
StringBuffer data = new StringBuffer("PASTE");
int i = 1;
String file = null;
}
return file;
}
-}
+
+ /**
+ * concatenate the list with separator
+ *
+ * @param list
+ * @param separator
+ * @return concatenated string
+ */
+ public static String arrayToSeparatorList(String[] list, String separator)
+ {
+ // TODO use StringUtils version
+ StringBuffer v = new StringBuffer();
+ if (list != null && list.length > 0)
+ {
+ for (int i = 0, iSize = list.length; i < iSize; i++)
+ {
+ if (list[i] != null)
+ {
+ if (i > 0)
+ {
+ v.append(separator);
+ }
+ v.append(list[i]);
+ }
+ }
+ // if (debug)
+ // {
+ // System.err
+ // .println("Returning '" + separator + "' separated List:\n");
+ // System.err.println(v);
+ // }
+ return v.toString();
+ }
+ // if (debug)
+ // {
+ // System.err.println(
+ // "Returning empty '" + separator + "' separated List\n");
+ // }
+ return "" + separator;
+ }
+
+ public String arrayToSeparatorList(String[] array)
+ {
+ return arrayToSeparatorList(array, separator);
+ }
+
+}
\ No newline at end of file