public String getAlignmentFrom(AlignFrame alf, String format, String suffix)
// add the given features or annotation to the current alignment
+// if features are loaded, feature display is automatically enabled
public void loadAnnotation(String annotation)
// add the given features or annotation to the given alignment view
+// if features are loaded, feature display is automatically enabled
public void loadAnnotationFrom(AlignFrame alf, String annotation)
+// parse the given string as a jalview or GFF features file and optionally enable feature display on the current alignment
+// (v2.7.1)
+public abstract void loadFeatures(String features, boolean autoenabledisplay)
+
+// parse the given string as a jalview or GFF features file and optionally enable feature display on the given alignment
+// (v2.7.1)
+public abstract void loadFeaturesFrom(AlignFrame alf, String features, boolean autoenabledisplay)
+
// get the sequence features in the given format (Jalview or GFF)
public String getFeatures(String format)
}\r
\r
/**\r
- * DOCUMENT ME!\r
+ * Load a features file onto the alignment\r
* \r
- * @param String\r
- * DOCUMENT ME!\r
+ * @param file file URL, content, or other resolvable path\r
+ * @param type is protocol for accessing data referred to by file\r
*/\r
\r
public void parseFeaturesFile(String file, String type)\r
{\r
+ parseFeaturesFile(file, type, true);\r
+ }\r
+ \r
+ /**\r
+ * Load a features file onto the alignment\r
+ * \r
+ * @param file file URL, content, or other resolvable path\r
+ * @param type is protocol for accessing data referred to by file\r
+ * @param autoenabledisplay when true, display features flag will be automatically enabled if features are loaded\r
+ */\r
+ public void parseFeaturesFile(String file, String type, boolean autoenabledisplay)\r
+ { \r
Hashtable featureLinks = new Hashtable();\r
boolean featuresFile = false;\r
try\r
{\r
alignPanel.seqPanel.seqCanvas.getFeatureRenderer().featureLinks = featureLinks;\r
}\r
- viewport.showSequenceFeatures = true;\r
- sequenceFeatures.setState(true);\r
+ if (autoenabledisplay)\r
+ {\r
+ viewport.showSequenceFeatures = true;\r
+ sequenceFeatures.setState(true);\r
+ }\r
if (viewport.featureSettings != null)\r
{\r
viewport.featureSettings.refreshTable();\r
/*\r
* (non-Javadoc)\r
* \r
+ * @see jalview.bin.JalviewLiteJsApi#loadAnnotation(java.lang.String)\r
+ */\r
+ public void loadFeatures(String features, boolean autoenabledisplay)\r
+ {\r
+ loadFeaturesFrom(getDefaultTargetFrame(), features, autoenabledisplay);\r
+ }\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ * \r
+ * @see\r
+ * jalview.bin.JalviewLiteJsApi#loadAnnotationFrom(jalview.appletgui.AlignFrame\r
+ * , java.lang.String)\r
+ */\r
+ public void loadFeaturesFrom(AlignFrame alf, String features, boolean autoenabledisplay)\r
+ {\r
+ alf.parseFeaturesFile(features, AppletFormatAdapter.PASTE, autoenabledisplay);\r
+ }\r
+\r
+\r
+ /*\r
+ * (non-Javadoc)\r
+ * \r
* @see jalview.bin.JalviewLiteJsApi#getFeatures(java.lang.String)\r
*/\r
public String getFeatures(String format)\r
public abstract void loadAnnotationFrom(AlignFrame alf, String annotation);
/**
+ * parse the given string as a jalview feature or GFF annotation file and optionally enable feature display on the current alignFrame
+ * @param features - gff or features file
+ * @param autoenabledisplay - when true, feature display will be enabled if any features can be parsed from the string.
+ */
+ public abstract void loadFeatures(String features, boolean autoenabledisplay);
+
+ /**
+ * parse the given string as a jalview feature or GFF annotation file and optionally enable feature display on the given alignFrame.
+ * @param alf
+ * @param features - gff or features file
+ * @param autoenabledisplay - when true, feature display will be enabled if any features can be parsed from the string.
+ */
+ public abstract void loadFeaturesFrom(AlignFrame alf, String features, boolean autoenabledisplay);
+
+ /**
* get the sequence features in the given format (Jalview or GFF)
* @param format
* @return