arguments=
auto.sync=false
build.scans.enabled=false
--connection.gradle.distribution=GRADLE_DISTRIBUTION(WRAPPER)
++connection.gradle.distribution=GRADLE_DISTRIBUTION(VERSION(7.6.4))
connection.project.dir=
eclipse.preferences.version=1
gradle.user.home=
java.home=
jvm.arguments=
offline.mode=false
--override.workspace.settings=false
++override.workspace.settings=true
show.console.view=false
show.executions.view=false
--- /dev/null
--- /dev/null
++<<<<<<< Conflict 1 of 1
++%%%%%%% Changes from base to side #1
++-jalview.release=releases/Release_2_11_2_Branch
++-jalview.version=2.11.2.6
+++jalview.release=releases/Release_2_12_Branch
+++jalview.version=2.12.0
+++++++++ Contents of side #2
++jalview.release=releases/Release_2_11_3_Branch
++jalview.version=2.11.3.3
++>>>>>>> Conflict 1 of 1 ends
dependencies {
classpath "com.vladsch.flexmark:flexmark-all:0.62.0"
classpath "org.jsoup:jsoup:1.14.3"
-- classpath "com.eowise:gradle-imagemagick:0.5.1"
++ classpath "com.eowise:gradle-imagemagick:0.4.0"
}
}
if (useClover) {
dependsOn cloverClasses
- } else { //?
- dependsOn compileJava //?
+ } else { //?
+ dependsOn testClasses
}
+ // not running tests in this task
+ exclude "**/*"
+ }
+ /* testTask0 is the main test task */
+ task testTask0(type: Test) {
+ group = "Verification"
+ description = "The main test task. Runs all non-testTaskN-labelled tests (unless excluded)"
useTestNG() {
- includeGroups testng_groups
- excludeGroups testng_excluded_groups
+ includeGroups testng_groups.split(",")
+ excludeGroups testng_excluded_groups.split(",")
+ tasks.withType(Test).matching {it.name.startsWith("testTask") && it.name != name}.all {t -> excludeGroups t.name}
preserveOrder true
useDefaultListeners=true
+ // Uncomment to show stdout and stderr for tests in gradle build output
+ // testLogging.showStandardStreams = true
}
+ }
+
+ /* separated tests */
+ task testTask1(type: Test) {
+ group = "Verification"
+ description = "Tests that need to be isolated from the main test run"
+ useTestNG() {
+ includeGroups name
+ excludeGroups testng_excluded_groups.split(",")
+ preserveOrder true
+ useDefaultListeners=true
+ }
+ }
+
+ task testTask2(type: Test) {
+ group = "Verification"
+ description = "Tests that need to be isolated from the main test run"
+ useTestNG() {
+ includeGroups name
+ excludeGroups testng_excluded_groups.split(",")
+ preserveOrder true
+ useDefaultListeners=true
+ }
+ }
+ task testTask3(type: Test) {
+ group = "Verification"
+ description = "Tests that need to be isolated from the main test run"
+ useTestNG() {
+ includeGroups name
+ excludeGroups testng_excluded_groups.split(",")
+ preserveOrder true
+ useDefaultListeners=true
+ }
+ }
+
+ /* insert more testTaskNs here -- change N to next digit or other string */
+ /*
+ task testTaskN(type: Test) {
+ group = "Verification"
+ description = "Tests that need to be isolated from the main test run"
+ useTestNG() {
+ includeGroups name
+ excludeGroups testng_excluded_groups.split(",")
+ preserveOrder true
+ useDefaultListeners=true
+ }
+ }
+ */
+
+ /*
+ * adapted from https://medium.com/@wasyl/pretty-tests-summary-in-gradle-744804dd676c
+ * to summarise test results from all Test tasks
+ */
+ /* START of test tasks results summary */
+ import groovy.time.TimeCategory
+ import org.gradle.api.tasks.testing.logging.TestExceptionFormat
+ import org.gradle.api.tasks.testing.logging.TestLogEvent
+ rootProject.ext.testsResults = [] // Container for tests summaries
+
+ tasks.withType(Test).matching {t -> t.getName().startsWith("testTask")}.all { testTask ->
+
+ // from original test task
+ if (useClover) {
+ dependsOn cloverClasses
+ } else { //?
+ dependsOn testClasses //?
+ }
+
+ // run main tests first
+ if (!testTask.name.equals("testTask0"))
+ testTask.mustRunAfter "testTask0"
+
+ testTask.testLogging { logging ->
+ events TestLogEvent.FAILED
+ // TestLogEvent.SKIPPED,
+ // TestLogEvent.STANDARD_OUT,
+ // TestLogEvent.STANDARD_ERROR
+
+ exceptionFormat TestExceptionFormat.FULL
+ showExceptions true
+ showCauses true
+ showStackTraces true
+ if (test_output) {
+ showStandardStreams true
+ }
+ info.events = [ TestLogEvent.FAILED ]
+ }
+
+ if (OperatingSystem.current().isMacOsX()) {
+ testTask.systemProperty "apple.awt.UIElement", "true"
+ testTask.environment "JAVA_TOOL_OPTIONS", "-Dapple.awt.UIElement=true"
+ }
+
+
+ ignoreFailures = true // Always try to run all tests for all modules
+
+ afterSuite { desc, result ->
+ if (desc.parent)
+ return // Only summarize results for whole modules
+
+ def resultsInfo = [testTask.project.name, testTask.name, result, TimeCategory.minus(new Date(result.endTime), new Date(result.startTime)), testTask.reports.html.entryPoint]
+
+ rootProject.ext.testsResults.add(resultsInfo)
+ }
+ // from original test task
maxHeapSize = "1024m"
workingDir = jalviewDir
action.select_all = Select all
action.select_highlighted_columns = Select Highlighted Columns
tooltip.select_highlighted_columns = Press B to mark highlighted columns, Ctrl-(or Cmd)-B to toggle, and Alt-B to mark all but highlighted columns
+ action.copy_highlighted_regions = Copy Highlighted Regions
+ tooltip.copy_highlighted_regions = Copies highlighted sequence regions to the clipboard for export or further analysis
action.deselect_all = Deselect all
action.invert_selection = Invert selection
+action.filter_by_evalue = Filter by E-Value
+action.filter_by_score = Filter by Score
action.using_jmol = Using Jmol
action.undo_changes_to_feature_settings = Undo all unapplied changes to feature settings
action.undo_changes_to_feature_settings_and_close_the_dialog = Undo all pending changes and close the feature settings dialog
label.colourScheme_buriedindex = Buried Index
label.colourScheme_purine/pyrimidine = Purine/Pyrimidine
label.colourScheme_nucleotide = Nucleotide
+label.colourScheme_hmmer-uniprot = HMMER profile v global background
+label.colourScheme_hmmer-alignment = HMMER profile v alignment background
+label.colourScheme_hmm_match_score = HMM Match Score
+ label.colourScheme_nucleotideambiguity = Nucleotide Ambiguity
label.colourScheme_t-coffeescores = T-Coffee Scores
label.colourScheme_rnahelices = By RNA Helices
label.colourScheme_sequenceid = Sequence ID Colour
int featureCount = feats[i] == null ? 0
: ((SequenceFeature[]) feats[i]).length;
scores[i] = featureCount;
- // System.err.println("Sorting on Density: seq "+seqs[i].getName()+
+ // jalview.bin.Console.errPrintln("Sorting on Density: seq
+ // "+seqs[i].getName()+
// " Feats: "+featureCount+" Score : "+scores[i]);
}
- QuickSort.sortByDouble(scores, seqs, sortByFeatureAscending);
+ doSort = true;
+ }
+ if (doSort)
+ {
+ QuickSort.sortByDouble(scores, seqs,
+ getInstance().sortByFeatureAscending);
}
-
setOrder(alignment, seqs);
}
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GeneLociI;
+import jalview.datamodel.HiddenColumns;
import jalview.datamodel.IncompleteCodonException;
import jalview.datamodel.Mapping;
import jalview.datamodel.Sequence;
}
try
{
- retrieved = sftch.getSequences(sourceRefs, !fromDna);
+ retrieved = SequenceFetcher.getInstance().getSequences(sourceRefs, !fromDna);
} catch (Exception e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Problem whilst retrieving cross references for Sequence : "
+ seq.getName());
e.printStackTrace();
import jalview.datamodel.SearchResultMatchI;
import jalview.datamodel.SearchResults;
import jalview.datamodel.SearchResultsI;
+ import jalview.datamodel.SequenceFeature;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+ import jalview.datamodel.features.SequenceFeaturesI;
import jalview.util.Comparison;
+import jalview.util.Platform;
import jalview.util.MapList;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.Iterator;
- import java.util.List;
-
- import com.stevesoft.pat.Regex;
-
/**
* Implements the search algorithm for the Find dialog
*/
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.analytics;
+
+ import java.io.BufferedReader;
+ import java.io.IOException;
+ import java.io.InputStreamReader;
+ import java.io.OutputStream;
+ import java.io.UnsupportedEncodingException;
+ import java.lang.invoke.MethodHandles;
+ import java.net.HttpURLConnection;
+ import java.net.MalformedURLException;
+ import java.net.URL;
+ import java.net.URLConnection;
+ import java.net.URLEncoder;
+ import java.nio.charset.StandardCharsets;
+ import java.util.AbstractMap;
+ import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Map;
+ import java.util.Random;
+
+ import jalview.bin.Cache;
+ import jalview.bin.Console;
+ import jalview.util.ChannelProperties;
+ import jalview.util.HttpUtils;
+
+ public class Plausible
+ {
+ private static final String USER_AGENT;
+
+ private static final String JALVIEW_ID = "Jalview Desktop";
+
+ private static final String DOMAIN = "jalview.org";
+
+ private static final String CONFIG_API_BASE_URL = "https://www.jalview.org/services/config/analytics/url";
+
+ private static final String DEFAULT_API_BASE_URL = "https://analytics.jalview.org/api/event";
+
+ private static final String API_BASE_URL;
+
+ private static final String clientId;
+
+ public static final String APPLICATION_BASE_URL = "desktop://localhost";
+
+ private List<Map.Entry<String, String>> queryStringValues;
+
+ private List<Map.Entry<String, Object>> jsonObject;
+
+ private List<Map.Entry<String, String>> cookieValues;
+
+ private static boolean ENABLED = false;
+
+ private static boolean DEBUG = true;
+
+ private static Plausible instance = null;
+
+ private static final Map<String, String> defaultProps;
+
+ static
+ {
+ defaultProps = new HashMap<>();
+ defaultProps.put("app_name",
+ ChannelProperties.getProperty("app_name") + " Desktop");
+ defaultProps.put("version", Cache.getProperty("VERSION"));
+ defaultProps.put("build_date",
+ Cache.getDefault("BUILD_DATE", "unknown"));
+ defaultProps.put("java_version", System.getProperty("java.version"));
+ String val = System.getProperty("sys.install4jVersion");
+ if (val != null)
+ {
+ defaultProps.put("install4j_version", val);
+ }
+ val = System.getProperty("installer_template_version");
+ if (val != null)
+ {
+ defaultProps.put("install4j_template_version", val);
+ }
+ val = System.getProperty("launcher_version");
+ if (val != null)
+ {
+ defaultProps.put("launcher_version", val);
+ }
+ defaultProps.put("java_arch",
+ System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ + System.getProperty("os.version"));
+ defaultProps.put("os", System.getProperty("os.name"));
+ defaultProps.put("os_version", System.getProperty("os.version"));
+ defaultProps.put("os_arch", System.getProperty("os.arch"));
- String installation = Cache.applicationProperties
- .getProperty("INSTALLATION");
++ String installation = Cache.getProperty("INSTALLATION");
+ if (installation != null)
+ {
+ defaultProps.put("installation", installation);
+ }
+
+ // ascertain the API_BASE_URL
+ API_BASE_URL = getAPIBaseURL();
+
+ // random clientId to make User-Agent unique (to register analytic)
+ clientId = String.format("%08x", new Random().nextInt());
+
+ USER_AGENT = HttpUtils.getUserAgent(
+ MethodHandles.lookup().lookupClass().getCanonicalName() + " "
+ + clientId);
+ }
+
+ private Plausible()
+ {
+ this.resetLists();
+ }
+
+ public static void setEnabled(boolean b)
+ {
+ ENABLED = b;
+ }
+
+ public void sendEvent(String eventName, String urlString,
+ String... propsStrings)
+ {
+ sendEvent(eventName, urlString, false, propsStrings);
+ }
+
+ /**
+ * The simplest way to send an analytic event.
+ *
+ * @param eventName
+ * The event name. To emulate a webpage view use "pageview" and set a
+ * "url" key/value. See https://plausible.io/docs/events-api
+ * @param sendDefaultProps
+ * Flag whether to add the default props about the application.
+ * @param propsStrings
+ * Optional multiple Strings in key, value pairs (there should be an
+ * even number of propsStrings) to be set as property of the event.
+ * To emulate a webpage view set "url" as the URL in a "pageview"
+ * event.
+ */
+ public void sendEvent(String eventName, String urlString,
+ boolean sendDefaultProps, String... propsStrings)
+ {
+ // clear out old lists
+ this.resetLists();
+
+ if (!ENABLED)
+ {
+ Console.debug("Plausible not enabled.");
+ return;
+ }
+ Map<String, String> props = new HashMap<>();
+
+ // add these to all events from this application instance
+ if (sendDefaultProps)
+ {
+ props.putAll(defaultProps);
+ }
+
+ // add (and overwrite with) the passed in props
+ if (propsStrings != null && propsStrings.length > 0)
+ {
+ if (propsStrings.length % 2 != 0)
+ {
+ Console.warn(
+ "Cannot addEvent with odd number of propsStrings. Ignoring the last one.");
+ }
+ for (int i = 0; i < propsStrings.length - 1; i += 2)
+ {
+ String key = propsStrings[i];
+ String value = propsStrings[i + 1];
+ props.put(key, value);
+ }
+ }
+
+ addJsonValue("domain", DOMAIN);
+ addJsonValue("name", eventName);
+ StringBuilder eventUrlSb = new StringBuilder(APPLICATION_BASE_URL);
+ if (!APPLICATION_BASE_URL.endsWith("/") && !urlString.startsWith("/"))
+ {
+ eventUrlSb.append("/");
+ }
+ eventUrlSb.append(urlString);
+ addJsonValue("url", eventUrlSb.toString());
+ addJsonObject("props", props);
+ StringBuilder urlSb = new StringBuilder();
+ urlSb.append(API_BASE_URL);
+ String qs = buildQueryString();
+ if (qs != null && qs.length() > 0)
+ {
+ urlSb.append('?');
+ urlSb.append(qs);
+ }
+ try
+ {
+ URL url = new URL(urlSb.toString());
+ URLConnection urlConnection = url.openConnection();
+ HttpURLConnection httpURLConnection = (HttpURLConnection) urlConnection;
+ httpURLConnection.setRequestMethod("POST");
+ httpURLConnection.setDoOutput(true);
+
+ String jsonString = buildJson();
+
+ Console.debug(
+ "Plausible: HTTP Request is: '" + urlSb.toString() + "'");
+ if (DEBUG)
+ {
+ Console.debug("Plausible: User-Agent is: '" + USER_AGENT + "'");
+ }
+ Console.debug("Plausible: POSTed JSON is:\n" + jsonString);
+
+ byte[] jsonBytes = jsonString.getBytes(StandardCharsets.UTF_8);
+ int jsonLength = jsonBytes.length;
+
+ httpURLConnection.setFixedLengthStreamingMode(jsonLength);
+ httpURLConnection.setRequestProperty("Content-Type",
+ "application/json");
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.connect();
+ try (OutputStream os = httpURLConnection.getOutputStream())
+ {
+ os.write(jsonBytes);
+ }
+ int responseCode = httpURLConnection.getResponseCode();
+ String responseMessage = httpURLConnection.getResponseMessage();
+
+ if (responseCode < 200 || responseCode > 299)
+ {
+ Console.warn("Plausible connection failed: '" + responseCode + " "
+ + responseMessage + "'");
+ }
+ else
+ {
+ Console.debug("Plausible connection succeeded: '" + responseCode
+ + " " + responseMessage + "'");
+ }
+
+ if (DEBUG)
+ {
+ BufferedReader br = new BufferedReader(new InputStreamReader(
+ (httpURLConnection.getInputStream())));
+ StringBuilder sb = new StringBuilder();
+ String response;
+ while ((response = br.readLine()) != null)
+ {
+ sb.append(response);
+ }
+ String body = sb.toString();
+ Console.debug("Plausible response content:\n" + body);
+ }
+ } catch (MalformedURLException e)
+ {
+ Console.debug(
+ "Somehow the Plausible BASE_URL and queryString is malformed: '"
+ + urlSb.toString() + "'",
+ e);
+ return;
+ } catch (IOException e)
+ {
+ Console.debug("Connection to Plausible BASE_URL '" + API_BASE_URL
+ + "' failed.", e);
+ } catch (ClassCastException e)
+ {
+ Console.debug(
+ "Couldn't cast URLConnection to HttpURLConnection in Plausible.",
+ e);
+ }
+ }
+
+ private void addJsonObject(String key, Map<String, String> map)
+ {
+ List<Map.Entry<String, ? extends Object>> list = new ArrayList<>();
+ for (String k : map.keySet())
+ {
+ list.add(stringEntry(k, map.get(k)));
+ }
+ addJsonObject(key, list);
+
+ }
+
+ private void addJsonObject(String key,
+ List<Map.Entry<String, ? extends Object>> object)
+ {
+ jsonObject.add(objectEntry(key, object));
+ }
+
+ private void addJsonValues(String key, List<Object> values)
+ {
+ jsonObject.add(objectEntry(key, values));
+ }
+
+ private void addJsonValue(String key, String value)
+ {
+ jsonObject.add(objectEntry(key, value));
+ }
+
+ private void addJsonValue(String key, int value)
+ {
+ jsonObject.add(objectEntry(key, Integer.valueOf(value)));
+ }
+
+ private void addJsonValue(String key, boolean value)
+ {
+ jsonObject.add(objectEntry(key, Boolean.valueOf(value)));
+ }
+
+ private void addQueryStringValue(String key, String value)
+ {
+ queryStringValues.add(stringEntry(key, value));
+ }
+
+ private void addCookieValue(String key, String value)
+ {
+ cookieValues.add(stringEntry(key, value));
+ }
+
+ private void resetLists()
+ {
+ jsonObject = new ArrayList<>();
+ queryStringValues = new ArrayList<>();
+ cookieValues = new ArrayList<>();
+ }
+
+ public static Plausible getInstance()
+ {
+ if (instance == null)
+ {
+ instance = new Plausible();
+ }
+ return instance;
+ }
+
+ public static void reset()
+ {
+ getInstance().resetLists();
+ }
+
+ private String buildQueryString()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (Map.Entry<String, String> entry : queryStringValues)
+ {
+ if (sb.length() > 0)
+ {
+ sb.append('&');
+ }
+ try
+ {
+ sb.append(URLEncoder.encode(entry.getKey(), "UTF-8"));
+ } catch (UnsupportedEncodingException e)
+ {
+ sb.append(entry.getKey());
+ }
+ sb.append('=');
+ try
+ {
+ sb.append(URLEncoder.encode(entry.getValue(), "UTF-8"));
+ } catch (UnsupportedEncodingException e)
+ {
+ sb.append(entry.getValue());
+ }
+ }
+ return sb.toString();
+ }
+
+ private void buildCookieHeaders()
+ {
+ // TODO not needed yet
+ }
+
+ private String buildJson()
+ {
+ StringBuilder sb = new StringBuilder();
+ addJsonObject(sb, 0, jsonObject);
+ return sb.toString();
+ }
+
+ private void addJsonObject(StringBuilder sb, int indent,
+ List<Map.Entry<String, Object>> entries)
+ {
+ indent(sb, indent);
+ sb.append('{');
+ newline(sb);
+ Iterator<Map.Entry<String, Object>> entriesI = entries.iterator();
+ while (entriesI.hasNext())
+ {
+ Map.Entry<String, Object> entry = entriesI.next();
+ String key = entry.getKey();
+ // TODO sensibly escape " characters in key
+ Object value = entry.getValue();
+ indent(sb, indent + 1);
+ sb.append('"').append(quoteEscape(key)).append('"').append(':');
+ space(sb);
+ if (value != null && value instanceof List)
+ {
+ newline(sb);
+ }
+ addJsonValue(sb, indent + 2, value);
+ if (entriesI.hasNext())
+ {
+ sb.append(',');
+ }
+ newline(sb);
+ }
+ indent(sb, indent);
+ sb.append('}');
+ }
+
+ private void addJsonValue(StringBuilder sb, int indent, Object value)
+ {
+ if (value == null)
+ {
+ return;
+ }
+ try
+ {
+ if (value instanceof Map.Entry)
+ {
+ Map.Entry<String, Object> entry = (Map.Entry<String, Object>) value;
+ List<Map.Entry<String, Object>> object = new ArrayList<>();
+ object.add(entry);
+ addJsonObject(sb, indent, object);
+ }
+ else if (value instanceof List)
+ {
+ // list of Map.Entries or list of values?
+ List<Object> valueList = (List<Object>) value;
+ if (valueList.size() > 0 && valueList.get(0) instanceof Map.Entry)
+ {
+ // entries
+ // indent(sb, indent);
+ List<Map.Entry<String, Object>> entryList = (List<Map.Entry<String, Object>>) value;
+ addJsonObject(sb, indent, entryList);
+ }
+ else
+ {
+ // values
+ indent(sb, indent);
+ sb.append('[');
+ newline(sb);
+ Iterator<Object> valueListI = valueList.iterator();
+ while (valueListI.hasNext())
+ {
+ Object v = valueListI.next();
+ addJsonValue(sb, indent + 1, v);
+ if (valueListI.hasNext())
+ {
+ sb.append(',');
+ }
+ newline(sb);
+ }
+ indent(sb, indent);
+ sb.append("]");
+ }
+ }
+ else if (value instanceof String)
+ {
+ sb.append('"').append(quoteEscape((String) value)).append('"');
+ }
+ else if (value instanceof Integer)
+ {
+ sb.append(((Integer) value).toString());
+ }
+ else if (value instanceof Boolean)
+ {
+ sb.append('"').append(((Boolean) value).toString()).append('"');
+ }
+ } catch (ClassCastException e)
+ {
+ Console.debug(
+ "Could not deal with type of json Object " + value.toString(),
+ e);
+ }
+ }
+
+ private static String quoteEscape(String s)
+ {
+ if (s == null)
+ {
+ return null;
+ }
+ // this escapes quotation marks (") that aren't already escaped (in the
+ // string) ready to go into a quoted JSON string value
+ return s.replaceAll("((?<!\\\\)(?:\\\\{2})*)\"", "$1\\\\\"");
+ }
+
+ private static void prettyWhitespace(StringBuilder sb, String whitespace,
+ int repeat)
+ {
+ // only add whitespace if we're in DEBUG mode
+ if (!Console.getLogger().isDebugEnabled())
+ {
+ return;
+ }
+ if (repeat >= 0 && whitespace != null)
+ {
+ // sb.append(whitespace.repeat(repeat));
+ sb.append(String.join("", Collections.nCopies(repeat, whitespace)));
+
+ }
+ else
+ {
+ sb.append(whitespace);
+ }
+ }
+
+ private static void indent(StringBuilder sb, int indent)
+ {
+ prettyWhitespace(sb, " ", indent);
+ }
+
+ private static void newline(StringBuilder sb)
+ {
+ prettyWhitespace(sb, "\n", -1);
+ }
+
+ private static void space(StringBuilder sb)
+ {
+ prettyWhitespace(sb, " ", -1);
+ }
+
+ protected static Map.Entry<String, Object> objectEntry(String s, Object o)
+ {
+ return new AbstractMap.SimpleEntry<String, Object>(s, o);
+ }
+
+ protected static Map.Entry<String, String> stringEntry(String s, String v)
+ {
+ return new AbstractMap.SimpleEntry<String, String>(s, v);
+ }
+
+ private static String getAPIBaseURL()
+ {
+ try
+ {
+ URL url = new URL(CONFIG_API_BASE_URL);
+ URLConnection urlConnection = url.openConnection();
+ HttpURLConnection httpURLConnection = (HttpURLConnection) urlConnection;
+ httpURLConnection.setRequestMethod("GET");
+ httpURLConnection.setRequestProperty("User-Agent", USER_AGENT);
+ httpURLConnection.setConnectTimeout(5000);
+ httpURLConnection.setReadTimeout(3000);
+ httpURLConnection.connect();
+ int responseCode = httpURLConnection.getResponseCode();
+ String responseMessage = httpURLConnection.getResponseMessage();
+
+ if (responseCode < 200 || responseCode > 299)
+ {
+ Console.warn("Config URL connection to '" + CONFIG_API_BASE_URL
+ + "' failed: '" + responseCode + " " + responseMessage
+ + "'");
+ }
+
+ BufferedReader br = new BufferedReader(
+ new InputStreamReader((httpURLConnection.getInputStream())));
+ StringBuilder sb = new StringBuilder();
+ String response;
+ while ((response = br.readLine()) != null)
+ {
+ sb.append(response);
+ }
+ if (sb.length() > 7 && sb.substring(0, 5).equals("https"))
+ {
+ return sb.toString();
+ }
+
+ } catch (MalformedURLException e)
+ {
+ Console.debug("Somehow the config URL is malformed: '"
+ + CONFIG_API_BASE_URL + "'", e);
+ } catch (IOException e)
+ {
+ Console.debug("Connection to Plausible BASE_URL '" + API_BASE_URL
+ + "' failed.", e);
+ } catch (ClassCastException e)
+ {
+ Console.debug(
+ "Couldn't cast URLConnection to HttpURLConnection in Plausible.",
+ e);
+ }
+ return DEFAULT_API_BASE_URL;
+ }
+ }
*/
boolean hasViewerActionsMenu();
+ String getViewId();
+
+ StructureViewer.ViewerType getViewerType();
+
+ boolean isUsedforaligment(AlignmentViewPanel ap);
+
+ boolean isColouredByViewer();
+
+ int getHeight();
+
+ int getWidth();
+
++ int getX();
++
+ int getY();
+
+ File saveSession();
+
+ /**
+ *
+ * @return heteroatoms in a form suitable for display and passing to command
+ * generator to display hetatms
+ */
+ default List<String> getHetatms()
+ {
+ return Collections.EMPTY_LIST;
+ }
-
}
// this is called after loading new annotation onto alignment
if (alignFrame.getSize().height == 0)
{
- jalview.bin.Console.outPrintln(
++ System.out.println(
+ "adjustAnnotationHeight frame size zero NEEDS FIXING");
+ // panel not laid out yet?
+ return;
}
fontChanged();
validateAnnotationDimensions(true);
--- /dev/null
+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+package jalview.bin;
+
++import jalview.gui.Desktop;
+import jalview.util.Platform;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * A class to hold singleton objects, whose scope (context) is
+ * <ul>
+ * <li>the Java runtime (JVM) when running as Java</li>
+ * <li>one 'applet', when running as JalviewJS</li>
+ * </ul>
+ * This allows separation of multiple JS applets running on the same browser
+ * page, each with their own 'singleton' instances.
+ * <p>
+ * Instance objects are held in a separate Map (keyed by Class) for each
+ * context. For Java, this is just a single static Map. For SwingJS, the map is
+ * stored as a field {@code _swingjsSingletons} of
+ * {@code Thread.currentThread.getThreadGroup()}, as a proxy for the applet.
+ * <p>
+ * Note that when an applet is stopped, its ThreadGroup is removed, allowing any
+ * singleton references to be garbage collected.
+ *
+ * @author hansonr
+ */
+public class ApplicationSingletonProvider
+{
+ /**
+ * A tagging interface to mark classes whose singleton instances may be served
+ * by {@code ApplicationSingletonProvider}, giving a distinct instance per JS
+ * 'applet'.
+ * <p>
+ * A class whose singleton should have global scope (be shared across all
+ * applets on a page) should <em>not</em> use this mechanism, but just provide
+ * a single instance (class static member) in the normal way.
+ */
+ public interface ApplicationSingletonI
+ {
+ }
+
+ /*
+ * Map used to hold singletons in JVM context
+ */
+ private static Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> singletons = new HashMap<>();
+
+ /**
+ * private constructor for non-instantiable class
+ */
+ private ApplicationSingletonProvider()
+ {
+ }
+
+ /**
+ * Returns the singletons map for the current context (JVM for Java,
+ * ThreadGroup for JS), creating the map on the first request for each JS
+ * ThreadGroup
+ *
+ * @return
+ */
+ private static Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> getContextMap()
+ {
+ @SuppressWarnings("unused")
+ ThreadGroup g = (Platform.isJS()
+ ? Thread.currentThread().getThreadGroup()
+ : null);
+ Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> map = singletons;
+ /** @j2sNative map = g._swingjsSingletons; */
+ if (map == null)
+ {
+ map = new HashMap<>();
+ /** @j2sNative g._swingjsSingletons = map; */
+ }
+
+ return map;
+ }
+
+ /**
+ * Answers the singleton instance of the given class for the current context
+ * (JVM or SwingJS 'applet'). If no instance yet exists, one is created, by
+ * calling the class's no-argument constructor. Answers null if any error
+ * occurs (or occurred previously for the same class).
+ *
++ * FIXME: threadsafety
++ *
++ * thread safe: the scope is not locked if another getInstance call is made
++ * for a particular ApplicationSingletonI when one is already in progress, so
++ * two will be made, and it is undefined which will end up in the registry.
++ * loop-safe: if an ApplicationSingletonI constructor implicitly calls
++ * getInstance for its class, a new instance will be called.
++ *
+ * @param c
+ * @return
+ */
+ @SuppressWarnings("unchecked")
+ public static <T extends ApplicationSingletonI> T getInstance(Class<T> c)
+ {
+ Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> map = getContextMap();
+ if (map.containsKey(c))
+ {
+ /*
+ * singleton already created _or_ creation failed (null value stored)
+ */
+ return (T) map.get(c);
+ }
+
+ /*
+ * create and save the singleton
+ */
+ T o = null;
+ try
+ {
+ Constructor<T> con = c.getDeclaredConstructor();
+ con.setAccessible(true);
+ o = con.newInstance();
+ } catch (IllegalAccessException | InstantiationException
+ | IllegalArgumentException | InvocationTargetException
+ | NoSuchMethodException | SecurityException e)
+ {
+ Console.error("Failed to create singleton for " + c.toString()
+ + ", error was: " + e.toString());
+ e.printStackTrace();
+ }
+
+ /*
+ * store the new singleton; note that a
+ * null value is saved if construction failed
+ */
+ getContextMap().put(c, o);
+ return o;
+ }
+
+ /**
+ * Removes the current singleton instance of the given class from the current
+ * application context. This has the effect of ensuring that a new instance is
+ * created the next time one is requested.
+ *
+ * @param c
+ */
+ public static void removeInstance(
+ Class<? extends ApplicationSingletonI> c)
+ {
+ Map<Class<? extends ApplicationSingletonI>, ApplicationSingletonI> map = getContextMap();
+ if (map != null)
+ {
+ map.remove(c);
+ }
+ }
++
++ public static boolean hasInstance(Class<? extends ApplicationSingletonI> class1)
++ {
++ return (getContextMap().get(class1)!=null);
++ }
+}
public ArgsParser(String[] args)
{
- vargs = new Vector<String>();
- for (int i = 0; i < args.length; i++)
+ vargs = new ArrayList<>();
+ isApplet = (args.length > 0 && args[0].startsWith("<applet"));
+ if (isApplet)
{
- String arg = args[i].trim();
- if (arg.length() > 0 && arg.charAt(0) == '-')
+ appletParams = AppletParams.getAppletParams(args, vargs);
+ }
+ else
+ {
+ if (Platform.isJS())
+
{
- arg = arg.substring(1);
+ isApplet = true;
+ appletParams = AppletParams
+ .getAppletParams(Platform.getAppletInfoAsMap(), vargs);
+ }
+ for (int i = 0; i < args.length; i++)
+ {
+ String arg = args[i].trim();
- if (arg.charAt(0) == '-')
++ if (arg.length() > 0 && arg.charAt(0) == '-')
+ {
+ arg = arg.substring(1);
+ }
+ vargs.add(arg);
}
- vargs.addElement(arg);
}
}
import javax.swing.LookAndFeel;
import javax.swing.UIManager;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+ import jalview.analytics.Plausible;
+ import jalview.bin.argparser.Arg;
+ import jalview.bin.argparser.ArgParser;
import jalview.datamodel.PDBEntry;
import jalview.gui.Preferences;
import jalview.gui.UserDefinedColours;
// in-memory only storage of proxy password, safer to use char array
public static char[] proxyAuthPassword = null;
+ /**
+ * Session properties, set by command line, try not to affect stored
+ * properties!
+ */
+ private static Map<String, String> sessionProperties = new HashMap<>();
+
+ private static boolean bypassSessionProperties = false;
+
+ public static void enableSessionProperties()
+ {
+ bypassSessionProperties = false;
+ }
+
+ public static void disableSessionProperties()
+ {
+ bypassSessionProperties = true;
+ }
+
/** Jalview Properties */
- public static Properties applicationProperties = new Properties()
+ private Properties applicationProperties = new Properties()
{
// override results in properties output in alphabetical order
@Override
/** Default file is ~/.jalview_properties */
static String propertiesFile;
+ private static final String fallbackPropertiesFile = ".jalview_properties";
+
private static boolean propsAreReadOnly = Platform.isJS();
+ public static boolean isPropsAreReadOnly()
+ {
+ return propsAreReadOnly;
+ }
+
+ public static void setPropsAreReadOnly(boolean propsAreReadOnly)
+ {
+ Cache.propsAreReadOnly = propsAreReadOnly;
+ }
+
private final static String JS_PROPERTY_PREFIX = "jalview_";
+
/**
- * Loads properties from the given properties file. Any existing properties
- * are first cleared.
+ * Loads properties from the given properties file. Any existing properties are
+ * first cleared.
*/
public static void loadProperties(String propsFile)
{
boolean defaultProperties = false;
if (propsFile == null && !propsAreReadOnly)
{
+ // TODO: @bsoares - for 2.12 testing: check test,develop,release props are located correctly
String channelPrefsFilename = ChannelProperties
.getProperty("preferences.filename");
- String releasePrefsFilename = ".jalview_properties";
+ String releasePrefsFilename = fallbackPropertiesFile;
- propertiesFile = System.getProperty("user.home") + File.separatorChar
- + channelPrefsFilename;
- releasePropertiesFile = System.getProperty("user.home")
- + File.separatorChar + releasePrefsFilename;
+ propertiesFile = Platform.getUserPath(channelPrefsFilename);
+ releasePropertiesFile = Platform.getUserPath(releasePrefsFilename);
defaultProperties = true;
}
else
*/
public static String getProperty(String key)
{
- String prop = getInstance().applicationProperties.getProperty(key);
+ return getProperty(key, false);
+ }
+
+ public static String getProperty(String key,
+ boolean skipSessionProperties)
+ {
+ String prop = null;
+ if (!(skipSessionProperties || bypassSessionProperties))
+ {
+ prop = getSessionProperty(key);
+ }
+ if (prop == null)
+ {
- prop = applicationProperties.getProperty(key);
- }
- if (prop == null && Platform.isJS())
- {
- prop = applicationProperties.getProperty(Platform.getUniqueAppletID()
- + "_" + JS_PROPERTY_PREFIX + key);
++ prop = getInstance().applicationProperties.getProperty(key);
+ }
+ // if (prop == null && Platform.isJS())
+ // {
+ // prop = applicationProperties.getProperty(Platform.getUniqueAppletID()
+ // + "_" + JS_PROPERTY_PREFIX + key);
+ // }
return prop;
}
{
try
{
- return date_format.parse(val);
+ if ((val = val.trim()).indexOf(",") < 0 && val.indexOf("-") >= 0 && val.indexOf(" ") == val.lastIndexOf(" ")) {
+ val = val.replace(" ",", ").replace('-',' ');
+ }
+ Date date = date_format.parse(val);
+ return date;
} catch (Exception ex)
{
- System.err.println("Invalid or corrupt date in property '"
- + propertyName + "' : value was '" + val + "'");
+ jalview.bin.Console
+ .errPrintln("Invalid or corrupt date in property '"
+ + propertyName + "' : value was '" + val + "'");
}
}
return null;
{
// consider returning more human friendly info
// eg 'built from Source' or update channel
- return Cache.getDefault("INSTALLATION", "unknown");
+ return Cache.getDefault("INSTALLATION", "unknown");
+ }
+
+ /**
+ *
+ * For AppletParams and Preferences ok_actionPerformed and
+ * startupFileTextfield_mouseClicked
+ *
+ * Sets a property value for the running application, without saving it to the
+ * properties file
+ *
+ * @param key
+ * @param obj
+ */
+ public static void setPropertyNoSave(String key, String obj)
+ {
+ getInstance().setPropertyImpl(key, obj, false);
+ }
+
+ /**
+ * Sets a property value, and optionally also saves the current properties to
+ * file
+ *
+ * @param key
+ * @param obj
+ * @param andSave
+ * @return
+ */
+ private Object setPropertyImpl(
+ String key, String obj, boolean andSave)
+ {
+ Object oldValue = null;
+ try
+ {
+ oldValue = applicationProperties.setProperty(key, obj);
- if (andSave && !propsAreReadOnly && propertiesFile != null)
++ // reset the session property too
++ if (sessionProperties.containsKey(key))
++ {
++ sessionProperties.remove(key);
++ }
++ if (andSave && !propsAreReadOnly && propertiesFile != null
++ // don't rewrite if new value is same as old value
++ && !((obj == null && oldValue == null)
++ || (obj != null && obj.equals(oldValue))))
+ {
+ FileOutputStream out = new FileOutputStream(propertiesFile);
+ applicationProperties.store(out, "---JalviewX Properties File---");
+ out.close();
+ }
+ } catch (Exception ex)
+ {
- System.out.println(
- "Error setting property: " + key + " " + obj + "\n" + ex);
++ if (!Jalview.quiet())
++ jalview.bin.Console.errPrintln(
++ "Error setting property: " + key + " " + obj + "\n" + ex);
+ }
+ return oldValue;
}
public static String getStackTraceString(Throwable t)
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.bin;
+
+ import java.awt.Color;
+ import java.io.File;
+ import java.io.IOException;
+ import java.net.URISyntaxException;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.Collections;
+ import java.util.HashMap;
+ import java.util.Iterator;
+ import java.util.List;
+ import java.util.Locale;
+ import java.util.Map;
+
+ import javax.swing.SwingUtilities;
+
+ import jalview.analysis.AlignmentUtils;
+ import jalview.api.structures.JalviewStructureDisplayI;
+ import jalview.bin.Jalview.ExitCode;
+ import jalview.bin.argparser.Arg;
+ import jalview.bin.argparser.ArgParser;
+ import jalview.bin.argparser.ArgValue;
+ import jalview.bin.argparser.ArgValuesMap;
+ import jalview.bin.argparser.SubVals;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.SequenceI;
+ import jalview.datamodel.annotations.AlphaFoldAnnotationRowBuilder;
+ import jalview.gui.AlignFrame;
+ import jalview.gui.AlignmentPanel;
+ import jalview.gui.AppJmol;
+ import jalview.gui.Desktop;
+ import jalview.gui.Preferences;
+ import jalview.gui.StructureChooser;
+ import jalview.gui.StructureViewer;
+ import jalview.gui.StructureViewer.ViewerType;
+ import jalview.io.AppletFormatAdapter;
+ import jalview.io.BackupFiles;
+ import jalview.io.BioJsHTMLOutput;
+ import jalview.io.DataSourceType;
+ import jalview.io.FileFormat;
+ import jalview.io.FileFormatException;
+ import jalview.io.FileFormatI;
+ import jalview.io.FileFormats;
+ import jalview.io.FileLoader;
+ import jalview.io.HtmlSvgOutput;
+ import jalview.io.IdentifyFile;
+ import jalview.io.NewickFile;
+ import jalview.io.exceptions.ImageOutputException;
+ import jalview.schemes.ColourSchemeI;
+ import jalview.schemes.ColourSchemeProperty;
+ import jalview.structure.StructureCommandI;
+ import jalview.structure.StructureImportSettings.TFType;
+ import jalview.structure.StructureSelectionManager;
+ import jalview.util.ColorUtils;
+ import jalview.util.FileUtils;
+ import jalview.util.HttpUtils;
+ import jalview.util.ImageMaker;
+ import jalview.util.ImageMaker.TYPE;
+ import jalview.util.MessageManager;
+ import jalview.util.Platform;
+ import jalview.util.StringUtils;
+ import jalview.util.imagemaker.BitmapImageSizing;
+
+ public class Commands
+ {
+ Desktop desktop;
+
+ private boolean headless;
+
+ private ArgParser argParser;
+
+ private Map<String, AlignFrame> afMap;
+
+ private Map<String, List<StructureViewer>> svMap;
+
+ private boolean commandArgsProvided = false;
+
+ private boolean argsWereParsed = false;
+
+ private List<String> errors = new ArrayList<>();
+
+ public Commands(ArgParser argparser, boolean headless)
+ {
- this(Desktop.instance, argparser, headless);
++ this(Desktop.getInstance(), argparser, headless);
+ }
+
+ public Commands(Desktop d, ArgParser argparser, boolean h)
+ {
+ argParser = argparser;
+ headless = h;
+ desktop = d;
+ afMap = new HashMap<>();
+ }
+
+ protected boolean processArgs()
+ {
+ if (argParser == null)
+ {
+ return true;
+ }
+
+ boolean theseArgsWereParsed = false;
+
+ if (argParser != null && argParser.getLinkedIds() != null)
+ {
+ for (String id : argParser.getLinkedIds())
+ {
+ ArgValuesMap avm = argParser.getLinkedArgs(id);
+ theseArgsWereParsed = true;
+ boolean processLinkedOkay = processLinked(id);
+ theseArgsWereParsed &= processLinkedOkay;
+
+ processGroovyScript(id);
+
+ // wait around until alignFrame isn't busy
+ AlignFrame af = afMap.get(id);
+ while (af != null && af.getViewport().isCalcInProgress())
+ {
+ try
+ {
+ Thread.sleep(25);
+ } catch (Exception q)
+ {
+ }
+ ;
+ }
+
+ theseArgsWereParsed &= processImages(id);
+
+ if (processLinkedOkay)
+ {
+ theseArgsWereParsed &= processOutput(id);
+ }
+
+ // close ap
+ if (avm.getBoolean(Arg.CLOSE))
+ {
+ af = afMap.get(id);
+ if (af != null)
+ {
+ af.closeMenuItem_actionPerformed(true);
+ }
+ }
+
+ }
+
+ }
+
+ // report errors - if any
+ String errorsRaised = errorsToString();
+ if (errorsRaised.trim().length() > 0)
+ {
+ Console.warn(
+ "The following errors and warnings occurred whilst processing files:\n"
+ + errorsRaised);
+ }
+ // gui errors reported in Jalview
+
+ if (argParser.getBoolean(Arg.QUIT))
+ {
+ Jalview.exit("Exiting due to " + Arg.QUIT.argString() + " argument.",
+ ExitCode.OK);
+ return true;
+ }
+ // carry on with jalview.bin.Jalview
+ argsWereParsed = theseArgsWereParsed;
+ return argsWereParsed;
+ }
+
+ public boolean commandArgsProvided()
+ {
+ return commandArgsProvided;
+ }
+
+ public boolean argsWereParsed()
+ {
+ return argsWereParsed;
+ }
+
+ protected boolean processLinked(String id)
+ {
+ boolean theseArgsWereParsed = false;
+ ArgValuesMap avm = argParser.getLinkedArgs(id);
+ if (avm == null)
+ {
+ return true;
+ }
+
+ Boolean isError = Boolean.valueOf(false);
+
+ // set wrap, showSSAnnotations, showAnnotations and hideTFrows scope here so
+ // it can be applied after structures are opened
+ boolean wrap = false;
+ boolean showSSAnnotations = false;
+ boolean showAnnotations = false;
+ boolean hideTFrows = false;
+ AlignFrame af = null;
+
+ if (avm.containsArg(Arg.APPEND) || avm.containsArg(Arg.OPEN))
+ {
+ commandArgsProvided = true;
+ final long progress = System.currentTimeMillis();
+
+ boolean first = true;
+ boolean progressBarSet = false;
+ // Combine the APPEND and OPEN files into one list, along with whether it
+ // was APPEND or OPEN
+ List<ArgValue> openAvList = new ArrayList<>();
+ openAvList.addAll(avm.getArgValueList(Arg.OPEN));
+ openAvList.addAll(avm.getArgValueList(Arg.APPEND));
+ // sort avlist based on av.getArgIndex()
+ Collections.sort(openAvList);
+ for (ArgValue av : openAvList)
+ {
+ Arg a = av.getArg();
+ SubVals sv = av.getSubVals();
+ String openFile = av.getValue();
+ if (openFile == null)
+ continue;
+
+ theseArgsWereParsed = true;
+ if (first)
+ {
+ first = false;
+ if (!headless && desktop != null)
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ desktop.setProgressBar(
+ MessageManager.getString(
+ "status.processing_commandline_args"),
+ progress);
+
+ }
+ });
+ progressBarSet = true;
+ }
+ }
+
+ if (!Platform.isJS())
+ /**
+ * ignore in JavaScript -- can't just file existence - could load it?
+ *
+ * @j2sIgnore
+ */
+ {
+ if (!HttpUtils.startsWithHttpOrHttps(openFile))
+ {
+ if (!(new File(openFile)).exists())
+ {
+ addError("Can't find file '" + openFile + "'");
+ isError = true;
+ continue;
+ }
+ }
+ }
+
+ DataSourceType protocol = AppletFormatAdapter
+ .checkProtocol(openFile);
+
+ FileFormatI format = null;
+ try
+ {
+ format = new IdentifyFile().identify(openFile, protocol);
+ } catch (FileFormatException e1)
+ {
+ addError("Unknown file format for '" + openFile + "'");
+ isError = true;
+ continue;
+ }
+
+ af = afMap.get(id);
+ // When to open a new AlignFrame
+ if (af == null || "true".equals(av.getSubVal("new"))
+ || a == Arg.OPEN || format == FileFormat.Jalview)
+ {
+ if (a == Arg.OPEN)
+ {
+ Jalview.testoutput(argParser, Arg.OPEN, "examples/uniref50.fa",
+ openFile);
+ }
+
+ Console.debug(
+ "Opening '" + openFile + "' in new alignment frame");
+ FileLoader fileLoader = new FileLoader(!headless);
+ boolean xception = false;
+ try
+ {
+ af = fileLoader.LoadFileWaitTillLoaded(openFile, protocol,
+ format);
+ } catch (Throwable thr)
+ {
+ xception = true;
+ addError("Couldn't open '" + openFile + "' as " + format + " "
+ + thr.getLocalizedMessage()
+ + " (Enable debug for full stack trace)");
+ isError = true;
+ Console.debug("Exception when opening '" + openFile + "'", thr);
+ } finally
+ {
+ if (af == null && !xception)
+ {
+ addInfo("Ignoring '" + openFile
+ + "' - no alignment data found.");
+ continue;
+ }
+ }
+
+ // colour alignment
+ String colour = null;
+ if (avm.containsArg(Arg.COLOUR)
+ || !(format == FileFormat.Jalview))
+ {
+ colour = avm.getFromSubValArgOrPref(av, Arg.COLOUR, sv, null,
+ "DEFAULT_COLOUR_PROT", null);
+ }
+ if (colour != null)
+ {
+ this.colourAlignFrame(af, colour);
+ }
+
+ // Change alignment frame title
+ String title = avm.getFromSubValArgOrPref(av, Arg.TITLE, sv, null,
+ null, null);
+ if (title != null)
+ {
+ af.setTitle(title);
+ Jalview.testoutput(argParser, Arg.TITLE, "test title", title);
+ }
+
+ // Add features
+ String featuresfile = avm.getValueFromSubValOrArg(av,
+ Arg.FEATURES, sv);
+ if (featuresfile != null)
+ {
+ af.parseFeaturesFile(featuresfile,
+ AppletFormatAdapter.checkProtocol(featuresfile));
+ Jalview.testoutput(argParser, Arg.FEATURES,
+ "examples/testdata/plantfdx.features", featuresfile);
+ }
+
+ // Add annotations from file
+ String annotationsfile = avm.getValueFromSubValOrArg(av,
+ Arg.ANNOTATIONS, sv);
+ if (annotationsfile != null)
+ {
+ af.loadJalviewDataFile(annotationsfile, null, null, null);
+ Jalview.testoutput(argParser, Arg.ANNOTATIONS,
+ "examples/testdata/plantfdx.annotations",
+ annotationsfile);
+ }
+
+ // Set or clear the sortbytree flag
+ boolean sortbytree = avm.getBoolFromSubValOrArg(Arg.SORTBYTREE,
+ sv);
+ if (sortbytree)
+ {
+ af.getViewport().setSortByTree(true);
+ Jalview.testoutput(argParser, Arg.SORTBYTREE);
+ }
+
+ // Load tree from file
+ String treefile = avm.getValueFromSubValOrArg(av, Arg.TREE, sv);
+ if (treefile != null)
+ {
+ try
+ {
+ NewickFile nf = new NewickFile(treefile,
+ AppletFormatAdapter.checkProtocol(treefile));
+ af.getViewport().setCurrentTree(
+ af.showNewickTree(nf, treefile).getTree());
+ Jalview.testoutput(argParser, Arg.TREE,
+ "examples/testdata/uniref50_test_tree", treefile);
+ } catch (IOException e)
+ {
+ addError("Couldn't add tree " + treefile, e);
+ isError = true;
+ }
+ }
+
+ // Show secondary structure annotations?
+ showSSAnnotations = avm.getFromSubValArgOrPref(
+ Arg.SHOWSSANNOTATIONS, av.getSubVals(), null,
+ "STRUCT_FROM_PDB", true);
+ // Show sequence annotations?
+ showAnnotations = avm.getFromSubValArgOrPref(Arg.SHOWANNOTATIONS,
+ av.getSubVals(), null, "SHOW_ANNOTATIONS", true);
+ // hide the Temperature Factor row?
+ hideTFrows = (avm.getBoolean(Arg.NOTEMPFAC));
+
+ // showSSAnnotations, showAnnotations, hideTFrows used after opening
+ // structure
+
+ // wrap alignment? do this last for formatting reasons
+ wrap = avm.getFromSubValArgOrPref(Arg.WRAP, sv, null,
+ "WRAP_ALIGNMENT", false);
+ // af.setWrapFormat(wrap) is applied after structures are opened for
+ // annotation reasons
+
+ // store the AlignFrame for this id
+ afMap.put(id, af);
+
+ // is it its own structure file?
+ if (format.isStructureFile())
+ {
+ StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
++ .getStructureSelectionManager(Desktop.getInstance());
+ SequenceI seq = af.alignPanel.getAlignment().getSequenceAt(0);
+ ssm.computeMapping(false, new SequenceI[] { seq }, null,
+ openFile, DataSourceType.FILE, null, null, null, false);
+ }
+ }
+ else
+ {
+ Console.debug(
+ "Opening '" + openFile + "' in existing alignment frame");
+
+ DataSourceType dst = HttpUtils.startsWithHttpOrHttps(openFile)
+ ? DataSourceType.URL
+ : DataSourceType.FILE;
+
+ FileLoader fileLoader = new FileLoader(!headless);
+ fileLoader.LoadFile(af.getCurrentView(), openFile, dst, null,
+ false);
+ }
+
+ Console.debug("Command " + Arg.APPEND + " executed successfully!");
+
+ }
+ if (first) // first=true means nothing opened
+ {
+ if (headless)
+ {
+ Jalview.exit("Could not open any files in headless mode",
+ ExitCode.NO_FILES);
+ }
+ else
+ {
+ Console.info("No more files to open");
+ }
+ }
+ if (progressBarSet && desktop != null)
+ desktop.setProgressBar(null, progress);
+
+ }
+
+ // open the structure (from same PDB file or given PDBfile)
+ if (!avm.getBoolean(Arg.NOSTRUCTURE))
+ {
+ if (af == null)
+ {
+ af = afMap.get(id);
+ }
+ if (avm.containsArg(Arg.STRUCTURE))
+ {
+ commandArgsProvided = true;
+ for (ArgValue structureAv : avm.getArgValueList(Arg.STRUCTURE))
+ {
+ argParser.setStructureFilename(null);
+ String val = structureAv.getValue();
+ SubVals subVals = structureAv.getSubVals();
+ int argIndex = structureAv.getArgIndex();
+ SequenceI seq = getSpecifiedSequence(af, avm, structureAv);
+ if (seq == null)
+ {
+ // Could not find sequence from subId, let's assume the first
+ // sequence in the alignframe
+ AlignmentI al = af.getCurrentView().getAlignment();
+ seq = al.getSequenceAt(0);
+ }
+
+ if (seq == null)
+ {
+ addWarn("Could not find sequence for argument "
+ + Arg.STRUCTURE.argString() + "=" + val);
+ continue;
+ }
+ String structureFilename = null;
+ File structureFile = null;
+ if (subVals.getContent() != null
+ && subVals.getContent().length() != 0)
+ {
+ structureFilename = subVals.getContent();
+ Console.debug("Using structure file (from argument) '"
+ + structureFilename + "'");
+ structureFile = new File(structureFilename);
+ }
+ /* THIS DOESN'T WORK */
+ else if (seq.getAllPDBEntries() != null
+ && seq.getAllPDBEntries().size() > 0)
+ {
+ structureFile = new File(
+ seq.getAllPDBEntries().elementAt(0).getFile());
+ if (structureFile != null)
+ {
+ Console.debug("Using structure file (from sequence) '"
+ + structureFile.getAbsolutePath() + "'");
+ }
+ structureFilename = structureFile.getAbsolutePath();
+ }
+
+ if (structureFilename == null || structureFile == null)
+ {
+ addWarn("Not provided structure file with '" + val + "'");
+ continue;
+ }
+
+ if (!structureFile.exists())
+ {
+ addWarn("Structure file '" + structureFile.getAbsoluteFile()
+ + "' not found.");
+ continue;
+ }
+
+ Console.debug("Using structure file "
+ + structureFile.getAbsolutePath());
+
+ argParser.setStructureFilename(structureFilename);
+
+ // open structure view
+ AlignmentPanel ap = af.alignPanel;
+ if (headless)
+ {
+ Cache.setProperty(Preferences.STRUCTURE_DISPLAY,
+ StructureViewer.ViewerType.JMOL.toString());
+ }
+
+ String structureFilepath = structureFile.getAbsolutePath();
+
+ // get PAEMATRIX file and label from subvals or Arg.PAEMATRIX
+ String paeFilepath = avm.getFromSubValArgOrPrefWithSubstitutions(
+ argParser, Arg.PAEMATRIX, ArgValuesMap.Position.AFTER,
+ structureAv, subVals, null, null, null);
+ if (paeFilepath != null)
+ {
+ File paeFile = new File(paeFilepath);
+
+ try
+ {
+ paeFilepath = paeFile.getCanonicalPath();
+ } catch (IOException e)
+ {
+ paeFilepath = paeFile.getAbsolutePath();
+ addWarn("Problem with the PAE file path: '"
+ + paeFile.getPath() + "'");
+ }
+ }
+
+ // showing annotations from structure file or not
+ boolean ssFromStructure = avm.getFromSubValArgOrPref(
+ Arg.SHOWSSANNOTATIONS, subVals, null, "STRUCT_FROM_PDB",
+ true);
+
+ // get TEMPFAC type from subvals or Arg.TEMPFAC in case user Adds
+ // reference annotations
+ String tftString = avm.getFromSubValArgOrPrefWithSubstitutions(
+ argParser, Arg.TEMPFAC, ArgValuesMap.Position.AFTER,
+ structureAv, subVals, null, null, null);
+ boolean notempfac = avm.getFromSubValArgOrPref(Arg.NOTEMPFAC,
+ subVals, null, "ADD_TEMPFACT_ANN", false, true);
+ TFType tft = notempfac ? null : TFType.DEFAULT;
+ if (tftString != null && !notempfac)
+ {
+ // get kind of temperature factor annotation
+ try
+ {
+ tft = TFType.valueOf(tftString.toUpperCase(Locale.ROOT));
+ Console.debug("Obtained Temperature Factor type of '" + tft
+ + "' for structure '" + structureFilepath + "'");
+ } catch (IllegalArgumentException e)
+ {
+ // Just an error message!
+ StringBuilder sb = new StringBuilder().append("Cannot set ")
+ .append(Arg.TEMPFAC.argString()).append(" to '")
+ .append(tft)
+ .append("', ignoring. Valid values are: ");
+ Iterator<TFType> it = Arrays.stream(TFType.values())
+ .iterator();
+ while (it.hasNext())
+ {
+ sb.append(it.next().toString().toLowerCase(Locale.ROOT));
+ if (it.hasNext())
+ sb.append(", ");
+ }
+ addWarn(sb.toString());
+ }
+ }
+
+ String sViewerName = avm.getFromSubValArgOrPref(
+ Arg.STRUCTUREVIEWER, ArgValuesMap.Position.AFTER,
+ structureAv, subVals, null, null, "jmol");
+ ViewerType viewerType = ViewerType.getFromString(sViewerName);
+
+ // TODO use ssFromStructure
+ StructureViewer structureViewer = StructureChooser
+ .openStructureFileForSequence(null, null, ap, seq, false,
+ structureFilepath, tft, paeFilepath, false,
+ ssFromStructure, false, viewerType);
+
+ if (structureViewer == null)
+ {
+ if (!StringUtils.equalsIgnoreCase(sViewerName, "none"))
+ {
+ addError("Failed to import and open structure view for file '"
+ + structureFile + "'.");
+ }
+ continue;
+ }
+ try
+ {
+ long tries = 1000;
+ while (structureViewer.isBusy() && tries > 0)
+ {
+ Thread.sleep(25);
+ if (structureViewer.isBusy())
+ {
+ tries--;
+ Console.debug(
+ "Waiting for viewer for " + structureFilepath);
+ }
+ }
+ if (tries == 0 && structureViewer.isBusy())
+ {
+ addWarn("Gave up waiting for structure viewer to load file '"
+ + structureFile
+ + "'. Something may have gone wrong.");
+ }
+ } catch (Exception x)
+ {
+ addError("Exception whilst waiting for structure viewer "
+ + structureFilepath, x);
+ isError = true;
+ }
+
+ // add StructureViewer to svMap list
+ if (svMap == null)
+ {
+ svMap = new HashMap<>();
+ }
+ if (svMap.get(id) == null)
+ {
+ svMap.put(id, new ArrayList<>());
+ }
+ svMap.get(id).add(structureViewer);
+
+ Console.debug(
+ "Successfully opened viewer for " + structureFilepath);
+
+ if (avm.containsArg(Arg.STRUCTUREIMAGE))
+ {
+ for (ArgValue structureImageArgValue : avm
+ .getArgValueListFromSubValOrArg(structureAv,
+ Arg.STRUCTUREIMAGE, subVals))
+ {
+ String structureImageFilename = argParser.makeSubstitutions(
+ structureImageArgValue.getValue(), id, true);
+ if (structureViewer != null && structureImageFilename != null)
+ {
+ SubVals structureImageSubVals = null;
+ structureImageSubVals = structureImageArgValue.getSubVals();
+ File structureImageFile = new File(structureImageFilename);
+ String width = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.WIDTH,
+ structureImageSubVals);
+ String height = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.HEIGHT,
+ structureImageSubVals);
+ String scale = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.SCALE,
+ structureImageSubVals);
+ String renderer = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.TEXTRENDERER,
+ structureImageSubVals);
+ String typeS = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.TYPE,
+ structureImageSubVals);
+ if (typeS == null || typeS.length() == 0)
+ {
+ typeS = FileUtils.getExtension(structureImageFile);
+ }
+ TYPE imageType;
+ try
+ {
+ imageType = Enum.valueOf(TYPE.class,
+ typeS.toUpperCase(Locale.ROOT));
+ } catch (IllegalArgumentException e)
+ {
+ addWarn("Do not know image format '" + typeS
+ + "', using PNG");
+ imageType = TYPE.PNG;
+ }
+ BitmapImageSizing userBis = ImageMaker
+ .parseScaleWidthHeightStrings(scale, width, height);
+
+ /////
+ // DON'T TRY TO EXPORT IF VIEWER IS UNSUPPORTED
+ if (viewerType != ViewerType.JMOL)
+ {
+ addWarn("Cannot export image for structure viewer "
+ + viewerType.name() + " yet");
+ continue;
+ }
+
+ /////
+ // Apply the temporary colourscheme to the linked alignment
+ // TODO: enhance for multiple linked alignments.
+
+ String imageColour = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.IMAGECOLOUR,
+ structureImageSubVals);
+ ColourSchemeI originalColourScheme = this
+ .getColourScheme(af);
+ this.colourAlignFrame(af, imageColour);
+
+ /////
+ // custom image background colour
+
+ String bgcolourstring = avm.getValueFromSubValOrArg(
+ structureImageArgValue, Arg.BGCOLOUR,
+ structureImageSubVals);
+ Color bgcolour = null;
+ if (bgcolourstring != null && bgcolourstring.length() > 0)
+ {
+ bgcolour = ColorUtils.parseColourString(bgcolourstring);
+ if (bgcolour == null)
+ {
+ Console.warn(
+ "Background colour string '" + bgcolourstring
+ + "' not recognised -- using default");
+ }
+ }
+
+ JalviewStructureDisplayI sview = structureViewer
+ .getJalviewStructureDisplay();
+
+ File sessionToRestore = null;
+
+ List<StructureCommandI> extraCommands = new ArrayList<>();
+
+ if (extraCommands.size() > 0 || bgcolour != null)
+ {
+ try
+ {
+ sessionToRestore = sview.saveSession();
+ } catch (Throwable t)
+ {
+ Console.warn(
+ "Unable to save temporary session file before custom structure view export operation.");
+ }
+ }
+
+ ////
+ // Do temporary ops
+
+ if (bgcolour != null)
+ {
+ sview.getBinding().setBackgroundColour(bgcolour);
+ }
+
+ sview.getBinding().executeCommands(extraCommands, false,
+ "Executing Custom Commands");
+
+ // and export the view as an image
+ boolean success = this.checksBeforeWritingToFile(avm,
+ subVals, false, structureImageFilename,
+ "structure image", isError);
+
+ if (!success)
+ {
+ continue;
+ }
+ Console.debug("Rendering image to " + structureImageFile);
+ //
+ // TODO - extend StructureViewer / Binding with makePDBImage so
+ // we can do this with every viewer
+ //
+
+ try
+ {
+ // We don't expect class cast exception
+ AppJmol jmol = (AppJmol) sview;
+ jmol.makePDBImage(structureImageFile, imageType, renderer,
+ userBis);
+ Console.info("Exported structure image to "
+ + structureImageFile);
+
+ // RESTORE SESSION AFTER EXPORT IF NEED BE
+ if (sessionToRestore != null)
+ {
+ Console.debug(
+ "Restoring session from " + sessionToRestore);
+
+ sview.getBinding().restoreSession(
+ sessionToRestore.getAbsolutePath());
+
+ }
+ } catch (ImageOutputException ioexec)
+ {
+ addError(
+ "Unexpected error when restoring structure viewer session after custom view operations.");
+ isError = true;
+ continue;
+ } finally
+ {
+ try
+ {
+ this.colourAlignFrame(af, originalColourScheme);
+ } catch (Exception t)
+ {
+ addError(
+ "Unexpected error when restoring colourscheme to alignment after temporary change for export.",
+ t);
+ }
+ }
+ }
+ }
+ }
+ argParser.setStructureFilename(null);
+ }
+ }
+ }
+
+ if (af == null)
+ {
+ af = afMap.get(id);
+ }
+ // many of jalview's format/layout methods are only thread safe on the
+ // swingworker thread.
+ // all these methods should be on the alignViewController so it can
+ // coordinate such details
+ if (headless)
+ {
+ showOrHideAnnotations(af, showSSAnnotations, showAnnotations,
+ hideTFrows);
+ }
+ else
+ {
+ try
+ {
+ AlignFrame _af = af;
+ final boolean _showSSAnnotations = showSSAnnotations;
+ final boolean _showAnnotations = showAnnotations;
+ final boolean _hideTFrows = hideTFrows;
+ SwingUtilities.invokeAndWait(() -> {
+ showOrHideAnnotations(_af, _showSSAnnotations, _showAnnotations,
+ _hideTFrows);
+ }
+
+ );
+ } catch (Exception x)
+ {
+ Console.warn(
+ "Unexpected exception adjusting annotation row visibility.",
+ x);
+ }
+ }
+
+ if (wrap)
+ {
+ if (af == null)
+ {
+ af = afMap.get(id);
+ }
+ if (af != null)
+ {
+ af.setWrapFormat(wrap, true);
+ }
+ }
+
+ /*
+ boolean doShading = avm.getBoolean(Arg.TEMPFAC_SHADING);
+ if (doShading)
+ {
+ AlignFrame af = afMap.get(id);
+ for (AlignmentAnnotation aa : af.alignPanel.getAlignment()
+ .findAnnotation(PDBChain.class.getName().toString()))
+ {
+ AnnotationColourGradient acg = new AnnotationColourGradient(aa,
+ af.alignPanel.av.getGlobalColourScheme(), 0);
+ acg.setSeqAssociated(true);
+ af.changeColour(acg);
+ Console.info("Changed colour " + acg.toString());
+ }
+ }
+ */
+
+ return theseArgsWereParsed && !isError;
+ }
+
+ private static void showOrHideAnnotations(AlignFrame af,
+ boolean showSSAnnotations, boolean showAnnotations,
+ boolean hideTFrows)
+ {
+ af.setAnnotationsVisibility(showSSAnnotations, true, false);
+ af.setAnnotationsVisibility(showAnnotations, false, true);
+
+ // show temperature factor annotations?
+ if (hideTFrows)
+ {
+ // do this better (annotation types?)
+ List<String> hideThese = new ArrayList<>();
+ hideThese.add("Temperature Factor");
+ hideThese.add(AlphaFoldAnnotationRowBuilder.LABEL);
+ AlignmentUtils.showOrHideSequenceAnnotations(
+ af.getCurrentView().getAlignment(), hideThese, null, false,
+ false);
+ }
+ }
+
+ protected void processGroovyScript(String id)
+ {
+ ArgValuesMap avm = argParser.getLinkedArgs(id);
+ AlignFrame af = afMap.get(id);
+
+ if (avm != null && !avm.containsArg(Arg.GROOVY))
+ {
+ // nothing to do
+ return;
+ }
+
+ if (af == null)
+ {
+ addWarn("Groovy script does not have an alignment window. Proceeding with caution!");
+ }
+
+ if (avm.containsArg(Arg.GROOVY))
+ {
+ for (ArgValue groovyAv : avm.getArgValueList(Arg.GROOVY))
+ {
+ String groovyscript = groovyAv.getValue();
+ if (groovyscript != null)
+ {
+ // Execute the groovy script after we've done all the rendering stuff
+ // and before any images or figures are generated.
+ Console.info("Executing script " + groovyscript);
+ Jalview.getInstance().executeGroovyScript(groovyscript, af);
+ }
+ }
+ }
+ }
+
+ protected boolean processImages(String id)
+ {
+ ArgValuesMap avm = argParser.getLinkedArgs(id);
+ AlignFrame af = afMap.get(id);
+
+ if (avm != null && !avm.containsArg(Arg.IMAGE))
+ {
+ // nothing to do
+ return true;
+ }
+
+ if (af == null)
+ {
+ addWarn("Do not have an alignment window to create image from (id="
+ + id + "). Not proceeding.");
+ return false;
+ }
+
+ Boolean isError = Boolean.valueOf(false);
+ if (avm.containsArg(Arg.IMAGE))
+ {
+ for (ArgValue imageAv : avm.getArgValueList(Arg.IMAGE))
+ {
+ String val = imageAv.getValue();
+ SubVals imageSubVals = imageAv.getSubVals();
+ String fileName = imageSubVals.getContent();
+ File file = new File(fileName);
+ String name = af.getName();
+ String renderer = avm.getValueFromSubValOrArg(imageAv,
+ Arg.TEXTRENDERER, imageSubVals);
+ if (renderer == null)
+ renderer = "text";
+ String type = "png"; // default
+
+ String scale = avm.getValueFromSubValOrArg(imageAv, Arg.SCALE,
+ imageSubVals);
+ String width = avm.getValueFromSubValOrArg(imageAv, Arg.WIDTH,
+ imageSubVals);
+ String height = avm.getValueFromSubValOrArg(imageAv, Arg.HEIGHT,
+ imageSubVals);
+ BitmapImageSizing userBis = ImageMaker
+ .parseScaleWidthHeightStrings(scale, width, height);
+
+ type = avm.getValueFromSubValOrArg(imageAv, Arg.TYPE, imageSubVals);
+ if (type == null && fileName != null)
+ {
+ for (String ext : new String[] { "svg", "png", "html", "eps" })
+ {
+ if (fileName.toLowerCase(Locale.ROOT).endsWith("." + ext))
+ {
+ type = ext;
+ }
+ }
+ }
+ // for moment we disable JSON export
+ Cache.setPropsAreReadOnly(true);
+ Cache.setProperty("EXPORT_EMBBED_BIOJSON", "false");
+
+ String imageColour = avm.getValueFromSubValOrArg(imageAv,
+ Arg.IMAGECOLOUR, imageSubVals);
+ ColourSchemeI originalColourScheme = this.getColourScheme(af);
+ this.colourAlignFrame(af, imageColour);
+
+ Console.info("Writing " + file);
+
+ boolean success = checksBeforeWritingToFile(avm, imageSubVals,
+ false, fileName, "image", isError);
+ if (!success)
+ {
+ continue;
+ }
+
+ try
+ {
+ switch (type)
+ {
+
+ case "svg":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
+ af.createSVG(file, renderer);
+ break;
+
+ case "png":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
+ af.createPNG(file, null, userBis);
+ break;
+
+ case "html":
+ Console.debug("Outputting type '" + type + "' to " + fileName);
+ HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
+ htmlSVG.exportHTML(fileName, renderer);
+ break;
+
+ case "biojs":
+ Console.debug(
+ "Outputting BioJS MSA Viwer HTML file: " + fileName);
+ try
+ {
+ BioJsHTMLOutput.refreshVersionInfo(
+ BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
+ } catch (URISyntaxException e)
+ {
+ e.printStackTrace();
+ }
+ BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
+ bjs.exportHTML(fileName);
+ break;
+
+ case "eps":
+ Console.debug("Outputting EPS file: " + fileName);
+ af.createEPS(file, renderer);
+ break;
+
+ case "imagemap":
+ Console.debug("Outputting ImageMap file: " + fileName);
+ af.createImageMap(file, name);
+ break;
+
+ default:
+ addWarn(Arg.IMAGE.argString() + " type '" + type
+ + "' not known. Ignoring");
+ break;
+ }
+ } catch (Exception ioex)
+ {
+ addError("Unexpected error during export to '" + fileName + "'",
+ ioex);
+ isError = true;
+ }
+
+ this.colourAlignFrame(af, originalColourScheme);
+ }
+ }
+ return !isError;
+ }
+
+ protected boolean processOutput(String id)
+ {
+ ArgValuesMap avm = argParser.getLinkedArgs(id);
+ AlignFrame af = afMap.get(id);
+
+ if (avm != null && !avm.containsArg(Arg.OUTPUT))
+ {
+ // nothing to do
+ return true;
+ }
+
+ if (af == null)
+ {
+ addWarn("Do not have an alignment window (id=" + id
+ + "). Not proceeding.");
+ return false;
+ }
+
+ Boolean isError = Boolean.valueOf(false);
+
+ if (avm.containsArg(Arg.OUTPUT))
+ {
+ for (ArgValue av : avm.getArgValueList(Arg.OUTPUT))
+ {
+ String val = av.getValue();
+ SubVals subVals = av.getSubVals();
+ String fileName = subVals.getContent();
+ boolean stdout = ArgParser.STDOUTFILENAME.equals(fileName);
+ File file = new File(fileName);
+
+ String name = af.getName();
+ String format = avm.getValueFromSubValOrArg(av, Arg.FORMAT,
+ subVals);
+ FileFormats ffs = FileFormats.getInstance();
+ List<String> validFormats = ffs.getWritableFormats(false);
+
+ FileFormatI ff = null;
+ if (format == null && fileName != null)
+ {
+ FORMAT: for (String fname : validFormats)
+ {
+ FileFormatI tff = ffs.forName(fname);
+ String[] extensions = tff.getExtensions().split(",");
+ for (String ext : extensions)
+ {
+ if (fileName.toLowerCase(Locale.ROOT).endsWith("." + ext))
+ {
+ ff = tff;
+ format = ff.getName();
+ break FORMAT;
+ }
+ }
+ }
+ }
+ if (ff == null && format != null)
+ {
+ ff = ffs.forName(format);
+ }
+ if (ff == null)
+ {
+ if (stdout)
+ {
+ ff = FileFormat.Fasta;
+ }
+ else
+ {
+ StringBuilder validSB = new StringBuilder();
+ for (String f : validFormats)
+ {
+ if (validSB.length() > 0)
+ validSB.append(", ");
+ validSB.append(f);
+ FileFormatI tff = ffs.forName(f);
+ validSB.append(" (");
+ validSB.append(tff.getExtensions());
+ validSB.append(")");
+ }
+
+ addError("No valid format specified for "
+ + Arg.OUTPUT.argString() + ". Valid formats are "
+ + validSB.toString() + ".");
+ continue;
+ }
+ }
+
+ boolean success = checksBeforeWritingToFile(avm, subVals, true,
+ fileName, ff.getName(), isError);
+ if (!success)
+ {
+ continue;
+ }
+
+ boolean backups = avm.getFromSubValArgOrPref(Arg.BACKUPS, subVals,
+ null, Platform.isHeadless() ? null : BackupFiles.ENABLED,
+ !Platform.isHeadless());
+
+ Console.info("Writing " + fileName);
+
+ af.saveAlignment(fileName, ff, stdout, backups);
+ if (af.isSaveAlignmentSuccessful())
+ {
+ Console.debug("Written alignment '" + name + "' in "
+ + ff.getName() + " format to '" + file + "'");
+ }
+ else
+ {
+ addError("Error writing file '" + file + "' in " + ff.getName()
+ + " format!");
+ isError = true;
+ continue;
+ }
+
+ }
+ }
+ return !isError;
+ }
+
+ private SequenceI getSpecifiedSequence(AlignFrame af, ArgValuesMap avm,
+ ArgValue av)
+ {
+ SubVals subVals = av.getSubVals();
+ ArgValue idAv = avm.getClosestNextArgValueOfArg(av, Arg.SEQID, true);
+ SequenceI seq = null;
+ if (subVals == null && idAv == null)
+ return null;
+ if (af == null || af.getCurrentView() == null)
+ {
+ return null;
+ }
+ AlignmentI al = af.getCurrentView().getAlignment();
+ if (al == null)
+ {
+ return null;
+ }
+ if (subVals != null)
+ {
+ if (subVals.has(Arg.SEQID.getName()))
+ {
+ seq = al.findName(subVals.get(Arg.SEQID.getName()));
+ }
+ else if (-1 < subVals.getIndex()
+ && subVals.getIndex() < al.getSequences().size())
+ {
+ seq = al.getSequenceAt(subVals.getIndex());
+ }
+ }
+ if (seq == null && idAv != null)
+ {
+ seq = al.findName(idAv.getValue());
+ }
+ return seq;
+ }
+
+ public AlignFrame[] getAlignFrames()
+ {
+ AlignFrame[] afs = null;
+ if (afMap != null)
+ {
+ afs = (AlignFrame[]) afMap.values().toArray();
+ }
+
+ return afs;
+ }
+
+ public List<StructureViewer> getStructureViewers()
+ {
+ List<StructureViewer> svs = null;
+ if (svMap != null)
+ {
+ for (List<StructureViewer> svList : svMap.values())
+ {
+ if (svs == null)
+ {
+ svs = new ArrayList<>();
+ }
+ svs.addAll(svList);
+ }
+ }
+ return svs;
+ }
+
+ private void colourAlignFrame(AlignFrame af, String colour)
+ {
+ // use string "none" to remove colour scheme
+ if (colour != null && "" != colour)
+ {
+ ColourSchemeI cs = ColourSchemeProperty.getColourScheme(
+ af.getViewport(), af.getViewport().getAlignment(), colour);
+ if (cs == null && !StringUtils.equalsIgnoreCase(colour, "none"))
+ {
+ addWarn("Couldn't parse '" + colour + "' as a colourscheme.");
+ }
+ else
+ {
+ Jalview.testoutput(argParser, Arg.COLOUR, "zappo", colour);
+ colourAlignFrame(af, cs);
+ }
+ }
+ }
+
+ private void colourAlignFrame(AlignFrame af, ColourSchemeI cs)
+ {
+ try {
+ SwingUtilities.invokeAndWait(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // Note that cs == null removes colour scheme from af
+ af.changeColour(cs);
+ }
+ }); } catch (Exception x) {
+ Console.trace("Interrupted whilst waiting for colorAlignFrame action",x);
+
+ }
+ }
+
+ private ColourSchemeI getColourScheme(AlignFrame af)
+ {
+ return af.getViewport().getGlobalColourScheme();
+ }
+
+ private void addInfo(String errorMessage)
+ {
+ Console.info(errorMessage);
+ errors.add(errorMessage);
+ }
+
+ private void addWarn(String errorMessage)
+ {
+ Console.warn(errorMessage);
+ errors.add(errorMessage);
+ }
+
+ private void addError(String errorMessage)
+ {
+ addError(errorMessage, null);
+ }
+
+ private void addError(String errorMessage, Exception e)
+ {
+ Console.error(errorMessage, e);
+ errors.add(errorMessage);
+ }
+
+ private boolean checksBeforeWritingToFile(ArgValuesMap avm,
+ SubVals subVal, boolean includeBackups, String filename,
+ String adjective, Boolean isError)
+ {
+ File file = new File(filename);
+
+ boolean overwrite = avm.getFromSubValArgOrPref(Arg.OVERWRITE, subVal,
+ null, "OVERWRITE_OUTPUT", false);
+ boolean stdout = false;
+ boolean backups = false;
+ if (includeBackups)
+ {
+ stdout = ArgParser.STDOUTFILENAME.equals(filename);
+ // backups. Use the Arg.BACKUPS or subval "backups" setting first,
+ // otherwise if headless assume false, if not headless use the user
+ // preference with default true.
+ backups = avm.getFromSubValArgOrPref(Arg.BACKUPS, subVal, null,
+ Platform.isHeadless() ? null : BackupFiles.ENABLED,
+ !Platform.isHeadless());
+ }
+
+ if (file.exists() && !(overwrite || backups || stdout))
+ {
+ addWarn("Won't overwrite file '" + filename + "' without "
+ + Arg.OVERWRITE.argString()
+ + (includeBackups ? " or " + Arg.BACKUPS.argString() : "")
+ + " set");
+ return false;
+ }
+
+ boolean mkdirs = avm.getFromSubValArgOrPref(Arg.MKDIRS, subVal, null,
+ "MKDIRS_OUTPUT", false);
+
+ if (!FileUtils.checkParentDir(file, mkdirs))
+ {
+ addError("Directory '"
+ + FileUtils.getParentDir(file).getAbsolutePath()
+ + "' does not exist for " + adjective + " file '" + filename
+ + "'."
+ + (mkdirs ? "" : " Try using " + Arg.MKDIRS.argString()));
+ isError = true;
+ return false;
+ }
+
+ return true;
+ }
+
+ public List<String> getErrors()
+ {
+ return errors;
+ }
+
+ public String errorsToString()
+ {
+ StringBuilder sb = new StringBuilder();
+ for (String error : errors)
+ {
+ if (sb.length() > 0)
+ sb.append("\n");
+ sb.append("- " + error);
+ }
+ return sb.toString();
+ }
+ }
}
try
{
- JLogger.LogLevel cachedLevel=null;
- if (System.getProperty("jalview.loglevel")!=null)
+ JLogger.LogLevel logLevel = JLogger.LogLevel.INFO;
-
++ // from 2.12 - should we still do this ?
++ //
++ // if (System.getProperty("jalview.loglevel")!=null)
++ // {
++ // cachedLevel = JLogger.LogLevel.valueOf(System.getProperty("jalview.loglevel"));
++ // }
+ if (providedLogLevel != null && JLogger.isLevel(providedLogLevel))
{
- cachedLevel = JLogger.LogLevel.valueOf(System.getProperty("jalview.loglevel"));
+ logLevel = Console.getLogLevel(providedLogLevel);
}
- if (cachedLevel==null) {
- cachedLevel = getCachedLogLevel();
+ else
+ {
+ logLevel = getCachedLogLevel();
}
+
if (!Platform.isJS())
{
- Log4j.init(cachedLevel);
+ if (!Jalview.quiet())
+ {
+ jalview.bin.Console.errPrintln(
+ "Setting initial log level to " + logLevel.name());
+ }
+ Log4j.init(logLevel);
}
// log output
// is laxis used? Does getLogger do anything without a Logger object?
// Logger laxis = Log4j.getLogger("org.apache.axis", myLevel);
- JLoggerLog4j.getLogger("org.apache.axis", cachedLevel);
+ JLoggerLog4j.getLogger("org.apache.axis", logLevel);
// The main application logger
- log = JLoggerLog4j.getLogger(Cache.JALVIEW_LOGGER_NAME, cachedLevel);
- log.info("Logging initialised at level: "+cachedLevel);
+ log = JLoggerLog4j.getLogger(Cache.JALVIEW_LOGGER_NAME, logLevel);
++ log.info("Logging initialised at level: "+logLevel);
} catch (NoClassDefFoundError e)
{
- System.err.println("Could not initialise the logger framework");
- e.printStackTrace();
+ jalview.bin.Console
+ .errPrintln("Could not initialise the logger framework");
+ Console.printStackTrace(e);
}
// Test message
import java.security.PermissionCollection;
import java.security.Permissions;
import java.security.Policy;
+ import java.util.ArrayList;
import java.util.HashMap;
+ import java.util.List;
import java.util.Locale;
import java.util.Map;
++import java.util.Objects;
+ import java.util.Properties;
import java.util.Vector;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
//import edu.stanford.ejalbert.launching.IBrowserLaunching;
import groovy.lang.Binding;
import groovy.util.GroovyScriptEngine;
+import jalview.api.AlignCalcWorkerI;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+ import jalview.bin.argparser.Arg;
+ import jalview.bin.argparser.Arg.Opt;
+ import jalview.bin.argparser.Arg.Type;
+ import jalview.bin.argparser.ArgParser;
+ import jalview.bin.argparser.BootstrapArgs;
+ import jalview.bin.groovy.JalviewObject;
+ import jalview.bin.groovy.JalviewObjectI;
import jalview.ext.so.SequenceOntology;
import jalview.gui.AlignFrame;
+import jalview.gui.AlignViewport;
import jalview.gui.Desktop;
+import jalview.gui.Preferences;
+ import jalview.gui.JvOptionPane;
import jalview.gui.PromptUserConfig;
+ import jalview.gui.QuitHandler;
+ import jalview.gui.QuitHandler.QResponse;
+ import jalview.gui.StructureViewerBase;
import jalview.io.AppletFormatAdapter;
import jalview.io.BioJsHTMLOutput;
import jalview.io.DataSourceType;
* @author $author$
* @version $Revision$
*/
- public class Jalview implements ApplicationSingletonI
-public class Jalview implements JalviewObjectI
++public class Jalview implements JalviewObjectI, ApplicationSingletonI
{
- static
+ // for testing those nasty messages you cannot ever find.
+ // static
+ // {
+ // System.setOut(new PrintStream(new ByteArrayOutputStream())
+ // {
+ // @Override
+ // public void println(Object o)
+ // {
+ // if (o != null)
+ // {
+ // System.err.println(o);
+ // }
+ // }
+ //
+ // });
+ // }
+ public static Jalview getInstance()
+ {
+ return ApplicationSingletonProvider.getInstance(Jalview.class);
+ }
+
+ private Jalview()
{
Platform.getURLCommandArguments();
Platform.addJ2SDirectDatabaseCall("https://www.jalview.org");
private Desktop desktop;
- public AlignFrame currentAlignFrame;
+ protected Commands cmds;
+
+ public AlignFrame currentAlignFrame = null;
+
+ private ArgParser argparser = null;
+
+ private BootstrapArgs bootstrapArgs = null;
+
+ private boolean QUIET = false;
+
+ public static boolean quiet()
+ {
+ return Jalview.getInstance() != null && Jalview.getInstance().QUIET;
+ }
+ public String appletResourcePath;
+
+ public String j2sAppletID;
+
+ private boolean noCalculation, noMenuBar, noStatus;
+
+ private boolean noAnnotation;
+
+ public boolean getStartCalculations()
+ {
+ return !noCalculation;
+ }
+
+ public boolean getAllowMenuBar()
+ {
+ return !noMenuBar;
+ }
+
+ public boolean getShowStatus()
+ {
+ return !noStatus;
+ }
+
+ public boolean getShowAnnotation()
+ {
+ return !noAnnotation;
+ }
+
++
static
{
- if (!Platform.isJS())
+ if (Platform.isJS())
+ {
+ Platform.getURLCommandArguments();
+ } else
/**
* Java only
*
*/
public static void main(String[] args)
{
+ if (doPlatformLogging)
+ {
+ Platform.startJavaLogging();
+ }
-
+ // setLogging(); // BH - for event debugging in JavaScript
- instance = new Jalview();
- instance.doMain(args);
++
+ getInstance().doMain(args);
-
}
-
+
+ private static void logClass(String name)
+ {
+ // BH - for event debugging in JavaScript
+ ConsoleHandler consoleHandler = new ConsoleHandler();
+ consoleHandler.setLevel(Level.ALL);
+ Logger logger = Logger.getLogger(name);
+ logger.setLevel(Level.ALL);
+ logger.addHandler(consoleHandler);
+ }
-
+ @SuppressWarnings("unused")
+ private static void setLogging()
+ {
+
+ /**
+ * @j2sIgnore
+ *
+ */
+ {
- Console.outPrintln("not in js");
++ System.out.println("not in js");
+ }
+
+ // BH - for event debugging in JavaScript (Java mode only)
+ if (!Platform.isJS())
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ Logger.getLogger("").setLevel(Level.ALL);
+ logClass("java.awt.EventDispatchThread");
+ logClass("java.awt.EventQueue");
+ logClass("java.awt.Component");
+ logClass("java.awt.focus.Component");
+ logClass("java.awt.focus.DefaultKeyboardFocusManager");
+ }
+
+ }
/**
* @param args
*/
void doMain(String[] args)
{
-
- if (!Platform.isJS())
+ boolean isJS = Platform.isJS();
+ if (!isJS)
{
System.setSecurityManager(null);
}
-
++
+ /*
+ * @j2sNative J2S.db._DirectDatabaseCalls["compbio.dundee.ac.uk"]=null;
+ * @j2sNative J2S.db._DirectDatabaseCalls["jalview.org"]=null;
+ *
+ */
- System.out
- .println("Java version: " + System.getProperty("java.version"));
- System.out.println("Java Home: " + System.getProperty("java.home"));
- System.out.println(System.getProperty("os.arch") + " "
- + System.getProperty("os.name") + " "
- + System.getProperty("os.version"));
- String val = System.getProperty("sys.install4jVersion");
- if (val != null)
+
+ if (args == null || args.length == 0 || (args.length == 1
+ && (args[0] == null || args[0].length() == 0)))
+ {
+ args = new String[] {};
+ }
+
+ // get args needed before proper ArgParser
+ bootstrapArgs = BootstrapArgs.getBootstrapArgs(args);
+
- if (!Platform.isJS())
++ if (!isJS)
+ {
+ // are we being --quiet ?
+ if (bootstrapArgs.contains(Arg.QUIET))
+ {
+ QUIET = true;
+ OutputStream devNull = new OutputStream()
+ {
+
+ @Override
+ public void write(int b)
+ {
+ // DO NOTHING
+ }
+ };
+ System.setOut(new PrintStream(devNull));
+ // redirecting stderr not working
+ if (bootstrapArgs.getList(Arg.QUIET).size() > 1)
+ {
+ System.setErr(new PrintStream(devNull));
+ }
+ }
+
+ if (bootstrapArgs.contains(Arg.HELP)
+ || bootstrapArgs.contains(Arg.VERSION))
+ {
+ QUIET = true;
+ }
+ }
+
+ // set individual session preferences
+ if (bootstrapArgs.contains(Arg.P))
+ {
+ for (String kev : bootstrapArgs.getValueList(Arg.P))
+ {
+ if (kev == null)
+ {
+ continue;
+ }
+ int equalsIndex = kev.indexOf(ArgParser.EQUALS);
+ if (equalsIndex > -1)
+ {
+ String key = kev.substring(0, equalsIndex);
+ String val = kev.substring(equalsIndex + 1);
+ Cache.setSessionProperty(key, val);
+ }
+ }
+ }
+
+ // Move any new getdown-launcher-new.jar into place over old
+ // getdown-launcher.jar
+ String appdirString = System.getProperty("getdownappdir");
+ if (appdirString != null && appdirString.length() > 0)
{
- System.out.println("Install4j version: " + val);
+ final File appdir = new File(appdirString);
+ new Thread()
+ {
+
+ @Override
+ public void run()
+ {
+ LaunchUtil.upgradeGetdown(
+ new File(appdir, "getdown-launcher-old.jar"),
+ new File(appdir, "getdown-launcher.jar"),
+ new File(appdir, "getdown-launcher-new.jar"));
+ }
+ }.start();
}
- val = System.getProperty("installer_template_version");
- if (val != null)
+
+ if (!quiet() || !bootstrapArgs.outputToStdout()
+ || bootstrapArgs.contains(Arg.VERSION))
{
- System.out.println("Install4j template version: " + val);
+ Console.outPrintln(
+ "Java version: " + System.getProperty("java.version"));
+ Console.outPrintln("Java home: " + System.getProperty("java.home"));
+ Console.outPrintln("Java arch: " + System.getProperty("os.arch") + " "
+ + System.getProperty("os.name") + " "
+ + System.getProperty("os.version"));
+
+ String val = System.getProperty("sys.install4jVersion");
+ if (val != null)
+ {
+ Console.outPrintln("Install4j version: " + val);
+ }
+ val = System.getProperty("installer_template_version");
+ if (val != null)
+ {
+ Console.outPrintln("Install4j template version: " + val);
+ }
+ val = System.getProperty("launcher_version");
+ if (val != null)
+ {
+ Console.outPrintln("Launcher version: " + val);
+ }
}
- val = System.getProperty("launcher_version");
- if (val != null)
+
+ if (Platform.isLinux() && LaunchUtils.getJavaVersion() < 11)
{
- System.out.println("Launcher version: " + val);
+ System.setProperty("flatlaf.uiScale", "1");
}
+ // get bootstrap properties (mainly for the logger level)
+ Properties bootstrapProperties = Cache
+ .bootstrapProperties(bootstrapArgs.getValue(Arg.PROPS));
+
// report Jalview version
- Cache.getInstance().loadBuildProperties(true);
- Cache.loadBuildProperties(
++ Cache.getInstance().loadBuildProperties(
+ !quiet() || bootstrapArgs.contains(Arg.VERSION));
+ // stop now if only after --version
+ if (bootstrapArgs.contains(Arg.VERSION))
+ {
+ Jalview.exit(null, ExitCode.OK);
+ }
-
+ // old ArgsParser
ArgsParser aparser = new ArgsParser(args);
- headless = false;
- String usrPropsFile = aparser.getValue("props");
- Cache.loadProperties(usrPropsFile); // must do this before
- // old
- boolean headless = false;
- // new
+ boolean headlessArg = false;
+
+ try
+ {
+ String logLevel = null;
+ if (bootstrapArgs.contains(Arg.TRACE))
+ {
+ logLevel = "TRACE";
+ }
+ else if (bootstrapArgs.contains(Arg.DEBUG))
+ {
+ logLevel = bootstrapArgs.getBoolean(Arg.DEBUG) ? "DEBUG" : "INFO";
+ }
+ if (logLevel == null && !(bootstrapProperties == null))
+ {
+ logLevel = bootstrapProperties.getProperty(Cache.JALVIEWLOGLEVEL);
+ }
+ Console.initLogger(logLevel);
+ } catch (NoClassDefFoundError error)
+ {
+ error.printStackTrace();
+ String message = "\nEssential logging libraries not found."
+ + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview";
+ Jalview.exit(message, ExitCode.OK);
+ }
+
+ // register SIGTERM listener
+ Runtime.getRuntime().addShutdownHook(new Thread()
+ {
+ @Override
+ public void run()
+ {
+ Console.debug("Running shutdown hook");
+ QuitHandler.startForceQuit();
+ boolean closeExternal = Cache
+ .getDefault("DEFAULT_CLOSE_EXTERNAL_VIEWERS", false)
+ || Cache.getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false);
+ StructureViewerBase.setQuitClose(closeExternal);
+ if (desktop != null)
+ {
- for (JInternalFrame frame : Desktop.desktop.getAllFrames())
++ for (JInternalFrame frame : Desktop.getInstance().getAllFrames())
+ {
+ if (frame instanceof StructureViewerBase)
+ {
+ ((StructureViewerBase) frame).closeViewer(closeExternal);
+ }
+ }
+ }
+
+ if (QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT)
+ {
+ // Got to here by a SIGTERM signal.
+ // Note we will not actually cancel the quit from here -- it's too
+ // late -- but we can wait for saving files and close external viewers
+ // if configured.
+ // Close viewers/Leave viewers open
+ Console.debug("Checking for saving files");
+ QuitHandler.getQuitResponse(false);
+ }
+ else
+ {
+ Console.debug("Nothing more to do");
+ }
+ Console.debug("Exiting, bye!");
+ // shutdownHook cannot be cancelled, JVM will now halt
+ }
+ });
-
+ boolean allowServices = true;
-
+ String usrPropsFile = bootstrapArgs.contains(Arg.PROPS)
+ ? bootstrapArgs.getValue(Arg.PROPS)
+ : aparser.getValue("props");
- // if usrPropsFile == null, loadProperties will use the Channel
- // preferences.file
- Cache.loadProperties(usrPropsFile);
+ if (isJS)
+ {
+ j2sAppletID = Platform.getAppID(null);
+ Preferences.setAppletDefaults();
+ Cache.loadProperties(usrPropsFile); // again, because we
+ // might be changing defaults here?
+ appletResourcePath = (String) aparser.getAppletValue("resourcepath",
+ null, true);
++ } else {
++ Cache.loadProperties(usrPropsFile);
++ }
++
+ if (usrPropsFile != null)
+ {
+ Console.outPrintln(
+ "CMD [-props " + usrPropsFile + "] executed successfully!");
+ testoutput(bootstrapArgs, Arg.PROPS,
+ "test/jalview/bin/testProps.jvprops", usrPropsFile);
}
++
+ // --argfile=... -- OVERRIDES ALL NON-BOOTSTRAP ARGS
+ if (bootstrapArgs.contains(Arg.ARGFILE))
+ {
+ argparser = ArgParser.parseArgFiles(
+ bootstrapArgs.getValueList(Arg.ARGFILE),
+ bootstrapArgs.getBoolean(Arg.INITSUBSTITUTIONS),
+ bootstrapArgs);
+ }
else
+ {
+ argparser = new ArgParser(args,
+ bootstrapArgs.getBoolean(Arg.INITSUBSTITUTIONS),
+ bootstrapArgs);
+ }
+
- if (!Platform.isJS())
++ if (!isJS)
/**
* Java only
*
}
if (aparser.contains("help") || aparser.contains("h"))
{
+ /*
+ * Now using new usage statement.
showUsage();
- System.exit(0);
+ */
+ Console.outPrintln(Arg.usage());
+ Jalview.exit(null, ExitCode.OK);
+ }
+
+ // new CLI
+ headlessArg = bootstrapArgs.isHeadless();
+ if (headlessArg)
+ {
+ System.setProperty("java.awt.headless", "true");
++ headless = true;
}
+ // BH note: Only -nodisplay is official; others are deprecated?
+ // old CLI
if (aparser.contains("nodisplay") || aparser.contains("nogui")
- || aparser.contains("headless"))
- {
- System.setProperty("java.awt.headless", "true");
+ || aparser.contains("headless")
+ || GraphicsEnvironment.isHeadless())
+ {
+ if (!isJS) {
+ // BH Definitely not a good idea in JavaScript;
- // probably should not be here for Java, either.
++ // probably should not be here for Java, either.
++ // @soares - can you weigh in ?
+ System.setProperty("java.awt.headless", "true");
+ }
headless = true;
}
// anything else!
// allow https handshakes to download intermediate certs if necessary
System.setProperty("com.sun.security.enableAIAcaIssuers", "true");
- final String jabawsUrl = aparser.getValue(ArgsParser.JABAWS);
-
+ String jabawsUrl = bootstrapArgs.getValue(Arg.JABAWS);
+ if (jabawsUrl == null)
- jabawsUrl = aparser.getValue("jabaws");
- if (jabawsUrl != null)
++ jabawsUrl = aparser.getValue(ArgsParser.JABAWS);
+ allowServices = !("none".equals(jabawsUrl));
+ if (allowServices && jabawsUrl != null)
{
try
{
- Jws2Discoverer.getDiscoverer().setPreferredUrl(jabawsUrl);
+ Jws2Discoverer.getInstance().setPreferredUrl(jabawsUrl);
- System.out.println(
+ Console.outPrintln(
"CMD [-jabaws " + jabawsUrl + "] executed successfully!");
+ testoutput(bootstrapArgs, Arg.JABAWS,
+ "http://www.compbio.dundee.ac.uk/jabaws", jabawsUrl);
} catch (MalformedURLException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Invalid jabaws parameter: " + jabawsUrl + " ignored");
}
}
}
else
{
- System.out.println("Executing setprop argument: " + defs);
+ jalview.bin.Console
+ .errPrintln("Executing setprop argument: " + setprop);
- if (Platform.isJS())
+ if (isJS)
{
- Cache.setProperty(defs.substring(0, p), defs.substring(p + 1));
+ Cache.setProperty(setprop.substring(0, p),
+ setprop.substring(p + 1));
}
+ // DISABLED FOR SECURITY REASONS
+ // TODO: add a property to allow properties to be overriden by cli args
+ // Cache.setProperty(setprop.substring(0,p), setprop.substring(p+1));
}
- defs = aparser.getValue("setprop");
}
if (System.getProperty("java.awt.headless") != null
&& System.getProperty("java.awt.headless").equals("true"))
} catch (NoClassDefFoundError error)
{
error.printStackTrace();
- System.out.println("\nEssential logging libraries not found."
- + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview");
- System.exit(0);
+ String message = "\nEssential logging libraries not found."
+ + "\nUse: java -classpath \"$PATH_TO_LIB$/*:$PATH_TO_CLASSES$\" jalview.bin.Jalview";
+ Jalview.exit(message, ExitCode.NO_LOGGING);
}
- desktop = null;
++ if (desktop!=null)
++ {
++ Desktop d = desktop;
++ Desktop.closeDesktop(); // calls ApplicationSingletonProvider.removeInstance(Desktop.class);
++ desktop=null;
++ Console.debug("Cleared out old instance of "+d.getClass()+" ("+Objects.hashCode(d));
++ // todo - could also set nosplash, so tests are a bit quicker ?
++
++ }
- desktop = null;
-
- setLookAndFeel();
+ if (!(headless || headlessArg))
+ setLookAndFeel();
/*
* configure 'full' SO model if preferences say to, else use the default (full SO)
* - as JS currently doesn't have OBO parsing, it must use 'Lite' version
*/
- boolean soDefault = !Platform.isJS();
+ boolean soDefault = !isJS;
if (Cache.getDefault("USE_FULL_SO", soDefault))
{
- SequenceOntologyFactory.setInstance(new SequenceOntology());
+ SequenceOntologyFactory.setSequenceOntology(new SequenceOntology());
}
- if (!headless)
+ if (!(headless || headlessArg))
{
- Desktop.nosplash = aparser.contains("nosplash");
+ Desktop.nosplash = "false".equals(bootstrapArgs.getValue(Arg.SPLASH))
+ || aparser.contains("nosplash")
+ || Cache.getDefault("SPLASH", "true").equals("false");
- desktop = new Desktop();
+ desktop = Desktop.getInstance();
desktop.setInBatchMode(true); // indicate we are starting up
+ mixedCliWarning();
+
try
{
JalviewTaskbar.setTaskbar(this);
desktop.setVisible(true);
- if (!Platform.isJS())
+ if (isJS)
+ {
+ Cache.setProperty("SHOW_JWS2_SERVICES", "false");
+ }
+ if (allowServices && !aparser.contains("nowebservicediscovery"))
+ {
+ desktop.startServiceDiscovery();
+ }
-
++
+ if (!isJS)
/**
* Java only
*
}
}
}
-
- // Check if JVM and compile version might cause problems and log if it
- // might.
- if (headless && !Platform.isJS() && !LaunchUtils.checkJavaVersion())
+ else
{
- Console.warn("The Java version being used (Java "
- + LaunchUtils.getJavaVersion()
- + ") may lead to problems. This installation of Jalview should be used with Java "
- + LaunchUtils.getJavaCompileVersion() + ".");
+
+ if (getArgParser().isMixedStyle())
+ {
+ String warning = MessageManager.formatMessage(
+ "warning.using_mixed_command_line_arguments",
+ getArgParser().getMixedExamples());
+ Console.warn(warning);
+ Jalview.exit(
+ "Exiting due to mixed old and new command line arguments",
+ ExitCode.INVALID_ARGUMENT);
+ }
+ if (getArgParser().isOldStyle())
+ {
+ String warning = MessageManager
+ .getString("warning.using_old_command_line_arguments")
+ .replace("\n", " ")
+ + "https://www.jalview.org/help/html/features/commandline.html";
+ Console.warn(warning);
+ }
+
}
+ parseArguments(aparser, true);
+ }
- // Run Commands from cli
- cmds = new Commands(argparser, headlessArg);
+ /**
+ * Parse all command-line String[] arguments as well as all JavaScript-derived
+ * parameters from Info.
+ *
+ * We allow for this method to be run from JavaScript. Basically allowing
+ * simple scripting.
+ *
+ * @param aparser
++ * @param headless
+ * @param isStartup
+ */
+ public void parseArguments(ArgsParser aparser, boolean isStartup)
+ {
-
- String groovyscript = null; // script to execute after all loading is
+ boolean isJS = Platform.isJS();
- if (!isJS)
- /** @j2sIgnore */
++ // Run Commands from cli - new style
++ cmds = new Commands(argparser, headless);
+ cmds.processArgs();
+ boolean commandsSuccess = cmds.argsWereParsed();
+
+ if (commandsSuccess)
{
- // Move any new getdown-launcher-new.jar into place over old
- // getdown-launcher.jar
- String appdirString = System.getProperty("getdownappdir");
- if (appdirString != null && appdirString.length() > 0)
- if (headlessArg)
++ if (headless)
{
- final File appdir = new File(appdirString);
- new Thread()
+ if (argparser.getBoolean(Arg.NOQUIT))
{
- @Override
- public void run()
- {
- LaunchUtil.upgradeGetdown(
- new File(appdir, "getdown-launcher-old.jar"),
- new File(appdir, "getdown-launcher.jar"),
- new File(appdir, "getdown-launcher-new.jar"));
- }
- }.start();
+ Console.warn(
+ "Completed " + Arg.HEADLESS.getName() + " commands, but "
+ + Arg.NOQUIT + " is set so not quitting!");
+ }
+ else
+ {
+ Jalview.exit("Successfully completed commands in headless mode",
+ ExitCode.OK);
+ }
+ }
+ Console.info("Successfully completed commands");
+ }
+ else
+ {
- if (headlessArg)
++ if (headless)
+ {
+ Jalview.exit("Error when running Commands in headless mode",
+ ExitCode.ERROR_RUNNING_COMMANDS);
}
+ Console.warn("Error when running commands");
+ }
- // completed one way or another
- // extract groovy argument and execute if necessary
- groovyscript = aparser.getValue("groovy", true);
+ // Check if JVM and compile version might cause problems and log if it
+ // might.
- if (headless && !Platform.isJS() && !LaunchUtils.checkJavaVersion())
++ if (headless && !isJS && !LaunchUtils.checkJavaVersion())
+ {
+ Console.warn("The Java version being used (Java "
+ + LaunchUtils.getJavaVersion()
+ + ") may lead to problems. This installation of Jalview should be used with Java "
+ + LaunchUtils.getJavaCompileVersion() + ".");
}
- String file = aparser.getValue("open", true);
+ String file = null, data = null;
+
+ FileFormatI format = null;
+
+ DataSourceType protocol = null;
+
+ FileLoader fileLoader = new FileLoader(!headless);
+
+ String groovyscript = null; // script to execute after all loading is
+ // completed one way or another
+ // extract groovy argument and execute if necessary
+ groovyscript = aparser.getValue("groovy", true);
+ file = aparser.getValue("open", true);
- if (!isJS && file == null && desktop == null)
+ if (file == null && desktop == null && !commandsSuccess)
{
- System.out.println("No files to open!");
- System.exit(1);
+ Jalview.exit("No files to open!", ExitCode.NO_FILES);
}
-
++ // process applet specific arguments
+ setDisplayParameters(aparser);
+
- // time to open a file.
long progress = -1;
- DataSourceType protocol = null;
- FileLoader fileLoader = new FileLoader(!headless);
- FileFormatI format = null;
// Finally, deal with the remaining input data.
- if (file != null)
+ AlignFrame af = null;
+
+ JalviewJSApp jsApp = (isJS ? new JalviewJSApp(this, aparser) : null);
+
+ if (file == null)
+ {
+ if (isJS)
+ {
+ // JalviewJS allows sequence1 sequence2 ....
+
+ }
- else if (!headless && Cache.getDefault("SHOW_STARTUP_FILE", true))
- /**
- * Java only
- *
- * @j2sIgnore
- */
- {
- file = Cache.getDefault("STARTUP_FILE",
- Cache.getDefault("www.jalview.org", "https://www.jalview.org")
- + "/examples/exampleFile_2_7.jvp");
- if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar")
- || file.equals(
- "http://www.jalview.org/examples/exampleFile_2_7.jar"))
- {
- file.replace("http:", "https:");
- // hardwire upgrade of the startup file
- file.replace("_2_3", "_2_7");
- file.replace("2_7.jar", "2_7.jvp");
- // and remove the stale setting
- Cache.removeProperty("STARTUP_FILE");
- }
-
- protocol = AppletFormatAdapter.checkProtocol(file);
++ else if (!headless && Cache.getDefault("SHOW_STARTUP_FILE", true)
++ && !cmds.commandArgsProvided()
++ && !bootstrapArgs.getBoolean(Arg.NOSTARTUPFILE))
++ // don't open the startup file if command line args have been processed
++ // (&& !Commands.commandArgsProvided())
+
- if (file.endsWith(".jar"))
- {
- format = FileFormat.Jalview;
- }
- else
++ /**
++ * Java only
++ *
++ * @j2sIgnore
++ */
+ {
- try
++ file = Cache.getDefault("STARTUP_FILE",
++ Cache.getDefault("www.jalview.org", "https://www.jalview.org")
++ + "/examples/exampleFile_2_7.jvp");
++ if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar")
++ || file.equals(
++ "http://www.jalview.org/examples/exampleFile_2_7.jar"))
+ {
- format = new IdentifyFile().identify(file, protocol);
- } catch (FileFormatException e)
++ file.replace("http:", "https:");
++ // hardwire upgrade of the startup file
++ file.replace("_2_3", "_2_7");
++ file.replace("2_7.jar", "2_7.jvp");
++ // and remove the stale setting
++ Cache.removeProperty("STARTUP_FILE");
++ }
++
++ protocol = AppletFormatAdapter.checkProtocol(file);
++
++ if (file.endsWith(".jar"))
+ {
- // TODO what?
++ format = FileFormat.Jalview;
++ }
++ else
++ {
++ try
++ {
++ format = new IdentifyFile().identify(file, protocol);
++ } catch (FileFormatException e)
++ {
++ // TODO what?
++ }
+ }
- }
+
- af = fileLoader.LoadFileWaitTillLoaded(file, protocol, format);
- }
++ AlignFrame startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol, format);
++ // don't ask to save when quitting if only the startup file has been
++ // opened
++ Console.debug("Resetting up-to-date flag for startup file");
++ startUpAlframe.getViewport().setSavedUpToDate(true);
++ }
+ }
+ else
{
if (!headless)
{
.getString("status.processing_commandline_args"),
progress = System.currentTimeMillis());
}
- System.out.println("CMD [-open " + file + "] executed successfully!");
+ Console.outPrintln("CMD [-open " + file + "] executed successfully!");
-- if (!Platform.isJS())
++ if (!isJS)
/**
* ignore in JavaScript -- can't just file existence - could load it?
*
format);
if (af == null)
{
- System.out.println("jalview error - AlignFrame was not created");
- Console.outPrintln("error");
++ Console.outPrintln("jalview error - AlignFrame was not created");
}
else
{
-
- setCurrentAlignFrame(af);
- data = aparser.getValue("colour", true);
- if (data != null)
+ // JalviewLite interface for JavaScript allows second file open
+ String file2 = aparser.getValue(ArgsParser.OPEN2, true);
+ if (file2 != null)
{
- data.replaceAll("%20", " ");
-
- ColourSchemeI cs = ColourSchemeProperty.getColourScheme(
- af.getViewport(), af.getViewport().getAlignment(), data);
-
- if (cs != null)
+ protocol = AppletFormatAdapter.checkProtocol(file2);
+ try
{
- Console.outPrintln(
- "CMD [-colour " + data + "] executed successfully!");
+ format = new IdentifyFile().identify(file2, protocol);
+ } catch (FileFormatException e1)
+ {
+ // TODO ?
}
- af.changeColour(cs);
- }
-
- // Must maintain ability to use the groups flag
- data = aparser.getValue("groups", true);
- if (data != null)
- {
- af.parseFeaturesFile(data,
- AppletFormatAdapter.checkProtocol(data));
- // Console.outPrintln("Added " + data);
- Console.outPrintln(
- "CMD groups[-" + data + "] executed successfully!");
- }
- data = aparser.getValue("features", true);
- if (data != null)
- {
- af.parseFeaturesFile(data,
- AppletFormatAdapter.checkProtocol(data));
- // Console.outPrintln("Added " + data);
- Console.outPrintln(
- "CMD [-features " + data + "] executed successfully!");
- }
-
- data = aparser.getValue("annotations", true);
- if (data != null)
- {
- af.loadJalviewDataFile(data, null, null, null);
- // Console.outPrintln("Added " + data);
- Console.outPrintln(
- "CMD [-annotations " + data + "] executed successfully!");
- }
- // set or clear the sortbytree flag.
- if (aparser.contains("sortbytree"))
- {
- af.getViewport().setSortByTree(true);
- if (af.getViewport().getSortByTree())
+ AlignFrame af2 = new FileLoader(!headless)
+ .LoadFileWaitTillLoaded(file2, protocol, format);
+ if (af2 == null)
{
- Console.outPrintln("CMD [-sortbytree] executed successfully!");
+ System.out.println("error");
}
- }
- if (aparser.contains("no-annotation"))
- {
- af.getViewport().setShowAnnotation(false);
- if (!af.getViewport().isShowAnnotation())
+ else
{
- Console.outPrintln("CMD no-annotation executed successfully!");
+ AlignViewport.openLinkedAlignmentAs(af,
+ af.getViewport().getAlignment(),
+ af2.getViewport().getAlignment(), "",
+ AlignViewport.SPLIT_FRAME);
- System.out.println(
- "CMD [-open2 " + file2 + "] executed successfully!");
++ System.out.println("CMD [-open2 " + file2 + "] executed successfully!");
}
}
- if (aparser.contains("nosortbytree"))
+ // af is loaded - so set it as current frame
+ setCurrentAlignFrame(af);
+
+ setFrameDependentProperties(aparser, af);
+
+ if (isJS)
{
- af.getViewport().setSortByTree(false);
- if (!af.getViewport().getSortByTree())
- {
- Console.outPrintln(
- "CMD [-nosortbytree] executed successfully!");
- }
+ jsApp.initFromParams(af);
}
- data = aparser.getValue("tree", true);
- if (data != null)
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
{
- try
- {
- Console.outPrintln(
- "CMD [-tree " + data + "] executed successfully!");
- NewickFile nf = new NewickFile(data,
- AppletFormatAdapter.checkProtocol(data));
- af.getViewport()
- .setCurrentTree(af.showNewickTree(nf, data).getTree());
- } catch (IOException ex)
+ if (groovyscript != null)
{
- jalview.bin.Console.errPrintln("Couldn't add tree " + data);
- ex.printStackTrace(System.err);
+ // Execute the groovy script after we've done all the rendering
+ // stuff
+ // and before any images or figures are generated.
- System.out.println("Executing script " + groovyscript);
++ Console.outPrintln("Executing script " + groovyscript);
+ executeGroovyScript(groovyscript, af);
- System.out.println("CMD groovy[" + groovyscript
++ Console.outPrintln("CMD groovy[" + groovyscript
+ + "] executed successfully!");
+ groovyscript = null;
}
}
-
- if (groovyscript != null)
- {
- // Execute the groovy script after we've done all the rendering stuff
- // and before any images or figures are generated.
- Console.outPrintln("Executing script " + groovyscript);
- executeGroovyScript(groovyscript, af);
- Console.outPrintln("CMD groovy[" + groovyscript
- + "] executed successfully!");
- groovyscript = null;
+ if (!isJS || !isStartup) {
+ createOutputFiles(aparser, format);
}
- String imageName = "unnamed.png";
- while (aparser.getSize() > 1)
- {
- try
- {
- String outputFormat = aparser.nextValue();
- file = aparser.nextValue();
+ }
+ if (headless)
+ {
+ af.getViewport().getCalcManager().shutdown();
+ }
+ }
+ // extract groovy arguments before anything else.
+ // Once all other stuff is done, execute any groovy scripts (in order)
+ if (!isJS && groovyscript != null)
+ {
+ if (Cache.groovyJarsPresent())
+ {
+ // TODO: DECIDE IF THIS SECOND PASS AT GROOVY EXECUTION IS STILL REQUIRED !!
- System.out.println("Executing script " + groovyscript);
++ Console.outPrintln("Executing script " + groovyscript);
+ executeGroovyScript(groovyscript, af);
- System.out.println("CMD groovy[" + groovyscript
++ Console.outPrintln("CMD groovy[" + groovyscript
+ + "] executed successfully!");
- if (outputFormat.equalsIgnoreCase("png"))
- {
- Console.outPrintln("Creating PNG image: " + file);
- af.createPNG(new File(file));
- imageName = (new File(file)).getName();
- continue;
- }
- else if (outputFormat.equalsIgnoreCase("svg"))
- {
- Console.outPrintln("Creating SVG image: " + file);
- File imageFile = new File(file);
- imageName = imageFile.getName();
- af.createSVG(imageFile);
- continue;
- }
- else if (outputFormat.equalsIgnoreCase("html"))
- {
- File imageFile = new File(file);
- imageName = imageFile.getName();
- HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
+ }
+ else
+ {
- System.err.println(
++ Console.errPrintln(
+ "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
+ + groovyscript);
+ }
+ }
- Console.outPrintln("Creating HTML image: " + file);
- htmlSVG.exportHTML(file);
- continue;
- }
- else if (outputFormat.equalsIgnoreCase("biojsmsa"))
- {
- if (file == null)
- {
- jalview.bin.Console.errPrintln(
- "The output html file must not be null");
- return;
- }
- try
- {
- BioJsHTMLOutput.refreshVersionInfo(
- BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
- } catch (URISyntaxException e)
- {
- e.printStackTrace();
- }
- BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
- Console.outPrintln(
- "Creating BioJS MSA Viwer HTML file: " + file);
- bjs.exportHTML(file);
- continue;
- }
- else if (outputFormat.equalsIgnoreCase("imgMap"))
- {
- Console.outPrintln("Creating image map: " + file);
- af.createImageMap(new File(file), imageName);
- continue;
- }
- else if (outputFormat.equalsIgnoreCase("eps"))
- {
- File outputFile = new File(file);
- Console.outPrintln(
- "Creating EPS file: " + outputFile.getAbsolutePath());
- af.createEPS(outputFile);
- continue;
- }
+ // and finally, turn off batch mode indicator - if the desktop still exists
+ if (desktop != null)
+ {
+ if (progress != -1)
+ {
+ desktop.setProgressBar(null, progress);
+ }
+ desktop.setInBatchMode(false);
+ }
+
+ if (jsApp != null) {
+ jsApp.callInitCallback();
+ }
+ }
+
+ /**
+ * Set general display parameters irrespective of file loading or headlessness.
+ *
+ * @param aparser
+ */
+ private void setDisplayParameters(ArgsParser aparser)
+ {
+ if (aparser.contains(ArgsParser.NOMENUBAR))
+ {
+ noMenuBar = true;
+ System.out.println("CMD [nomenu] executed successfully!");
+ }
- FileFormatI outFormat = null;
- try
- {
- outFormat = FileFormats.getInstance().forName(outputFormat);
- } catch (Exception formatP)
- {
- Console.outPrintln("Couldn't parse " + outFormat
- + " as a valid Jalview format string.");
- }
- if (outFormat != null)
- {
- if (!outFormat.isWritable())
- {
- Console.outPrintln(
- "This version of Jalview does not support alignment export as "
- + outputFormat);
- }
- else
- {
- af.saveAlignment(file, outFormat);
- if (af.isSaveAlignmentSuccessful())
- {
- Console.outPrintln("Written alignment in "
- + outFormat.getName() + " format to " + file);
- }
- else
- {
- Console.outPrintln("Error writing file " + file + " in "
- + outFormat.getName() + " format!!");
- }
- }
- }
- } catch (ImageOutputException ioexc)
- {
- Console.outPrintln(
- "Unexpected error whilst exporting image to " + file);
- ioexc.printStackTrace();
- }
+ if (aparser.contains(ArgsParser.NOSTATUS))
+ {
+ noStatus = true;
+ System.out.println("CMD [nostatus] executed successfully!");
+ }
- }
+ if (aparser.contains(ArgsParser.NOANNOTATION)
+ || aparser.contains(ArgsParser.NOANNOTATION2))
+ {
+ noAnnotation = true;
+ System.out.println("CMD no-annotation executed successfully!");
+ }
+ if (aparser.contains(ArgsParser.NOCALCULATION))
+ {
+ noCalculation = true;
+ System.out.println("CMD [nocalculation] executed successfully!");
+ }
+ }
- while (aparser.getSize() > 0)
- {
- Console.outPrintln("Unknown arg: " + aparser.nextValue());
- }
+ private void setFrameDependentProperties(ArgsParser aparser,
+ AlignFrame af)
+ {
+ String data = aparser.getValue(ArgsParser.COLOUR, true);
+ if (data != null)
+ {
+ data.replaceAll("%20", " ");
+
+ ColourSchemeI cs = ColourSchemeProperty.getColourScheme(
+ af.getViewport(), af.getViewport().getAlignment(), data);
+
+ if (cs != null)
+ {
- System.out.println(
- "CMD [-color " + data + "] executed successfully!");
++ Console.outPrintln(
++ "CMD [-colour " + data + "] executed successfully!");
}
+ af.changeColour(cs);
}
- AlignFrame startUpAlframe = null;
- // We'll only open the default file if the desktop is visible.
- // And the user
- // ////////////////////
+ // Must maintain ability to use the groups flag
+ data = aparser.getValue(ArgsParser.GROUPS, true);
+ if (data != null)
+ {
+ af.parseFeaturesFile(data,
+ AppletFormatAdapter.checkProtocol(data));
+ // System.out.println("Added " + data);
- System.out.println(
++ Console.outPrintln(
+ "CMD groups[-" + data + "] executed successfully!");
+ }
+ data = aparser.getValue(ArgsParser.FEATURES, true);
+ if (data != null)
+ {
+ af.parseFeaturesFile(data,
+ AppletFormatAdapter.checkProtocol(data));
- // System.out.println("Added " + data);
- System.out.println(
++ // Console.outPrintln("Added " + data);
++ Console.outPrintln(
+ "CMD [-features " + data + "] executed successfully!");
+ }
+ data = aparser.getValue(ArgsParser.ANNOTATIONS, true);
+ if (data != null)
+ {
+ af.loadJalviewDataFile(data, null, null, null);
- // System.out.println("Added " + data);
- System.out.println(
++ // Console.outPrintln("Added " + data);
++ Console.outPrintln(
+ "CMD [-annotations " + data + "] executed successfully!");
+ }
+
+ // JavaScript feature
+
+ if (aparser.contains(ArgsParser.SHOWOVERVIEW))
+ {
+ af.overviewMenuItem_actionPerformed(null);
- System.out.println("CMD [showoverview] executed successfully!");
++ // Console.outPrintln("Added " + data);
++ Console.outPrintln("CMD [showoverview] executed successfully!");
+ }
- if (!Platform.isJS() && !headless && file == null
- && Cache.getDefault("SHOW_STARTUP_FILE", true)
- && !cmds.commandArgsProvided()
- && !bootstrapArgs.getBoolean(Arg.NOSTARTUPFILE))
- // don't open the startup file if command line args have been processed
- // (&& !Commands.commandArgsProvided())
+ // set or clear the sortbytree flag.
+ if (aparser.contains(ArgsParser.SORTBYTREE))
+ {
+ af.getViewport().setSortByTree(true);
+ if (af.getViewport().getSortByTree())
+ {
- System.out.println("CMD [-sortbytree] executed successfully!");
++ Console.outPrintln("CMD [-sortbytree] executed successfully!");
+ }
+ }
+
+ boolean doUpdateAnnotation = false;
/**
- * Java only
+ * we do this earlier in JalviewJS because of a complication with
+ * SHOWOVERVIEW
+ *
+ * For now, just fixing this in JalviewJS.
+ *
*
* @j2sIgnore
+ *
*/
{
- file = Cache.getDefault("STARTUP_FILE",
- Cache.getDefault("www.jalview.org", "https://www.jalview.org")
- + "/examples/exampleFile_2_7.jvp");
- if (file.equals("http://www.jalview.org/examples/exampleFile_2_3.jar")
- || file.equals(
- "http://www.jalview.org/examples/exampleFile_2_7.jar"))
- {
- file.replace("http:", "https:");
- // hardwire upgrade of the startup file
- file.replace("_2_3", "_2_7");
- file.replace("2_7.jar", "2_7.jvp");
- // and remove the stale setting
- Cache.removeProperty("STARTUP_FILE");
- }
-
- protocol = AppletFormatAdapter.checkProtocol(file);
-
- if (file.endsWith(".jar"))
- {
- format = FileFormat.Jalview;
- }
- else
+ if (noAnnotation)
{
- try
+ af.getViewport().setShowAnnotation(false);
+ if (!af.getViewport().isShowAnnotation())
{
- format = new IdentifyFile().identify(file, protocol);
- } catch (FileFormatException e)
- {
- // TODO what?
+ doUpdateAnnotation = true;
++ Console.outPrintln("CMD no-annotation executed successfully!");
}
}
- startUpAlframe = fileLoader.LoadFileWaitTillLoaded(file, protocol,
- format);
- // don't ask to save when quitting if only the startup file has been
- // opened
- Console.debug("Resetting up-to-date flag for startup file");
- startUpAlframe.getViewport().setSavedUpToDate(true);
- // extract groovy arguments before anything else.
}
- // Once all other stuff is done, execute any groovy scripts (in order)
- if (groovyscript != null)
+ if (aparser.contains(ArgsParser.NOSORTBYTREE))
{
- if (Cache.groovyJarsPresent())
+ af.getViewport().setSortByTree(false);
+ if (!af.getViewport().getSortByTree())
{
- Console.outPrintln("Executing script " + groovyscript);
- executeGroovyScript(groovyscript, startUpAlframe);
+ doUpdateAnnotation = true;
- System.out
- .println("CMD [-nosortbytree] executed successfully!");
++ Console.outPrintln("CMD [-nosortbytree] executed successfully!");
}
- else
+ }
+ if (doUpdateAnnotation)
+ { // BH 2019.07.24
+ af.setMenusForViewport();
+ af.alignPanel.updateLayout();
+ }
+
+ data = aparser.getValue(ArgsParser.TREE, true);
+ if (data != null)
+ {
+ try
{
- jalview.bin.Console.errPrintln(
- "Sorry. Groovy Support is not available, so ignoring the provided groovy script "
- + groovyscript);
+ NewickFile nf = new NewickFile(data,
+ AppletFormatAdapter.checkProtocol(data));
+ af.getViewport()
+ .setCurrentTree(af.showNewickTree(nf, data).getTree());
- System.out.println(
++ Console.outPrintln(
+ "CMD [-tree " + data + "] executed successfully!");
+ } catch (IOException ex)
+ {
- System.err.println("Couldn't add tree " + data);
++ Console.errPrintln("Couldn't add tree " + data);
+ ex.printStackTrace(System.err);
}
}
- // and finally, turn off batch mode indicator - if the desktop still exists
- if (desktop != null)
- {
- if (progress != -1)
+ // TODO - load PDB structure(s) to alignment JAL-629
+ // (associate with identical sequence in alignment, or a specified
+ // sequence)
+
+ }
+
+ /**
+ * Writes an output file for each format (if any) specified in the
+ * command-line arguments. Supported formats are currently
+ * <ul>
+ * <li>png</li>
+ * <li>svg</li>
+ * <li>html</li>
+ * <li>biojsmsa</li>
+ * <li>imgMap</li>
+ * <li>eps</li>
+ * </ul>
+ * A format parameter should be followed by a parameter specifying the output
+ * file name. {@code imgMap} parameters should follow those for the
+ * corresponding alignment image output.
+ *
+ * @param aparser
+ * @param format
+ */
+ private void createOutputFiles(ArgsParser aparser, FileFormatI format)
+ {
+ // logic essentially the same as 2.11.2/2.11.3 but uses a switch instead
+ AlignFrame af = currentAlignFrame;
+ while (aparser.getSize() >= 2)
+ {
+ String outputFormat = aparser.nextValue();
+ File imageFile;
- String fname;
- switch (outputFormat.toLowerCase(Locale.ROOT))
- {
- case "png":
- imageFile = new File(aparser.nextValue());
- af.createPNG(imageFile);
- System.out.println(
- "Creating PNG image: " + imageFile.getAbsolutePath());
- continue;
- case "svg":
- imageFile = new File(aparser.nextValue());
- af.createSVG(imageFile);
- System.out.println(
- "Creating SVG image: " + imageFile.getAbsolutePath());
- continue;
- case "eps":
- imageFile = new File(aparser.nextValue());
- System.out.println(
- "Creating EPS file: " + imageFile.getAbsolutePath());
- af.createEPS(imageFile);
- continue;
- case "biojsmsa":
- fname = new File(aparser.nextValue()).getAbsolutePath();
- try
- {
- BioJsHTMLOutput.refreshVersionInfo(
- BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
- } catch (URISyntaxException e)
- {
- e.printStackTrace();
- }
- BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
- bjs.exportHTML(fname);
- System.out.println("Creating BioJS MSA Viwer HTML file: " + fname);
- continue;
- case "html":
- fname = new File(aparser.nextValue()).getAbsolutePath();
- HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
- htmlSVG.exportHTML(fname);
- System.out.println("Creating HTML image: " + fname);
- continue;
- case "imgmap":
- imageFile = new File(aparser.nextValue());
- af.alignPanel.makePNGImageMap(imageFile, "unnamed.png");
- System.out.println(
- "Creating image map: " + imageFile.getAbsolutePath());
- continue;
- default:
- // fall through - try to parse as an alignment data export format
- FileFormatI outFormat = null;
- try
- {
- outFormat = FileFormats.getInstance().forName(outputFormat);
- } catch (Exception formatP)
++ String fname = "UNEXPECTED ERROR - PLEASE REPORT";
++ try {
++ switch (outputFormat.toLowerCase(Locale.ROOT))
+ {
- }
- if (outFormat == null)
- {
- System.out.println("Couldn't parse " + outputFormat
- + " as a valid Jalview format string.");
++ case "png":
++ imageFile = new File(aparser.nextValue());
++ af.createPNG(imageFile);
++ Console.outPrintln(
++ "Creating PNG image: " + imageFile.getAbsolutePath());
+ continue;
- }
- if (!outFormat.isWritable())
- {
- System.out.println(
- "This version of Jalview does not support alignment export as "
- + outputFormat);
++ case "svg":
++ imageFile = new File(aparser.nextValue());
++ af.createSVG(imageFile);
++ Console.outPrintln(
++ "Creating SVG image: " + imageFile.getAbsolutePath());
+ continue;
- }
- // record file as it was passed to Jalview so it is recognisable to the CLI
- // caller
- String file;
- fname = new File(file = aparser.nextValue()).getAbsolutePath();
- // JBPNote - yuck - really wish we did have a bean returned from this which gave
- // success/fail like before !
- af.saveAlignment(fname, outFormat);
- if (!af.isSaveAlignmentSuccessful())
- {
- System.out.println("Written alignment in " + outputFormat
- + " format to " + file);
++ case "eps":
++ imageFile = new File(aparser.nextValue());
++ Console.outPrintln(
++ "Creating EPS file: " + imageFile.getAbsolutePath());
++ af.createEPS(imageFile);
+ continue;
++ case "biojsmsa":
++ fname = new File(aparser.nextValue()).getAbsolutePath();
++ try
++ {
++ BioJsHTMLOutput.refreshVersionInfo(
++ BioJsHTMLOutput.BJS_TEMPLATES_LOCAL_DIRECTORY);
++ } catch (URISyntaxException e)
++ {
++ e.printStackTrace();
++ }
++ BioJsHTMLOutput bjs = new BioJsHTMLOutput(af.alignPanel);
++ bjs.exportHTML(fname);
++ Console.outPrintln("Creating BioJS MSA Viwer HTML file: " + fname);
++ continue;
++ case "html":
++ fname = new File(aparser.nextValue()).getAbsolutePath();
++ HtmlSvgOutput htmlSVG = new HtmlSvgOutput(af.alignPanel);
++ htmlSVG.exportHTML(fname);
++ Console.outPrintln("Creating HTML image: " + fname);
++ continue;
++ case "imgmap":
++ imageFile = new File(aparser.nextValue());
++ Console.outPrintln(
++ "Creating image map: " + imageFile.getAbsolutePath());
++ af.alignPanel.makePNGImageMap(imageFile, imageFile.getName());
++ continue;
++ default:
++ // fall through - try to parse as an alignment data export format
++ FileFormatI outFormat = null;
++ try
++ {
++ outFormat = FileFormats.getInstance().forName(outputFormat);
++ } catch (Exception formatP)
++ {
++ }
++ if (outFormat == null)
++ {
++ Console.outPrintln("Couldn't parse " + outputFormat
++ + " as a valid Jalview format string.");
++ continue;
++ }
++ if (!outFormat.isWritable())
++ {
++ Console.outPrintln(
++ "This version of Jalview does not support alignment export as "
++ + outputFormat);
++ continue;
++ }
++ // record file as it was passed to Jalview so it is recognisable to the CLI
++ // caller
++ String file;
++ fname = new File(file = aparser.nextValue()).getAbsolutePath();
++ // JBPNote - yuck - really wish we did have a bean returned from this which gave
++ // success/fail like before !
++ af.saveAlignment(fname, outFormat);
++ if (!af.isSaveAlignmentSuccessful())
++ {
++ Console.outPrintln("Written alignment in " + outputFormat
++ + " format to " + file);
++ continue;
++ }
++ else
++ {
++ Console.outPrintln("Error writing file " + file + " in "
++ + outputFormat + " format!!");
++ }
+ }
- else
- {
- System.out.println("Error writing file " + file + " in "
- + outputFormat + " format!!");
- }
++ } catch (ImageOutputException ioexc)
+ {
- desktop.setProgressBar(null, progress);
++ Console.outPrintln(
++ "Unexpected error whilst exporting image to " + fname);
++ ioexc.printStackTrace();
}
- desktop.setInBatchMode(false);
+ }
+ // ??? Should report - 'ignoring' extra args here...
+ while (aparser.getSize() > 0)
+ {
- System.out.println("Ignoring extra argument: " + aparser.nextValue());
++ Console.outPrintln("Ignoring extra argument: " + aparser.nextValue());
}
+
+ cliWarning();
}
private static void setLookAndFeel()
private static boolean setFlatLookAndFeel()
{
- boolean set = setSpecificLookAndFeel("flatlaf light",
- "com.formdev.flatlaf.FlatLightLaf", false);
- if (set)
+ boolean set = false;
+ if (SystemInfo.isMacOS)
{
- if (Platform.isMac())
+ try
{
- System.setProperty("apple.laf.useScreenMenuBar", "true");
- System.setProperty("apple.awt.application.name",
- ChannelProperties.getProperty("app_name"));
- System.setProperty("apple.awt.application.appearance", "system");
- if (SystemInfo.isMacFullWindowContentSupported
- && Desktop.getInstance() != null)
- {
- Desktop.getInstance().getRootPane()
- .putClientProperty("apple.awt.fullWindowContent", true);
- Desktop.getInstance().getRootPane()
- .putClientProperty("apple.awt.transparentTitleBar", true);
- }
+ UIManager.setLookAndFeel(
+ "com.formdev.flatlaf.themes.FlatMacLightLaf");
+ set = true;
+ Console.debug("Using FlatMacLightLaf");
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e)
+ {
+ Console.debug("Exception loading FlatLightLaf", e);
+ }
+ System.setProperty("apple.laf.useScreenMenuBar", "true");
+ System.setProperty("apple.awt.application.name",
+ ChannelProperties.getProperty("app_name"));
+ System.setProperty("apple.awt.application.appearance", "system");
+ if (SystemInfo.isMacFullWindowContentSupported
- && Desktop.desktop != null)
++ && Desktop.getInstance()!= null)
+ {
+ Console.debug("Setting transparent title bar");
- Desktop.desktop.getRootPane()
++ Desktop.getInstance().getRootPane()
+ .putClientProperty("apple.awt.fullWindowContent", true);
- Desktop.desktop.getRootPane()
++ Desktop.getInstance().getRootPane()
+ .putClientProperty("apple.awt.transparentTitleBar", true);
- Desktop.desktop.getRootPane()
++ Desktop.getInstance().getRootPane()
+ .putClientProperty("apple.awt.fullscreenable", true);
+ }
+ SwingUtilities.invokeLater(() -> {
+ FlatMacLightLaf.setup();
+ });
+ Console.debug("Using FlatMacLightLaf");
+ set = true;
+ }
+ if (!set)
+ {
+ try
+ {
+ UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
+ set = true;
+ Console.debug("Using FlatLightLaf");
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e)
+ {
+ Console.debug("Exception loading FlatLightLaf", e);
+ }
+ // Windows specific properties here
+ SwingUtilities.invokeLater(() -> {
+ FlatLightLaf.setup();
+ });
+ Console.debug("Using FlatLightLaf");
+ set = true;
+ }
+ else if (SystemInfo.isLinux)
+ {
+ try
+ {
+ UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
+ set = true;
+ Console.debug("Using FlatLightLaf");
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e)
+ {
+ Console.debug("Exception loading FlatLightLaf", e);
+ }
+ // enable custom window decorations
+ JFrame.setDefaultLookAndFeelDecorated(true);
+ JDialog.setDefaultLookAndFeelDecorated(true);
+ SwingUtilities.invokeLater(() -> {
+ FlatLightLaf.setup();
+ });
+ Console.debug("Using FlatLightLaf");
+ set = true;
+ }
- SwingUtilities.invokeLater(() -> {
- FlatLightLaf.setup();
- });
+ if (!set)
+ {
+ try
+ {
+ UIManager.setLookAndFeel("com.formdev.flatlaf.FlatLightLaf");
+ set = true;
+ Console.debug("Using FlatLightLaf");
+ } catch (ClassNotFoundException | InstantiationException
+ | IllegalAccessException | UnsupportedLookAndFeelException e)
+ {
+ Console.debug("Exception loading FlatLightLaf", e);
}
+ }
+ if (set)
+ {
+ UIManager.put("TabbedPane.tabType", "card");
UIManager.put("TabbedPane.showTabSeparators", true);
- UIManager.put("TabbedPane.tabSeparatorsFullHeight", true);
+ UIManager.put("TabbedPane.showContentSeparator", true);
+ // UIManager.put("TabbedPane.tabSeparatorsFullHeight", true);
UIManager.put("TabbedPane.tabsOverlapBorder", true);
- // UIManager.put("TabbedPane.hasFullBorder", true);
+ UIManager.put("TabbedPane.hasFullBorder", true);
UIManager.put("TabbedPane.tabLayoutPolicy", "scroll");
UIManager.put("TabbedPane.scrollButtonsPolicy", "asNeeded");
UIManager.put("TabbedPane.smoothScrolling", true);
/**
* start a User Config prompt asking if we can log usage statistics.
*/
- PromptUserConfig prompter = new PromptUserConfig(Desktop.desktop,
+ PromptUserConfig prompter = new PromptUserConfig(Desktop.getDesktopPane(),
- "USAGESTATS", "Jalview Usage Statistics",
- "Do you want to help make Jalview better by enabling "
- + "the collection of usage statistics with Google Analytics ?"
- + "\n\n(you can enable or disable usage tracking in the preferences)",
- new Runnable()
+ "USAGESTATS",
+ MessageManager.getString("prompt.analytics_title"),
+ MessageManager.getString("prompt.analytics"), new Runnable()
{
@Override
public void run()
}
/**
- * Quit method delegates to Desktop.quit - unless running in headless mode when
- * it just ends the JVM
+ * jalview.bin.Jalview.quit() will just run the non-GUI shutdownHook and exit
*/
+ @Override
public void quit()
{
- if (desktop != null)
+ // System.exit will run the shutdownHook first
+ Jalview.exit("Quitting now. Bye!", ExitCode.OK);
+ }
+
+ @Override
+ public AlignFrame getCurrentAlignFrame()
+ {
- return currentAlignFrame;
++ return Jalview.getInstance().currentAlignFrame;
+ }
+
+ public void setCurrentAlignFrame(AlignFrame af)
+ {
- this.currentAlignFrame = af;
++ Jalview.getInstance().currentAlignFrame = currentAlignFrame;
+ }
+
+ public Commands getCommands()
+ {
+ return cmds;
+ }
+
+ public static void exit(String message, ExitCode ec)
+ {
+ int exitcode = ec == ExitCode.OK ? 0 : ec.ordinal() + 1;
+ if (Console.log == null)
{
- desktop.quit();
+ // Don't start the logger just to exit!
+ if (message != null)
+ {
+ if (exitcode == 0)
+ {
+ Console.outPrintln(message);
+ }
+ else
+ {
+ jalview.bin.Console.errPrintln(message);
+ }
+ }
}
else
{
}
}
- public static AlignFrame getCurrentAlignFrame()
+ public enum ExitCode
{
- return Jalview.getInstance().currentAlignFrame;
+ // only add new ones to the end of the list (to preserve ordinal values)
+ OK, FILE_NOT_FOUND, FILE_NOT_READABLE, NO_FILES, INVALID_FORMAT,
+ INVALID_ARGUMENT, INVALID_VALUE, MIXED_CLI_ARGUMENTS,
+ ERROR_RUNNING_COMMANDS, NO_LOGGING, GROOVY_ERROR;
}
- public static void setCurrentAlignFrame(AlignFrame currentAlignFrame)
+ /******************************
+ *
+ * TEST OUTPUT METHODS
+ *
+ * these operate only when Arg.TESTOUTPUT has been passed, and variously check
+ * if an expected value / arg was set and report it to the test framework.
+ *
+ ******************************/
+ /**
+ * report string values parsed/processed during tests When the Bootstrap
+ * argument Arg.TESTOUTPUT is present - reports on debug if given s1 is not
+ * null and not equals s2, warns if given argument is not set, and calls
+ * testoutput(true,a,s1,s2) to report processing progress.
+ *
+ * @param ap
+ * - ArgParser handling parsing
+ * @param a
+ * - Arg currently being processed
+ * @param s1
+ * - expected
+ * @param s2
+ */
+ protected static void testoutput(ArgParser ap, Arg a, String s1,
+ String s2)
{
- Jalview.getInstance().currentAlignFrame = currentAlignFrame;
+ BootstrapArgs bsa = ap.getBootstrapArgs();
+ if (!bsa.getBoolean(Arg.TESTOUTPUT))
+ return;
+ if (!((s1 == null && s2 == null) || (s1 != null && s1.equals(s2))))
+ {
+ Console.debug("testoutput with unmatching values '" + s1 + "' and '"
+ + s2 + "' for arg " + a.argString());
+ return;
+ }
+ boolean isset = a.hasOption(Opt.BOOTSTRAP) ? bsa.contains(a)
+ : ap.isSet(a);
+ if (!isset)
+ {
+ Console.warn("Arg '" + a.getName() + "' not set at all");
+ return;
+ }
+ testoutput(true, a, s1, s2);
}
-
+
+ /**
+ * report values passed via bootstrap arguments
+ *
+ * TODO: significant code duplication with testouput(Argparser...) - move it
+ */
+
+ protected static void testoutput(BootstrapArgs bsa, Arg a, String s1,
+ String s2)
+ {
+ if (!bsa.getBoolean(Arg.TESTOUTPUT))
+ return;
+ if (!((s1 == null && s2 == null) || (s1 != null && s1.equals(s2))))
+ {
+ Console.debug("testoutput with unmatching values '" + s1 + "' and '"
+ + s2 + "' for arg " + a.argString());
+ return;
+ }
+ if (!a.hasOption(Opt.BOOTSTRAP))
+ {
+ Console.error("Non-bootstrap Arg '" + a.getName()
+ + "' given to testoutput(BootstrapArgs bsa, Arg a, String s1, String s2) with only BootstrapArgs");
+ }
+ if (!bsa.contains(a))
+ {
+ Console.warn("Arg '" + a.getName() + "' not set at all");
+ return;
+ }
+ testoutput(true, a, s1, s2);
+ }
+
+ /**
+ * conditionally (on @param yes) report that expected value s1 was set during
+ * CommandsTest tests
+ */
+ private static void testoutput(boolean yes, Arg a, String s1, String s2)
+ {
+ if (yes && ((s1 == null && s2 == null)
+ || (s1 != null && s1.equals(s2))))
+ {
+ Console.outPrintln("[TESTOUTPUT] arg " + a.argString() + "='" + s1
+ + "' was set");
+ }
+ }
+
+ /*
+ * testoutput for boolean and unary values
+ */
+ protected static void testoutput(ArgParser ap, Arg a)
+ {
+ if (ap == null)
+ return;
+ BootstrapArgs bsa = ap.getBootstrapArgs();
+ if (bsa == null)
+ return;
+ if (!bsa.getBoolean(Arg.TESTOUTPUT))
+ return;
+ boolean val = a.hasOption(Opt.BOOTSTRAP) ? bsa.getBoolean(a)
+ : ap.getBoolean(a);
+ boolean isset = a.hasOption(Opt.BOOTSTRAP) ? bsa.contains(a)
+ : ap.isSet(a);
+ if (!isset)
+ {
+ Console.warn("Arg '" + a.getName() + "' not set at all");
+ return;
+ }
+ testoutput(val, a);
+ }
+
+ protected static void testoutput(BootstrapArgs bsa, Arg a)
+ {
+ if (!bsa.getBoolean(Arg.TESTOUTPUT))
+ return;
+ if (!a.hasOption(Opt.BOOTSTRAP))
+ {
+ Console.warn("Non-bootstrap Arg '" + a.getName()
+ + "' given to testoutput(BootstrapArgs bsa, Arg a) with only BootstrapArgs");
+
+ }
+ if (!bsa.contains(a))
+ {
+ Console.warn("Arg '" + a.getName() + "' not set at all");
+ return;
+ }
+ testoutput(bsa.getBoolean(a), a);
+ }
+
+ private static void testoutput(boolean yes, Arg a)
+ {
+ String message = null;
+ if (a.hasOption(Opt.BOOLEAN))
+ {
+ message = (yes ? a.argString() : a.negateArgString()) + " was set";
+ }
+ else if (a.hasOption(Opt.UNARY))
+ {
+ message = a.argString() + (yes ? " was set" : " was not set");
+ }
+ Console.outPrintln("[TESTOUTPUT] arg " + message);
+ }
+
+ public ArgParser getArgParser()
+ {
+ return argparser;
+ }
+
+ public BootstrapArgs getBootstrapArgs()
+ {
+ return bootstrapArgs;
+ }
+
+ public static boolean isBatchMode()
+ {
+ return getInstance() != null && (getInstance().desktop == null
+ || getInstance().desktop.isInBatchMode());
+ }
+
+ /**
+ * Warning about old or mixed command line arguments
+ */
+ private void mixedCliWarning()
+ {
+ Jalview j = Jalview.getInstance();
+ boolean mixedStyle = j.getArgParser() != null
+ && j.getArgParser().isMixedStyle();
+ String title = MessageManager.getString("label.command_line_arguments");
+ if (mixedStyle)
+ {
+ String warning = MessageManager.formatMessage(
+ "warning.using_mixed_command_line_arguments",
+ j.getArgParser().getMixedExamples());
+ String quit = MessageManager.getString("action.quit");
+
- Desktop.instance.nonBlockingDialog(title, warning, null, quit,
++ Desktop.getInstance().nonBlockingDialog(title, warning, null, quit,
+ JvOptionPane.WARNING_MESSAGE, false, false, true, 30000);
+
- Jalview.exit(
++ j.exit(
+ "Exiting due to mixed old and new command line arguments.",
+ ExitCode.MIXED_CLI_ARGUMENTS);
+ }
+ }
+
+ private void cliWarning()
+ {
+ Jalview j = Jalview.getInstance();
+ Commands c = j.getCommands();
+ boolean oldStyle = j.getArgParser() != null
+ && j.getArgParser().isOldStyle();
+ String title = MessageManager.getString("label.command_line_arguments");
+ if (oldStyle)
+ {
+ String warning = MessageManager
+ .getString("warning.using_old_command_line_arguments");
+ String url = "<a href=\"https://www.jalview.org/help/html/features/commandline.html\">https://www.jalview.org/help/html/features/commandline.html</a>";
- if (Desktop.instance != null)
++ if (Desktop.getInstance() != null)
+ {
+ String cont = MessageManager.getString("label.continue");
+
- Desktop.instance.nonBlockingDialog(title, warning, url, cont,
++ Desktop.getInstance().nonBlockingDialog(title, warning, url, cont,
+ JvOptionPane.WARNING_MESSAGE, false, true, true, 30000);
+ }
+ }
+ if (j.getCommands() != null && j.getCommands().getErrors().size() > 0)
+ {
- if (Desktop.instance != null)
++ if (Desktop.getInstance() != null)
+ {
+ String message = MessageManager
+ .getString("warning.the_following_errors");
+ String ok = MessageManager.getString("action.ok");
+ int shortest = 60;
+ List<String> errors = j.getCommands().getErrors();
+ for (int i = 0; i < errors.size(); i++)
+ {
+ shortest = Math.min(shortest, errors.get(i).length());
+ }
- Desktop.instance.nonBlockingDialog(
++ Desktop.getInstance().nonBlockingDialog(
+ Math.max(message.length(), Math.min(60, shortest)),
+ Math.min(errors.size(), 20), title, message,
+ j.getCommands().errorsToString(), ok,
+ JvOptionPane.WARNING_MESSAGE, true, false, true, -1);
+ }
+ }
+ }
+
+ public void notifyWorker(AlignCalcWorkerI worker, String status)
+ {
+ // System.out.println("Jalview worker " + worker.getClass().getSimpleName()
+ // + " " + status);
+ }
+
+
+ private static boolean isInteractive = true;
+
+ public static boolean isInteractive()
+ {
+ return isInteractive;
+ }
+
+ public static void setInteractive(boolean tf)
+ {
+ isInteractive = tf;
+ }
}
return false;
}
+ @Override
+ public boolean copyHighlightedRegionsToClipboard()
+ {
+ if (!viewport.hasSearchResults())
+ {
+ // do nothing if no selection exists
+ return false;
+ }
+
+ SearchResultsI searchResults = viewport.getSearchResults();
+ if (searchResults.isEmpty())
+ {
+ return false; // shouldn't happen
+ }
+ List<SequenceI> seqs = searchResults.getMatchingSubSequences();
+
+ // TODO: pass in hiddenColumns according to intersection of searchResults
+ // and visible columns. Currently this isn't done, since each contig becomes
+ // a single subsequence
- Desktop.jalviewClipboard = new Object[] {
++ Desktop.getInstance().jalviewClipboard = new Object[] {
+ seqs.toArray(new SequenceI[0]),
+ alignPanel.getAlignment().getDataset(), null };
+ avcg.setStatus(MessageManager.formatMessage(
+ "label.copied_sequences_to_clipboard", seqs.size()));
+ // Technically we should return false, since view has not changed
+ return false;
+ }
}
}
}
+ @Override
+ public List<SequenceI> getHmmSequences()
+ {
+ List<SequenceI> result = new ArrayList<>();
+ for (int i = 0; i < sequences.size(); i++)
+ {
+ SequenceI seq = sequences.get(i);
+ if (seq.hasHMMProfile())
+ {
+ result.add(seq);
+ }
+ }
+ return result;
+ }
+ ////
+ //// Contact Matrix Holder Boilerplate
+ ////
+ ContactMapHolder cmholder = new ContactMapHolder();
+
+ @Override
+ public Collection<ContactMatrixI> getContactMaps()
+ {
+ return cmholder.getContactMaps();
+ }
+
+ @Override
+ public ContactMatrixI getContactMatrixFor(AlignmentAnnotation _aa)
+ {
+ ContactMatrixI cm = cmholder.getContactMatrixFor(_aa);
+ if (cm == null && _aa.groupRef != null)
+ {
+ cm = _aa.groupRef.getContactMatrixFor(_aa);
+ }
+ if (cm == null && _aa.sequenceRef != null)
+ {
+ cm = _aa.sequenceRef.getContactMatrixFor(_aa);
+ if (cm == null && _aa.sequenceRef.getDatasetSequence() != null)
+ {
+ // TODO fix up this logic and unify with getContactListFor
+ cm = _aa.sequenceRef.getDatasetSequence().getContactMatrixFor(_aa);
+ }
+ }
+ return cm;
+ }
+
+ @Override
+ public ContactListI getContactListFor(AlignmentAnnotation _aa, int column)
+ {
+ if (_aa.annotations == null || column >= _aa.annotations.length
+ || column < 0)
+ {
+ return null;
+ }
+ ContactListI cl = cmholder.getContactListFor(_aa, column);
+ if (cl == null && _aa.groupRef != null)
+ {
+ cl = _aa.groupRef.getContactListFor(_aa, column);
+ }
+ if (cl == null && _aa.sequenceRef != null)
+ {
+ if (_aa.annotations[column] != null)
+ {
+ // sequence associated
+ cl = _aa.sequenceRef.getContactListFor(_aa, column);
+ if (cl == null && _aa.sequenceRef.getDatasetSequence() != null)
+ {
+ int spos = _aa.sequenceRef.findPosition(column);
+ if (spos >= _aa.sequenceRef.getStart()
+ && spos <= 1 + _aa.sequenceRef.getEnd())
+ {
+ cl = _aa.sequenceRef.getDatasetSequence().getContactListFor(_aa,
+ spos - _aa.sequenceRef.getStart());
+ }
+ }
+ }
+ }
+ return cl;
+ }
+
+ @Override
+ public AlignmentAnnotation addContactList(ContactMatrixI cm)
+ {
+ AlignmentAnnotation aa = cmholder.addContactList(cm);
+
+ Annotation _aa[] = new Annotation[getWidth()];
+ for (int i = 0; i < _aa.length; _aa[i++] = new Annotation(0.0f))
+ {
+ ;
+ }
+ aa.annotations = _aa;
+ addAnnotation(aa);
+ return aa;
+ }
+
+ @Override
+ public void addContactListFor(AlignmentAnnotation annotation,
+ ContactMatrixI cm)
+ {
+ cmholder.addContactListFor(annotation, cm);
+
+ }
}
*/
private long invalidrnastruc = -2;
+ private double bitScore;
+
+ private double eValue;
+
/**
+ * the type of temperature factor plot (if it is one)
+ */
+ private StructureImportSettings.TFType tfType = StructureImportSettings.TFType.DEFAULT;
+
+ public void setTFType(StructureImportSettings.TFType t)
+ {
+ tfType = t;
+ }
+
+ public StructureImportSettings.TFType getTFType()
+ {
+ return tfType;
+ }
+
+ /**
* Updates the _rnasecstr field Determines the positions that base pair and
* the positions of helices based on secondary structure from a Stockholm file
*
return aa;
}
+ public String getLabel()
+ {
+ return label;
+ }
+
+ public Annotation[] getAnnotations()
+ {
+ return annotations;
+ }
+
+ public double getBitScore()
+ {
+ return bitScore;
+ }
+
+ public void setBitScore(double bitScore)
+ {
+ this.bitScore = bitScore;
+ }
+
+ public double getEValue()
+ {
+ return eValue;
+ }
+
+ public void setEValue(double eValue)
+ {
+ this.eValue = eValue;
+ }
+
+ public static AlignmentAnnotation findFirstAnnotation(
+ Iterable<AlignmentAnnotation> alignmentAnnotation, String name,
+ String calcId, boolean autoCalc, SequenceI seqRef,
+ SequenceGroup groupRef)
+ {
+
+ for (AlignmentAnnotation annot : alignmentAnnotation)
+ {
+ if (annot.autoCalculated == autoCalc && (name.equals(annot.label))
+ && (calcId == null || annot.getCalcId().equals(calcId))
+ && annot.sequenceRef == seqRef && annot.groupRef == groupRef)
+ {
+ return annot;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * convenience method to check for the 'CONTACT_MAP_NOGROUPS' property for
+ * this alignment annotation row
+ *
+ * @return true if no CONTACT_MAP_NOGROUPS property is found, or it is set to
+ * ""
+ */
+ public boolean isShowGroupsForContactMatrix()
+ {
+ return getProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS) == null
+ || "".equals(
+ getProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS));
+ }
+
+ /**
+ * set the 'CONTACT_MAP_NOGROUPS' property for this alignment annotation row
+ *
+ * @see isShowGroupsForContactMatrix
+ */
+ public void setShowGroupsForContactMatrix(boolean showGroups)
+ {
+ setProperty(AlignmentAnnotation.CONTACT_MAP_NOGROUPS,
+ showGroups ? "" : "nogroups");
+ }
+
}
import java.util.Vector;
import fr.orsay.lri.varna.models.rna.RNA;
+ import jalview.analysis.AlignSeq;
+ import jalview.analysis.AlignmentUtils;
+ import jalview.analysis.SeqsetUtils;
+ import jalview.datamodel.features.SequenceFeatures;
+ import jalview.datamodel.features.SequenceFeaturesI;
+ import jalview.util.Comparison;
+ import jalview.util.DBRefUtils;
+ import jalview.util.MapList;
+ import jalview.util.StringUtils;
++import jalview.workers.InformationThread;
+ import jalview.ws.datamodel.alphafold.MappableContactMatrix;
/**
*
return 0;
}
+ @Override
+ public boolean hasHMMProfile()
+ {
+ return hmm != null;
+ }
++
+ ////
+ //// Contact Matrix Holder Boilerplate
+ ////
+ ContactMapHolderI _cmholder = null;
+
+ private ContactMapHolderI getContactMapHolder()
+ {
+ if (datasetSequence != null)
+ {
+ return ((Sequence) datasetSequence).getContactMapHolder();
+ }
+ if (_cmholder == null)
+ {
+ _cmholder = new ContactMapHolder();
+ }
+ return _cmholder;
+ }
+
+ @Override
+ public Collection<ContactMatrixI> getContactMaps()
+ {
+ return getContactMapHolder().getContactMaps();
+ }
+
+ @Override
+ public ContactMatrixI getContactMatrixFor(AlignmentAnnotation ann)
+ {
+ return getContactMapHolder().getContactMatrixFor(ann);
+ }
+
+ @Override
+ public ContactListI getContactListFor(AlignmentAnnotation _aa, int column)
+ {
+ return getContactMapHolder().getContactListFor(_aa, column);
+ }
+
+ @Override
+ public AlignmentAnnotation addContactList(ContactMatrixI cm)
+ {
+ AlignmentAnnotation aa;
+
+ if (datasetSequence != null)
+ {
+ aa = datasetSequence.addContactList(cm);
+ // clone the annotation for the local sequence
+ aa = new AlignmentAnnotation(aa);
+ aa.restrict(start, end);
+ aa.adjustForAlignment();
+ getContactMapHolder().addContactListFor(aa, cm);
+ addAlignmentAnnotation(aa);
+ return aa;
+ }
+
+ // construct new annotation for matrix on dataset sequence
+ aa = getContactMapHolder().addContactList(cm);
+
+ Annotation _aa[] = new Annotation[getLength()];
+
+ for (int i = 0; i < _aa.length; _aa[i++] = new Annotation(0.0f))
+ {
+ ;
+ }
+ aa.annotations = _aa;
+ aa.setSequenceRef(this);
+ if (cm instanceof MappableContactMatrix
+ && !((MappableContactMatrix) cm).hasReferenceSeq())
+ {
+ ((MappableContactMatrix) cm).setRefSeq(this);
+ }
+ aa.createSequenceMapping(this, getStart(), false);
+ addAlignmentAnnotation(aa);
+ return aa;
+ }
+
+ @Override
+ public void addContactListFor(AlignmentAnnotation annotation,
+ ContactMatrixI cm)
+ {
+ getContactMapHolder().addContactListFor(annotation, cm);
+ }
}
import jalview.renderer.ResidueShader;
import jalview.renderer.ResidueShaderI;
import jalview.schemes.ColourSchemeI;
+import jalview.util.MessageManager;
+import jalview.workers.InformationThread;
+
- import java.awt.Color;
- import java.beans.PropertyChangeListener;
- import java.beans.PropertyChangeSupport;
- import java.util.ArrayList;
- import java.util.Arrays;
- import java.util.List;
- import java.util.Map;
/**
* Collects a set contiguous ranges on a set of sequences
return (startRes <= apos && endRes >= apos) && sequences.contains(seq);
}
+ public boolean isShowInformationHistogram()
+ {
+ return hmmShowHistogram;
+ }
+
+ public void setShowInformationHistogram(boolean state)
+ {
+ if (hmmShowHistogram != state && hmmInformation != null)
+ {
+ this.hmmShowHistogram = state;
+ // recalcConservation(); TODO don't know what to do here next
+ }
+ this.hmmShowHistogram = state;
+ }
+
+ public boolean isShowHMMSequenceLogo()
+ {
+ return hmmShowSequenceLogo;
+ }
+
+ public void setShowHMMSequenceLogo(boolean state)
+ {
+ hmmShowSequenceLogo = state;
+ }
+
+ public boolean isNormaliseHMMSequenceLogo()
+ {
+ return hmmNormaliseSequenceLogo;
+ }
+
+ public void setNormaliseHMMSequenceLogo(boolean state)
+ {
+ hmmNormaliseSequenceLogo = state;
+ }
+
+ public ProfilesI getConsensusData()
+ {
+ return consensusProfiles;
+ }
+
+ public ProfilesI getHmmProfiles()
+ {
+ return hmmProfiles;
+ }
+
+ public void setHmmProfiles(ProfilesI hmmProfiles)
+ {
+ this.hmmProfiles = hmmProfiles;
+ }
+
+ @Override
+ public List<SequenceI> getHmmSequences()
+ {
+ List<SequenceI> result = new ArrayList<>();
+ for (int i = 0; i < sequences.size(); i++)
+ {
+ SequenceI seq = sequences.get(i);
+ if (seq.hasHMMProfile())
+ {
+ result.add(seq);
+ }
+ }
+ return result;
+ }
+
++
+ ////
+ //// Contact Matrix Holder Boilerplate
+ ////
+ ContactMapHolder cmholder = new ContactMapHolder();
+
+ @Override
+ public Collection<ContactMatrixI> getContactMaps()
+ {
+ return cmholder.getContactMaps();
+ }
+
+ @Override
+ public ContactMatrixI getContactMatrixFor(AlignmentAnnotation ann)
+ {
+ return cmholder.getContactMatrixFor(ann);
+ }
+
+ @Override
+ public ContactListI getContactListFor(AlignmentAnnotation _aa, int column)
+ {
+ return cmholder.getContactListFor(_aa, column);
+ }
+
+ @Override
+ public AlignmentAnnotation addContactList(ContactMatrixI cm)
+ {
+ AlignmentAnnotation aa = cmholder.addContactList(cm);
+
+ Annotation _aa[] = new Annotation[getWidth()];
+ Annotation dummy = new Annotation(0.0f);
+ for (int i = 0; i < _aa.length; _aa[i++] = dummy)
+ {
+ ;
+ }
+ aa.annotations = _aa;
+ // TODO passing annotations back to context to be added
+ return aa;
+ }
+
+ @Override
+ public void addContactListFor(AlignmentAnnotation annotation,
+ ContactMatrixI cm)
+ {
+ cmholder.addContactListFor(annotation, cm);
+ }
+
}
*/
public int firstResidueOutsideIterator(Iterator<int[]> it);
- public void addContactListFor(AlignmentAnnotation annotation,
- ContactMatrixI cm);
++
+ /**
+ * Answers true if this sequence has an associated Hidden Markov Model
+ *
+ * @return
+ */
+ boolean hasHMMProfile();
++
++ public void addContactListFor(AlignmentAnnotation annotation,
++ ContactMatrixI cm);
}
+
URI uri = webResource.getURI();
- System.out.println(uri);
+ jalview.bin.Console.outPrintln(uri);
ClientResponse clientResponse = null;
int responseStatus = -1;
+
// Get the JSON string from the response object or directly from the
// client (JavaScript)
Map<String, Object> jsonObj = null;
*/
package jalview.gui;
- import java.util.Locale;
-
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.swing.JFileChooser;
+import javax.swing.JOptionPane;
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
import java.awt.print.PageFormat;
import java.awt.print.PrinterJob;
import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
import java.io.File;
import java.io.FileWriter;
+ import java.io.IOException;
+ import java.io.OutputStreamWriter;
import java.io.PrintWriter;
import java.net.URL;
import java.util.ArrayList;
* @version $Revision$
*/
@SuppressWarnings("serial")
-public class AlignFrame extends GAlignFrame implements DropTargetListener,
- IProgressIndicator, AlignViewControllerGuiI, ColourChangeListener
+public class AlignFrame extends GAlignFrame
+ implements DropTargetListener, IProgressIndicator,
+ AlignViewControllerGuiI, ColourChangeListener, ServiceChangeListener
{
+ public static int frameCount;
++
public static final int DEFAULT_WIDTH = 700;
public static final int DEFAULT_HEIGHT = 500;
*/
String fileName = null;
+ /**
+ * TODO: remove reference to 'FileObject' in AlignFrame - not correct mapping
+ */
File fileObject;
+ private int id;
+
- private DataSourceType protocol ;
++ private DataSourceType protocol;
++
/**
* Creates a new AlignFrame object with specific width and height.
*
*/
void init()
{
+ setFrameIcon(null);
+
+ boolean newPanel = (alignPanel == null);
+ viewport.setShowAutocalculatedAbove(isShowAutoCalculatedAbove());
+ if (newPanel)
+ {
+ if (Platform.isJS())
+ {
+ // need to set this up front if NOANNOTATION is
+ // used in conjunction with SHOWOVERVIEW.
+
+ // I have not determined if this is appropriate for
+ // Jalview/Java, as it means we are setting this flag
+ // for all subsequent AlignFrames. For now, at least,
+ // I am setting it to be JalviewJS-only.
+
+ boolean showAnnotation = Jalview.getInstance().getShowAnnotation();
+ viewport.setShowAnnotation(showAnnotation);
+ }
+ alignPanel = new AlignmentPanel(this, viewport);
+ }
+ addAlignmentPanel(alignPanel, newPanel);
// setBackground(Color.white); // BH 2019
if (!Jalview.isHeadlessMode())
// modifyPID.setEnabled(false);
}
- String sortby = Cache.getDefault(Preferences.SORT_ALIGNMENT,
- "No sort");
- String sortby = Cache.getDefault("SORT_ALIGNMENT", "No sort");
++ String sortby = Cache.getDefault(Preferences.SORT_ALIGNMENT, "No sort");
if (sortby.equals("Id"))
{
}
/**
+ *
+ * @param fileName
- * @param file from SwingJS; may contain bytes -- for reload
- * @param protocol from SwingJS; may be RELATIVE_URL
++ * @param file
++ * from SwingJS; may contain bytes -- for reload
++ * @param protocol
++ * from SwingJS; may be RELATIVE_URL
+ * @param format
+ */
- public void setFile(String fileName, File file, DataSourceType protocol, FileFormatI format)
++ public void setFile(String fileName, File file, DataSourceType protocol,
++ FileFormatI format)
+ {
+ this.fileName = fileName;
+ this.fileObject = file;
+ this.protocol = protocol;
+ setFileFormat(format);
+ reload.setEnabled(true);
+ }
+
+ /**
* JavaScript will have this, maybe others. More dependable than a file name
* and maintains a reference to the actual bytes loaded.
*
return viewport;
}
- /* Set up intrinsic listeners for dynamically generated GUI bits. */
- private void addServiceListeners()
+ @Override
+ public void servicesChanged(WSDiscovererI discoverer,
+ Collection<? extends ServiceWithParameters> services)
{
- final java.beans.PropertyChangeListener thisListener;
- Desktop.instance.addJalviewPropertyChangeListener("services",
- thisListener = new java.beans.PropertyChangeListener()
- {
- @Override
- public void propertyChange(PropertyChangeEvent evt)
- {
- // // jalview.bin.Console.outPrintln("Discoverer property
- // change.");
- // if (evt.getPropertyName().equals("services"))
- {
- SwingUtilities.invokeLater(new Runnable()
- {
+ buildWebServicesMenu();
+ }
-
- private WebServiceDiscovererI.ServicesChangeListener slivkaServiceChangeListener =
- (discoverer, services) -> {
++
++ private WebServiceDiscovererI.ServicesChangeListener slivkaServiceChangeListener =
++ (discoverer, services) -> {
+ // run when slivka services change
- var menu = AlignFrame.this.slivkaMenu;
- menu.setServices(discoverer);
- menu.setInProgress(discoverer.isRunning());
- menu.setNoServices(services.isEmpty() && discoverer.isDone());
- };
++ var menu = AlignFrame.this.slivkaMenu;menu.setServices(discoverer);menu.setInProgress(discoverer.isRunning());menu.setNoServices(services.isEmpty()&&discoverer.isDone());};
- @Override
- public void run()
- {
- jalview.bin.Console.errPrintln(
- "Rebuild WS Menu for service change");
- BuildWebServiceMenu();
- }
+ private WebServiceDiscovererI.ServicesChangeListener ebiServiceChangeListener =
+ (discoverer, services) -> {
+ // run when ebi services change
- var menu = AlignFrame.this.ebiMenu;
- menu.setServices(discoverer);
- menu.setInProgress(discoverer.isRunning());
- menu.setNoServices(services.isEmpty() && discoverer.isDone());
- };
-
++ var menu = AlignFrame.this.ebiMenu;menu.setServices(discoverer);menu.setInProgress(discoverer.isRunning());menu.setNoServices(services.isEmpty()&&discoverer.isDone());};
+
- });
- }
- }
- });
- addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()
+ private WebServiceDiscovererI.ServicesChangeListener jpred4ServiceChangeListener =
+ (discoverer, services) -> {
+ // run when jpred4 services change
- var menu = AlignFrame.this.jpred4Menu;
- menu.setServices(discoverer);
- menu.setInProgress(discoverer.isRunning());
- menu.setNoServices(services.isEmpty() && discoverer.isDone());
- };
++ var menu = AlignFrame.this.jpred4Menu;menu.setServices(discoverer);menu.setInProgress(discoverer.isRunning());menu.setNoServices(services.isEmpty()&&discoverer.isDone());
++ };
+
+ /* Set up intrinsic listeners for dynamically generated GUI bits. */
+ private void addServiceListeners()
+ {
+ if (Cache.getDefault("SHOW_SLIVKA_SERVICES", true))
+ {
+ WebServiceDiscovererI discoverer = SlivkaWSDiscoverer.getInstance();
+ discoverer.addServicesChangeListener(slivkaServiceChangeListener);
+ }
+ if (Cache.getDefault("SHOW_EBI_SERVICES", true))
+ {
+ JobDispatcherWSDiscoverer.getInstance().addServicesChangeListener(ebiServiceChangeListener);
+ }
+ if (Cache.getDefault("SHOW_JPRED4_SERVICES", true))
+ {
+ JPred4WSDiscoverer.getInstance().addServicesChangeListener(jpred4ServiceChangeListener);
+ }
+ if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
+ {
+ WSDiscovererI discoverer = Jws2Discoverer.getInstance();
+ discoverer.addServiceChangeListener(this);
+ }
+ // legacy event listener for compatibility with jws1
- PropertyChangeListener legacyListener = (changeEvent) -> {
- buildWebServicesMenu();
++ PropertyChangeListener legacyListener = new PropertyChangeListener()
+ {
++
+ @Override
- public void internalFrameClosed(
- javax.swing.event.InternalFrameEvent evt)
++ public void propertyChange(PropertyChangeEvent evt)
+ {
- // jalview.bin.Console.outPrintln("deregistering discoverer listener");
- Desktop.instance.removeJalviewPropertyChangeListener("services",
- thisListener);
- closeMenuItem_actionPerformed(true);
++ buildWebServicesMenu();
+ }
- });
- // Finally, build the menu once to get current service state
- new Thread(new Runnable()
- {
+ };
+ Desktop.getInstance().addJalviewPropertyChangeListener("services",legacyListener);
+
+ addInternalFrameListener(new InternalFrameAdapter() {
@Override
- public void run()
- {
- BuildWebServiceMenu();
+ public void internalFrameClosed(InternalFrameEvent e) {
- System.out.println("deregistering discoverer listener");
++ jalview.bin.Console.outPrintln("deregistering discoverer listener");
+ SlivkaWSDiscoverer.getInstance().removeServicesChangeListener(slivkaServiceChangeListener);
+ JPred4WSDiscoverer.getInstance().removeServicesChangeListener(jpred4ServiceChangeListener);
+ Jws2Discoverer.getInstance().removeServiceChangeListener(AlignFrame.this);
+ Desktop.getInstance().removeJalviewPropertyChangeListener("services", legacyListener);
+ closeMenuItem_actionPerformed(true);
}
- }).start();
+ });
+ buildWebServicesMenu();
}
/**
@Override
public void setProgressBar(String message, long id)
{
- progressBar.setProgressBar(message, id);
+ if (!Platform.isHeadless() && progressBar != null)
+ progressBar.setProgressBar(message, id);
}
+
+ @Override
+ public void addProgressBar(long id, String message)
+ {
+ progressBar.addProgressBar(id, message);
+ }
+
+ @Override
+ public void removeProgressBar(long id)
+ {
+ progressBar.removeProgressBar(id);
+ }
@Override
public void registerHandler(final long id,
lastSaveSuccessful = new Jalview2XML().saveAlignment(this, file,
shortName);
+ Console.debug("lastSaveSuccessful=" + lastSaveSuccessful);
+ if (lastSaveSuccessful)
+ {
+ this.getViewport().setSavedUpToDate(true);
+ }
+
statusBar.setText(MessageManager.formatMessage(
"label.successfully_saved_to_file_in_format", new Object[]
- { file, format }));
+ { fileName, format }));
return;
}
public void bioJSMenuItem_actionPerformed(ActionEvent e)
{
BioJsHTMLOutput bjs = new BioJsHTMLOutput(alignPanel);
- bjs.exportHTML(null);
+ try
+ {
+ bjs.exportHTML(null);
+ } catch (ImageOutputException x)
+ {
+ // report problem to console and raise dialog
+ }
}
+ // ??
public void createImageMap(File file, String image)
{
- alignPanel.makePNGImageMap(file, image);
+ try
+ {
+ alignPanel.makePNGImageMap(file, image);
+ } catch (ImageOutputException x)
+ {
+ // report problem to console and raise dialog
+ }
+ }
+
+ @Override
+ public void createPNG_actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ createPNG(null);
+ } catch (ImageOutputException ioex)
+ {
+ // raise dialog, and report via console
+ }
+ }
+
+ @Override
+ public void createEPS_actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ createEPS(null);
+ } catch (ImageOutputException ioex)
+ {
+ // raise dialog, and report via console
+ }
+
+ }
+
+ @Override
+ public void createSVG_actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ createSVG(null);
+ } catch (ImageOutputException ioex)
+ {
+ // raise dialog, and report via console
+ }
+
}
/**
return;
}
- Runnable okAction = new Runnable()
- {
- @Override
- public void run()
- {
- SequenceI[] cut = sg.getSequences()
- .toArray(new SequenceI[sg.getSize()]);
+ Runnable okAction = () -> {
+ SequenceI[] cut = sg.getSequences()
+ .toArray(new SequenceI[sg.getSize()]);
- addHistoryItem(new EditCommand(
- MessageManager.getString("label.cut_sequences"), Action.CUT,
- cut, sg.getStartRes(),
- sg.getEndRes() - sg.getStartRes() + 1,
- viewport.getAlignment()));
+ addHistoryItem(new EditCommand(
+ MessageManager.getString("label.cut_sequences"), Action.CUT,
+ cut, sg.getStartRes(), sg.getEndRes() - sg.getStartRes() + 1,
+ viewport.getAlignment()));
- viewport.setSelectionGroup(null);
- viewport.sendSelection();
- viewport.getAlignment().deleteGroup(sg);
+ viewport.setSelectionGroup(null);
+ viewport.sendSelection();
+ viewport.getAlignment().deleteGroup(sg);
- viewport.firePropertyChange("alignment", null,
- viewport.getAlignment().getSequences());
- if (viewport.getAlignment().getHeight() < 1)
- {
- try
- {
- AlignFrame.this.setClosed(true);
- } catch (Exception ex)
+ viewport.notifyAlignment();
+ if (viewport.getAlignment().getHeight() < 1)
{
+ try
+ {
+ AlignFrame.this.setClosed(true);
+ } catch (Exception ex)
+ {
+ }
+ } else {
+ updateAll(null);
}
-- }
};
/*
@Override
public void overviewMenuItem_actionPerformed(ActionEvent e)
{
+ boolean showHiddenRegions = Cache
+ .getDefault(Preferences.SHOW_OV_HIDDEN_AT_START, false);
+ openOverviewPanel(showHiddenRegions);
+ }
+
+ public OverviewPanel openOverviewPanel(boolean showHidden)
+ {
if (alignPanel.overviewPanel != null)
{
- return;
+ return alignPanel.overviewPanel;
}
-
JInternalFrame frame = new JInternalFrame();
- frame.setFrameIcon(null);
- final OverviewPanel overview = new OverviewPanel(alignPanel, frame,
- showHidden);
+ // BH 2019.07.26 we allow for an embedded
+ // undecorated overview with defined size
+ frame.setName(Platform.getAppID("overview"));
+ //
+ Dimension dim = Platform.getDimIfEmbedded(frame, -1, -1);
+ if (dim != null && dim.width == 0)
+ {
+ dim = null; // hidden, not embedded
+ }
- OverviewPanel overview = new OverviewPanel(alignPanel, dim);
++ OverviewPanel overview = new OverviewPanel(alignPanel, frame, dim,showHidden);
frame.setContentPane(overview);
-
+ alignPanel.setOverviewPanel(overview);
+ alignPanel.setOverviewTitle(this);
+
- Desktop.addInternalFrame(frame, overview.getTitle(), true,
- frame.getWidth(), frame.getHeight(), true, true);
+ if (dim == null)
+ {
+ dim = new Dimension();
+ // was frame.getSize(), but that is 0,0 at this point;
+ }
+ else
+ {
+ // we are imbedding, and so we have an undecorated frame
+ // and we can set the the frame dimensions accordingly.
+ }
+ // allowing for unresizable option using, style="resize:none"
+ boolean resizable = (Platform.getEmbeddedAttribute(frame,
+ "resize") != "none");
+ Desktop.addInternalFrame(frame, MessageManager
+ .formatMessage("label.overview_params", new Object[]
+ { this.getTitle() }), Desktop.FRAME_MAKE_VISIBLE, dim.width,
+ dim.height, resizable, Desktop.FRAME_ALLOW_ANY_SIZE);
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
+ final AlignmentPanel thePanel = this.alignPanel;
frame.addInternalFrameListener(
new javax.swing.event.InternalFrameAdapter()
{
return tp;
}
+ public void showContactMapTree(AlignmentAnnotation aa, ContactMatrixI cm)
+ {
+ int x = 4, y = 5;
+ int w = 400, h = 500;
+
+ try
+ {
+ NewickFile fin = new NewickFile(
+ new FileParse(cm.getNewick(), DataSourceType.PASTE));
+ String title = aa.label + " " + cm.getTreeMethod() + " tree"
+ + (aa.sequenceRef != null
+ ? (" for " + aa.sequenceRef.getDisplayId(false))
+ : "");
+
+ showColumnWiseTree(fin, aa, title, w, h, x, y);
+ } catch (Throwable xx)
+ {
+ Console.error("Unexpected exception showing tree for contact matrix",
+ xx);
+ }
+ }
+
+ public TreePanel showColumnWiseTree(NewickFile nf, AlignmentAnnotation aa,
+ String treeTitle, int w, int h, int x, int y)
+ {
+ try
+ {
+ nf.parse();
+ if (nf.getTree() == null)
+ {
+ return null;
+ }
+ TreePanel tp = new TreePanel(alignPanel, nf, aa, treeTitle);
+
+ tp.setSize(w, h);
+
+ if (x > 0 && y > 0)
+ {
+ tp.setLocation(x, y);
+ }
+
+ Desktop.addInternalFrame(tp, treeTitle, w, h);
+ return tp;
+ } catch (Throwable xx)
+ {
- Console.error("Unexpected exception showing tree for contact matrix",
- xx);
++ Console.error("Unexpected exception showing tree for contact matrix",
++ xx);
++ }
++ return null;
++ }
++
+ private WebServicesMenuManager slivkaMenu = new WebServicesMenuManager("slivka", this);
+ private WebServicesMenuManager ebiMenu = new WebServicesMenuManager("job dispatcher", this);
+ private WebServicesMenuManager jpred4Menu = new WebServicesMenuManager("jpred4", this);
+
+ /**
+ * Schedule the web services menu rebuild to the event dispatch thread.
+ */
+ public void buildWebServicesMenu()
+ {
+ SwingUtilities.invokeLater(() -> {
+ Console.info("Rebuiling WS menu");
+ webService.removeAll();
+ if (Cache.getDefault("SHOW_SLIVKA_SERVICES", true))
+ {
+ Console.info("Building web service menu for slivka");
+ SlivkaWSDiscoverer discoverer = SlivkaWSDiscoverer.getInstance();
+ slivkaMenu.setServices(discoverer);
+ slivkaMenu.setInProgress(discoverer.isRunning());
+ slivkaMenu.setNoServices(discoverer.isDone() && !discoverer.hasServices());
+ webService.add(slivkaMenu.getMenu());
+ }
+ if (Cache.getDefault("SHOW_EBI_SERVICES", true))
+ {
+ Console.info("Building web services menu for jobs dispatcher");
+ JobDispatcherWSDiscoverer discoverer = JobDispatcherWSDiscoverer.getInstance();
+ ebiMenu.setServices(discoverer);
+ ebiMenu.setInProgress(discoverer.isRunning());
+ ebiMenu.setNoServices(discoverer.isDone() && !discoverer.hasServices());
+ webService.add(ebiMenu.getMenu());
+ }
+ if (Cache.getDefault("SHOW_JPRED4_SERVICES", true))
+ {
+ Console.info("Building web services menu for jpred4");
+ JPred4WSDiscoverer discoverer = JPred4WSDiscoverer.getInstance();
+ jpred4Menu.setServices(discoverer);
+ jpred4Menu.setInProgress(discoverer.isRunning());
+ jpred4Menu.setNoServices(discoverer.isDone() && !discoverer.hasServices());
+ webService.add(jpred4Menu.getMenu());
+ }
+ if (Cache.getDefault("SHOW_JWS2_SERVICES", true))
+ {
+ WSDiscovererI jws2servs = Jws2Discoverer.getInstance();
+ JMenu submenu = new JMenu("JABAWS");
+ buildLegacyWebServicesMenu(submenu);
+ buildWebServicesMenu(jws2servs, submenu);
+ webService.add(submenu);
+ }
+ build_urlServiceMenu(webService);
+ build_fetchdbmenu(webService);
+ });
+ }
+
+ private void buildLegacyWebServicesMenu(JMenu menu)
+ {
+ JMenu secstrmenu = new JMenu("Secondary Structure Prediction");
+ if (Discoverer.getServices() != null && Discoverer.getServices().size() > 0)
+ {
+ var secstrpred = Discoverer.getServices().get("SecStrPred");
+ if (secstrpred != null)
+ {
+ for (ext.vamsas.ServiceHandle sh : secstrpred)
+ {
+ var menuProvider = Discoverer.getServiceClient(sh);
+ menuProvider.attachWSMenuEntry(secstrmenu, this);
+ }
+ }
}
- return null;
+ menu.add(secstrmenu);
}
- private boolean buildingMenu = false;
-
/**
- * Generates menu items and listener event actions for web service clients
+ * Constructs the web services menu for the given discoverer under the
+ * specified menu. This method must be called on the EDT
*
+ * @param discoverer
+ * the discoverer used to build the menu
+ * @param menu
+ * parent component which the elements will be attached to
*/
- public void BuildWebServiceMenu()
+ private void buildWebServicesMenu(WSDiscovererI discoverer, JMenu menu)
{
- while (buildingMenu)
+ if (discoverer.hasServices())
{
- try
- {
- jalview.bin.Console
- .errPrintln("Waiting for building menu to finish.");
- Thread.sleep(10);
- } catch (Exception e)
- {
- }
+ PreferredServiceRegistry.getRegistry().populateWSMenuEntry(
+ discoverer.getServices(), sv -> buildWebServicesMenu(), menu,
+ this, null);
}
- final AlignFrame me = this;
- buildingMenu = true;
- new Thread(new Runnable()
+ if (discoverer.isRunning())
{
- @Override
- public void run()
- {
- final List<JMenuItem> legacyItems = new ArrayList<>();
- try
- {
- // jalview.bin.Console.errPrintln("Building ws menu again "
- // + Thread.currentThread());
- // TODO: add support for context dependent disabling of services based
- // on
- // alignment and current selection
- // TODO: add additional serviceHandle parameter to specify abstract
- // handler
- // class independently of AbstractName
- // TODO: add in rediscovery GUI function to restart discoverer
- // TODO: group services by location as well as function and/or
- // introduce
- // object broker mechanism.
- final Vector<JMenu> wsmenu = new Vector<>();
- final IProgressIndicator af = me;
-
- /*
- * do not i18n these strings - they are hard-coded in class
- * compbio.data.msa.Category, Jws2Discoverer.isRecalculable() and
- * SequenceAnnotationWSClient.initSequenceAnnotationWSClient()
- */
- final JMenu msawsmenu = new JMenu("Alignment");
- final JMenu secstrmenu = new JMenu(
- "Secondary Structure Prediction");
- final JMenu seqsrchmenu = new JMenu("Sequence Database Search");
- final JMenu analymenu = new JMenu("Analysis");
- final JMenu dismenu = new JMenu("Protein Disorder");
- // JAL-940 - only show secondary structure prediction services from
- // the legacy server
- if (// Cache.getDefault("SHOW_JWS1_SERVICES", true)
- // &&
- Discoverer.services != null && (Discoverer.services.size() > 0))
- {
- // TODO: refactor to allow list of AbstractName/Handler bindings to
- // be
- // stored or retrieved from elsewhere
- // No MSAWS used any more:
- // Vector msaws = null; // (Vector)
- // Discoverer.services.get("MsaWS");
- Vector<ServiceHandle> secstrpr = Discoverer.services
- .get("SecStrPred");
- if (secstrpr != null)
- {
- // Add any secondary structure prediction services
- for (int i = 0, j = secstrpr.size(); i < j; i++)
- {
- final ext.vamsas.ServiceHandle sh = secstrpr.get(i);
- jalview.ws.WSMenuEntryProviderI impl = jalview.ws.jws1.Discoverer
- .getServiceClient(sh);
- int p = secstrmenu.getItemCount();
- impl.attachWSMenuEntry(secstrmenu, me);
- int q = secstrmenu.getItemCount();
- for (int litm = p; litm < q; litm++)
- {
- legacyItems.add(secstrmenu.getItem(litm));
- }
- }
- }
- }
-
- // Add all submenus in the order they should appear on the web
- // services menu
- wsmenu.add(msawsmenu);
- wsmenu.add(secstrmenu);
- wsmenu.add(dismenu);
- wsmenu.add(analymenu);
- // No search services yet
- // wsmenu.add(seqsrchmenu);
-
- javax.swing.SwingUtilities.invokeLater(new Runnable()
- {
- @Override
- public void run()
- {
- try
- {
- webService.removeAll();
- // first, add discovered services onto the webservices menu
- if (wsmenu.size() > 0)
- {
- for (int i = 0, j = wsmenu.size(); i < j; i++)
- {
- webService.add(wsmenu.get(i));
- }
- }
- else
- {
- webService.add(me.webServiceNoServices);
- }
- // TODO: move into separate menu builder class.
- {
- // logic for 2.11.1.4 is
- // always look to see if there is a discover. if there isn't
- // we can't show any Jws2 services
- // if there are services available, show them - regardless of
- // the 'show JWS2 preference'
- // if the discoverer is running then say so
- // otherwise offer to trigger discovery if 'show JWS2' is not
- // enabled
- Jws2Discoverer jws2servs = Jws2Discoverer.getDiscoverer();
- if (jws2servs != null)
- {
- if (jws2servs.hasServices())
- {
- jws2servs.attachWSMenuEntry(webService, me);
- for (Jws2Instance sv : jws2servs.getServices())
- {
- if (sv.description.toLowerCase(Locale.ROOT)
- .contains("jpred"))
- {
- for (JMenuItem jmi : legacyItems)
- {
- jmi.setVisible(false);
- }
- }
- }
- }
-
- if (jws2servs.isRunning())
- {
- JMenuItem tm = new JMenuItem(
- "Still discovering JABA Services");
- tm.setEnabled(false);
- webService.add(tm);
- }
- else if (!Cache.getDefault("SHOW_JWS2_SERVICES", true))
- {
- JMenuItem enableJws2 = new JMenuItem(
- "Discover Web Services");
- enableJws2.setToolTipText(
- "Select to start JABA Web Service discovery (or enable option in Web Service preferences)");
- enableJws2.setEnabled(true);
- enableJws2.addActionListener(new ActionListener()
- {
-
- @Override
- public void actionPerformed(ActionEvent e)
- {
- // start service discoverer, but ignore preference
- Desktop.instance.startServiceDiscovery(false,
- true);
- }
- });
- webService.add(enableJws2);
- }
- }
- }
- build_urlServiceMenu(me.webService);
- build_fetchdbmenu(webService);
- for (JMenu item : wsmenu)
- {
- if (item.getItemCount() == 0)
- {
- item.setEnabled(false);
- }
- else
- {
- item.setEnabled(true);
- }
- }
- } catch (Exception e)
- {
- Console.debug(
- "Exception during web service menu building process.",
- e);
- }
- }
- });
- } catch (Exception e)
- {
- }
- buildingMenu = false;
- }
- }).start();
-
+ JMenuItem item = new JMenuItem("Service discovery in progress.");
+ item.setEnabled(false);
+ menu.add(item);
+ }
+ else if (!discoverer.hasServices())
+ {
+ JMenuItem item = new JMenuItem("No services available.");
+ item.setEnabled(false);
+ menu.add(item);
+ }
}
/**
{
e.printStackTrace();
}
- if (files != null)
+ }
+
+ protected void loadDroppedFiles(List<Object> files,
+ List<DataSourceType> protocols, DropTargetDropEvent evt,
+ Transferable t)
+ {
+ try
{
- new Thread(new Runnable()
+ // check to see if any of these files have names matching sequences
+ // in
+ // the alignment
+ SequenceIdMatcher idm = new SequenceIdMatcher(
+ viewport.getAlignment().getSequencesArray());
+ /**
+ * Object[] { String,SequenceI}
+ */
+ ArrayList<Object[]> filesmatched = new ArrayList<>();
- ArrayList<Object> filesnotmatched = new ArrayList<>();
++ ArrayList<Object[]> filesnotmatched = new ArrayList<>();
+ for (int i = 0; i < files.size(); i++)
{
- @Override
- public void run()
+ // BH 2018
+ Object fileObj = files.get(i);
+ String fileName = fileObj.toString();
+ String pdbfn = "";
+ DataSourceType protocol = (fileObj instanceof File
+ ? DataSourceType.FILE
+ : FormatAdapter.checkProtocol(fileName));
+ if (protocol == DataSourceType.FILE)
{
- try
+ File file;
+ if (fileObj instanceof File)
+ {
+ file = (File) fileObj;
+ Platform.cacheFileData(file);
+ }
+ else
+ {
+ file = new File(fileName);
+ }
+ pdbfn = file.getName();
+ }
+ else if (protocol == DataSourceType.URL)
+ {
+ URL url = new URL(fileName);
+ pdbfn = url.getFile();
+ }
+ if (pdbfn.length() > 0)
+ {
+ // attempt to find a match in the alignment
+ SequenceI[] mtch = idm.findAllIdMatches(pdbfn);
+ int l = 0, c = pdbfn.indexOf(".");
+ while (mtch == null && c != -1)
{
- // check to see if any of these files have names matching sequences
- // in
- // the alignment
- SequenceIdMatcher idm = new SequenceIdMatcher(
- viewport.getAlignment().getSequencesArray());
- /**
- * Object[] { String,SequenceI}
- */
- ArrayList<Object[]> filesmatched = new ArrayList<>();
- ArrayList<Object[]> filesnotmatched = new ArrayList<>();
- for (int i = 0; i < files.size(); i++)
+ do
{
- // BH 2018
- Object file = files.get(i);
- String fileName = file.toString();
- String pdbfn = "";
- DataSourceType protocol = (file instanceof File
- ? DataSourceType.FILE
- : FormatAdapter.checkProtocol(fileName));
- if (protocol == DataSourceType.FILE)
- {
- File fl;
- if (file instanceof File)
- {
- fl = (File) file;
- Platform.cacheFileData(fl);
- }
- else
- {
- fl = new File(fileName);
- }
- pdbfn = fl.getName();
- }
- else if (protocol == DataSourceType.URL)
- {
- URL url = new URL(fileName);
- pdbfn = url.getFile();
- }
- if (pdbfn.length() > 0)
- {
- // attempt to find a match in the alignment
- SequenceI[] mtch = idm.findAllIdMatches(pdbfn);
- int l = 0, c = pdbfn.indexOf(".");
- while (mtch == null && c != -1)
- {
- do
- {
- l = c;
- } while ((c = pdbfn.indexOf(".", l)) > l);
- if (l > -1)
- {
- pdbfn = pdbfn.substring(0, l);
- }
- mtch = idm.findAllIdMatches(pdbfn);
- }
- FileFormatI type = null;
- if (mtch != null)
- {
- try
- {
- type = new IdentifyFile().identify(file, protocol);
- } catch (Exception ex)
- {
- type = null;
- }
- if (type != null && type.isStructureFile())
- {
- filesmatched.add(new Object[] { file, protocol, mtch });
- continue;
- }
- }
- // File wasn't named like one of the sequences or wasn't a PDB
- // file.
- filesnotmatched.add(new Object[] { file, protocol, type });
- }
+ l = c;
+ } while ((c = pdbfn.indexOf(".", l)) > l);
+ if (l > -1)
+ {
+ pdbfn = pdbfn.substring(0, l);
}
- int assocfiles = 0;
- if (filesmatched.size() > 0)
+ mtch = idm.findAllIdMatches(pdbfn);
+ }
++ FileFormatI type = null;
+ if (mtch != null)
+ {
- FileFormatI type;
+ try
{
- boolean autoAssociate = Cache
- .getDefault("AUTOASSOCIATE_PDBANDSEQS", false);
- if (!autoAssociate)
- {
- String msg = MessageManager.formatMessage(
- "label.automatically_associate_structure_files_with_sequences_same_name",
- new Object[]
- { Integer.valueOf(filesmatched.size())
- .toString() });
- String ttl = MessageManager.getString(
- "label.automatically_associate_structure_files_by_name");
- int choice = JvOptionPane.showConfirmDialog(thisaf, msg,
- ttl, JvOptionPane.YES_NO_OPTION);
- autoAssociate = choice == JvOptionPane.YES_OPTION;
- }
- if (autoAssociate)
- {
- for (Object[] fm : filesmatched)
- {
- // try and associate
- // TODO: may want to set a standard ID naming formalism for
- // associating PDB files which have no IDs.
- for (SequenceI toassoc : (SequenceI[]) fm[2])
- {
- PDBEntry pe = new AssociatePdbFileWithSeq()
- .associatePdbWithSeq(fm[0].toString(),
- (DataSourceType) fm[1], toassoc, false,
- Desktop.instance);
- if (pe != null)
- {
- jalview.bin.Console.errPrintln("Associated file : "
- + (fm[0].toString()) + " with "
- + toassoc.getDisplayId(true));
- assocfiles++;
- }
- }
- // TODO: do we need to update overview ? only if features are
- // shown I guess
- alignPanel.paintAlignment(true, false);
- }
- }
- else
- {
- /*
- * add declined structures as sequences
- */
- for (Object[] o : filesmatched)
- {
- filesnotmatched.add(new Object[] { o[0], o[1] });
- }
- }
+ type = new IdentifyFile().identify(fileObj, protocol);
+ } catch (Exception ex)
+ {
+ type = null;
}
- if (filesnotmatched.size() > 0)
+ if (type != null && type.isStructureFile())
{
- if (assocfiles > 0 && (Cache.getDefault(
- "AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false)
- || JvOptionPane.showConfirmDialog(thisaf,
- "<html>" + MessageManager.formatMessage(
- "label.ignore_unmatched_dropped_files_info",
- new Object[]
- { Integer.valueOf(
- filesnotmatched.size())
- .toString() })
- + "</html>",
- MessageManager.getString(
- "label.ignore_unmatched_dropped_files"),
- JvOptionPane.YES_NO_OPTION) == JvOptionPane.YES_OPTION))
- {
- return;
- }
- for (Object[] fn : filesnotmatched)
+ filesmatched.add(new Object[] { fileObj, protocol, mtch });
+ continue;
+ }
+ }
+ // File wasn't named like one of the sequences or wasn't a PDB
+ // file.
- filesnotmatched.add(fileObj);
++ filesnotmatched.add(new Object[] { fileObj, protocol, type });
+ }
+ }
+ int assocfiles = 0;
+ if (filesmatched.size() > 0)
+ {
+ boolean autoAssociate = Cache
+ .getDefault(Preferences.AUTOASSOCIATE_PDBANDSEQS, false);
+ if (!autoAssociate)
+ {
+ String msg = MessageManager.formatMessage(
+ "label.automatically_associate_structure_files_with_sequences_same_name",
+ new Object[]
+ { Integer.valueOf(filesmatched.size()).toString() });
+ String ttl = MessageManager.getString(
+ "label.automatically_associate_structure_files_by_name");
+ int choice = JvOptionPane.showConfirmDialog(this, msg, ttl,
+ JvOptionPane.YES_NO_OPTION);
+ autoAssociate = choice == JvOptionPane.YES_OPTION;
+ }
+ if (autoAssociate)
+ {
+ for (Object[] fm : filesmatched)
+ {
+ // try and associate
+ // TODO: may want to set a standard ID naming formalism for
+ // associating PDB files which have no IDs.
+ for (SequenceI toassoc : (SequenceI[]) fm[2])
+ {
+ PDBEntry pe = AssociatePdbFileWithSeq.associatePdbWithSeq(
+ fm[0].toString(), (DataSourceType) fm[1], toassoc,
+ false);
+ if (pe != null)
{
- System.err.println("Associated file : " + (fm[0].toString())
- loadJalviewDataFile(fn[0], (DataSourceType) fn[1],
- (FileFormatI) fn[2], null);
++ jalview.bin.Console.errPrintln("Associated file : " + (fm[0].toString())
+ + " with " + toassoc.getDisplayId(true));
+ assocfiles++;
}
}
- } catch (Exception ex)
+ // TODO: do we need to update overview ? only if features are
+ // shown I guess
+ alignPanel.paintAlignment(true, false);
+ }
+ }
+ else
+ {
+ /*
+ * add declined structures as sequences
+ */
+ for (Object[] o : filesmatched)
{
- filesnotmatched.add(o[0]);
- ex.printStackTrace();
++ filesnotmatched.add(new Object[] { o[0], o[1] });
}
}
- }).start();
+ }
+ if (filesnotmatched.size() > 0)
+ {
+ if (assocfiles > 0 && (Cache
+ .getDefault("AUTOASSOCIATE_PDBANDSEQS_IGNOREOTHERS", false)
+ || JvOptionPane.showConfirmDialog(this,
+ "<html>" + MessageManager.formatMessage(
+ "label.ignore_unmatched_dropped_files_info",
+ new Object[]
+ { Integer.valueOf(filesnotmatched.size())
+ .toString() })
+ + "</html>",
+ MessageManager.getString(
+ "label.ignore_unmatched_dropped_files"),
+ JvOptionPane.YES_NO_OPTION) == JvOptionPane.YES_OPTION))
+ {
+ return;
+ }
- for (Object fn : filesnotmatched)
++ for (Object[] fn : filesnotmatched)
+ {
- loadJalviewDataFile(fn, null, null, null);
++ loadJalviewDataFile(fn[0], (DataSourceType) fn[1],
++ (FileFormatI) fn[2], null);
+ }
+
+ }
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
}
}
console.runScript();
} catch (Exception ex)
{
- System.err.println((ex.toString()));
+ jalview.bin.Console.errPrintln((ex.toString()));
- JvOptionPane.showInternalMessageDialog(Desktop.desktop,
+ JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
MessageManager.getString("label.couldnt_run_groovy_script"),
MessageManager.getString("label.groovy_support_failed"),
JvOptionPane.ERROR_MESSAGE);
import jalview.datamodel.SearchResultsI;
import jalview.datamodel.SequenceGroup;
import jalview.datamodel.SequenceI;
+import jalview.datamodel.features.FeatureMatcherSetI;
+ import jalview.io.AppletFormatAdapter;
+ import jalview.io.DataSourceType;
+ import jalview.io.FileFormatException;
+ import jalview.io.FileFormatI;
+ import jalview.io.FileFormats;
+ import jalview.io.FileLoader;
+ import jalview.io.IdentifyFile;
import jalview.renderer.ResidueShader;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.ColourSchemeProperty;
al.addSequence(seq);
}
}
-
+ for (ContactMatrixI cm : toAdd.getContactMaps())
+ {
+ al.addContactList(cm);
+ }
ranges.setEndSeq(getAlignment().getHeight() - 1); // BH 2019.04.18
- firePropertyChange("alignment", null, getAlignment().getSequences());
+ notifyAlignment();
+ }
+
++ public void addFile(File file)
++ {
++ addFile(file, null);
+ }
+
+ /**
+ * Load a File into this AlignViewport attempting to detect format if not
+ * given or given as null.
+ *
+ * @param file
+ * @param format
+ */
+ public void addFile(File file, FileFormatI format)
+ {
+ addFile(file, format, true);
+ }
+
+ public void addFile(File file, FileFormatI format, boolean async)
+ {
+ DataSourceType protocol = AppletFormatAdapter.checkProtocol(file);
+
+ if (format == null)
+ {
+ try
+ {
+ format = new IdentifyFile().identify(file, protocol);
+ } catch (FileFormatException e1)
+ {
+ jalview.bin.Console.error("Unknown file format for '" + file + "'");
+ }
+ }
+ else if (FileFormats.getInstance().isIdentifiable(format))
+ {
+ try
+ {
+ format = new IdentifyFile().identify(file, protocol);
+ } catch (FileFormatException e)
+ {
+ jalview.bin.Console.error("Unknown file format for '" + file + "'",
+ e);
+ }
+ }
+
+ new FileLoader().LoadFile(this, file, DataSourceType.FILE, format,
+ async);
+ }
+
- public void addFile(File file)
- {
- addFile(file, null);
- }
-
/**
* Show a dialog with the option to open and link (cDNA <-> protein) as a new
* alignment, either as a standalone alignment or in a split frame. Returns
* dialog responses 0, 1, 2 (even though JOptionPane shows them
* in reverse order)
*/
- JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.desktop)
- .setResponseHandler(0, () -> {
- addDataToAlignment(al);
- }).setResponseHandler(1, () -> {
- us.openLinkedAlignmentAs(al, title, true);
- }).setResponseHandler(2, () -> {
- us.openLinkedAlignmentAs(al, title, false);
+ JvOptionPane dialog = JvOptionPane.newOptionDialog(Desktop.getDesktopPane())
+ .setResponseHandler(NO_SPLIT, new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ addDataToAlignment(al);
+ }
+ }).setResponseHandler(SPLIT_FRAME, new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // Make a copy of this one to open it in a splitframe
++ // us.openLinkedAlignmentAs(al, title, true);
+ openLinkedAlignmentAs(getAlignPanel().alignFrame,
+ new Alignment(getAlignment()), al, title,
+ SPLIT_FRAME);
+ }
+ }).setResponseHandler(NEW_WINDOW, new Runnable()
+ {
+ @Override
+ public void run()
+ {
++ // us.openLinkedAlignmentAs(al, title, false);
+ openLinkedAlignmentAs(null, getAlignment(), al, title,
+ NEW_WINDOW);
+ }
});
- dialog.showDialog(question,
+ dialog.showDialog(question,
MessageManager.getString("label.open_split_window"),
JvOptionPane.DEFAULT_OPTION, JvOptionPane.PLAIN_MESSAGE, null,
options, options[0]);
int oldWidth = av.getIdWidth();
// calculate sensible default width when no preference is available
- Dimension r = null;
+ Dimension d = null;
if (av.getIdWidth() < 0)
{
- int maxWidth = getMaxWidth();
- d = calculateIdWidth(maxWidth);
- r = calculateDefaultAlignmentIdWidth();
- av.setIdWidth(r.width);
++ d = calculateDefaultAlignmentIdWidth();
+ av.setIdWidth(d.width);
}
else
{
* fudge: if desired width has changed, update layout
* (see also paintComponent - updates layout on a repaint)
*/
- if (r.width != oldWidth)
+ if (d.width != oldWidth)
{
- idPanelHolder.setPreferredSize(r);
+ idPanelHolder.setPreferredSize(d);
validate();
}
- return r;
+ return d;
}
- public int getMaxWidth()
+ public Dimension calculateDefaultAlignmentIdWidth()
+ {
+ return calculateIdWidth(-1, false, false);
+ }
+
+ /**
+ * pre 2.11.3 Id width calculation - used when importing old projects only
+ *
+ * @return
+ */
+ public int getLegacyIdWidth()
{
int afwidth = (alignFrame != null ? alignFrame.getWidth() : 300);
int idWidth = Math.min(afwidth - 200, 2 * afwidth / 3);
* @return Dimension giving the maximum width of the alignment label panel
* that should be used.
*/
- protected Dimension calculateIdWidth(int maxwidth)
+ public Dimension calculateIdWidth(int maxwidth)
{
+ return calculateIdWidth(maxwidth, true, false);
+ }
+
+ /**
+ * Calculate the width of the alignment labels based on the displayed names
+ * and any bounds on label width set in preferences.
+ *
+ * @param maxwidth
+ * -1 or maximum width allowed for IdWidth
+ * @param includeAnnotations
+ * - when true includes width of any additional marks in annotation
+ * id panel
+ * @param visibleOnly
+ * - when true, ignore label widths for hidden annotation rows
+ * @return Dimension giving the maximum width of the alignment label panel
+ * that should be used.
+ */
+ public Dimension calculateIdWidth(int maxwidth,
+ boolean includeAnnotations, boolean visibleOnly)
+ {
+ return calculateIdWidthOrLegacy(false, maxwidth, includeAnnotations,
+ visibleOnly);
+ }
+
+ /**
+ * legacy mode or post 2.11.3 ID width calculation
+ *
+ * @param legacy
+ * - uses annotation labels, not rendered label width (excludes
+ * additional decorators)
+ * @param maxwidth
+ * @param includeAnnotations
+ * @param visibleOnly
+ * @return
+ */
+ private Dimension calculateIdWidthOrLegacy(boolean legacy, int maxwidth,
+ boolean includeAnnotations, boolean visibleOnly)
+ {
- Container c = new Container();
+ Container c = this;// new Container();
FontMetrics fm = c.getFontMetrics(
new Font(av.font.getName(), Font.ITALIC, av.font.getSize()));
{
// BH 2018.04.18 comment: addNotify() is not appropriate here. We
// are not changing ancestors, and keyboard action listeners do
- // not need to be reset. addNotify() is a very expensive operation,
+ // not need to be reset, and most importantly, we can't be sure we are actually
+ // connected to resources.
+
+ // addNotify() is a very expensive operation,
// requiring a full re-layout of all parents and children.
+
// Note in JComponent:
+
// This method is called by the toolkit internally and should
// not be called directly by programs.
+
// I note that addNotify() is called in several areas of Jalview.
- int annotationHeight = getAnnotationPanel().adjustPanelHeight();
- annotationHeight = getAnnotationPanel()
- .adjustForAlignFrame(adjustPanelHeight, annotationHeight);
+ AnnotationPanel ap = getAnnotationPanel();
+ int annotationHeight = ap.adjustPanelHeight();
+ annotationHeight = ap.adjustForAlignFrame(adjustPanelHeight,
+ annotationHeight);
+ // BH no!!
hscroll.addNotify();
- annotationScroller.setPreferredSize(
- new Dimension(annotationScroller.getWidth(), annotationHeight));
-
Dimension e = idPanel.getSize();
- alabels.setSize(new Dimension(e.width, annotationHeight));
+ int idWidth = e.width;
+ boolean manuallyAdjusted = this.getIdPanel().getIdCanvas()
+ .isManuallyAdjusted();
+ annotationScroller.setPreferredSize(new Dimension(
+ manuallyAdjusted ? idWidth : annotationScroller.getWidth(),
+ annotationHeight));
+ alabels.setPreferredSize(new Dimension(idWidth, annotationHeight));
annotationSpaceFillerHolder.setPreferredSize(new Dimension(
- annotationSpaceFillerHolder.getWidth(), annotationHeight));
+ manuallyAdjusted ? idWidth
+ : annotationSpaceFillerHolder.getWidth(),
+ annotationHeight));
annotationScroller.validate();
annotationScroller.addNotify();
+ ap.validate();
}
/**
fontChanged();
setAnnotationVisible(av.isShowAnnotation());
boolean wrap = av.getWrapAlignment();
- ViewportRanges ranges = av.getRanges();
ranges.setStartSeq(0);
- scalePanelHolder.setVisible(!wrap);
+ // scalePanelHolder.setVisible(!wrap);
hscroll.setVisible(!wrap);
- idwidthAdjuster.setVisible(!wrap);
+ // Allow idPanel width adjustment in wrap mode
+ idwidthAdjuster.setVisible(true);
if (wrap)
{
}
}
+ // idSpaceFillerPanel1.setVisible(!wrap);
++ // RH debugging
+ // System.out.println("ap dim = " + getSize());
+ // these values will go negative if getSize() returns (0,0):
+ // System.out.println("seqpan dim = " + getSeqPanel().getSize());
+ // System.out.println("seqcan dim = " + getSeqPanel().seqCanvas.getSize());
repaint();
}
int width = av.getAlignment().getVisibleWidth();
int height = av.getAlignment().getHeight();
-
- hextent = getSeqPanel().seqCanvas.getWidth() / av.getCharWidth();
- vextent = getSeqPanel().seqCanvas.getHeight() / av.getCharHeight();
-
- if (hextent > width)
- {
- hextent = width;
- }
-
- if (vextent > height)
- {
- vextent = height;
- }
-
- if ((hextent + x) > width)
- {
- x = width - hextent;
- }
-
- if ((vextent + y) > height)
- {
- y = height - vextent;
- }
-
- if (y < 0)
- {
- y = 0;
- }
-
- if (x < 0)
- {
- x = 0;
- }
-
- // update the scroll values
- hscroll.setValues(x, hextent, 0, width);
- vscroll.setValues(y, vextent, 0, height);
++ // JBNote this is 2.12 version of calculation - 2.11.2 version might be better tuned for CLI stuff ?
+ hextent = Math.min(getSeqPanel().seqCanvas.getWidth() / av.getCharWidth(), width);
+ vextent = Math.min(getSeqPanel().seqCanvas.getHeight() / av.getCharHeight(), height);
+
+ x = Math.max(0, Math.min(x, width - hextent));
+ y = Math.max(0, Math.min(y, height - vextent));
+
+ updateRanges(x, y);
+ updateScrollBars(x, y, width, height);
}
}
+ private void updateScrollBars(int x, int y, int width, int height)
+ {
+ hscroll.setValues(x, hextent, 0, width);
+ vscroll.setValues(y, vextent, 0, height);
+ }
++
+ /**
+ * Answers true if the panel has no horizontal scrollbar, or the scrollbar is
+ * at its rightmost position, else false.
+ *
+ * @return
+ */
+ boolean isScrolledFullyRight()
+ {
+ if (hscroll == null)
+ {
+ return true;
+ }
+ BoundedRangeModel model = hscroll.getModel();
+ return (model.getExtent() + model.getValue() >= model.getMaximum());
+ }
+
/**
* Respond to adjustment event when horizontal or vertical scrollbar is
* changed
@Override
public void paintComponent(Graphics g)
{
+ // BH OUCH!
invalidate(); // needed so that the id width adjuster works correctly
-
Dimension d = getIdPanel().getIdCanvas().getPreferredSize();
- idPanelHolder.setPreferredSize(d);
- hscrollFillerPanel.setPreferredSize(new Dimension(d.width, 12));
+ int idWidth = d.width;
+
+ // check wrapped alignment as at least 1 residue width
+ if (av.getWrapAlignment())
+ {
+ SeqCanvas sc = this.getSeqPanel().seqCanvas;
+ if (sc != null && sc.getWidth() < sc.getMinimumWrappedCanvasWidth())
+ {
+ // need to make some adjustments
+ idWidth -= (sc.getMinimumWrappedCanvasWidth() - sc.getWidth());
+ av.setIdWidth(idWidth);
+ av.getAlignPanel().getIdPanel().getIdCanvas()
+ .setManuallyAdjusted(true);
+
+ validateAnnotationDimensions(false);
+ }
+ }
+
+ idPanelHolder.setPreferredSize(new Dimension(idWidth, d.height));
+ hscrollFillerPanel.setPreferredSize(new Dimension(idWidth, 12));
validate(); // needed so that the id width adjuster works correctly
}
/**
+ * From appletgui, for JalviewJS JavaScript interface
+ *
+ * preliminary - untested
+ *
+ * @param ostart
+ * @param end
+ * @param seqIndex
+ * @param scrollToNearest
+ * @param redrawOverview
+ * @return
+ */
+ public boolean scrollTo(int ostart, int end, int seqIndex,
+ boolean scrollToNearest, boolean redrawOverview)
+ {
+ int startv, endv, starts, ends;// , width;
+
+ int start = -1;
+ if (av.hasHiddenColumns())
+ {
+ AlignmentI al = av.getAlignment();
+ start = al.getHiddenColumns().absoluteToVisibleColumn(ostart);
+ end = al.getHiddenColumns().absoluteToVisibleColumn(end);
+ if (start == end)
+ {
+ if (!scrollToNearest && !al.getHiddenColumns().isVisible(ostart))
+ {
+ // don't scroll - position isn't visible
+ return false;
+ }
+ }
+ }
+ else
+ {
+ start = ostart;
+ }
+
+ ViewportRanges ranges = av.getRanges();
+ if (!av.getWrapAlignment())
+ {
+ /*
+ * int spos=av.getStartRes(),sqpos=av.getStartSeq(); if ((startv =
+ * av.getStartRes()) >= start) { spos=start-1; // seqIn //
+ * setScrollValues(start - 1, seqIndex); } else if ((endv =
+ * av.getEndRes()) <= end) { // setScrollValues(spos=startv + 1 + end -
+ * endv, seqIndex); spos=startv + 1 + end - endv; } else if ((starts =
+ * av.getStartSeq()) > seqIndex) { setScrollValues(av.getStartRes(),
+ * seqIndex); } else if ((ends = av.getEndSeq()) <= seqIndex) {
+ * setScrollValues(av.getStartRes(), starts + seqIndex - ends + 1); }
+ */
+
+ // below is scrolling logic up to Jalview 2.8.2
+ // if ((av.getStartRes() > end)
+ // || (av.getEndRes() < start)
+ // || ((av.getStartSeq() > seqIndex) || (av.getEndSeq() < seqIndex)))
+ // {
+ // if (start > av.getAlignment().getWidth() - hextent)
+ // {
+ // start = av.getAlignment().getWidth() - hextent;
+ // if (start < 0)
+ // {
+ // start = 0;
+ // }
+ //
+ // }
+ // if (seqIndex > av.getAlignment().getHeight() - vextent)
+ // {
+ // seqIndex = av.getAlignment().getHeight() - vextent;
+ // if (seqIndex < 0)
+ // {
+ // seqIndex = 0;
+ // }
+ // }
+ // setScrollValues(start, seqIndex);
+ // }
+ // logic copied from jalview.gui.AlignmentPanel:
+ if ((startv = ranges.getStartRes()) >= start)
+ {
+ /*
+ * Scroll left to make start of search results visible
+ */
+ setScrollValues(start - 1, seqIndex);
+ }
+ else if ((endv = ranges.getEndRes()) <= end)
+ {
+ /*
+ * Scroll right to make end of search results visible
+ */
+ setScrollValues(startv + 1 + end - endv, seqIndex);
+ }
+ else if ((starts = ranges.getStartSeq()) > seqIndex)
+ {
+ /*
+ * Scroll up to make start of search results visible
+ */
+ setScrollValues(ranges.getStartRes(), seqIndex);
+ }
+ else if ((ends = ranges.getEndSeq()) <= seqIndex)
+ {
+ /*
+ * Scroll down to make end of search results visible
+ */
+ setScrollValues(ranges.getStartRes(), starts + seqIndex - ends + 1);
+ }
+ /*
+ * Else results are already visible - no need to scroll
+ */
+ }
+ else
+ {
+ ranges.scrollToWrappedVisible(start);
+ }
+
+ paintAlignment(redrawOverview, false);
+ return true;
+ }
+
+ private boolean holdRepaint = false;
+
+ /**
+ * Called by IdCanvas and SeqPanel to defer painting until after JVP loading.
+ *
+ * @return true if holding
+ */
+ public boolean getHoldRepaint()
+ {
+ return holdRepaint;
+ }
+
+ /**
+ * Called by Jalview2xml while loading
+ *
+ * @param tf
+ */
+ public void setHoldRepaint(boolean tf)
+ {
+ if (holdRepaint == tf)
+ {
+ return;
+ }
+ holdRepaint = tf;
+ if (!tf)
+ {
+ repaint();
+ }
+ }
+
+ @Override
+ public void repaint()
+ {
+ if (holdRepaint)
+ {
+ // System.out.println("AP repaint holding");
+ // Platform.stackTrace();
+ return;
+ }
+ super.repaint();
+ }
+
+ public void selectAllSequences()
+ {
+ selectSequences(av.getAlignment().getSequences());
+ }
+
+ public void deselectAllSequences()
+ {
+ if (av.cursorMode)
+ {
+ getSeqPanel().keyboardNo1 = null;
+ getSeqPanel().keyboardNo2 = null;
+ }
+ av.setSelectionGroup(null);
+ av.getColumnSelection().clear();
+ av.setSearchResults(null);
+ getIdPanel().getIdCanvas().searchResults = null;
+ av.sendSelection();
+ // JAL-2034 - should delegate to
+ // alignPanel to decide if overview needs
+ // updating.
+ paintAlignment(false, false);
+ PaintRefresher.Refresh(this, av.getSequenceSetId());
+ }
+
+ public void selectSequences(List<SequenceI> seqs)
+ {
+ SequenceGroup sg = new SequenceGroup(seqs);
+ sg.setEndRes(av.getAlignment().getWidth() - 1);
+ av.setSelectionGroup(sg);
+ av.isSelectionGroupChanged(true);
+ av.sendSelection();
+ // JAL-2034 - should delegate to
+ // alignPanel to decide if overview needs
+ // updating.
+ paintAlignment(false, false);
+ PaintRefresher.Refresh(this, av.getSequenceSetId());
+ }
+
++ /**
+ * Constructs and sets the title for the Overview window (if there is one),
+ * including the align frame's title, and view name (if applicable). Returns
+ * the title, or null if this panel has no Overview window open.
+ *
+ * @param alignFrame
+ * @return
+ */
+ public String setOverviewTitle(AlignFrame alignFrame)
+ {
+ if (this.overviewPanel == null)
+ {
+ return null;
+ }
+ String overviewTitle = MessageManager
+ .formatMessage("label.overview_params", new Object[]
+ { alignFrame.getTitle() });
+ String viewName = getViewName();
+ if (viewName != null)
+ {
+ overviewTitle += (" " + viewName);
+ }
+ overviewPanel.setTitle(overviewTitle);
+ return overviewTitle;
+ }
+
+ /**
+ * If this alignment panel has an Overview panel open, closes it
+ */
+ public void closeOverviewPanel()
+ {
+ if (overviewPanel != null)
+ {
+ overviewPanel.close();
+ overviewPanel = null;
+ }
+ }
}
*/
package jalview.gui;
+import java.util.Locale;
+
+import jalview.analysis.AlignSeq;
+import jalview.analysis.AlignmentUtils;
+import jalview.datamodel.Alignment;
+import jalview.datamodel.AlignmentAnnotation;
+import jalview.datamodel.Annotation;
+import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.Sequence;
+import jalview.datamodel.SequenceGroup;
+import jalview.datamodel.SequenceI;
+import jalview.io.FileFormat;
+import jalview.io.FormatAdapter;
+import jalview.util.Comparison;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+import jalview.workers.InformationThread;
+
+ import java.awt.Canvas;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.Dimension;
consclipbrd.addActionListener(this);
pop.add(consclipbrd);
}
+ else if (InformationThread.HMM_CALC_ID.equals(ann.getCalcId()))
+ {
+ addHmmerMenu(pop, ann);
+ }
+
+ addColourOrFilterByOptions(ap, aa[selectedRow], pop);
+
+ if (aa[selectedRow].graph == AlignmentAnnotation.CONTACT_MAP)
+ {
+ addContactMatrixOptions(ap, aa[selectedRow], pop);
+ // Set/adjust threshold for grouping ?
+ // colour alignment by this [type]
+ // select/hide columns by this row
+
+ }
}
+
pop.show(this, evt.getX(), evt.getY());
}
+ /**
+ * Adds context menu options for (alignment or group) Hmmer annotation
+ *
+ * @param pop
+ * @param ann
+ */
+ protected void addHmmerMenu(JPopupMenu pop, final AlignmentAnnotation ann)
+ {
+ final boolean isGroupAnnotation = ann.groupRef != null;
+ pop.addSeparator();
+ final JCheckBoxMenuItem cbmi = new JCheckBoxMenuItem(
+ MessageManager.getString(
+ "label.ignore_below_background_frequency"),
+ isGroupAnnotation
+ ? ann.groupRef
+ .isIgnoreBelowBackground()
+ : ap.av.isIgnoreBelowBackground());
+ cbmi.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (isGroupAnnotation)
+ {
+ if (!ann.groupRef.isUseInfoLetterHeight())
+ {
+ ann.groupRef.setIgnoreBelowBackground(cbmi.getState());
+ // todo and recompute group annotation
+ }
+ }
+ else if (!ap.av.isInfoLetterHeight())
+ {
+ ap.av.setIgnoreBelowBackground(cbmi.getState(), ap);
+ // todo and recompute annotation
+ }
+ ap.alignmentChanged(); // todo not like this
+ }
+ });
+ pop.add(cbmi);
+ final JCheckBoxMenuItem letterHeight = new JCheckBoxMenuItem(
+ MessageManager.getString("label.use_info_for_height"),
+ isGroupAnnotation ? ann.groupRef.isUseInfoLetterHeight()
+ : ap.av.isInfoLetterHeight());
+ letterHeight.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ if (isGroupAnnotation)
+ {
+ ann.groupRef.setInfoLetterHeight((letterHeight.getState()));
+ ann.groupRef.setIgnoreBelowBackground(true);
+ // todo and recompute group annotation
+ }
+ else
+ {
+ ap.av.setInfoLetterHeight(letterHeight.getState(), ap);
+ ap.av.setIgnoreBelowBackground(true, ap);
+ // todo and recompute annotation
+ }
+ ap.alignmentChanged();
+ }
+ });
+ pop.add(letterHeight);
+ if (isGroupAnnotation)
+ {
+ final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+ MessageManager.getString("label.show_group_histogram"),
+ ann.groupRef.isShowInformationHistogram());
+ chist.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ ann.groupRef.setShowInformationHistogram(chist.getState());
+ ap.repaint();
+ }
+ });
+ pop.add(chist);
+ final JCheckBoxMenuItem cprofl = new JCheckBoxMenuItem(
+ MessageManager.getString("label.show_group_logo"),
+ ann.groupRef.isShowHMMSequenceLogo());
+ cprofl.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ ann.groupRef.setShowHMMSequenceLogo(cprofl.getState());
+ ap.repaint();
+ }
+ });
+ pop.add(cprofl);
+ final JCheckBoxMenuItem cproflnorm = new JCheckBoxMenuItem(
+ MessageManager.getString("label.normalise_group_logo"),
+ ann.groupRef.isNormaliseHMMSequenceLogo());
+ cproflnorm.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ ann.groupRef
+ .setNormaliseHMMSequenceLogo(cproflnorm.getState());
+ // automatically enable logo display if we're clicked
+ ann.groupRef.setShowHMMSequenceLogo(true);
+ ap.repaint();
+ }
+ });
+ pop.add(cproflnorm);
+ }
+ else
+ {
+ final JCheckBoxMenuItem chist = new JCheckBoxMenuItem(
+ MessageManager.getString("label.show_histogram"),
+ av.isShowInformationHistogram());
+ chist.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ av.setShowInformationHistogram(chist.getState());
+ ap.repaint();
+ }
+ });
+ pop.add(chist);
+ final JCheckBoxMenuItem cprof = new JCheckBoxMenuItem(
+ MessageManager.getString("label.show_logo"),
+ av.isShowHMMSequenceLogo());
+ cprof.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ av.setShowHMMSequenceLogo(cprof.getState());
+ ap.repaint();
+ }
+ });
+ pop.add(cprof);
+ final JCheckBoxMenuItem cprofnorm = new JCheckBoxMenuItem(
+ MessageManager.getString("label.normalise_logo"),
+ av.isNormaliseHMMSequenceLogo());
+ cprofnorm.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ av.setShowHMMSequenceLogo(true);
+ av.setNormaliseHMMSequenceLogo(cprofnorm.getState());
+ ap.repaint();
+ }
+ });
+ pop.add(cprofnorm);
+ }
+ }
+
+ static void addColourOrFilterByOptions(final AlignmentPanel ap,
+ final AlignmentAnnotation alignmentAnnotation,
+ final JPopupMenu pop)
+ {
+ JMenuItem item;
+ item = new JMenuItem(
+ MessageManager.getString("label.colour_by_annotation"));
+ item.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ AnnotationColourChooser.displayFor(ap.av, ap, alignmentAnnotation,
+ false);
+ };
+ });
+ pop.add(item);
+ if (alignmentAnnotation.sequenceRef != null)
+ {
+ item = new JMenuItem(
+ MessageManager.getString("label.colour_by_annotation") + " ("
+ + MessageManager.getString("label.per_seq") + ")");
+ item.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ AnnotationColourChooser.displayFor(ap.av, ap, alignmentAnnotation,
+ true);
+ };
+ });
+ pop.add(item);
+ }
+ item = new JMenuItem(
+ MessageManager.getString("action.select_by_annotation"));
+ item.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ AnnotationColumnChooser.displayFor(ap.av, ap, alignmentAnnotation);
+ };
+ });
+ pop.add(item);
+ }
+
+ static void addContactMatrixOptions(final AlignmentPanel ap,
+ final AlignmentAnnotation alignmentAnnotation,
+ final JPopupMenu pop)
+ {
+
+ final ContactMatrixI cm = ap.av.getContactMatrix(alignmentAnnotation);
+ JMenuItem item;
+ if (cm != null)
+ {
+ pop.addSeparator();
+
+ if (cm.hasGroups())
+ {
+ JCheckBoxMenuItem chitem = new JCheckBoxMenuItem(
+ MessageManager.getString("action.show_groups_on_matrix"));
+ chitem.setToolTipText(MessageManager
+ .getString("action.show_groups_on_matrix_tooltip"));
+ boolean showGroups = alignmentAnnotation
+ .isShowGroupsForContactMatrix();
+ final AlignmentAnnotation sel_row = alignmentAnnotation;
+ chitem.setState(showGroups);
+ chitem.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ sel_row.setShowGroupsForContactMatrix(chitem.getState());
+ // so any annotation colour changes are propagated - though they
+ // probably won't be unless the annotation row colours are removed
+ // too!
+ ap.alignmentChanged();
+ }
+ });
+ pop.add(chitem);
+ }
+ if (cm.hasTree())
+ {
+ item = new JMenuItem(
+ MessageManager.getString("action.show_tree_for_matrix"));
+ item.setToolTipText(MessageManager
+ .getString("action.show_tree_for_matrix_tooltip"));
+ item.addActionListener(new ActionListener()
+ {
+
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+
+ ap.alignFrame.showContactMapTree(alignmentAnnotation, cm);
+
+ }
+ });
+ pop.add(item);
+ }
+ else
+ {
+ item = new JMenuItem(
+ MessageManager.getString("action.cluster_matrix"));
+ item.setToolTipText(
+ MessageManager.getString("action.cluster_matrix_tooltip"));
+ item.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ final long progBar;
+ ap.alignFrame.setProgressBar(
+ MessageManager.formatMessage(
+ "action.clustering_matrix_for",
+ cm.getAnnotDescr(), 5f),
+ progBar = System.currentTimeMillis());
+ cm.setGroupSet(GroupSet.makeGroups(cm, true));
+ cm.randomlyReColourGroups();
+ cm.transferGroupColorsTo(alignmentAnnotation);
+ ap.alignmentChanged();
+ ap.alignFrame.showContactMapTree(alignmentAnnotation, cm);
+ ap.alignFrame.setProgressBar(null, progBar);
+ }
+ }).start();
+ }
+ });
+ pop.add(item);
+ }
+ }
+ }
+
/**
* A helper method that adds menu options for calculation and visualisation of
* group and/or alignment consensus annotation to a popup menu. This is
AlignmentAnnotation graphAnnotation = av.getAlignment()
.getAlignmentAnnotation()[graphStretch];
int newHeight = Math.max(0, graphAnnotation.graphHeight + deltaY);
- graphAnnotation.graphHeight = newHeight;
+ if (notJustOne)
+ {
+ for (AlignmentAnnotation similar : av.getAlignment()
+ .findAnnotations(null, graphAnnotation.getCalcId(),
+ graphAnnotation.label))
+ {
+ similar.graphHeight = newHeight;
+ }
+
+ }
+ else
+ {
+ graphAnnotation.graphHeight = newHeight;
+ }
adjustPanelHeight();
+ setNoFastPaint();
ap.paintAlignment(false, false);
}
}
&& ann.annotations[column] != null)
{
tooltip = ann.annotations[column].description;
+ if ("".equals(tooltip))
+ {
+ tooltip = null;
+ }
}
-
+ // TODO abstract tooltip generator so different implementations can be built
+ if (ann.graph == AlignmentAnnotation.CONTACT_MAP)
+ {
+ if (rowAndOffset >= ann.graphHeight)
+ {
+ return null;
+ }
+ ContactListI clist = av.getContactList(ann, column);
+ if (clist != null)
+ {
+ ContactGeometry cgeom = new ContactGeometry(clist, ann.graphHeight);
+ ContactGeometry.contactInterval ci = cgeom.mapFor(rowAndOffset);
+ ContactRange cr = clist.getRangeFor(ci.cStart, ci.cEnd);
+ StringBuilder tooltipb = new StringBuilder();
+ tooltipb.append("Contact from ").append(clist.getPosition())
+ .append(", [").append(ci.cStart).append(" - ")
+ .append(ci.cEnd).append("]").append("<br/>Mean:");
+ Format.appendPercentage(tooltipb, (float) cr.getMean(), 2);
+ tooltip = tooltipb.toString();
+ int col = ann.sequenceRef.findPosition(column);
+ int[][] highlightPos;
+ int[] mappedPos = clist.getMappedPositionsFor(ci.cStart, ci.cEnd);
+ if (mappedPos != null)
+ {
+ highlightPos = new int[1 + mappedPos.length][2];
+ highlightPos[0] = new int[] { col, col };
+ for (int p = 0, h = 0; p < mappedPos.length; h++, p += 2)
+ {
+ highlightPos[h][0] = ann.sequenceRef
+ .findPosition(mappedPos[p] - 1);
+ highlightPos[h][1] = ann.sequenceRef
+ .findPosition(mappedPos[p + 1] - 1);
+ }
+ }
+ else
+ {
+ highlightPos = new int[][] { new int[] { col, col } };
+ }
+ ap.getStructureSelectionManager()
+ .highlightPositionsOn(ann.sequenceRef, highlightPos, null);
+ }
+ }
return tooltip;
}
return;
}
}
- imgWidth = (ranges.getEndRes() - ranges.getStartRes() + 1)
- * av.getCharWidth();
+ updateFadedImageWidth();
if (imgWidth < 1)
{
+ fastPaint = false;
return;
}
Graphics2D gg;
g.drawImage(image, 0, 0, this);
}
+ public void updateFadedImageWidth()
+ {
++
+ imgWidth = (av.getRanges().getEndRes() - av.getRanges().getStartRes()
+ + 1) * av.getCharWidth();
+
+ }
+
+ /**
+ * set true to enable redraw timing debug output on stderr
+ */
+ private final boolean debugRedraw = false;
+
/**
* non-Thread safe repaint
*
int er = av.getRanges().getEndRes() + 1;
int transX = 0;
+ if (er == sr + 1)
+ {
+ fastPaint = false;
+ return;
+ }
Graphics2D gg = (Graphics2D) image.getGraphics();
- if (imgWidth>Math.abs(horizontal*av.getCharWidth())) {
- //scroll is less than imgWidth away so can re-use buffered graphics
+ if (imgWidth > Math.abs(horizontal * av.getCharWidth()))
+ {
+ // scroll is less than imgWidth away so can re-use buffered graphics
gg.copyArea(0, 0, imgWidth, getHeight(),
-horizontal * av.getCharWidth(), 0);
-
+
if (horizontal > 0) // scrollbar pulled right, image to the left
{
transX = (er - sr - horizontal) * av.getCharWidth();
public class AssociatePdbFileWithSeq
{
+ private AssociatePdbFileWithSeq()
+ {
+ // inaccessible
+ }
+
/**
- * assocate the given PDB file with
+ * Associate the given PDB file name or URL with a sequence. Do not map
+ * mouse-over events.
*
- * @param choice
- * @param sequence
+ * @param fileName
+ * or URL
+ * @param type
+ * will be DataType.FILE or DataType.URL
- * @param sequence
- * to associate
- * @param prompt
++ * @param sequence * @param prompt
+ * true if the user should be asked what to do if the specified file
+ * does not seem to contain PDB information (StructureChooser only)
+ * @return null if file is not found
*/
- public static PDBEntry associatePdbWithSeq(String fileName,
- DataSourceType type, SequenceI sequence, boolean prompt)
- {
- public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,
- SequenceI sequence, boolean prompt,
- StructureSelectionManagerProvider ssmp)
- {
- return associatePdbWithSeq(choice, file, sequence, prompt, ssmp,
- TFType.DEFAULT, null, true);
- }
++public static PDBEntry associatePdbWithSeq(String fileName, DataSourceType type,
++ SequenceI sequence, boolean prompt)
++{
++ return associatePdbWithSeq(fileName, type, sequence, prompt, Desktop.getInstance(),
++ TFType.DEFAULT, null, true);
++}
+
- public PDBEntry associatePdbWithSeq(String choice, DataSourceType file,
- SequenceI sequence, boolean prompt,
- StructureSelectionManagerProvider ssmp, TFType tft,
- String paeFilename, boolean doXferSettings)
- {
++public static PDBEntry associatePdbWithSeq(String choice, DataSourceType file,
++ SequenceI sequence, boolean prompt,
++ StructureSelectionManagerProvider ssmp, TFType tft,
++ String paeFilename, boolean doXferSettings)
++{
PDBEntry entry = new PDBEntry();
- StructureFile pdbfile = null;
- pdbfile = Desktop.getStructureSelectionManager()
+ StructureFile pdbfile = StructureSelectionManager
+ .getStructureSelectionManager(ssmp)
.setMapping(false, new SequenceI[]
- { sequence }, null, fileName, type);
+ { sequence }, null, choice, file, tft, paeFilename,
+ doXferSettings);
if (pdbfile == null)
{
// stacktrace already thrown so just return
return null;
}
- if (pdbfile.getId() == null)
+ String id = pdbfile.getId();
+ if (id == null && (id = (prompt
+ ? JvOptionPane.showInternalInputDialog(Desktop.getDesktopPane(),
+ MessageManager
+ .getString("label.couldnt_find_pdb_id_in_file"),
+ MessageManager.getString("label.no_pdb_id_in_file"),
+ JvOptionPane.QUESTION_MESSAGE)
+ : null)) == null)
{
- String reply = null;
-
- if (prompt)
- {
- reply = JvOptionPane.showInternalInputDialog(Desktop.desktop,
- MessageManager
- .getString("label.couldnt_find_pdb_id_in_file"),
- MessageManager.getString("label.no_pdb_id_in_file"),
- JvOptionPane.QUESTION_MESSAGE);
- }
- if (reply == null)
- {
- return null;
- }
-
- entry.setId(reply);
- }
- else
- {
- entry.setId(pdbfile.getId());
+ return null;
}
+ entry.setId(id);
entry.setType(PDBEntry.Type.FILE);
- entry.setFile(fileName);
- sequence.getDatasetSequence().addPDBId(entry);
- Desktop.getStructureSelectionManager()
- .registerPDBEntry(entry);
+
+ if (pdbfile != null)
+ {
+ entry.setFile(choice);
+ sequence.getDatasetSequence().addPDBId(entry);
+ StructureSelectionManager.getStructureSelectionManager(ssmp)
+ .registerPDBEntry(entry);
+ entry.setStructureFile(pdbfile);
+ }
+ if (tft != null)
+ entry.setProperty("TFType", tft.name());
+ if (paeFilename != null)
+ entry.setProperty("PAEFile", paeFilename);
return entry;
}
}
*/
package jalview.gui;
+import jalview.analysis.TreeBuilder;
+import jalview.analysis.scoremodels.ScoreModels;
+import jalview.analysis.scoremodels.SimilarityParams;
+import jalview.api.AlignViewportI;
+import jalview.api.analysis.ScoreModelI;
+import jalview.api.analysis.SimilarityParamsI;
+import jalview.bin.Cache;
+import jalview.datamodel.SequenceGroup;
+import jalview.util.MessageManager;
++
import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Component;
*/
package jalview.gui;
+import java.util.Locale;
import java.awt.BorderLayout;
import java.awt.Color;
+ import java.awt.Component;
import java.awt.Dimension;
import java.awt.FontMetrics;
import java.awt.Graphics;
import java.util.Hashtable;
import java.util.List;
import java.util.ListIterator;
-import java.util.Locale;
+ import java.util.Map;
import java.util.Vector;
+import java.util.concurrent.ExecutionException;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
+import java.util.concurrent.Future;
+import java.util.concurrent.FutureTask;
import java.util.concurrent.Semaphore;
import javax.swing.AbstractAction;
import jalview.api.AlignViewportI;
import jalview.api.AlignmentViewPanel;
+import jalview.api.StructureSelectionManagerProvider;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+ import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Jalview;
+ import jalview.bin.Jalview.ExitCode;
+ import jalview.bin.argparser.Arg;
+ import jalview.bin.groovy.JalviewObject;
+ import jalview.bin.groovy.JalviewObjectI;
+ import jalview.datamodel.Alignment;
+ import jalview.datamodel.HiddenColumns;
+ import jalview.datamodel.Sequence;
+ import jalview.datamodel.SequenceI;
import jalview.gui.ImageExporter.ImageWriterI;
+ import jalview.gui.QuitHandler.QResponse;
import jalview.io.BackupFiles;
import jalview.io.DataSourceType;
import jalview.io.FileFormat;
import jalview.io.IdentifyFile;
import jalview.io.JalviewFileChooser;
import jalview.io.JalviewFileView;
- import jalview.jbgui.APQHandlers;
++import jalview.gui.APQHandlers;
+import jalview.jbgui.GDesktop;
+ import jalview.io.exceptions.ImageOutputException;
import jalview.jbgui.GSplitFrame;
import jalview.jbgui.GStructureViewer;
import jalview.project.Jalview2XML;
* @author $author$
* @version $Revision: 1.155 $
*/
-public class Desktop extends jalview.jbgui.GDesktop
+@SuppressWarnings("serial")
+public class Desktop extends GDesktop
implements DropTargetListener, ClipboardOwner, IProgressIndicator,
- StructureSelectionManagerProvider, ApplicationSingletonI
-
- jalview.api.StructureSelectionManagerProvider, JalviewObjectI
++ StructureSelectionManagerProvider, ApplicationSingletonI, JalviewObjectI
{
private static final String CITATION;
- static
- {
- URL bg_logo_url = ChannelProperties.getImageURL(
- "bg_logo." + String.valueOf(SplashScreen.logoSize));
- URL uod_logo_url = ChannelProperties.getImageURL(
- "uod_banner." + String.valueOf(SplashScreen.logoSize));
+ static {
+ URL bg_logo_url = ChannelProperties.getImageURL("bg_logo." + String.valueOf(SplashScreen.logoSize));
+ URL uod_logo_url = ChannelProperties.getImageURL("uod_banner." + String.valueOf(SplashScreen.logoSize));
boolean logo = (bg_logo_url != null || uod_logo_url != null);
StringBuilder sb = new StringBuilder();
sb.append(
{
sb.append("<br>");
}
- sb.append(bg_logo_url == null ? ""
- : "<img alt=\"Barton Group logo\" src=\""
- + bg_logo_url.toString() + "\">");
+ sb.append(bg_logo_url == null ? "" : "<img alt=\"Barton Group logo\" src=\"" + bg_logo_url.toString() + "\">");
sb.append(uod_logo_url == null ? ""
- : " <img alt=\"University of Dundee shield\" src=\""
- + uod_logo_url.toString() + "\">");
+ : " <img alt=\"University of Dundee shield\" src=\"" + uod_logo_url.toString() + "\">");
sb.append(
- "<br><br>For help, see <a href=\"https://www.jalview.org/faq\">www.jalview.org/faq</a> and join <a href=\"https://discourse.jalview.org\">discourse.jalview.org</a>");
+ "<br><br>For help, see <a href=\"https://www.jalview.org/help/faq\">www.jalview.org/faq</a> and join <a href=\"https://discourse.jalview.org\">discourse.jalview.org</a>");
sb.append("<br><br>If you use Jalview, please cite:"
+ "<br>Waterhouse, A.M., Procter, J.B., Martin, D.M.A, Clamp, M. and Barton, G. J. (2009)"
+ "<br>Jalview Version 2 - a multiple sequence alignment editor and analysis workbench"
public static HashMap<String, FileWriter> savingFiles = new HashMap<String, FileWriter>();
+ private static int DRAG_MODE = JDesktopPane.OUTLINE_DRAG_MODE;
+
+ public static void setLiveDragMode(boolean b)
+ {
+ DRAG_MODE = b ? JDesktopPane.LIVE_DRAG_MODE
+ : JDesktopPane.OUTLINE_DRAG_MODE;
- if (desktop != null)
- desktop.setDragMode(DRAG_MODE);
++ if (getInstance().getDesktopPane()!= null)
++ getInstance().getDesktopPane().setDragMode(DRAG_MODE);
+ }
+
+ @SuppressWarnings("deprecation")
private JalviewChangeSupport changeSupport = new JalviewChangeSupport();
public static boolean nosplash = false;
}
}
+ /**
+ * APQHandlers sets handlers for About, Preferences and Quit actions peculiar to
+ * macOS's application menu. APQHandlers will check to see if a handler is
+ * supported before setting it.
+ */
+ try {
+ APQHandlers.setAPQHandlers(this);
+ } catch (Exception e) {
+ System.out.println("Cannot set APQHandlers");
+ // e.printStackTrace();
+ } catch (Throwable t) {
+ jalview.bin.Console.warn("Error setting APQHandlers: " + t.toString());
+ jalview.bin.Console.trace(Cache.getStackTraceString(t));
+ }
+
setIconImages(ChannelProperties.getIconList());
- addWindowListener(new WindowAdapter() {
-
+ // override quit handling when GUI OS close [X] button pressed
+ this.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
+ addWindowListener(new WindowAdapter()
+ {
@Override
- public void windowClosing(WindowEvent ev) {
- quit();
+ public void windowClosing(WindowEvent ev)
+ {
+ QuitHandler.QResponse ret = desktopQuit(true, true); // ui, disposeFlag
}
});
- boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE", false);
+ boolean selmemusage = Cache.getDefault("SHOW_MEMUSAGE", false);
- boolean showjconsole = Cache.getDefault("SHOW_JAVA_CONSOLE", false);
- desktopPane = new MyDesktopPane(selmemusage);
+ boolean showjconsole = Cache.getArgCacheDefault(Arg.JAVACONSOLE,
+ "SHOW_JAVA_CONSOLE", false);
+
+ // start dialogue queue for single dialogues
+ startDialogQueue();
+
+ if (!Platform.isJS())
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
- Desktop.instance.acquireDialogQueue();
++ acquireDialogQueue();
+
+ jconsole = new Console(this);
+ jconsole.setHeader(Cache.getVersionDetailsForConsole());
+ showConsole(showjconsole);
+
- Desktop.instance.releaseDialogQueue();
++ releaseDialogQueue();
+ }
+
- desktop = new MyDesktopPane(selmemusage);
++ desktopPane = new MyDesktopPane(selmemusage);
- showMemusage.setSelected(selmemusage);
- desktop.setBackground(Color.white);
+ showMemusage.setSelected(selmemusage);
+ desktopPane.setBackground(Color.white);
- getContentPane().setLayout(new BorderLayout());
- // alternate config - have scrollbars - see notes in JAL-153
- // JScrollPane sp = new JScrollPane();
- // sp.getViewport().setView(desktop);
- // getContentPane().add(sp, BorderLayout.CENTER);
+ getContentPane().setLayout(new BorderLayout());
+ // alternate config - have scrollbars - see notes in JAL-153
+ // JScrollPane sp = new JScrollPane();
+ // sp.getViewport().setView(desktop);
+ // getContentPane().add(sp, BorderLayout.CENTER);
- // BH 2018 - just an experiment to try unclipped JInternalFrames.
- if (Platform.isJS())
- {
- getRootPane().putClientProperty("swingjs.overflow.hidden", "false");
- }
+ // BH 2018 - just an experiment to try unclipped JInternalFrames.
+ if (Platform.isJS())
+ {
+ getRootPane().putClientProperty("swingjs.overflow.hidden", "false");
+ }
- getContentPane().add(desktop, BorderLayout.CENTER);
- desktop.setDragMode(DRAG_MODE);
+ getContentPane().add(desktopPane, BorderLayout.CENTER);
- desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE);
++ desktopPane.setDragMode(JDesktopPane.OUTLINE_DRAG_MODE); // DRAG_MODE in 2.11
- // This line prevents Windows Look&Feel resizing all new windows to maximum
- // if previous window was maximised
- desktop.setDesktopManager(new MyDesktopManager(
- Platform.isJS() ? desktop.getDesktopManager()
+
+ // This line prevents Windows Look&Feel resizing all new windows to
+ // maximum
+ // if previous window was maximised
+ desktopPane.setDesktopManager(new MyDesktopManager(
- (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
- : Platform.isAMacAndNotJS()
- ? new AquaInternalFrameManager(
- desktopPane.getDesktopManager())
- : desktopPane.getDesktopManager())));
++ Platform.isJS() ? desktopPane.getDesktopManager()
+ : new DefaultDesktopManager()));
+ /*
- (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
- : Platform.isAMacAndNotJS()
- ? new AquaInternalFrameManager(
- desktop.getDesktopManager())
- : desktop.getDesktopManager())));
++ (Platform.isWindowsAndNotJS() ? new DefaultDesktopManager()
++ : Platform.isAMacAndNotJS()
++ ? new AquaInternalFrameManager(
++ desktopPane.getDesktopManager())
++ : desktopPane.getDesktopManager())));
+ */
- Rectangle dims = getLastKnownDimensions("");
- if (dims != null)
- {
- setBounds(dims);
- }
- else
- {
- Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
- int xPos = Math.max(5, (screenSize.width - 900) / 2);
- int yPos = Math.max(5, (screenSize.height - 650) / 2);
- setBounds(xPos, yPos, 900, 650);
- }
+ Rectangle dims = getLastKnownDimensions("");
+ if (dims != null)
+ {
+ setBounds(dims);
+ }
+ else
+ {
+ Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
+ int xPos = Math.max(5, (screenSize.width - 900) / 2);
+ int yPos = Math.max(5, (screenSize.height - 650) / 2);
+ setBounds(xPos, yPos, 900, 650);
+ }
- if (!Platform.isJS())
- /**
- * Java only
- *
- * @j2sIgnore
- */
- {
- jconsole = new Console(this, showjconsole);
- jconsole.setHeader(Cache.getVersionDetailsForConsole());
- showConsole(showjconsole);
-
- showNews.setVisible(false); // not sure if we should only do this for interactive session?
+ if (!Platform.isJS())
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ showNews.setVisible(false);
- experimentalFeatures.setSelected(showExperimental());
-
- getIdentifiersOrgData();
+ experimentalFeatures.setSelected(showExperimental());
- checkURLLinks();
+ getIdentifiersOrgData();
- // Spawn a thread that shows the splashscreen
- if (!nosplash)
- {
- SwingUtilities.invokeLater(new Runnable()
+ if (Jalview.isInteractive())
{
- @Override
- public void run()
- {
- new SplashScreen(true);
+ // disabled for SeqCanvasTest
+ checkURLLinks();
+
+ // Spawn a thread that shows the splashscreen
+ if (!nosplash) {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ new SplashScreen(true);
+ }
+ });
}
- });
- }
- // Thread off a new instance of the file chooser - this reduces the time
- // it takes to open it later on.
- new Thread(new Runnable()
- {
- @Override
- public void run()
- {
- jalview.bin.Console.debug("Filechooser init thread started.");
- String fileFormat = FileLoader.getUseDefaultFileFormat()
+ // Thread off a new instance of the file chooser - this reduces the
+ // time
+ // it
+ // takes to open it later on.
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ jalview.bin.Console.debug("Filechooser init thread started.");
- String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
++ String fileFormat = FileLoader.getUseDefaultFileFormat()
+ ? Cache.getProperty("DEFAULT_FILE_FORMAT")
+ : null;
- JalviewFileChooser.forRead(Cache.getProperty("LAST_DIRECTORY"),
- fileFormat);
- jalview.bin.Console.debug("Filechooser init thread finished.");
- }
- }).start();
- // Add the service change listener
- changeSupport.addJalviewPropertyChangeListener("services",
- new PropertyChangeListener()
- {
+ JalviewFileChooser.forRead(
+ Cache.getProperty("LAST_DIRECTORY"), fileFormat);
+ jalview.bin.Console.debug("Filechooser init thread finished.");
+ }
+ }).start();
+ // Add the service change listener
+ changeSupport.addJalviewPropertyChangeListener("services",
+ new PropertyChangeListener()
+ {
- @Override
- public void propertyChange(PropertyChangeEvent evt)
- {
- jalview.bin.Console
- .debug("Firing service changed event for "
- + evt.getNewValue());
- JalviewServicesChanged(evt);
- }
- });
- }
+ @Override
+ public void propertyChange(PropertyChangeEvent evt)
+ {
+ jalview.bin.Console.debug("Firing service changed event for "
+ + evt.getNewValue());
+ JalviewServicesChanged(evt);
+ }
+ });
+ }
+ }
- this.setDropTarget(new java.awt.dnd.DropTarget(desktopPane, this));
- this.setDropTarget(new java.awt.dnd.DropTarget(desktop, this));
++ this.setDropTarget(new java.awt.dnd.DropTarget(this, this));
- this.addWindowListener(new WindowAdapter()
+ MouseAdapter ma;
+ this.addMouseListener(ma = new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent evt)
{
- @Override
- public void windowClosing(WindowEvent evt)
+ if (evt.isPopupTrigger()) // Mac
{
- quit();
+ showPasteMenu(evt.getX(), evt.getY());
}
- });
+ }
- MouseAdapter ma;
- this.addMouseListener(ma = new MouseAdapter()
+ @Override
+ public void mouseReleased(MouseEvent evt)
{
- @Override
- public void mousePressed(MouseEvent evt)
+ if (evt.isPopupTrigger()) // Windows
{
- if (evt.isPopupTrigger()) // Mac
- {
- showPasteMenu(evt.getX(), evt.getY());
- }
+ showPasteMenu(evt.getX(), evt.getY());
}
- @Override
- public void mouseReleased(MouseEvent evt)
- {
- if (evt.isPopupTrigger()) // Windows
- {
- showPasteMenu(evt.getX(), evt.getY());
- }
- }
- });
- desktopPane.addMouseListener(ma);
- } catch (Throwable t)
- {
- t.printStackTrace();
- }
+ }
+ });
- desktop.addMouseListener(ma);
-
- if (Platform.isJS())
- {
- // used for jalviewjsTest
- jalview.bin.Console.info("JALVIEWJS: CREATED DESKTOP");
- }
++ desktopPane.addMouseListener(ma);
++ } catch (Throwable t) // catch all exceptions and report
++ {
++ t.printStackTrace();
++ jalview.bin.Console.error("Unexpected exception during creation of desktop",t);
++ }
++ if (Platform.isJS())
++ {
++ // used for jalviewjsTest
++ jalview.bin.Console.info("JALVIEWJS: CREATED DESKTOP");
++ }
+
}
/**
public void doConfigureStructurePrefs()
{
// configure services
- StructureSelectionManager ssm = StructureSelectionManager.getStructureSelectionManager(this);
- if (Cache.getDefault(Preferences.ADD_SS_ANN, true)) {
- ssm.setAddTempFacAnnot(Cache.getDefault(Preferences.ADD_TEMPFACT_ANN, true));
- ssm.setProcessSecondaryStructure(Cache.getDefault(Preferences.STRUCT_FROM_PDB, true));
- // JAL-3915 - RNAView is no longer an option so this has no effect
- ssm.setSecStructServices(Cache.getDefault(Preferences.USE_RNAVIEW, false));
- } else {
- ssm.setAddTempFacAnnot(false);
- ssm.setProcessSecondaryStructure(false);
- ssm.setSecStructServices(false);
- }
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(this);
+ StructureSelectionManager.doConfigureStructurePrefs(ssm);
}
- public void checkForNews()
- {
+ public void checkForNews() {
final Desktop me = this;
// Thread off the news reader, in case there are connection problems.
- new Thread(new Runnable()
- {
+ new Thread(new Runnable() {
@Override
public void run()
{
public void paste()
{
- try
+ // quick patch for JAL-4150 - needs some more work and test coverage
+ // TODO - unify below and AlignFrame.paste()
+ // TODO - write tests and fix AlignFrame.paste() which doesn't track if
+ // clipboard has come from a different alignment window than the one where
+ // paste has been called! JAL-4151
+
- if (Desktop.jalviewClipboard != null)
++ if (Desktop.getInstance().jalviewClipboard != null)
{
- Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
- Transferable contents = c.getContents(this);
+ // The clipboard was filled from within Jalview, we must use the
+ // sequences
+ // And dataset from the copied alignment
- SequenceI[] newseq = (SequenceI[]) Desktop.jalviewClipboard[0];
++ SequenceI[] newseq = (SequenceI[]) Desktop.getInstance().jalviewClipboard[0];
+ // be doubly sure that we create *new* sequence objects.
+ SequenceI[] sequences = new SequenceI[newseq.length];
+ for (int i = 0; i < newseq.length; i++)
+ {
+ sequences[i] = new Sequence(newseq[i]);
+ }
+ Alignment alignment = new Alignment(sequences);
+ // dataset is inherited
- alignment.setDataset((Alignment) Desktop.jalviewClipboard[1]);
++ alignment.setDataset((Alignment) Desktop.getInstance().jalviewClipboard[1]);
+ AlignFrame af = new AlignFrame(alignment, AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
+ String newtitle = new String("Copied sequences");
- if (contents != null)
- if (Desktop.jalviewClipboard[2] != null)
++ if (Desktop.getInstance().jalviewClipboard[2] != null)
{
- String file = (String) contents
- .getTransferData(DataFlavor.stringFlavor);
- HiddenColumns hc = (HiddenColumns) Desktop.jalviewClipboard[2];
++ HiddenColumns hc = (HiddenColumns) Desktop.getInstance().jalviewClipboard[2];
+ af.viewport.setHiddenColumns(hc);
+ }
- FileFormatI format = new IdentifyFile().identify(file,
- DataSourceType.PASTE);
+ Desktop.addInternalFrame(af, newtitle, AlignFrame.DEFAULT_WIDTH,
+ AlignFrame.DEFAULT_HEIGHT);
- new FileLoader().LoadFile(file, DataSourceType.PASTE, format);
+ }
+ else
+ {
+ try
+ {
+ Clipboard c = Toolkit.getDefaultToolkit().getSystemClipboard();
+ Transferable contents = c.getContents(this);
+ if (contents != null)
+ {
+ String file = (String) contents
+ .getTransferData(DataFlavor.stringFlavor);
+
+ FileFormatI format = new IdentifyFile().identify(file,
+ DataSourceType.PASTE);
+
+ new FileLoader().LoadFile(file, DataSourceType.PASTE, format);
+
+ }
+ } catch (Exception ex)
+ {
+ jalview.bin.Console.outPrintln(
+ "Unable to paste alignment from system clipboard:\n" + ex);
}
- } catch (Exception ex)
- {
- System.out.println(
- "Unable to paste alignment from system clipboard:\n" + ex);
}
}
setKeyBindings(frame);
- getDesktopPane().add(frame);
+ // Since the latest FlatLaf patch, we occasionally have problems showing
+ // structureViewer frames...
+ int tries = 3;
+ boolean shown = false;
+ Exception last = null;
+ do
+ {
+ try
+ {
- desktop.add(frame);
++ getDesktopPane().add(frame);
+ shown = true;
+ } catch (IllegalArgumentException iaex)
+ {
+ last = iaex;
+ tries--;
+ jalview.bin.Console.info("Squashed IllegalArgument Exception ("
+ + tries + " left) for " + frame.getTitle(), iaex);
+ try
+ {
+ Thread.sleep(5);
+ } catch (InterruptedException iex)
+ {
+ }
+ ;
+ }
+ } while (!shown && tries > 0);
+ if (!shown)
+ {
+ jalview.bin.Console.error(
+ "Serious Problem whilst showing window " + frame.getTitle(),
+ last);
+ }
- getInstance().windowMenu.add(menuItem);
+ windowMenu.add(menuItem);
frame.toFront();
try
Object[] options = new Object[] { MessageManager.getString("action.ok"),
MessageManager.getString("action.cancel") };
- Runnable action = () -> {
- @SuppressWarnings("unchecked")
- String url = (history instanceof JTextField
- ? ((JTextField) history).getText()
- : ((JComboBox<String>) history).getEditor().getItem()
- .toString().trim());
+ Runnable action = new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ @SuppressWarnings("unchecked")
+ String url = (history instanceof JTextField ? ((JTextField) history).getText()
+ : ((JComboBox<String>) history).getEditor().getItem().toString().trim());
- if (url.toLowerCase(Locale.ROOT).endsWith(".jar")) {
- if (viewport != null) {
- new FileLoader().LoadFile(viewport, url, DataSourceType.URL, FileFormat.Jalview);
- } else {
- new FileLoader().LoadFile(url, DataSourceType.URL, FileFormat.Jalview);
- }
- } else {
- FileFormatI format = null;
- try
- {
- format = new IdentifyFile().identify(url, DataSourceType.URL);
- } catch (FileFormatException e)
- {
- // TODO revise error handling, distinguish between
- // URL not found and response not valid
- }
+ if (url.toLowerCase(Locale.ROOT).endsWith(".jar"))
+ {
+ if (viewport != null)
+ {
+ new FileLoader().LoadFile(viewport, url, DataSourceType.URL,
+ FileFormat.Jalview);
+ }
+ else
+ {
+ new FileLoader().LoadFile(url, DataSourceType.URL,
+ FileFormat.Jalview);
+ }
+ }
+ else
+ {
+ FileFormatI format = null;
+ try
+ {
+ format = new IdentifyFile().identify(url, DataSourceType.URL);
+ } catch (FileFormatException e)
+ {
+ // TODO revise error handling, distinguish between
+ // URL not found and response not valid
+ }
- if (format == null)
- {
- String msg = MessageManager.formatMessage("label.couldnt_locate",
- url);
- JvOptionPane.showInternalMessageDialog(Desktop.desktop, msg,
- MessageManager.getString("label.url_not_found"),
- JvOptionPane.WARNING_MESSAGE);
- return;
- }
+ if (format == null)
+ {
+ String msg = MessageManager
+ .formatMessage("label.couldnt_locate", url);
+ JvOptionPane.showInternalMessageDialog(getDesktopPane(), msg,
+ MessageManager.getString("label.url_not_found"),
+ JvOptionPane.WARNING_MESSAGE);
+
+ return;
+ }
- if (viewport != null)
- {
- new FileLoader().LoadFile(viewport, url, DataSourceType.URL,
- format);
- }
- else
- {
- new FileLoader().LoadFile(url, DataSourceType.URL, format);
- }
+ if (viewport != null)
+ {
+ new FileLoader().LoadFile(viewport, url, DataSourceType.URL,
+ format);
+ }
+ else
+ {
+ new FileLoader().LoadFile(url, DataSourceType.URL, format);
}
}
++ }
};
String dialogOption = MessageManager
.getString("label.input_alignment_from_url");
- JvOptionPane.newOptionDialog(desktopPane).setResponseHandler(0, action)
- .showInternalDialog(panel, dialogOption,
- JvOptionPane.YES_NO_CANCEL_OPTION,
- JvOptionPane.PLAIN_MESSAGE, null, options,
- MessageManager.getString("action.ok"));
- JvOptionPane.newOptionDialog(desktop).setResponseHandler(0, action)
- .showInternalDialog(panel, dialogOption,
- JvOptionPane.YES_NO_CANCEL_OPTION,
- JvOptionPane.PLAIN_MESSAGE, null, options,
- MessageManager.getString("action.ok"));
++ JvOptionPane.newOptionDialog(getDesktopPane()).setResponseHandler(0, action)
++ .showInternalDialog(panel, dialogOption,
++ JvOptionPane.YES_NO_CANCEL_OPTION,
++ JvOptionPane.PLAIN_MESSAGE, null, options,
++ MessageManager.getString("action.ok"));
}
/**
{
// suppress a possible repeat prompt to save script
groovyConsole.setDirty(false);
- groovyConsole.exit();
+
+ // and tidy up
+ if (((Window) groovyConsole.getFrame()) != null
+ && ((Window) groovyConsole.getFrame()).isVisible())
+ {
+ // console is visible -- FIXME JAL-4327
+ groovyConsole.exit();
+ }
+ else
+ {
+ // console is not, so just let it dispose itself when we shutdown
+ // we don't call groovyConsole.exit() because it calls the shutdown
+ // handler with invokeAndWait() causing deadlock
+ groovyConsole = null;
+ }
+ }
+
+ if (terminateJvm)
+ {
+ // note that shutdown hook will not be run
+ jalview.bin.Console.debug("Force Quit selected by user");
+ Runtime.getRuntime().halt(0);
+ }
+
+ jalview.bin.Console.debug("Quit selected by user");
+ if (dispose)
+ {
- instance.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
++ getInstance().setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
+ // instance.dispose();
}
- System.exit(0);
+ }
+
+ public QuitHandler.QResponse desktopQuit(boolean ui, boolean disposeFlag)
+ {
+ final Runnable doDesktopQuit = () -> {
+
+ // FIRST !! check for aborted quit
+ if (QuitHandler.quitCancelled())
+ {
+ jalview.bin.Console
+ .debug("Quit was cancelled - Desktop aborting quit");
+ return;
+ }
+
+ // Proceed with quitting
+ quitTheDesktop(disposeFlag,
+ QuitHandler.gotQuitResponse() == QResponse.FORCE_QUIT);
+ // and exit the JVM
- instance.quit();
++ getInstance().quit();
+ };
+
+ return QuitHandler.getQuitResponse(ui, doDesktopQuit, doDesktopQuit,
+ QuitHandler.defaultCancelQuit);
+ }
+
+ /**
+ * Exits the program and the JVM.
+ *
+ * Don't call this directly
+ *
+ * - use desktopQuit() above to tidy up first.
+ *
+ * - use closeDesktop() to shutdown Jalview without shutting down the JVM
+ *
+ */
+ @Override
+ public void quit()
+ {
+ // this will run the shutdownHook but QuitHandler.getQuitResponse() should
+ // not run a second time if gotQuitResponse flag has been set (i.e. user
+ // confirmed quit of some kind).
+ Jalview.exit("Desktop exiting.", ExitCode.OK);
}
private void storeLastKnownDimensions(String string, Rectangle jc)
public void closeAll_actionPerformed(ActionEvent e)
{
// TODO show a progress bar while closing?
- JInternalFrame[] frames = desktopPane.getAllFrames();
- JInternalFrame[] frames = desktop.getAllFrames();
++ JInternalFrame[] frames = getAllFrames();
for (int i = 0; i < frames.length; i++)
{
try
}
}
+ public int structureViewersStillRunningCount()
+ {
+ int count = 0;
- JInternalFrame[] frames = desktop.getAllFrames();
++ JInternalFrame[] frames = getInstance().getAllFrames();
+ for (int i = 0; i < frames.length; i++)
+ {
+ if (frames[i] != null
+ && frames[i] instanceof JalviewStructureDisplayI)
+ {
+ if (((JalviewStructureDisplayI) frames[i]).stillRunning())
+ count++;
+ }
+ }
+ return count;
+ }
+
@Override
public void raiseRelated_actionPerformed(ActionEvent e)
{
public static AlignmentViewport[] getViewports(String sequenceSetId)
{
List<AlignmentViewport> viewp = new ArrayList<>();
- if (desktop != null)
+ if (getDesktopPane() != null)
{
- AlignFrame[] frames = getAlignFrames();
+ AlignFrame[] frames = Desktop.getDesktopAlignFrames();
for (AlignFrame afr : frames)
{
public JInternalFrame[] getAllFrames()
{
- return desktopPane.getAllFrames();
- return desktop.getAllFrames();
++ return desktopPane!=null ? desktopPane.getAllFrames():new JInternalFrame[] {};
}
/**
*
* @return an array of AlignFrame, or null if none found
*/
- public static AlignFrame[] getAlignFrames()
+ @Override
+ public AlignFrame[] getAlignFrames()
{
- if (Jalview.isHeadlessMode())
- if (desktop == null)
++ if (getDesktopPane() == null)
{
- return null;
++ // return null in 2.11.3
+ return new AlignFrame[] { Jalview.getInstance().currentAlignFrame };
}
- JInternalFrame[] frames = Desktop.desktop.getAllFrames();
+ JInternalFrame[] frames = getDesktopPane().getAllFrames();
if (frames == null)
{
}
/**
+ * static version
+ */
+ public static AlignFrame[] getDesktopAlignFrames()
+ {
+ if (Jalview.isHeadlessMode())
+ {
+ // Desktop.desktop is null in headless mode
+ return Jalview.getInstance().getAlignFrames();
+ }
+
- if (instance != null && desktop != null)
++ if (getInstance() != null && getInstance().getDesktopPane() != null)
+ {
- return instance.getAlignFrames();
++ return getInstance().getAlignFrames();
+ }
+
+ return null;
+ }
+
+ /**
* Returns an array of any AppJmol frames in the Desktop (or null if none).
*
* @return
openGroovyConsole();
} catch (Exception ex)
{
- jalview.bin.Console.error("Groovy Shell Creation failed.", ex);
- jalview.bin.Console.error("Groovy Console creation failed.", ex);
- JvOptionPane.showInternalMessageDialog(Desktop.desktop,
++ jalview.bin.Console.error("Groovy Console Creation failed.", ex);
+ JvOptionPane.showInternalMessageDialog(desktopPane,
MessageManager.getString("label.couldnt_create_groovy_shell"),
MessageManager.getString("label.groovy_support_failed"),
*/
public static void showUrl(final String url)
{
- showUrl(url, getInstance());
+ if (url != null && !url.trim().equals(""))
+ {
+ jalview.bin.Console.info("Opening URL: " + url);
- showUrl(url, Desktop.instance);
++ showUrl(url, getInstance());
+ }
+ else
+ {
+ jalview.bin.Console.warn("Ignoring attempt to show an empty URL.");
+ }
+
}
/**
{
if (dialogPause)
{
- try
- {
- block.acquire();
- } catch (InterruptedException x)
- {
- }
+ acquireDialogQueue();
}
- if (instance == null)
+ if (Jalview.isHeadlessMode())
{
return;
}
jalview.bin.Console.debug(Cache.getStackTraceString(e));
}
}
+
+ /**
+ * closes the current instance window, but leaves the JVM running. Bypasses
+ * any shutdown prompts, but does not set window dispose on close in case JVM
+ * terminates.
+ */
+ public static void closeDesktop()
+ {
- if (Desktop.instance != null)
++ if (ApplicationSingletonProvider.hasInstance(Desktop.class))
+ {
- Desktop us = Desktop.instance;
- Desktop.instance.quitTheDesktop(false, false);
++ Desktop us = Desktop.getInstance();
++ us.quitTheDesktop(false, false);
++ ApplicationSingletonProvider.removeInstance(Desktop.class);
+ // call dispose in a separate thread - try to avoid indirect deadlocks
+ if (us != null)
+ {
+ new Thread(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ ExecutorService dex = us.dialogExecutor;
+ if (dex != null)
+ {
+ dex.shutdownNow();
+ us.dialogExecutor = null;
+ us.block.drainPermits();
+ }
+ us.dispose();
+ }
+ }).start();
+ }
+ }
+ }
+
+ /**
+ * checks if any progress bars are being displayed in any of the windows
+ * managed by the desktop
+ *
+ * @return
+ */
+ public boolean operationsAreInProgress()
+ {
+ JInternalFrame[] frames = getAllFrames();
+ for (JInternalFrame frame : frames)
+ {
+ if (frame instanceof IProgressIndicator)
+ {
+ if (((IProgressIndicator) frame).operationInProgress())
+ {
+ return true;
+ }
+ }
+ }
+ return operationInProgress();
+ }
+
+ /**
+ * keep track of modal JvOptionPanes open as modal dialogs for AlignFrames.
+ * The way the modal JInternalFrame is made means it cannot be a child of an
+ * AlignFrame, so closing the AlignFrame might leave the modal open :(
+ */
+ private static Map<AlignFrame, JInternalFrame> alignFrameModalMap = new HashMap<>();
+
+ protected static void addModal(AlignFrame af, JInternalFrame jif)
+ {
+ alignFrameModalMap.put(af, jif);
+ }
+
+ protected static void closeModal(AlignFrame af)
+ {
+ if (!alignFrameModalMap.containsKey(af))
+ {
+ return;
+ }
+ JInternalFrame jif = alignFrameModalMap.get(af);
+ if (jif != null)
+ {
+ try
+ {
+ jif.setClosed(true);
+ } catch (PropertyVetoException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ alignFrameModalMap.remove(af);
+ }
+
+ public void nonBlockingDialog(String title, String message, String button,
+ int type, boolean scrollable, boolean modal)
+ {
+ nonBlockingDialog(title, message, null, button, type, scrollable, false,
+ modal, -1);
+ }
+
+ public void nonBlockingDialog(String title, String message,
+ String boxtext, String button, int type, boolean scrollable,
+ boolean html, boolean modal, int timeout)
+ {
+ nonBlockingDialog(32, 2, title, message, boxtext, button, type,
+ scrollable, html, modal, timeout);
+ }
+
+ public void nonBlockingDialog(int width, int height, String title,
+ String message, String boxtext, String button, int type,
+ boolean scrollable, boolean html, boolean modal, int timeout)
+ {
+ if (type < 0)
+ {
+ type = JvOptionPane.WARNING_MESSAGE;
+ }
+ JLabel jl = new JLabel(message);
+
+ JTextComponent jtc = null;
+ if (html)
+ {
+ JTextPane jtp = new JTextPane();
+ jtp.setContentType("text/html");
+ jtp.setEditable(false);
+ jtp.setAutoscrolls(true);
+ jtp.setText(boxtext);
+
+ jtc = jtp;
+ }
+ else
+ {
+ JTextArea jta = new JTextArea(height, width);
+ // jta.setLineWrap(true);
+ jta.setEditable(false);
+ jta.setWrapStyleWord(true);
+ jta.setAutoscrolls(true);
+ jta.setText(boxtext);
+
+ jtc = jta;
+ }
+
+ JScrollPane jsp = scrollable
+ ? new JScrollPane(jtc, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
+ JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED)
+ : null;
+
+ JvOptionPane jvp = JvOptionPane.newOptionDialog(this);
+
+ JPanel jp = new JPanel();
+ jp.setLayout(new BoxLayout(jp, BoxLayout.Y_AXIS));
+
+ if (message != null)
+ {
+ jl.setAlignmentX(Component.LEFT_ALIGNMENT);
+ jp.add(jl);
+ }
+ if (boxtext != null)
+ {
+ if (scrollable)
+ {
+ jsp.setAlignmentX(Component.LEFT_ALIGNMENT);
+ jp.add(jsp);
+ }
+ else
+ {
+ jtc.setAlignmentX(Component.LEFT_ALIGNMENT);
+ jp.add(jtc);
+ }
+ }
+
+ jvp.setResponseHandler(JOptionPane.YES_OPTION, () -> {
+ });
+ jvp.setTimeout(timeout);
+ JButton jb = new JButton(button);
+ jvp.showDialogOnTopAsync(this, jp, title, JOptionPane.YES_OPTION, type,
+ null, new Object[]
+ { button }, button, modal, new JButton[] { jb }, false);
+ }
+
+ @Override
+ public AlignFrame getCurrentAlignFrame()
+ {
+ return Jalview.getInstance().getCurrentAlignFrame();
+ }
}
// Fill in the background
gg.setColor(Color.white);
gg.fillRect(0, 0, getWidth(), imgHeight);
-
- drawIds(gg, av, av.getRanges().getStartSeq(), av.getRanges().getEndSeq(), searchResults);
+
+ drawIds(gg, av, av.getRanges().getStartSeq(),
+ av.getRanges().getEndSeq(), searchResults, true, getWidth());
gg.dispose();
-
+
g.drawImage(image, 0, 0, this);
}
AnnotationLabels labels = null;
if (alignViewport.isShowAnnotation())
{
- // BH when was ap == null?
+ // in wrapped mode, no alignPanel reference is available
+ // FIXME: make the renderer not create a new object in wrapped mode
+ // everytime!
++ // BH when was ap == null? FIXME: TOO ! JBPNote - do we still need to create AnnotationPanel again!
+ if (ap == null)
+ {
+ ap = new AnnotationPanel(alignViewport);
+ }
labels = new AnnotationLabels(alignViewport);
}
public void propertyChange(PropertyChangeEvent evt)
{
String propertyName = evt.getPropertyName();
- if (propertyName.equals(ViewportRanges.STARTSEQ)
- || (av.getWrapAlignment()
- && propertyName.equals(ViewportRanges.STARTRES)))
+ switch (propertyName)
{
+ case ViewportRanges.STARTSEQ:
fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
- }
- else if (propertyName.equals(ViewportRanges.STARTRESANDSEQ))
- {
+ break;
+ case ViewportRanges.STARTRES:
+ if (av.getWrapAlignment())
+ {
+ fastPaint((int) evt.getNewValue() - (int) evt.getOldValue());
+ }
+ break;
+ case ViewportRanges.STARTRESANDSEQ:
fastPaint(((int[]) evt.getNewValue())[1]
- ((int[]) evt.getOldValue())[1]);
- }
- else if (propertyName.equals(ViewportRanges.MOVE_VIEWPORT))
- {
+ break;
+ case ViewportRanges.MOVE_VIEWPORT:
repaint();
- break;
++ break;
+ default:
}
}
+ /**
+ * Clears the flag that allows a 'fast paint' on the next repaint, so
+ * requiring a full repaint
+ */
+ public void setNoFastPaint()
+ {
+ allowFastPaint = false;
+ }
++
+ private boolean manuallyAdjusted = false;
+
+ public boolean isManuallyAdjusted()
+ {
+ return manuallyAdjusted;
+ }
+
+ public void setManuallyAdjusted(boolean b)
+ {
+ manuallyAdjusted = b;
- }
++ }
+
}
*/
if (file == null && !Jalview.isHeadlessMode())
{
- if (Desktop.instance.isInBatchMode())
++ if (Desktop.getInstance().isInBatchMode())
+ {
+ // defensive error report - we could wait for user input.. I guess ?
+ throw (new ImageOutputException(
+ "Need an output file to render to when exporting images in batch mode!"));
+ }
JalviewFileChooser chooser = imageType.getFileChooser();
chooser.setFileView(new JalviewFileView());
MessageManager.formatMessage("label.create_image_of",
handleResponse(getMockResponse());
}
+ // need to set these separately so we can set the title bar icon later
+ this.setOptionType(yesNoCancelOption);
+ this.setMessageType(questionMessage);
+ this.setIcon(icon);
+ this.setInitialValue(initresponse);
+ this.setOptions(options);
+ this.setMessage(mainPanel);
+
ourOptions = Arrays.asList(options);
- int response;
- if (parentComponent != this)
+ if (parentComponent != this
- && !(parentComponent == null && Desktop.instance == null))
++ && !(parentComponent == null && Desktop.getInstance() == null))
{
- response = JOptionPane.showInternalOptionDialog(parentComponent,
- mainPanel, title, yesNoCancelOption, questionMessage, icon,
- options, initresponse);
+ // note the parent goes back to a JRootPane so is probably
+ // Desktop.getDesktop()
+ JInternalFrame jif = this.createInternalFrame(
- parentComponent != null ? parentComponent : Desktop.instance,
++ parentComponent != null ? parentComponent : Desktop.getInstance(),
+ title);
+ // connect to the alignFrame using a map in Desktop
+ if (parentComponent instanceof AlignFrame)
+ {
+ Desktop.addModal((AlignFrame) parentComponent, jif);
+ }
+ jif.setFrameIcon(null);
+ jif.addInternalFrameListener(new InternalFrameListener()
+ {
+ @Override
+ public void internalFrameActivated(InternalFrameEvent arg0)
+ {
+ }
+
+ @Override
+ public void internalFrameClosed(InternalFrameEvent arg0)
+ {
+ JvOptionPane.this.internalDialogHandleResponse();
+ }
+
+ @Override
+ public void internalFrameClosing(InternalFrameEvent arg0)
+ {
+ }
+
+ @Override
+ public void internalFrameDeactivated(InternalFrameEvent arg0)
+ {
+ }
+
+ @Override
+ public void internalFrameDeiconified(InternalFrameEvent arg0)
+ {
+ }
+
+ @Override
+ public void internalFrameIconified(InternalFrameEvent arg0)
+ {
+ }
+
+ @Override
+ public void internalFrameOpened(InternalFrameEvent arg0)
+ {
+ }
+ });
+ jif.setVisible(true);
+ startModal(jif);
+ return;
}
else
{
Runnable action = callbacks.get(response);
if (action != null)
{
- action.run();
- parentComponent.requestFocus();
+ try
+ {
+ new Thread(action).start();
+ // action.call();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+ if (parentComponent != null)
+ parentComponent.requestFocus();
}
}
+
+ /**
+ * Create a non-modal confirm dialog
+ */
+ public JDialog createDialog(Component parentComponent, Object message,
+ String title, int optionType, int messageType, Icon icon,
+ Object[] options, Object initialValue, boolean modal)
+ {
+ return createDialog(parentComponent, message, title, optionType,
+ messageType, icon, options, initialValue, modal, null);
+ }
+
+ public JDialog createDialog(Component parentComponent, Object message,
+ String title, int optionType, int messageType, Icon icon,
+ Object[] options, Object initialValue, boolean modal,
+ JButton[] buttons)
+ {
+ if (!isInteractiveMode())
+ {
+ handleResponse(getMockResponse());
+ return null;
+ }
+ JButton[] optionsButtons = null;
+ Object initialValueButton = null;
+ JOptionPane joptionpane = new JOptionPane();
+ // Make button options
+ int[] buttonActions = { JOptionPane.YES_OPTION, JOptionPane.NO_OPTION,
+ JOptionPane.CANCEL_OPTION };
+
+ // we need the strings to make the buttons with actionEventListener
+ if (options == null)
+ {
+ ArrayList<String> options_default = new ArrayList<>();
+ options_default.add(UIManager.getString("OptionPane.yesButtonText"));
+ if (optionType == JOptionPane.YES_NO_OPTION
+ || optionType == JOptionPane.YES_NO_CANCEL_OPTION)
+ {
+ options_default.add(UIManager.getString("OptionPane.noButtonText"));
+ }
+ if (optionType == JOptionPane.YES_NO_CANCEL_OPTION)
+ {
+ options_default
+ .add(UIManager.getString("OptionPane.cancelButtonText"));
+ }
+ options = options_default.toArray();
+ }
+ if (!Platform.isJS()) // JalviewJS already uses callback, don't need to
+ // add them here
+ {
+ if (((optionType == JOptionPane.YES_OPTION
+ || optionType == JOptionPane.NO_OPTION
+ || optionType == JOptionPane.CANCEL_OPTION
+ || optionType == JOptionPane.OK_OPTION
+ || optionType == JOptionPane.DEFAULT_OPTION)
+ && options.length < 1)
+ || ((optionType == JOptionPane.YES_NO_OPTION
+ || optionType == JOptionPane.OK_CANCEL_OPTION)
+ && options.length < 2)
+ || (optionType == JOptionPane.YES_NO_CANCEL_OPTION
+ && options.length < 3))
+ {
+ jalview.bin.Console
+ .debug("JvOptionPane: not enough options for dialog type");
+ }
+ optionsButtons = new JButton[options.length];
+ for (int i = 0; i < options.length && i < 3; i++)
+ {
+ Object o = options[i];
+ int buttonAction = buttonActions[i];
+ Runnable action = callbacks.get(buttonAction);
+ JButton jb;
+ if (buttons != null && buttons.length > i && buttons[i] != null)
+ {
+ jb = buttons[i];
+ }
+ else
+ {
+ jb = new JButton();
+ }
+ jb.setText((String) o);
+ jb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ joptionpane.setValue(buttonAction);
+ if (action != null)
+ new Thread(action).start();
+ // joptionpane.transferFocusBackward();
+ joptionpane.transferFocusBackward();
+ joptionpane.setVisible(false);
+ // put focus and raise parent window if possible, unless cancel
+ // button pressed
+ boolean raiseParent = (parentComponent != null);
+ if (buttonAction == JOptionPane.CANCEL_OPTION)
+ raiseParent = false;
+ if (optionType == JOptionPane.YES_NO_OPTION
+ && buttonAction == JOptionPane.NO_OPTION)
+ raiseParent = false;
+ if (raiseParent)
+ {
+ parentComponent.requestFocus();
+ if (parentComponent instanceof JInternalFrame)
+ {
+ JInternalFrame jif = (JInternalFrame) parentComponent;
+ jif.show();
+ jif.moveToFront();
+ jif.grabFocus();
+ }
+ else if (parentComponent instanceof Window)
+ {
+ Window w = (Window) parentComponent;
+ w.toFront();
+ w.requestFocus();
+ }
+ }
+ joptionpane.setVisible(false);
+ }
+ });
+ optionsButtons[i] = jb;
+ if (o.equals(initialValue))
+ initialValueButton = jb;
+ }
+ }
+ joptionpane.setMessage(message);
+ joptionpane.setMessageType(messageType);
+ joptionpane.setOptionType(optionType);
+ joptionpane.setIcon(icon);
+ joptionpane.setOptions(Platform.isJS() ? options : optionsButtons);
+ joptionpane.setInitialValue(
+ Platform.isJS() ? initialValue : initialValueButton);
+
+ JDialog dialog = joptionpane.createDialog(parentComponent, title);
+ dialog.setIconImages(ChannelProperties.getIconList());
+ dialog.setModalityType(
+ modal ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
+ dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
+ setDialog(dialog);
+ return dialog;
+ }
+
+ /**
+ * Utility to programmatically click a button on a JOptionPane (as a JFrame)
+ *
+ * returns true if button was found
+ */
+ public static boolean clickButton(JFrame frame, int buttonType)
+ {
+
+ return false;
+ }
+
+ /**
+ * This helper method makes the JInternalFrame wait until it is notified by an
+ * InternalFrameClosing event. This method also adds the given JOptionPane to
+ * the JInternalFrame and sizes it according to the JInternalFrame's preferred
+ * size.
+ *
+ * @param f
+ * The JInternalFrame to make modal.
+ */
+ private static void startModal(JInternalFrame f)
+ {
+ // We need to add an additional glasspane-like component directly
+ // below the frame, which intercepts all mouse events that are not
+ // directed at the frame itself.
+ JPanel modalInterceptor = new JPanel();
+ modalInterceptor.setOpaque(false);
+ JLayeredPane lp = JLayeredPane.getLayeredPaneAbove(f);
+ lp.setLayer(modalInterceptor, JLayeredPane.MODAL_LAYER.intValue());
+ modalInterceptor.setBounds(0, 0, lp.getWidth(), lp.getHeight());
+ modalInterceptor.addMouseListener(new MouseAdapter()
+ {
+ });
+ modalInterceptor.addMouseMotionListener(new MouseMotionAdapter()
+ {
+ });
+ lp.add(modalInterceptor);
+ f.toFront();
+
+ // disable the main menu bar if in Linux
+ JMenuBar menubar = null;
+ if (Platform.isLinux())
+ {
- JRootPane rootpane = Desktop.getDesktop().getRootPane();
++ JRootPane rootpane = Desktop.getInstance().getRootPane();
+ menubar = rootpane.getJMenuBar();
+ }
+
+ // We need to explicitly dispatch events when we are blocking the event
+ // dispatch thread.
+ EventQueue queue = Toolkit.getDefaultToolkit().getSystemEventQueue();
+ try
+ {
+ if (menubar != null)
+ {
+ // don't allow clicks on main menu on linux due to a hanging bug.
+ // see JAL-4214.
+ setMenusEnabled(menubar, false);
+ }
+
+ while (!f.isClosed())
+ {
+ if (EventQueue.isDispatchThread())
+ {
+ // The getNextEventMethod() issues wait() when no
+ // event is available, so we don't need do explicitly wait().
+ AWTEvent ev = queue.getNextEvent();
+ // This mimics EventQueue.dispatchEvent(). We can't use
+ // EventQueue.dispatchEvent() directly, because it is
+ // protected, unfortunately.
+ if (ev instanceof ActiveEvent)
+ {
+ ((ActiveEvent) ev).dispatch();
+ }
+ else if (ev instanceof KeyEvent && ((KeyEvent) ev).isControlDown()
+ && menubar != null)
+ {
+ // temporarily enable menus to send Ctrl+? KeyEvents
+ setMenusEnabled(menubar, true);
+ ((Component) ev.getSource()).dispatchEvent(ev);
+ setMenusEnabled(menubar, false);
+ }
+ else if (ev.getSource() instanceof MenuComponent)
+ {
+ ((MenuComponent) ev.getSource()).dispatchEvent(ev);
+ }
+ else if (ev.getSource() instanceof Component)
+ {
+ ((Component) ev.getSource()).dispatchEvent(ev);
+ }
+ // Other events are ignored as per spec in
+ // EventQueue.dispatchEvent
+ }
+ else
+ {
+ // Give other threads a chance to become active.
+ Thread.yield();
+ }
+ }
+ } catch (InterruptedException ex)
+ {
+ // If we get interrupted, then leave the modal state.
+ } finally
+ {
+ // re-enable the main menu bar
+ if (menubar != null)
+ {
+ setMenusEnabled(menubar, true);
+ }
+
+ // Clean up the modal interceptor.
+ lp.remove(modalInterceptor);
+
+ // unpaint the frame
+ f.setVisible(false);
+
+ // close the frame
+ try
+ {
+ f.setClosed(true);
+ } catch (PropertyVetoException e)
+ {
+ f.doDefaultCloseAction();
+ }
+
+ // Remove the internal frame from its parent, so it is no longer
+ // lurking around and clogging memory.
+ Container parent = f.getParent();
+ if (parent != null)
+ {
+ parent.remove(f);
+ }
+ }
+ }
+
+ public static JvOptionPane frameDialog(Object message, String title,
+ int messageType, String[] buttonsTextS, String defaultButtonS,
+ List<Runnable> handlers, boolean modal)
+ {
+ JFrame parent = new JFrame();
+ JvOptionPane jvop = JvOptionPane.newOptionDialog();
+ final String[] buttonsText;
+ final String defaultButton;
+ if (buttonsTextS == null)
+ {
+ String ok = MessageManager.getString("action.ok");
+ buttonsText = new String[] { ok };
+ defaultButton = ok;
+ }
+ else
+ {
+ buttonsText = buttonsTextS;
+ defaultButton = defaultButtonS;
+ }
+ JButton[] buttons = new JButton[buttonsText.length];
+ for (int i = 0; i < buttonsText.length; i++)
+ {
+ buttons[i] = new JButton();
+ buttons[i].setText(buttonsText[i]);
+ Console.debug("DISABLING BUTTON " + buttons[i].getText());
+ buttons[i].setEnabled(false);
+ buttons[i].setVisible(false);
+ }
+
+ int dialogType = -1;
+ if (buttonsText.length == 1)
+ {
+ dialogType = JOptionPane.OK_OPTION;
+ }
+ else if (buttonsText.length == 2)
+ {
+ dialogType = JOptionPane.YES_NO_OPTION;
+ }
+ else
+ {
+ dialogType = JOptionPane.YES_NO_CANCEL_OPTION;
+ }
+ jvop.setResponseHandler(JOptionPane.YES_OPTION,
+ (handlers != null && handlers.size() > 0) ? handlers.get(0)
+ : NULLCALLABLE);
+ if (dialogType == JOptionPane.YES_NO_OPTION
+ || dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
+ {
+ jvop.setResponseHandler(JOptionPane.NO_OPTION,
+ (handlers != null && handlers.size() > 1) ? handlers.get(1)
+ : NULLCALLABLE);
+ }
+ if (dialogType == JOptionPane.YES_NO_CANCEL_OPTION)
+ {
+ jvop.setResponseHandler(JOptionPane.CANCEL_OPTION,
+ (handlers != null && handlers.size() > 2) ? handlers.get(2)
+ : NULLCALLABLE);
+ }
+
+ final int dt = dialogType;
+ new Thread(() -> {
+ jvop.showDialog(message, title, dt, messageType, null, buttonsText,
+ defaultButton, modal, buttons);
+ }).start();
+
+ return jvop;
+ }
+
+ private static void setMenusEnabled(JMenuBar menubar, boolean b)
+ {
+ for (int i = 0; i < menubar.getMenuCount(); i++)
+ {
+ JMenu menu = menubar.getMenu(i);
+ menu.setEnabled(b);
+ }
+ }
+
}
import javax.swing.JPopupMenu;
import javax.swing.SwingUtilities;
-import jalview.renderer.OverviewRenderer;
-import jalview.util.MessageManager;
-import jalview.util.Platform;
-import jalview.viewmodel.OverviewDimensions;
-import jalview.viewmodel.OverviewDimensionsHideHidden;
-import jalview.viewmodel.OverviewDimensionsShowHidden;
-import jalview.viewmodel.ViewportListenerI;
+
/**
* Panel displaying an overview of the full alignment, with an interactive box
* representing the viewport onto the alignment.
protected boolean draggingBox = false;
+ private Dimension dim;
+
+ private boolean showProgress = !Platform.isJS();
protected ProgressPanel progressPanel;
-
++
/**
- * Creates a new OverviewPanel object.
- *
- * @param alPanel
- * The alignment panel which is shown in the overview panel
- * @param frame
- * @param isShowHidden
- * TODO
+ * Creates the appropriate type of OverviewDimensions, with the desired size
*/
- public OverviewPanel(AlignmentPanel alPanel, JInternalFrame frame,
- boolean isShowHidden)
+ private void createOverviewDimensions()
{
- this.av = alPanel.av;
- this.ap = alPanel;
- this.internalFrame = frame;
-
- showHidden = isShowHidden;
+ boolean showAnnotation = (av.isShowAnnotation()
+ && av.getAlignmentConservationAnnotation() != null);
if (showHidden)
{
- od = new OverviewDimensionsShowHidden(av.getRanges(),
- (av.isShowAnnotation()
- && av.getAlignmentConservationAnnotation() != null));
+ od = new OverviewDimensionsShowHidden(av.getRanges(), showAnnotation,
- dim);
++ getDims());
}
else
{
- od = new OverviewDimensionsHideHidden(av.getRanges(),
- (av.isShowAnnotation()
- && av.getAlignmentConservationAnnotation() != null));
+ od = new OverviewDimensionsHideHidden(av.getRanges(), showAnnotation,
- dim);
++ getDims());
}
+ }
- public OverviewPanel(AlignmentPanel alPanel, Dimension dim)
++ private Dimension getDims()
++ {
++ if (dim!=null)
++ {
++ return dim;
++ }
++ return internalFrame.getSize();
++ }
++ /**
++ *
++ * @param alPanel - parent alignPanel
++ * @param frame - may be null if dimensions is not
++ * @param dim - dimensions - may be null if frame is not
++ * @param isShowHidden - show or hide hidden regions in overview
++ */
++ public OverviewPanel(AlignmentPanel alPanel, JInternalFrame frame, Dimension dim,
++ boolean isShowHidden)
+ {
+ this.av = alPanel.av;
+ this.ap = alPanel;
+ this.dim = dim;
-
- showHidden = Cache.getDefault(Preferences.SHOW_OV_HIDDEN_AT_START,
- false);
- createOverviewDimensions();
++ this.internalFrame = frame;
++ this.showHidden = isShowHidden;
++
setLayout(new BorderLayout());
progressPanel = new ProgressPanel(OverviewRenderer.UPDATE,
MessageManager.getString("label.oview_calc"), getWidth());
oviewCanvas = null;
ap = null;
od = null;
+ internalFrame = null;
++ dim = null;
}
}
+
+ public boolean isShowHiddenRegions()
+ {
+ return showHidden;
+ }
+
+ public OverviewCanvas getCanvas()
+ {
+ return oviewCanvas;
+ }
+
+ /**
+ * Sets the title of the enclosing frame
+ *
+ * @param title
+ */
+ public void setTitle(String title)
+ {
- internalFrame.setTitle(title);
++ if (internalFrame != null)
++ internalFrame.setTitle(title);
+ }
+
+ /**
+ * Returns the title of the enclosing frame
+ *
+ * @return title
+ */
+ public String getTitle()
+ {
- return internalFrame.getTitle();
++ if (internalFrame != null)
++ return internalFrame.getTitle();
++ else return "WE DONtT HABVE A TITLE!"; // FIXME: store title!"
+ }
+
+ /**
+ * Sets the bounds of the frame holding the Overview panel
+ *
+ * @param xpos
+ * @param ypos
+ * @param width
+ * @param height
+ */
+ public void setFrameBounds(int xpos, int ypos, int width, int height)
+ {
- internalFrame.setBounds(xpos, ypos, width, height);
++ if (internalFrame != null)
++ internalFrame.setBounds(xpos, ypos, width, height);
+ }
+
+ /**
+ * Returns the bounds of the enclosing frame
+ *
+ * @return
+ */
+ public Rectangle getFrameBounds()
+ {
- return internalFrame.getBounds();
++ if (internalFrame != null)
++ return internalFrame.getBounds();
++ else return new Rectangle(0,0,dim.width, dim.height);
+ }
+
+ /**
+ * Closes the frame containing the overview panel
+ */
+ public void close()
+ {
- internalFrame.dispose();
++ if (internalFrame!=null)
++ internalFrame.dispose();
+ }
}
sequence.getDescription(),
MessageManager.getString("label.sequence_name"),
MessageManager.getString("label.sequence_description"));
- dialog.showDialog(ap.alignFrame,
- MessageManager.getString(
- "label.edit_sequence_name_description"),
- new Runnable()
- {
- @Override
- public void run()
+ dialog.showDialog(ap.alignFrame, MessageManager
+ .getString("label.edit_sequence_name_description"), () -> {
+ if (dialog.getName() != null)
{
- if (dialog.getName() != null)
+ if (dialog.getName().indexOf(" ") > -1)
{
- if (dialog.getName().indexOf(" ") > -1)
- {
- JvOptionPane.showMessageDialog(ap,
- MessageManager.getString(
- "label.spaces_converted_to_underscores"),
- MessageManager.getString(
- "label.no_spaces_allowed_sequence_name"),
- JvOptionPane.WARNING_MESSAGE);
- }
- sequence.setName(dialog.getName().replace(' ', '_'));
- ap.paintAlignment(false, false);
+ String ok = MessageManager.getString("action.ok");
+ String cancel = MessageManager.getString("action.cancel");
+ String message = MessageManager.getString(
+ "label.spaces_converted_to_underscores");
+ String title = MessageManager.getString(
+ "label.no_spaces_allowed_sequence_name");
+ Object[] options = new Object[] { ok, cancel };
+
+ JvOptionPane.frameDialog(message, title,
+ JvOptionPane.WARNING_MESSAGE, null, null, null,
+ false);
}
- sequence.setDescription(dialog.getDescription());
- ap.av.notifyAlignment();
+ sequence.setName(dialog.getName().replace(' ', '_'));
+ ap.paintAlignment(false, false);
}
+ sequence.setDescription(dialog.getDescription());
- ap.av.firePropertyChange("alignment", null,
- ap.av.getAlignment().getSequences());
++ ap.av.notifyAlignment();
});
}
private WsPreferences wsPrefs;
+ private SlivkaPreferences slivkaPrefs;
private OptionsParam promptEachTimeOpt = new OptionsParam(
MessageManager.getString("label.prompt_each_time"),
- "Prompt each time");
+ LineartOptions.PROMPT_EACH_TIME);
private OptionsParam lineArtOpt = new OptionsParam(
MessageManager.getString("label.lineart"), "Lineart");
maxColour.getBackground());
/*
+ * Save HMMER settings
+ */
+ Cache.setPropertyNoSave(HMMALIGN_TRIM_TERMINI,
+ Boolean.toString(hmmrTrimTermini.isSelected()));
+ Cache.setPropertyNoSave(HMMINFO_GLOBAL_BACKGROUND,
+ Boolean.toString(hmmerBackgroundUniprot.isSelected()));
+ Cache.setPropertyNoSave(HMMSEARCH_SEQCOUNT,
+ hmmerSequenceCount.getText());
+ Cache.setOrRemove(HMMER_PATH, hmmerPath.getText());
+ if (cygwinPath != null)
+ {
+ Cache.setOrRemove(CYGWIN_PATH, cygwinPath.getText());
+ }
- AlignFrame[] frames = Desktop.getAlignFrames();
++ AlignFrame[] frames = Desktop.getDesktopAlignFrames();
+ if (frames != null && frames.length > 0)
+ {
+ for (AlignFrame f : frames)
+ {
+ f.updateHMMERStatus();
+ }
+ }
+
+ hmmrTrimTermini.setSelected(Cache.getDefault(HMMALIGN_TRIM_TERMINI, false));
+ if (Cache.getDefault(HMMINFO_GLOBAL_BACKGROUND, false))
+ {
+ hmmerBackgroundUniprot.setSelected(true);
+ }
+ else
+ {
+ hmmerBackgroundAlignment.setSelected(true);
+ }
+ hmmerSequenceCount
+ .setText(Cache.getProperty(HMMSEARCH_SEQCOUNT));
+ hmmerPath.setText(Cache.getProperty(HMMER_PATH));
+
+ /*
* Save Overview settings
*/
- Cache.setColourProperty(GAP_COLOUR, gapColour.getBackground());
- Cache.setColourProperty(HIDDEN_COLOUR, hiddenColour.getBackground());
- Cache.applicationProperties.setProperty(USE_LEGACY_GAP,
+ Cache.setColourPropertyNoSave(GAP_COLOUR, gapColour.getBackground());
+ Cache.setColourPropertyNoSave(HIDDEN_COLOUR, hiddenColour.getBackground());
+ Cache.setPropertyNoSave(USE_LEGACY_GAP,
Boolean.toString(useLegacyGap.isSelected()));
- Cache.applicationProperties.setProperty(SHOW_OV_HIDDEN_AT_START,
+ Cache.setPropertyNoSave(SHOW_OV_HIDDEN_AT_START,
Boolean.toString(showHiddenAtStart.isSelected()));
/*
|| !newProxyType.equals(previousProxyType))
{
// force a re-lookup of ws if proxytype is custom or has changed
- wsPrefs.update++;
+ wsPrefs.refreshWs_actionPerformed(null);
}
previousProxyType = newProxyType;
-
+ Cache.enableSessionProperties();
}
- /**
+ public static void setAppletDefaults()
+ {
+
+ // http://www.jalview.org/old/v2_8/examples/appletParameters.html
+
+ // showConservation true or false Default is true.
+ // showQuality true or false Default is true.
+ // showConsensus true or false Default is true.
+ // showFeatureSettings true or false Shows the feature settings window when
+ // startin
+ // showTreeBootstraps true or false (default is true) show or hide branch
+ // bootstraps
+ // showTreeDistances true or false (default is true) show or hide branch
+ // lengths
+ // showUnlinkedTreeNodes true or false (default is false) indicate if
+ // unassociated nodes should be highlighted in the tree view
+ // showUnconserved true of false (default is false) When true, only gaps and
+ // symbols different to the consensus sequence ions of the alignment
+ // showGroupConsensus true of false (default is false) When true, shows
+ // consensus annotation row for any groups on the alignment. (since 2.7)
+ // showGroupConservation true of false (default is false) When true, shows
+ // amino-acid property conservation annotation row for any groups on the
+ // showConsensusHistogram true of false (default is true) When true, shows
+ // the percentage occurence of the consensus symbol for each column as a
+ // showSequenceLogo true of false (default is false) When true, shows a
+ // sequence logo above the consensus sequence (overlaid above the Consensus
+
+ Cache.setPropertyNoSave(SHOW_CONSERVATION, "true");
+ Cache.setPropertyNoSave(SHOW_QUALITY, "false");
+ Cache.setPropertyNoSave(SHOW_CONSENSUS, "true");
+ Cache.setPropertyNoSave(SHOW_UNCONSERVED, "false");
+ Cache.setPropertyNoSave(SHOW_GROUP_CONSERVATION, "false");
+ Cache.setPropertyNoSave(SHOW_GROUP_CONSENSUS, "false");
+
+ // TODO -- just a start here
+ }
+ /**
* Do any necessary validation before saving settings. Return focus to the
* first tab which fails validation.
*
final JPanel progressPanel = progressBars.get(id);
if (progressPanel == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
- "call setProgressBar before registering the progress bar's handler.");
+ "call setProgressBar before registering the progress bar's handler.");
return;
}
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.gui;
+
+ import java.io.File;
+ import java.util.List;
+ import java.util.Locale;
+ import java.util.concurrent.CompletableFuture;
+ import java.util.concurrent.ExecutionException;
+ import java.util.concurrent.ExecutorService;
+ import java.util.concurrent.Executors;
+ import java.util.concurrent.RejectedExecutionException;
+ import java.util.concurrent.TimeUnit;
+ import java.util.concurrent.TimeoutException;
+
+ import javax.swing.JButton;
+ import javax.swing.JFrame;
+ import javax.swing.JOptionPane;
+ import javax.swing.JTextPane;
+
+ import com.formdev.flatlaf.extras.FlatDesktop;
+ import com.formdev.flatlaf.extras.FlatDesktop.QuitResponse;
+
+ import jalview.api.AlignmentViewPanel;
+ import jalview.bin.Cache;
+ import jalview.bin.Console;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.SequenceI;
+ import jalview.io.BackupFiles;
+ import jalview.project.Jalview2XML;
+ import jalview.util.MessageManager;
+ import jalview.util.Platform;
+
+ public class QuitHandler
+ {
+ private static final int MIN_WAIT_FOR_SAVE = 1000;
+
+ private static final int MAX_WAIT_FOR_SAVE = 20000;
+
+ private static boolean interactive = true;
+
+ private static QuitResponse flatlafResponse = null;
+
+ public static enum QResponse
+ {
+ NULL, QUIT, CANCEL_QUIT, FORCE_QUIT
+ };
+
+ public static enum Message
+ {
+ UNSAVED_CHANGES, UNSAVED_ALIGNMENTS
+ };
+
+ protected static Message message = Message.UNSAVED_CHANGES;
+
+ public static void setMessage(Message m)
+ {
+ message = m;
+ }
+
+ private static ExecutorService executor = Executors.newFixedThreadPool(3);
+
+ public static void setQuitHandler()
+ {
+ FlatDesktop.setQuitHandler(response -> {
+ flatlafResponse = response;
- Desktop.instance.desktopQuit();
++ Desktop.getInstance().desktopQuit();
+ });
+ }
+
+ public static void startForceQuit()
+ {
+ setResponse(QResponse.FORCE_QUIT);
+ }
+
+ private static QResponse gotQuitResponse = QResponse.NULL;
+
+ protected static QResponse setResponse(QResponse qresponse)
+ {
+ gotQuitResponse = qresponse;
+ if ((qresponse == QResponse.CANCEL_QUIT || qresponse == QResponse.NULL)
+ && flatlafResponse != null)
+ {
+ flatlafResponse.cancelQuit();
+ }
+ return qresponse;
+ }
+
+ public static QResponse gotQuitResponse()
+ {
+ return gotQuitResponse;
+ }
+
+ public static final Runnable defaultCancelQuit = () -> {
+ Console.debug("QuitHandler: (default) Quit action CANCELLED by user");
+ // reset
+ setResponse(QResponse.CANCEL_QUIT);
+ };
+
+ public static final Runnable defaultOkQuit = () -> {
+ Console.debug("QuitHandler: (default) Quit action CONFIRMED by user");
+ setResponse(QResponse.QUIT);
+ };
+
+ public static final Runnable defaultForceQuit = () -> {
+ Console.debug("QuitHandler: (default) Quit action FORCED by user");
+ // note that shutdown hook will not be run
+ Runtime.getRuntime().halt(0);
+ setResponse(QResponse.FORCE_QUIT); // this line never reached!
+ };
+
+ public static QResponse getQuitResponse(boolean ui)
+ {
+ return getQuitResponse(ui, defaultOkQuit, defaultForceQuit,
+ defaultCancelQuit);
+ }
+
+ public static QResponse getQuitResponse(boolean ui, Runnable okQuit,
+ Runnable forceQuit, Runnable cancelQuit)
+ {
+ QResponse got = gotQuitResponse();
+ if (got != QResponse.NULL && got != QResponse.CANCEL_QUIT)
+ {
+ // quit has already been selected, continue with calling quit method
+ return got;
+ }
+
+ interactive = ui && !Platform.isHeadless();
+ // confirm quit if needed and wanted
+ boolean confirmQuit = true;
+
+ if (!interactive)
+ {
+ Console.debug("Non interactive quit -- not confirming");
+ confirmQuit = false;
+ }
+ else if (Jalview2XML.allSavedUpToDate())
+ {
+ Console.debug("Nothing changed -- not confirming quit");
+ confirmQuit = false;
+ }
+ else
+ {
+ confirmQuit = jalview.bin.Cache
+ .getDefault(jalview.gui.Desktop.CONFIRM_KEYBOARD_QUIT, true);
+ Console.debug("Jalview property '"
+ + jalview.gui.Desktop.CONFIRM_KEYBOARD_QUIT
+ + "' is/defaults to " + confirmQuit + " -- "
+ + (confirmQuit ? "" : "not ") + "confirming quit");
+ }
+ got = confirmQuit ? QResponse.NULL : QResponse.QUIT;
+ setResponse(got);
+
+ if (confirmQuit)
+ {
+ String messageString = MessageManager
+ .getString(message == Message.UNSAVED_ALIGNMENTS
+ ? "label.unsaved_alignments"
+ : "label.unsaved_changes");
+ setQuitDialog(JvOptionPane.newOptionDialog()
+ .setResponseHandler(JOptionPane.YES_OPTION, defaultOkQuit)
+ .setResponseHandler(JOptionPane.NO_OPTION, cancelQuit));
+ JvOptionPane qd = getQuitDialog();
+ qd.showDialogOnTopAsync(
+ new StringBuilder(
+ MessageManager.getString("label.quit_jalview"))
+ .append("\n").append(messageString)
+ .toString(),
+ MessageManager.getString("action.quit"),
+ JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE, null,
+ new Object[]
+ { MessageManager.getString("action.quit"),
+ MessageManager.getString("action.cancel") },
+ MessageManager.getString("action.quit"), true);
+ }
+
+ got = gotQuitResponse();
+
+ // check for external viewer frames
+ if (got != QResponse.CANCEL_QUIT)
+ {
- int count = Desktop.instance.structureViewersStillRunningCount();
++ int count = Desktop.getInstance().structureViewersStillRunningCount();
+ if (count > 0)
+ {
+ String alwaysCloseExternalViewers = Cache
+ .getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", "ask");
+ String prompt = MessageManager
+ .formatMessage(count == 1 ? "label.confirm_quit_viewer"
+ : "label.confirm_quit_viewers");
+ String title = MessageManager.getString(
+ count == 1 ? "label.close_viewer" : "label.close_viewers");
+ String cancelQuitText = MessageManager
+ .getString("action.cancel_quit");
+ String[] buttonsText = { MessageManager.getString("action.yes"),
+ MessageManager.getString("action.no"), cancelQuitText };
+
+ int confirmResponse = -1;
+ if (alwaysCloseExternalViewers == null || "ask".equals(
+ alwaysCloseExternalViewers.toLowerCase(Locale.ROOT)))
+ {
- confirmResponse = JvOptionPane.showOptionDialog(Desktop.instance,
++ confirmResponse = JvOptionPane.showOptionDialog(Desktop.getInstance(),
+ prompt, title, JvOptionPane.YES_NO_CANCEL_OPTION,
+ JvOptionPane.WARNING_MESSAGE, null, buttonsText,
+ cancelQuit);
+ }
+ else
+ {
+ confirmResponse = Cache
+ .getDefault("ALWAYS_CLOSE_EXTERNAL_VIEWERS", false)
+ ? JvOptionPane.YES_OPTION
+ : JvOptionPane.NO_OPTION;
+ }
+
+ if (confirmResponse == JvOptionPane.CANCEL_OPTION)
+ {
+ // Cancel Quit
+ QuitHandler.setResponse(QResponse.CANCEL_QUIT);
+ }
+ else
+ {
+ // Close viewers/Leave viewers open
+ StructureViewerBase
+ .setQuitClose(confirmResponse == JvOptionPane.YES_OPTION);
+ }
+ }
+
+ }
+
+ got = gotQuitResponse();
+
+ boolean wait = false;
+ if (got == QResponse.CANCEL_QUIT)
+ {
+ // reset
+ Console.debug("Cancelling quit. Resetting response to NULL");
+ setResponse(QResponse.NULL);
+ // but return cancel
+ return QResponse.CANCEL_QUIT;
+ }
+ else if (got == QResponse.QUIT)
+ {
+ if (Cache.getDefault("WAIT_FOR_SAVE", true)
+ && BackupFiles.hasSavesInProgress())
+ {
+ waitQuit(interactive, okQuit, forceQuit, cancelQuit);
+ QResponse waitResponse = gotQuitResponse();
+ wait = waitResponse == QResponse.QUIT;
+ }
+ }
+
+ Runnable next = null;
+ switch (gotQuitResponse())
+ {
+ case QUIT:
+ next = okQuit;
+ break;
+ case FORCE_QUIT: // not actually an option at this stage
+ next = forceQuit;
+ break;
+ default:
+ next = cancelQuit;
+ break;
+ }
+ try
+ {
+ executor.submit(next).get();
+ got = gotQuitResponse();
+ } catch (RejectedExecutionException e)
+ {
+ // QuitHander.abortQuit() probably called
+ // CANCEL_QUIT test will reset QuitHandler
+ Console.info("Quit aborted!");
+ got = QResponse.NULL;
+ setResponse(QResponse.NULL);
+ } catch (InterruptedException | ExecutionException e)
+ {
+ jalview.bin.Console
+ .debug("Exception during quit handling (final choice)", e);
+ }
+ setResponse(got);
+
+ if (quitCancelled())
+ {
+ // reset if cancelled
+ Console.debug("Quit cancelled");
+ setResponse(QResponse.NULL);
+ return QResponse.CANCEL_QUIT;
+ }
+ return gotQuitResponse();
+ }
+
+ private static QResponse waitQuit(boolean interactive, Runnable okQuit,
+ Runnable forceQuit, Runnable cancelQuit)
+ {
+ // check for saves in progress
+ if (!BackupFiles.hasSavesInProgress())
+ return QResponse.QUIT;
+
+ int size = 0;
+ AlignFrame[] afArray = Desktop.getDesktopAlignFrames();
+ if (!(afArray == null || afArray.length == 0))
+ {
+ for (int i = 0; i < afArray.length; i++)
+ {
+ AlignFrame af = afArray[i];
+ List<? extends AlignmentViewPanel> avpList = af.getAlignPanels();
+ for (AlignmentViewPanel avp : avpList)
+ {
+ AlignmentI a = avp.getAlignment();
+ List<SequenceI> sList = a.getSequences();
+ for (SequenceI s : sList)
+ {
+ size += s.getLength();
+ }
+ }
+ }
+ }
+ int waitTime = Math.min(MAX_WAIT_FOR_SAVE,
+ Math.max(MIN_WAIT_FOR_SAVE, size / 2));
+ Console.debug("Set waitForSave to " + waitTime);
+
+ int iteration = 0;
+ boolean doIterations = true; // note iterations not used in the gui now,
+ // only one pass without the "Wait" button
+ while (doIterations && BackupFiles.hasSavesInProgress()
+ && iteration++ < (interactive ? 100 : 5))
+ {
+ // future that returns a Boolean when all files are saved
+ CompletableFuture<Boolean> filesAllSaved = new CompletableFuture<>();
+
+ // callback as each file finishes saving
+ for (CompletableFuture<Boolean> cf : BackupFiles
+ .savesInProgressCompletableFutures(false))
+ {
+ // if this is the last one then complete filesAllSaved
+ cf.whenComplete((ret, e) -> {
+ if (!BackupFiles.hasSavesInProgress())
+ {
+ filesAllSaved.complete(true);
+ }
+ });
+ }
+ try
+ {
+ filesAllSaved.get(waitTime, TimeUnit.MILLISECONDS);
+ } catch (InterruptedException | ExecutionException e1)
+ {
+ Console.debug(
+ "Exception whilst waiting for files to save before quit",
+ e1);
+ } catch (TimeoutException e2)
+ {
+ // this Exception to be expected
+ }
+
+ if (interactive && BackupFiles.hasSavesInProgress())
+ {
+ boolean showForceQuit = iteration > 0; // iteration > 1 to not show
+ // force quit the first time
+ JFrame parent = new JFrame();
+ JButton[] buttons = { new JButton(), new JButton() };
+ JvOptionPane waitDialog = JvOptionPane.newOptionDialog();
+ JTextPane messagePane = new JTextPane();
+ messagePane.setBackground(waitDialog.getBackground());
+ messagePane.setBorder(null);
+ messagePane.setText(waitingForSaveMessage());
+ // callback as each file finishes saving
+ for (CompletableFuture<Boolean> cf : BackupFiles
+ .savesInProgressCompletableFutures(false))
+ {
+ cf.whenComplete((ret, e) -> {
+ if (BackupFiles.hasSavesInProgress())
+ {
+ // update the list of saving files as they save too
+ messagePane.setText(waitingForSaveMessage());
+ }
+ else
+ {
+ if (!(quitCancelled()))
+ {
+ for (int i = 0; i < buttons.length; i++)
+ {
+ Console.debug("DISABLING BUTTON " + buttons[i].getText());
+ buttons[i].setEnabled(false);
+ buttons[i].setVisible(false);
+ }
+ // if this is the last one then close the dialog
+ messagePane.setText(new StringBuilder()
+ .append(MessageManager.getString("label.all_saved"))
+ .append("\n")
+ .append(MessageManager
+ .getString("label.quitting_bye"))
+ .toString());
+ messagePane.setEditable(false);
+ try
+ {
+ Thread.sleep(1500);
+ } catch (InterruptedException e1)
+ {
+ }
+ parent.dispose();
+ }
+ }
+ });
+ }
+
+ String[] options;
+ int dialogType = -1;
+ if (showForceQuit)
+ {
+ options = new String[2];
+ options[0] = MessageManager.getString("action.force_quit");
+ options[1] = MessageManager.getString("action.cancel_quit");
+ dialogType = JOptionPane.YES_NO_OPTION;
+ waitDialog.setResponseHandler(JOptionPane.YES_OPTION, forceQuit)
+ .setResponseHandler(JOptionPane.NO_OPTION, cancelQuit);
+ }
+ else
+ {
+ options = new String[1];
+ options[0] = MessageManager.getString("action.cancel_quit");
+ dialogType = JOptionPane.YES_OPTION;
+ waitDialog.setResponseHandler(JOptionPane.YES_OPTION, cancelQuit);
+ }
+ waitDialog.showDialogOnTopAsync(parent, messagePane,
+ MessageManager.getString("label.wait_for_save"), dialogType,
+ JOptionPane.WARNING_MESSAGE, null, options,
+ MessageManager.getString("action.cancel_quit"), true,
+ buttons);
+
+ parent.dispose();
+ final QResponse thisWaitResponse = gotQuitResponse();
+ switch (thisWaitResponse)
+ {
+ case QUIT: // wait -- do another iteration
+ break;
+ case FORCE_QUIT:
+ doIterations = false;
+ break;
+ case CANCEL_QUIT:
+ doIterations = false;
+ break;
+ case NULL: // already cancelled
+ doIterations = false;
+ break;
+ default:
+ }
+ } // end if interactive
+
+ } // end while wait iteration loop
+ return gotQuitResponse();
+ };
+
+ private static String waitingForSaveMessage()
+ {
+ StringBuilder messageSB = new StringBuilder();
+
+ messageSB.append(MessageManager.getString("label.save_in_progress"));
+ List<File> files = BackupFiles.savesInProgressFiles(false);
+ boolean any = files.size() > 0;
+ if (any)
+ {
+ for (File file : files)
+ {
+ messageSB.append("\n\u2022 ").append(file.getName());
+ }
+ }
+ else
+ {
+ messageSB.append(MessageManager.getString("label.unknown"));
+ }
+ messageSB.append("\n\n")
+ .append(MessageManager.getString("label.quit_after_saving"));
+ return messageSB.toString();
+ }
+
+ public static void abortQuit()
+ {
+ setResponse(QResponse.NULL);
+ // executor.shutdownNow();
+ }
+
+ private static JvOptionPane quitDialog = null;
+
+ private static void setQuitDialog(JvOptionPane qd)
+ {
+ quitDialog = qd;
+ }
+
+ private static JvOptionPane getQuitDialog()
+ {
+ return quitDialog;
+ }
+
+ public static boolean quitCancelled()
+ {
+ return QuitHandler.gotQuitResponse() == QResponse.CANCEL_QUIT
+ || QuitHandler.gotQuitResponse() == QResponse.NULL;
+ }
+
+ public static boolean quitting()
+ {
+ return QuitHandler.gotQuitResponse() == QResponse.QUIT
+ || QuitHandler.gotQuitResponse() == QResponse.FORCE_QUIT;
+ }
+ }
import javax.swing.JPanel;
+ import jalview.api.SequenceRenderer;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.HiddenColumns;
+ import jalview.datamodel.SearchResultsI;
+ import jalview.datamodel.SequenceGroup;
+ import jalview.datamodel.SequenceI;
+ import jalview.datamodel.VisibleContigsIterator;
+ import jalview.renderer.ScaleRenderer;
+ import jalview.renderer.ScaleRenderer.ScaleMark;
+ import jalview.util.Comparison;
+ import jalview.viewmodel.ViewportListenerI;
+ import jalview.viewmodel.ViewportRanges;
+
++
/**
* The Swing component on which the alignment sequences, and annotations (if
* shown), are drawn. This includes scales above, left and right (if shown) in
}
}
+
- // System.err.println(">>> FastPaint to " + transX + " " + transY + " "
+ // jalview.bin.Console.errPrintln(">>> FastPaint to " + transX + " " +
+ // transY + " "
// + horizontal + " " + vertical + " " + startRes + " " + endRes
// + " " + startSeq + " " + endSeq);
img.getWidth(), img.getHeight(), -horizontal * charWidth,
-vertical * charHeight);
- /** @j2sNative xxi = this.img */
gg.translate(transX, transY);
- drawPanel(gg, startRes, endRes, startSeq, endSeq, 0);
+ drawPanel(seqRdr, gg, startRes, endRes, startSeq, endSeq, 0);
gg.translate(-transX, -transY);
gg.dispose();
if (av.getWrapAlignment())
{
- drawWrappedPanel(gg, availWidth, availHeight, ranges.getStartRes());
- drawWrappedPanel(seqRdr, gg, getWidth(), getHeight(),
++ drawWrappedPanel(seqRdr, gg, availWidth, availHeight,
+ ranges.getStartRes());
}
else
{
/**
* Draws as many widths of a wrapped alignment as can fit in the visible
* window
-- *
++ * NB: may be race conditions if canvasWidth/Height are different to availWidth/height (which became default internal in 2.12, but 2.11 changes conflicted)
* @param g
- * @param availWidth
+ * @param canvasWidth
* available width in pixels
- * @param availHeight
+ * @param canvasHeight
* available height in pixels
* @param startColumn
* the first column (0...) of the alignment to draw
*/
- public void drawWrappedPanel(Graphics g, int availWidth, int availHeight,
- final int startColumn)
+ public void drawWrappedPanel(SequenceRenderer seqRdr, Graphics g,
+ int canvasWidth, int canvasHeight, final int startColumn)
{
- int wrappedWidthInResidues = calculateWrappedGeometry();
- int wrappedWidthInResidues = calculateWrappedGeometry(canvasWidth,
- canvasHeight);
++ int wrappedWidthInResidues = calculateWrappedGeometry(canvasWidth,canvasHeight);
av.setWrappedWidth(wrappedWidthInResidues);
// we need to call this again to make sure the startColumn +
// wrappedWidthInResidues values are used to calculate wrappedVisibleWidths
// correctly.
- calculateWrappedGeometry();
- calculateWrappedGeometry(canvasWidth, canvasHeight);
++ calculateWrappedGeometry(canvasWidth,canvasHeight);
/*
* draw one width at a time (excluding any scales shown),
* <li>whether scales are shown left, right or above the alignment</li>
* </ul>
*
- * @param availWidth
- * @param availHeight
++ * Recomputes availWidth and availHeight
+ * @return the number of residue columns in each width
+ */
+ protected int calculateWrappedGeometry()
+ {
+ getAvailSizes();
+ return calculateWrappedGeometry(availWidth, availHeight);
+
+ }
+
+ /**
+ * for test only
* @param canvasWidth
* @param canvasHeight
- * @return the number of residue columns in each width
+ * @return
*/
- protected int calculateWrappedGeometry(int canvasWidth, int canvasHeight)
+ public int calculateWrappedGeometry(int canvasWidth, int canvasHeight)
{
int charHeight = av.getCharHeight();
// group
if (sx + xwidth < visWidth)
{
- g.drawLine(sx + xwidth, oldY, sx + xwidth, sy);
+ g.drawLine(sx + xwidth, oldY, sx + xwidth, sy - 1);
}
}
-
/**
* Highlights search results in the visible region by rendering as white text
* on a black background. Any previous highlighting is removed. Answers true
public void propertyChange(PropertyChangeEvent evt)
{
String eventName = evt.getPropertyName();
++
+ // jalview.bin.Console.errPrintln(">>SeqCanvas propertyChange " +
+ // eventName);
- if (eventName.equals(SequenceGroup.SEQ_GROUP_CHANGED))
++
+ // BH 2019.07.27 removes dead code introduced in aad3650 and simplifies
+ // logic, emphasizing no check for ENDRES or ENDSEQ
+
+ // Both scrolling and resizing change viewport ranges: scrolling changes
+ // both start and end points, but resize only changes end values.
+ // Here we only want to fastpaint on a scroll, with resize using a normal
+ // paint, so scroll events are identified as changes to the horizontal or
+ // vertical start value.
+
+ // Make sure we're not trying to draw a panel
+ // larger than the visible window
+ int scrollX = 0;
+ int scrollY = 0;
+ switch (eventName)
{
+ case SequenceGroup.SEQ_GROUP_CHANGED:
fastPaint = true;
repaint();
return;
- }
- else if (eventName.equals(ViewportRanges.MOVE_VIEWPORT))
- {
+ case ViewportRanges.MOVE_VIEWPORT:
fastPaint = false;
+ // jalview.bin.Console.errPrintln("!!!! fastPaint false from
+ // MOVE_VIEWPORT");
repaint();
return;
- }
-
- int scrollX = 0;
- if (eventName.equals(ViewportRanges.STARTRES)
- || eventName.equals(ViewportRanges.STARTRESANDSEQ))
- {
- // Make sure we're not trying to draw a panel
- // larger than the visible window
- if (eventName.equals(ViewportRanges.STARTRES))
- {
- scrollX = (int) evt.getNewValue() - (int) evt.getOldValue();
- }
- else
+ case ViewportRanges.STARTSEQ:
+ // meaning STARTOREND
+ // typically scroll, but possibly just the end changed
+ fastPaint(0, (int) evt.getNewValue() - (int) evt.getOldValue());
+ return;
+ case ViewportRanges.STARTRES:
+ // meaning STARTOREND
+ scrollX = (int) evt.getNewValue() - (int) evt.getOldValue();
+ break;
+ case ViewportRanges.STARTRESANDSEQ:
+ scrollX = ((int[]) evt.getNewValue())[0]
+ - ((int[]) evt.getOldValue())[0];
+ scrollY = ((int[]) evt.getNewValue())[1]
+ - ((int[]) evt.getOldValue())[1];
+ if (scrollX != 0 && scrollY != 0)
{
- scrollX = ((int[]) evt.getNewValue())[0]
- - ((int[]) evt.getOldValue())[0];
- }
- ViewportRanges vpRanges = av.getRanges();
+ // all sorts of problems in JavaScript if this is commented out.
+ repaint();
+ return;
- int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1;
- if (scrollX > range)
- {
- scrollX = range;
- }
- else if (scrollX < -range)
- {
- scrollX = -range;
}
+ break;
+ default:
+ return;
+ }
+
+ ViewportRanges vpRanges = av.getRanges();
+ int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1;
+ scrollX = Math.max(Math.min(scrollX, range), -range);
+ // only STARTRES or STARTRESANDSEQ:
+ if (av.getWrapAlignment())
+ {
+ fastPaintWrapped(scrollX);
}
+ else
+ {
+ fastPaint(scrollX, scrollY);
+ }
+
+ // BH 2019.07.27 was:
+ // if (eventName.equals(SequenceGroup.SEQ_GROUP_CHANGED))
+ // {
+ // fastPaint = true;
+ // repaint();
+ // return;
+ // }
+ // else if (eventName.equals(ViewportRanges.MOVE_VIEWPORT))
+ // {
+ // fastPaint = false;
+ // // System.err.println("!!!! fastPaint false from MOVE_VIEWPORT");
+ // repaint();
+ // return;
+ // }
+ //
+ // if (eventName.equals(ViewportRanges.STARTRES)
+ // || eventName.equals(ViewportRanges.STARTRESANDSEQ))
+ // {
+ // // Make sure we're not trying to draw a panel
+ // // larger than the visible window
+ // if (eventName.equals(ViewportRanges.STARTRES))
+ // {
+ // scrollX = (int) evt.getNewValue() - (int) evt.getOldValue();
+ // }
+ // else
+ // {
+ // scrollX = ((int[]) evt.getNewValue())[0]
+ // - ((int[]) evt.getOldValue())[0];
+ // }
+ // ViewportRanges vpRanges = av.getRanges();
+ //
+ // int range = vpRanges.getEndRes() - vpRanges.getStartRes() + 1;
+ // if (scrollX > range)
+ // {
+ // scrollX = range;
+ // }
+ // else if (scrollX < -range)
+ // {
+ // scrollX = -range;
+ // }
+ // }
// Both scrolling and resizing change viewport ranges: scrolling changes
// both start and end points, but resize only changes end values.
// Here we only want to fastpaint on a scroll, with resize using a normal
AlignmentAnnotation[] anns = av.getAlignment().getAlignmentAnnotation();
String tooltip = AnnotationPanel.buildToolTip(anns[rowIndex], column,
- anns);
+ anns, 0, av, ap);
- if (tooltip == null ? tooltip != lastTooltip
- : !tooltip.equals(lastTooltip))
+ boolean tooltipChanged = tooltip == null ? lastTooltip != null : !tooltip.equals(lastTooltip);
+ if (tooltipChanged)
{
lastTooltip = tooltip;
lastFormattedTooltip = tooltip == null ? null
frame = new JInternalFrame();
frame.setContentPane(this);
+ frame.setFrameIcon(null);
- Desktop.addInternalFrame(frame, getFrameTitle(), true, 400,
- Platform.isAMacAndNotJS() ? 240 : 180);
+ Desktop.addInternalFrame(frame, getFrameTitle(), Desktop.FRAME_MAKE_VISIBLE, 400,
+ Platform.isAMacAndNotJS() ? 240 : 180, Desktop.FRAME_ALLOW_RESIZE, Desktop.FRAME_SET_MIN_SIZE_300);
}
private String getFrameTitle()
/**
* Constructor that displays the splash screen
*
- * @param isTransient
+ * @param isStartup
* if true the panel removes itself on click or after a few seconds;
- * if false it stays up until closed by the user
+ * if false it stays up until closed by the user (from Help..About menu)
*/
- public SplashScreen(boolean isTransient)
+ public SplashScreen(boolean isStartup)
{
- this.transientDialog = isTransient;
- if (this.transientDialog)
- {
- Desktop.instance.acquireDialogQueue();
- }
+ this.transientDialog = isStartup;
+
- if (Platform.isJS()) // BH 2019
++ if (isStartup)
+ {
- splashText = new JLabel("");
- run();
- }
- else
- {
- /**
- * Java only
- *
- * @j2sIgnore
- */
- {
- splashText = new JTextPane();
- splashText.setBackground(bg);
- splashText.setForeground(fg);
- splashText.setFont(font);
- Thread t = new Thread(this);
- t.start();
- }
++ Desktop.getInstance().acquireDialogQueue();
+ }
++
+ // we must get the image in JavaScript BEFORE starting the helper,
+ // as it will take a 1 ms clock tick to obtain width and height information.
+ image = ChannelProperties.getImage("banner");
+ logo = ChannelProperties.getImage("logo.48");
+ font = new Font("SansSerif", Font.PLAIN, FONT_SIZE);
+ helper = new StateHelper(this);
+ helper.next(STATE_INIT);
}
- /**
- * ping the jalview version page then create and display the jalview
- * splashscreen window.
- */
- void initSplashScreenWindow()
+ protected void initSplashScreenWindow()
{
addMouseListener(closer);
-
- try
- {
- if (!Platform.isJS())
- {
- image = ChannelProperties.getImage("banner");
- Image logo = ChannelProperties.getImage("logo.48");
- MediaTracker mt = new MediaTracker(this);
- if (image != null)
- {
- mt.addImage(image, 0);
- }
- if (logo != null)
- {
- mt.addImage(logo, 1);
- }
- do
- {
- try
- {
- mt.waitForAll();
- } catch (InterruptedException x)
- {
- }
- if (mt.isErrorAny())
- {
- jalview.bin.Console.errPrintln("Error when loading images!");
- }
- } while (!mt.checkAll());
- Desktop.instance.setIconImages(ChannelProperties.getIconList());
- }
- } catch (Exception ex)
- {
- }
-
- this.setBackground(bg);
- this.setForeground(fg);
- this.setFont(font);
-
+ waitForImages();
+ setLayout(new BorderLayout());
iframe = new JInternalFrame();
iframe.setFrameIcon(null);
iframe.setClosable(true);
}
/**
- * update text in author text panel reflecting current version information
+ * Both Java and JavaScript have to wait for images, but this method will
+ * accomplish nothing for JavaScript. We have already taken care of image
+ * loading with our state loop in JavaScript.
+ *
*/
- protected boolean refreshText()
+ private void waitForImages()
{
- String newtext = Desktop.instance.getAboutMessage();
- // jalview.bin.Console.errPrintln("Text found: \n"+newtext+"\nEnd of
- // newtext.");
- if (oldTextLength != newtext.length())
+ if (Platform.isJS())
+ return;
+ MediaTracker mt = new MediaTracker(this);
+ mt.addImage(image, 0);
+ mt.addImage(logo, 1);
+ do
{
- iframe.setVisible(false);
- oldTextLength = newtext.length();
- if (Platform.isJS()) // BH 2019
+ try
+ {
+ mt.waitForAll();
+ } catch (InterruptedException x)
{
- /*
- * SwingJS doesn't have HTMLEditorKit, required for a JTextPane
- * to display formatted html, so we use a simple alternative
- */
- String text = "<html><br><img src=\""
- + ChannelProperties.getImageURL("banner") + "\"/>" + newtext
- + "<br></html>";
- JLabel ta = new JLabel(text);
- ta.setOpaque(true);
- ta.setBackground(Color.white);
- splashText = ta;
}
- else
- /**
- * Java only
- *
- * @j2sIgnore
- */
+ if (mt.isErrorAny())
{
- System.err.println("Error when loading images!");
- JTextPane jtp = new JTextPane();
- jtp.setEditable(false);
- jtp.setBackground(bg);
- jtp.setForeground(fg);
- jtp.setFont(font);
- jtp.setContentType("text/html");
- jtp.setText("<html>" + newtext + "</html>");
- jtp.addHyperlinkListener(this);
- splashText = jtp;
++ jalview.bin.Console.errPrintln("Error when loading images!");
+ break;
}
- splashText.addMouseListener(closer);
-
- splashText.setVisible(true);
- splashText.setSize(new Dimension(750,
- 425 + logoSize + (Platform.isJS() ? 40 : 0)));
- splashText.setBackground(bg);
- splashText.setForeground(fg);
- splashText.setFont(font);
- add(splashText, BorderLayout.CENTER);
- revalidate();
- int width = Math.max(splashText.getWidth(), iconimg.getWidth());
- int height = splashText.getHeight() + iconimg.getHeight();
- iframe.setBounds(
- Math.max(0, (Desktop.instance.getWidth() - width) / 2),
- Math.max(0, (Desktop.instance.getHeight() - height) / 2),
- width, height);
- iframe.validate();
- iframe.setVisible(true);
- return true;
+ } while (!mt.checkAll());
- if (logo != null)
++ if (logo != null) // still need to check if logo != null ? don't do this in 2.12, but do in 2.11
+ {
- Desktop.getInstance().setIconImage(logo);
++ Desktop.getInstance().setIconImages(ChannelProperties.getIconList());
}
- return false;
+
+ this.setBackground(bg);
+ this.setForeground(fg);
+ this.setFont(font);
}
/**
- * Create splash screen, display it and clear it off again.
+ * update text in author text panel reflecting current version information
*/
- @Override
- public void run()
+ protected boolean refreshText()
{
- initSplashScreenWindow();
-
- long startTime = System.currentTimeMillis() / 1000;
-
- while (visible)
+ String newtext = Desktop.getInstance().getAboutMessage();
- // System.err.println("Text found: \n"+newtext+"\nEnd of newtext.");
++ // jalview.bin.Console.errPrintln("Text found: \n"+newtext+"\nEnd of newtext.");
+ if (oldTextLength == newtext.length())
{
- iframe.repaint();
- try
- {
- Thread.sleep(500);
- } catch (Exception ex)
- {
- }
-
- if (transientDialog && ((System.currentTimeMillis() / 1000)
- - startTime) > SHOW_FOR_SECS)
- {
- visible = false;
- }
-
- if (visible && refreshText())
- {
- iframe.repaint();
- }
- if (!transientDialog)
- {
- return;
- }
+ return false;
}
+
+ iframe.setVisible(false);
+ oldTextLength = newtext.length();
+ if (Platform.isJS()) // BH 2019
+ {
+ /*
+ * SwingJS doesn't have HTMLEditorKit, required for a JTextPane
+ * to display formatted html, so we use a simple alternative
+ */
+ String text = "<html><br><img src=\""
+ + ChannelProperties.getImageURL("banner") + "\"/>" + newtext
+ + "<br></html>";
+ JLabel ta = new JLabel(text);
+ ta.setOpaque(true);
+ ta.setBackground(Color.white);
+ splashText = ta;
+ }
+ else
+ /**
+ * Java only
+ *
+ * @j2sIgnore
+ */
+ {
+ JTextPane jtp = new JTextPane();
+ jtp.setEditable(false);
+ jtp.setBackground(bg);
+ jtp.setForeground(fg);
+ jtp.setFont(font);
+ jtp.setContentType("text/html");
+ jtp.setText("<html>" + newtext + "</html>");
+ jtp.addHyperlinkListener(this);
+ splashText = jtp;
+ }
+ splashText.addMouseListener(closer);
- closeSplash();
+ splashText.setVisible(true);
+ splashText.setSize(new Dimension(750,
+ 375 + logoSize + (Platform.isJS() ? 40 : 0)));
+ splashText.setBackground(bg);
+ splashText.setForeground(fg);
+ splashText.setFont(font);
+ add(splashText, BorderLayout.CENTER);
+ revalidate();
+ int width = Math.max(splashText.getWidth(), iconimg.getWidth());
+ int height = splashText.getHeight() + iconimg.getHeight();
+ iframe.setBounds((iframe.getParent().getWidth() - width) / 2,
+ (iframe.getParent().getHeight() - height) / 2,
+ width,height);
+ iframe.validate();
+ iframe.setVisible(true);
+ return true;
}
- /**
- * DOCUMENT ME!
- */
- public void closeSplash()
+ protected void closeSplash()
{
+ if (this.transientDialog)
+ {
- Desktop.instance.releaseDialogQueue();
++ Desktop.getInstance().releaseDialogQueue();
+ }
try
{
-
- iframe.setClosed(true);
+ final JInternalFrame frme = iframe;
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ try
+ {
+ frme.setClosed(true);
+ } catch (Exception ex)
+ {
+ }
+ }
+ });
} catch (Exception ex)
{
}
}
- public class SplashImage extends JPanel
+ /**
+ * A simple state machine with just three states: init, loop, and done. Ideal
+ * for a simple while/sleep loop that works in Java and JavaScript
+ * identically.
+ *
+ */
+ @Override
+ public boolean stateLoop()
+ {
+ while (true)
+ {
+ switch (helper.getState())
+ {
+ case STATE_INIT:
+ initSplashScreenWindow();
+ helper.setState(STATE_LOOP);
+ continue;
+ case STATE_LOOP:
+ if (!isVisible())
+ {
+ helper.setState(STATE_DONE);
+ continue;
+ }
+ if (refreshText())
+ {
+ iframe.repaint();
+ }
+ if (transientDialog)
+ helper.delayedState(SHOW_FOR_SECS * 1000, STATE_DONE);
+ return true;
+ default:
+ case STATE_DONE:
+ setVisible(false);
+ closeSplash();
- Desktop.getInstance().startDialogQueue();
++ Desktop.getInstance().releaseDialogQueue(); // should this be releaseDialogQueue ?
+ return true;
+ }
+ }
+
+ }
+
+ private class SplashImage extends JPanel
{
Image image;
List<SequenceI> seqsWithoutSourceDBRef = null;
+ private boolean showChooserGUI = true;
+
+ /**
+ * when true, queries to external services are supressed (no SIFTs, no PDBe,
+ * no 3D-Beacons, etc)
+ */
+ private boolean dontQueryServices = false;
-
- private static StructureViewer lastTargetedView = null;
++ /**
++ * TODO: should be threadsafe singleton
++ */
+ protected static StructureViewer lastTargetedView = null;
public StructureChooser(SequenceI[] selectedSeqs, SequenceI selectedSeq,
AlignmentPanel ap)
notQueriedTDBYet = false;
// new thread to discover structures - via 3d beacons
Executors.defaultThreadFactory().newThread(strucDiscovery).start();
-
+
}
};
-
+
// fetch db refs if OK pressed
- final Runnable discoverCanonicalDBrefs = new Runnable()
- {
- @Override
- public void run()
- {
- btn_queryTDB.setEnabled(false);
- populateSeqsWithoutSourceDBRef();
+ final Runnable discoverCanonicalDBrefs = () -> {
+ btn_queryTDB.setEnabled(false);
+ populateSeqsWithoutSourceDBRef();
- final int y = seqsWithoutSourceDBRef.size();
- if (y > 0)
- {
- final SequenceI[] seqWithoutSrcDBRef = seqsWithoutSourceDBRef
- .toArray(new SequenceI[y]);
- DBRefFetcher dbRefFetcher = new DBRefFetcher(seqWithoutSrcDBRef,
- progressBar, new DbSourceProxy[]
- { new jalview.ws.dbsources.Uniprot() }, null, false);
- dbRefFetcher.addListener(afterDbRefFetch);
- // ideally this would also gracefully run with callbacks
- dbRefFetcher.fetchDBRefs(true);
- }
- else
- {
- // call finished action directly
- afterDbRefFetch.finished();
- }
+ final int y = seqsWithoutSourceDBRef.size();
+ if (y > 0)
+ {
+ final SequenceI[] seqWithoutSrcDBRef = seqsWithoutSourceDBRef
+ .toArray(new SequenceI[y]);
+ DBRefFetcher dbRefFetcher = new DBRefFetcher(seqWithoutSrcDBRef,
+ progressBar, new DbSourceProxy[]
+ { new jalview.ws.dbsources.Uniprot() }, null, false);
+ dbRefFetcher.addListener(afterDbRefFetch);
+ // ideally this would also gracefully run with callbacks
+
+ dbRefFetcher.fetchDBRefs(true);
+ }
+ else
+ {
+ // call finished action directly
+ afterDbRefFetch.finished();
}
-
};
- final Runnable revertview = new Runnable()
- {
- @Override
- public void run()
+ final Runnable revertview = () -> {
+ if (lastSelected != null)
{
- if (lastSelected != null)
- {
- cmb_filterOption.setSelectedItem(lastSelected);
- }
- };
+ cmb_filterOption.setSelectedItem(lastSelected);
+ }
};
int threshold = Cache.getDefault("UNIPROT_AUTOFETCH_THRESHOLD",
THRESHOLD_WARN_UNIPROT_FETCH_NEEDED);
Console.debug("Using Uniprot fetch threshold of " + threshold);
if (ignoreGui || seqsWithoutSourceDBRef.size() < threshold)
{
- Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs).start();
++ // FIXME: in 2.12 Executors.defaultThreadFactory().newThread(discoverCanonicalDBrefs).start();
+ Executors.newSingleThreadExecutor().submit(discoverCanonicalDBrefs);
return;
}
// need cancel and no to result in the discoverPDB action - mocked is
{
final StructureSelectionManager ssm = ap.getStructureSelectionManager();
-
+ final StructureViewer theViewer = getTargetedStructureViewer(ssm);
+ boolean superimpose = chk_superpose.isSelected();
final int preferredHeight = pnl_filter.getHeight();
+ btn_add.setEnabled(false);
+ btn_newView.setEnabled(false);
+ btn_cancel.setEnabled(false);
+ actionsPanel.setEnabled(false);
+ final String progress = MessageManager
+ .getString("label.working_ellipsis");
+ setProgressBar(progress, progress.hashCode());
Runnable viewStruc = new Runnable()
{
@Override
@Override
public void setProgressBar(String message, long id)
{
- progressBar.setProgressBar(message, id);
+ if (!Platform.isHeadless() && progressBar != null)
+ progressBar.setProgressBar(message, id);
}
+
+ @Override
+ public void addProgressBar(long id, String message)
+ {
+ progressBar.addProgressBar(id, message);
+ }
+
+ @Override
+ public void removeProgressBar(long id)
+ {
+ progressBar.removeProgressBar(id);
+ }
@Override
public void registerHandler(long id, IProgressIndicatorHandler handler)
{
return notQueriedTDBYet;
}
+
+ /**
+ * Open a single structure file for a given sequence
+ */
+ public static void openStructureFileForSequence(
+ StructureSelectionManager ssm, StructureChooser sc,
+ AlignmentPanel ap, SequenceI seq, boolean prompt,
+ String sFilename, TFType tft, String paeFilename,
+ boolean doXferSettings)
+ {
+ openStructureFileForSequence(ssm, sc, ap, seq, prompt, sFilename, tft,
+ paeFilename, false, true, doXferSettings, null);
+ }
+
+ public static StructureViewer openStructureFileForSequence(
+ StructureSelectionManager ssm, StructureChooser sc,
+ AlignmentPanel ap, SequenceI seq, boolean prompt,
+ String sFilename, TFType tft, String paeFilename,
+ boolean forceHeadless, boolean showRefAnnotations,
+ boolean doXferSettings, ViewerType viewerType)
+ {
+ StructureViewer sv = null;
+ boolean headless = forceHeadless;
+ if (sc == null)
+ {
+ // headless = true;
+ prompt = false;
+ // suppress structure viewer's external service queries
+ sc = new StructureChooser(new SequenceI[] { seq }, seq, ap, false,
+ true);
+ }
+ if (ssm == null)
+ {
+ ssm = ap.getStructureSelectionManager();
+ StructureSelectionManager.doConfigureStructurePrefs(ssm);
+ }
+
- PDBEntry fileEntry = new AssociatePdbFileWithSeq().associatePdbWithSeq(
- sFilename, DataSourceType.FILE, seq, prompt, Desktop.instance,
++ PDBEntry fileEntry = AssociatePdbFileWithSeq.associatePdbWithSeq(
++ sFilename, DataSourceType.FILE, seq, prompt, Desktop.getInstance(),
+ tft, paeFilename, doXferSettings);
+
+ // if headless, "false" in the sc constructor above will avoid GUI behaviour
+ // in sc.launchStructureViewer()
+ if (!headless && !(viewerType == null))
+ {
+ sv = sc.launchStructureViewer(ssm, new PDBEntry[] { fileEntry }, ap,
+ new SequenceI[]
+ { seq }, viewerType);
+ }
+
+ sc.mainFrame.dispose();
+
+ if (showRefAnnotations)
+ {
+ showReferenceAnnotationsForSequence(ap.alignFrame, seq);
+ }
+
+ return sv;
+ }
+
+ public static void showReferenceAnnotationsForSequence(AlignFrame af,
+ SequenceI sequence)
+ {
+ AlignViewport av = af.getCurrentView();
+ AlignmentI al = av.getAlignment();
+
+ List<SequenceI> forSequences = new ArrayList<>();
+ forSequences.add(sequence);
+ final Map<SequenceI, List<AlignmentAnnotation>> candidates = new LinkedHashMap<>();
+ AlignmentUtils.findAddableReferenceAnnotations(forSequences, null,
+ candidates, al);
+ final SequenceGroup selectionGroup = av.getSelectionGroup();
+ AlignmentUtils.addReferenceAnnotations(candidates, al, selectionGroup);
+ for (AlignmentViewPanel ap : af.getAlignPanels())
+ {
+ // required to readjust the height and position of the PAE
+ // annotation
+ ap.adjustAnnotationHeight();
+ }
+
+ }
}
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.List;
+ import java.util.Locale;
import java.util.Map;
import java.util.Map.Entry;
-
import jalview.api.structures.JalviewStructureDisplayI;
import jalview.bin.Cache;
import jalview.bin.Console;
@Override
public void propertyChange(PropertyChangeEvent evt)
{
- if (evt.getPropertyName().equals("alignment"))
- {
+ switch (evt.getPropertyName()) {
+ case AlignmentViewport.PROPERTY_ALIGNMENT:
if (tree == null)
{
- System.out.println("tree is null");
+ jalview.bin.Console.outPrintln("tree is null");
// TODO: deal with case when a change event is received whilst a
// tree is still being calculated - should save reference for
// processing message later.
}
if (evt.getNewValue() == null)
{
- System.out.println(
+ jalview.bin.Console.outPrintln(
"new alignment sequences vector value is null");
+ return;
}
tree.updatePlaceHolders((List<SequenceI>) evt.getNewValue());
{
colorChooser.getSelectionModel().addChangeListener(this);
frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.setContentPane(this);
Desktop.addInternalFrame(frame,
- MessageManager.getString("label.user_defined_colours"),
- MY_FRAME_WIDTH, MY_FRAME_HEIGHT, true);
+ MessageManager.getString("label.user_defined_colours"), Desktop.FRAME_MAKE_VISIBLE,
+ MY_FRAME_WIDTH, MY_FRAME_HEIGHT, Desktop.FRAME_ALLOW_RESIZE, Desktop.FRAME_SET_MIN_SIZE_300);
}
/**
boolean makeVisible)
{
frame = new JInternalFrame();
+ frame.setFrameIcon(null);
frame.setContentPane(this);
- Desktop.addInternalFrame(frame, title, makeVisible, width, height);
+ Desktop.addInternalFrame(frame, title, makeVisible, width, height, Desktop.FRAME_ALLOW_RESIZE, Desktop.FRAME_SET_MIN_SIZE_300);
frame.setClosable(false);
progressBar = new ProgressBar(statusPanel, statusBar);
titlePanel.add(titleText, BorderLayout.CENTER);
setStatus(currentStatus);
- Thread thread = new Thread(ap);
- thread.start();
- final WebserviceInfo thisinfo = this;
- frame.addInternalFrameListener(new InternalFrameAdapter()
+ if (!Platform.isJS())
{
- @Override
- public void internalFrameClosed(InternalFrameEvent evt)
- {
- // jalview.bin.Console.outPrintln("Shutting down webservice client");
- WSClientI service = thisinfo.getthisService();
- if (service != null && service.isCancellable())
- {
- service.cancelJob();
- }
- }
- });
+ // No animation for the moment//
+ Thread thread = new Thread(ap);
+ thread.start();
+ }
+ final WebserviceInfo thisinfo = this;
+ frame.addInternalFrameListener(
+ new InternalFrameAdapter()
+ {
+ @Override
+ public void internalFrameClosed(InternalFrameEvent evt)
+ {
- // System.out.println("Shutting down webservice client");
++ // // jalview.bin.Console.outPrintln("Shutting down webservice client");
+ WSClientI service = thisinfo.getthisService();
+ if (service != null && service.isCancellable())
+ {
+ service.cancelJob();
+ }
+ }
+ });
frame.validate();
}
for (OptionBox pbox : opanp.getOptSet().values())
{
pbox.validate();
- cw += pbox.getSize().width + hgap;
- if (cw + 120 > panewidth)
+ int boxWidth = pbox.getSize().width;
+ currentWidth += boxWidth + hgap;
+ boolean wrapAfterLast = currentWidth > availableWidth
+ && lastAdded != null;
- // System.out.println(String.format(
++ // jalview.bin.Console.outPrintln(
+ // "%s width=%d, paneWidth=%d, currentWidth=%d, wrapAfterLast=%s",
+ // pbox.toString(), boxWidth, panewidth, currentWidth,
+ // wrapAfterLast));
+ if (wrapAfterLast)
{
- jobOptions.add(pbox, "wrap");
- // jalview.bin.Console.outPrintln("Wrap on "+pbox.option.getName());
- cw = hgap + pbox.getSize().width;
- fh = true;
- }
- else
- {
- jobOptions.add(pbox);
- }
- if (fh)
- {
- finalh += pbox.getSize().height + fl.getVgap();
- fh = false;
+ optionsPanel.remove(lastAdded);
+ optionsPanel.add(lastAdded, "wrap");
+ currentWidth = hgap + boxWidth;
}
+ optionsPanel.add(pbox);
+ lastAdded = pbox;
}
- jobOptions.revalidate();
+ optionsPanel.revalidate();
}
else
{
*/
protected void updateWebServiceMenus()
{
+ if (Desktop.getInstance() == null)
+ {
+ return;
+ }
- for (AlignFrame alignFrame : Desktop.getAlignFrames())
+ for (AlignFrame alignFrame : Desktop.getDesktopAlignFrames())
{
- alignFrame.BuildWebServiceMenu();
+ alignFrame.buildWebServicesMenu();
}
}
seqs.add(seq);
}
+ /**
+ * Used only for hmmer statistics, so should probably be removed at some
+ * point. TODO remove this
+ *
+ * @return
+ */
+ public Vector<AlignmentAnnotation> getAnnotations()
+ {
+ return annotations;
+ }
+
++
+ public void setDoXferSettings(boolean b)
+ {
+ doXferSettings = b;
+ }
+
+ public boolean getDoXferSettings()
+ {
+ return doXferSettings;
+ }
}
DataSourceType sourceType, FileFormatI fileFormat)
throws IOException
{
+ return readFile(selectedFile, file, sourceType, fileFormat, null);
+ }
+
+ public AlignmentI readFile(File selectedFile, String file,
+ DataSourceType sourceType, FileFormatI fileFormat,
+ StructureImportSettings.TFType tempfacType) throws IOException
+ {
this.selectedFile = selectedFile;
- inFile = (selectedFile == null ? file : selectedFile.getPath());
- this.inFile = selectedFile != null ? selectedFile.getPath() : file;
++ this.inFile = (selectedFile != null ? selectedFile.getPath() : file);
try
{
if (fileFormat.isStructureFile())
? "Copied From Clipboard"
: file;
Runtime rt = Runtime.getRuntime();
+
try
{
- if (Desktop.instance != null)
+ if (Desktop.getInstance() != null)
{
- Desktop.instance.startLoading(file);
+ Desktop.getInstance().startLoading(file);
}
if (format == null)
{
if (format == null)
{
- Desktop.instance.stopLoading();
+ Desktop.getInstance().stopLoading();
- System.err.println("The input file \"" + file
+ jalview.bin.Console.errPrintln("The input file \"" + file
+ "\" has null or unidentifiable data content!");
- if (!Jalview.isHeadlessMode())
+ if (!Jalview.isHeadlessMode() && !Jalview.isBatchMode())
{
- JvOptionPane.showInternalMessageDialog(Desktop.desktop,
+ JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
MessageManager.getString("label.couldnt_read_data")
+ " in " + file + "\n"
+ AppletFormatAdapter.getSupportedFormats(),
// status in Jalview 3
// TODO: define 'virtual desktop' for benefit of headless scripts
// that perform queries to find the 'current working alignment'
- Desktop.addInternalFrame(alignFrame, title,
+
+ Dimension dim = Platform.getDimIfEmbedded(alignFrame,
AlignFrame.DEFAULT_WIDTH, AlignFrame.DEFAULT_HEIGHT);
+ alignFrame.setSize(dim);
+ Desktop.addInternalFrame(alignFrame, title, dim.width,
+ dim.height);
+
+ /*
+ * for an Overview automatically opened with alignment,
+ * set its title now alignFrame title has been set
+ */
+ alignFrame.alignPanel.setOverviewTitle(alignFrame);
}
try
"label.couldnt_load_file") + " " + title + "\n" + error;
// TODO: refactor FileLoader to be independent of Desktop / Applet GUI
// bits ?
- if (raiseGUI && Desktop.getDesktopPane() != null)
- if (raiseGUI && !Jalview.isBatchMode() && Desktop.desktop != null)
++ if (raiseGUI && !Jalview.isBatchMode() && Desktop.getDesktopPane() != null)
{
javax.swing.SwingUtilities.invokeLater(new Runnable()
{
}
}
// remove the visual delay indicator
- if (Desktop.instance != null)
+ if (Desktop.getInstance() != null)
{
- Desktop.instance.stopLoading();
+ Desktop.getInstance().stopLoading();
}
+ this.setShouldBeSaved();
+ // after first file loaded we revert to assuming a default file format
+ useDefaultFileFormat = true;
}
/**
reply = FileFormat.ScoreMatrix;
break;
}
+ if (data.startsWith("HMMER3"))
+ {
+ reply = FileFormat.HMMER3;
+ break;
+ }
+ if (data.startsWith(XMLHEADER) && !lineswereskipped)
+ {
+ isXml = true;
+ }
if (data.startsWith("LOCUS"))
{
reply = FileFormat.GenBank;
reply = FileFormat.Rnaml;
break;
}
+ if (upper.substring(lessThan).startsWith("<BSML"))
+ {
+ reply = FileFormat.BSML;
+ break;
+ }
+ if (isXml && data.contains(
+ "<NS2:JALVIEWUSERCOLOURS SCHEMENAME=\"SEQUENCE FEATURES\" XMLNS:NS2=\"WWW.JALVIEW.ORG/COLOURS\">"))
+ {
+ reply = FileFormat.FeatureSettings;
+ break;
+ }
}
if ((data.length() < 1) || (data.indexOf("#") == 0))
// TODO: Extended SequenceNodeI to hold parsed NHX strings
package jalview.io;
+import java.util.Locale;
+
++import jalview.bin.Jalview;
++import jalview.bin.Jalview.ExitCode;
++import jalview.datamodel.BinaryNode;
+import jalview.datamodel.SequenceNode;
+import jalview.util.MessageManager;
+import jalview.util.Platform;
+
import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import com.stevesoft.pat.Regex;
-import jalview.bin.Jalview;
-import jalview.bin.Jalview.ExitCode;
-import jalview.datamodel.BinaryNode;
-import jalview.datamodel.SequenceNode;
-import jalview.util.MessageManager;
+
+// TODO This class does not conform to Java standards for field name capitalization.
/**
* Parse a new hanpshire style tree Caveats: NHX files are NOT supported and the
* tree distances and topology are unreliable when they are parsed. TODO: on
*/
public class NewickFile extends FileParse
{
- private SequenceNode root;
++ // FIXME: 2.12 was private SequenceNode root
+ BinaryNode root;
private boolean HasBootstrap = false;
NewickFile trf = new NewickFile(args[0], DataSourceType.FILE);
trf.parse();
- System.out.println("Original file :\n");
+ jalview.bin.Console.outPrintln("Original file :\n");
- Regex nonl = new Regex("\n+", "");
+ Regex nonl = getRegex(REGEX_NO_LINES);// "\n+", "");
- System.out.println(nonl.replaceAll(newickfile.toString()) + "\n");
-
- System.out.println("Parsed file.\n");
- System.out.println("Default output type for original input.\n");
- System.out.println(trf.print());
- System.out.println("Without bootstraps.\n");
- System.out.println(trf.print(false));
- System.out.println("Without distances.\n");
- System.out.println(trf.print(true, false));
- System.out.println("Without bootstraps but with distanecs.\n");
- System.out.println(trf.print(false, true));
- System.out.println("Without bootstraps or distanecs.\n");
- System.out.println(trf.print(false, false));
- System.out.println("With bootstraps and with distances.\n");
- System.out.println(trf.print(true, true));
+ jalview.bin.Console
+ .outPrintln(nonl.replaceAll(newickfile.toString()) + "\n");
+
+ jalview.bin.Console.outPrintln("Parsed file.\n");
+ jalview.bin.Console
+ .outPrintln("Default output type for original input.\n");
+ jalview.bin.Console.outPrintln(trf.print());
+ jalview.bin.Console.outPrintln("Without bootstraps.\n");
+ jalview.bin.Console.outPrintln(trf.print(false));
+ jalview.bin.Console.outPrintln("Without distances.\n");
+ jalview.bin.Console.outPrintln(trf.print(true, false));
+ jalview.bin.Console
+ .outPrintln("Without bootstraps but with distanecs.\n");
+ jalview.bin.Console.outPrintln(trf.print(false, true));
+ jalview.bin.Console.outPrintln("Without bootstraps or distanecs.\n");
+ jalview.bin.Console.outPrintln(trf.print(false, false));
+ jalview.bin.Console
+ .outPrintln("With bootstraps and with distances.\n");
+ jalview.bin.Console.outPrintln(trf.print(true, true));
} catch (java.io.IOException e)
{
- System.err.println("Exception\n" + e);
+ jalview.bin.Console.errPrintln("Exception\n" + e);
e.printStackTrace();
}
}
}
} catch (Exception x)
{
- System.err.println("problem when creating links from "
- jalview.bin.Console.errPrintln(
- "problem when creating links from " + urlstring);
++ jalview.bin.Console.errPrintln("problem when creating links from "
+ + urlstring);
x.printStackTrace();
}
}
// First, we have to check that this file has STOCKHOLM format, i.e. the
// first line must match
- r = new Regex("# STOCKHOLM ([\\d\\.]+)");
+ r = getRegex(REGEX_STOCKHOLM);
if (!r.search(nextLine()))
{
- throw new IOException(MessageManager
- .getString("exception.stockholm_invalid_format"));
+ throw new IOException(
+ MessageManager.getString("exception.stockholm_invalid_format")
+ + " (" + r + ")");
}
else
{
{
// jalview.gui.Jalview2XML fromxml = new jalview.gui.Jalview2XML();
Jalview2XML fromxml = new Jalview2XML();
-- fromxml.attemptversion1parse = false;
fromxml.setUniqueSetSuffix("");
fromxml.setObjectMappingTables(vobj2jv, jv2vobj); // mapKeysToString
// and
try
{
Jalview2XML fromxml = new Jalview2XML();
-- fromxml.attemptversion1parse = false;
fromxml.setUniqueSetSuffix("");
fromxml.setSkipList(skipList);
fromxml.setObjectMappingTables(mapKeysToString(vobj2jv),
{
try
{
+ setFrameIcon(null);
// for Web-page embedding using id=align-frame-div
- setName("jalview-alignment");
+ setName(Platform.getAppID("alignment"));
jbInit();
setJMenuBar(alignFrameMenuBar);
private void jbInit() throws Exception
{
+ setFrameIcon(null);
initColourMenu();
+
JMenuItem saveAs = new JMenuItem(
MessageManager.getString("action.save_as"));
ActionListener al = new ActionListener()
});
JMenuItem selectHighlighted = new JMenuItem(
MessageManager.getString("action.select_highlighted_columns"));
+ selectHighlighted.setToolTipText(JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("tooltip.select_highlighted_columns")));
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ selectHighlightedColumns_actionPerformed(actionEvent);
+ }
+ };
++ // FIXME 2.12 BADMERGE ?
+ JMenuItem Filter = new JMenuItem(
+ MessageManager.getString("action.select_highlighted_columns"));
selectHighlighted.setToolTipText(
MessageManager.getString("tooltip.select_highlighted_columns"));
al = new ActionListener()
}
};
selectHighlighted.addActionListener(al);
+
+ copyHighlighted = new JMenuItem(
+ MessageManager.getString("action.copy_highlighted_regions"));
+ keyStroke = KeyStroke.getKeyStroke(KeyEvent.VK_C,
- jalview.util.ShortcutKeyMaskExWrapper.getMenuShortcutKeyMaskEx()
- + jalview.util.ShortcutKeyMaskExWrapper.SHIFT_DOWN_MASK,
++ Platform.SHORTCUT_KEY_MASK
++ + InputEvent.SHIFT_DOWN_MASK,
+ false);
+ copyHighlighted.setToolTipText(
+ MessageManager.getString("tooltip.copy_highlighted_regions"));
+ al = new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent actionEvent)
+ {
+ copyHighlightedColumns_actionPerformed(actionEvent);
+ }
+ };
+ addMenuActionAndAccelerator(keyStroke, copyHighlighted, al);
+ copyHighlighted.addActionListener(al);
+
JMenu tooltipSettingsMenu = new JMenu(
MessageManager.getString("label.sequence_id_tooltip"));
JMenu autoAnnMenu = new JMenu(
// selectMenu.add(listenToViewSelections);
}
+ /**
+ * Constructs the entries on the HMMER menu
+ */
+ protected void initHMMERMenu()
+ {
+ /*
+ * hmmbuild
+ */
+ JMenu hmmBuild = new JMenu(MessageManager.getString("label.hmmbuild"));
+ JMenuItem hmmBuildSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmBuildSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmBuild_actionPerformed(false);
+ }
+ });
+ JMenuItem hmmBuildRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmbuild"));
+ hmmBuildRun.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmBuild_actionPerformed(true);
+ }
+ });
+ hmmBuild.add(hmmBuildRun);
+ hmmBuild.add(hmmBuildSettings);
+
+ /*
+ * hmmalign
+ */
+ JMenu hmmAlign = new JMenu(MessageManager.getString("label.hmmalign"));
+ JMenuItem hmmAlignRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmalign"));
+ hmmAlignRun.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmAlign_actionPerformed(true);
+ }
+ });
+ JMenuItem hmmAlignSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmAlignSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmAlign_actionPerformed(false);
+ }
+ });
+ hmmAlign.add(hmmAlignRun);
+ hmmAlign.add(hmmAlignSettings);
+
+ /*
+ * hmmsearch
+ */
+ JMenu hmmSearch = new JMenu(
+ MessageManager.getString("label.hmmsearch"));
+ JMenuItem hmmSearchSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ hmmSearchSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmSearch_actionPerformed(false);
+ }
+ });
+ JMenuItem hmmSearchRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "hmmsearch"));
+ hmmSearchRun.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ hmmSearch_actionPerformed(true);
+ }
+ });
+ JMenuItem addDatabase = new JMenuItem(
+ MessageManager.getString("label.add_database"));
+ addDatabase.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ addDatabase_actionPerformed();
+ } catch (IOException e1)
+ {
+ e1.printStackTrace();
+ }
+ }
+ });
+ hmmSearch.add(hmmSearchRun);
+ hmmSearch.add(hmmSearchSettings);
+ // hmmSearch.add(addDatabase);
+
+ /*
+ * jackhmmer
+ */
+ JMenu jackhmmer = new JMenu(
+ MessageManager.getString("label.jackhmmer"));
+ JMenuItem jackhmmerSettings = new JMenuItem(
+ MessageManager.getString("label.edit_settings_and_run"));
+ jackhmmerSettings.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ jackhmmer_actionPerformed(false);
+ }
+ });
+ JMenuItem jackhmmerRun = new JMenuItem(MessageManager.formatMessage(
+ "label.action_with_default_settings", "jackhmmer"));
+ jackhmmerRun.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ jackhmmer_actionPerformed(true);
+ }
+
+ });
+ /*
+ JMenuItem addDatabase = new JMenuItem(
+ MessageManager.getString("label.add_database"));
+ addDatabase.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ try
+ {
+ addDatabase_actionPerformed();
+ } catch (IOException e1)
+ {
+ e1.printStackTrace();
+ }
+ }
+ });
+ */
+ jackhmmer.add(jackhmmerRun);
+ jackhmmer.add(jackhmmerSettings);
+ // hmmSearch.add(addDatabase);
+
+ /*
+ * top level menu
+ */
+ hmmerMenu.setText(MessageManager.getString("action.hmmer"));
+ hmmerMenu.setEnabled(HmmerCommand.isHmmerAvailable());
+ hmmerMenu.add(hmmBuild);
+ hmmerMenu.add(hmmAlign);
+ hmmerMenu.add(hmmSearch);
+ hmmerMenu.add(jackhmmer);
+
+ }
+
+ protected void enableSortMenuOptions()
+ {
+ }
+
+ protected void createPNG_actionPerformed(ActionEvent object)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void createEPS_actionPerformed(ActionEvent object)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void createSVG_actionPerformed(ActionEvent object)
+ {
+ // TODO Auto-generated method stub
+
+ }
+
+ protected void copyHighlightedColumns_actionPerformed(
+ ActionEvent actionEvent)
+ {
+
+ }
+
protected void loadVcf_actionPerformed()
{
}
{
}
+ protected void hmmBuild_actionPerformed(boolean withDefaults)
+ {
+ }
+
+ protected void hmmSearch_actionPerformed(boolean withDefaults)
+ {
+ }
+
+ protected void jackhmmer_actionPerformed(boolean b)
+ {
+ }
+
+ protected void addDatabase_actionPerformed()
+ throws FileFormatException, IOException
+ {
+ }
+
+ protected void hmmAlign_actionPerformed(boolean withDefaults)
+ {
+ }
- public void createPNG(java.io.File f)
- {
- }
+
protected void font_actionPerformed(ActionEvent e)
{
}
@Override
public void actionPerformed(ActionEvent e)
{
- quit();
- if (Desktop.instance != null)
- Desktop.instance.desktopQuit();
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().desktopQuit();
}
});
aboutMenuItem.setText(MessageManager.getString("label.about"));
private void jbInit() throws Exception
{
+ setFrameIcon(null);
- setName("jalview-pca");
+ setName(Platform.getAppID("pca"));
this.getContentPane().setLayout(new BorderLayout());
JPanel jPanel2 = new JPanel();
jPanel2.setLayout(new FlowLayout());
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
+ import java.util.EnumSet;
import java.util.List;
+import javax.swing.AbstractButton;
import javax.swing.AbstractCellEditor;
import javax.swing.BorderFactory;
import javax.swing.BoxLayout;
private void jbInit() throws Exception
{
-
+ setFrameIcon(null);
- setName("jalview-structureviewer");
+ setName(Platform.getAppID("structureviewer"));
JMenuBar menuBar = new JMenuBar();
this.setJMenuBar(menuBar);
* The Jalview Authors are detailed in the 'AUTHORS' file.
*/
package jalview.jbgui;
-
- import jalview.util.ImageMaker.TYPE;
- import jalview.util.MessageManager;
+import jalview.util.Platform;
import java.awt.BorderLayout;
import java.awt.Color;
private void jbInit() throws Exception
{
+ setFrameIcon(null);
- setName("jalview-tree");
+ setName(Platform.getAppID("tree"));
this.getContentPane().setLayout(borderLayout1);
this.setBackground(Color.white);
this.setFont(new java.awt.Font("Verdana", 0, 12));
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.ContactListI;
+ import jalview.datamodel.ContactMatrix;
+ import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.DBRefEntry;
+ import jalview.datamodel.FloatContactMatrix;
import jalview.datamodel.GeneLocus;
import jalview.datamodel.GraphLine;
+import jalview.datamodel.HiddenMarkovModel;
+ import jalview.datamodel.GroupSet;
+ import jalview.datamodel.GroupSetI;
import jalview.datamodel.PDBEntry;
import jalview.datamodel.Point;
import jalview.datamodel.RnaViewerModel;
import jalview.gui.AlignViewport;
import jalview.gui.AlignmentPanel;
import jalview.gui.AppVarna;
+import jalview.gui.ChimeraViewFrame;
import jalview.gui.Desktop;
+import jalview.gui.FeatureRenderer;
import jalview.gui.JvOptionPane;
import jalview.gui.OOMWarning;
+ import jalview.gui.OverviewPanel;
import jalview.gui.PCAPanel;
import jalview.gui.PaintRefresher;
import jalview.gui.SplitFrame;
import jalview.viewmodel.seqfeatures.FeatureRendererModel;
import jalview.viewmodel.seqfeatures.FeatureRendererSettings;
import jalview.viewmodel.seqfeatures.FeaturesDisplayed;
+import jalview.ws.api.ServiceWithParameters;
+ import jalview.ws.datamodel.MappableContactMatrixI;
+ import jalview.ws.datamodel.alphafold.PAEContactMatrix;
-import jalview.ws.jws2.Jws2Discoverer;
+import jalview.ws.jws2.PreferredServiceRegistry;
import jalview.ws.jws2.dm.AAConSettings;
-import jalview.ws.jws2.jabaws2.Jws2Instance;
import jalview.ws.params.ArgumentI;
import jalview.ws.params.AutoCalcSetting;
import jalview.ws.params.WsParamSetI;
import jalview.xml.binding.jalview.ThresholdType;
import jalview.xml.binding.jalview.VAMSAS;
+import java.awt.Color;
+import java.awt.Dimension;
+import java.awt.Font;
+import java.awt.Rectangle;
+import java.io.BufferedReader;
+import java.io.ByteArrayInputStream;
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.math.BigInteger;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
++import java.util.BitSet;
+import java.util.Collections;
+import java.util.Enumeration;
+import java.util.GregorianCalendar;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Hashtable;
+import java.util.IdentityHashMap;
+import java.util.Iterator;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Locale;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+import java.util.Vector;
+import java.util.jar.JarEntry;
+import java.util.jar.JarInputStream;
+import java.util.jar.JarOutputStream;
+
+import javax.swing.JInternalFrame;
+import javax.swing.SwingUtilities;
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.JAXBElement;
+import javax.xml.bind.Marshaller;
+import javax.xml.datatype.DatatypeConfigurationException;
+import javax.xml.datatype.DatatypeFactory;
+import javax.xml.datatype.XMLGregorianCalendar;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamReader;
/**
* Write out the current jalview desktop state as a Jalview XML stream.
*
public class Jalview2XML
{
- // BH 2018 we add the .jvp binary extension to J2S so that
- // it will declare that binary when we do the file save from the browser
+ // BH 2018 we add the .jvp binary extension to J2S so that
+ // it will declare that binary when we do the file save from the browser
- static
- {
- Platform.addJ2SBinaryType(".jvp?");
- }
+ static
+ {
+ Platform.addJ2SBinaryType(".jvp?");
+ }
- private static final String VIEWER_PREFIX = "viewer_";
+ private static final String VIEWER_PREFIX = "viewer_";
- private static final String RNA_PREFIX = "rna_";
+ private static final String RNA_PREFIX = "rna_";
- private static final String UTF_8 = "UTF-8";
+ private static final String HMMER_PREFIX = "hmmer_";
+ private static final String UTF_8 = "UTF-8";
+ /**
+ * used in decision if quit confirmation should be issued
+ */
+ private static boolean stateSavedUpToDate = false;
+
- /**
- * prefix for recovering datasets for alignments with multiple views where
- * non-existent dataset IDs were written for some views
- */
- private static final String UNIQSEQSETID = "uniqueSeqSetId.";
+ /**
+ * prefix for recovering datasets for alignments with multiple views where
+ * non-existent dataset IDs were written for some views
+ */
+ private static final String UNIQSEQSETID = "uniqueSeqSetId.";
- // use this with nextCounter() to make unique names for entities
- private int counter = 0;
+ // use this with nextCounter() to make unique names for entities
+ private int counter = 0;
- /*
- * SequenceI reference -> XML ID string in jalview XML. Populated as XML reps
- * of sequence objects are created.
- */
- IdentityHashMap<SequenceI, String> seqsToIds = null;
+ /*
+ * SequenceI reference -> XML ID string in jalview XML. Populated as XML reps
+ * of sequence objects are created.
+ */
+ IdentityHashMap<SequenceI, String> seqsToIds = null;
- /**
- * jalview XML Sequence ID to jalview sequence object reference (both dataset
- * and alignment sequences. Populated as XML reps of sequence objects are
- * created.)
- */
- Map<String, SequenceI> seqRefIds = null;
+ /**
+ * jalview XML Sequence ID to jalview sequence object reference (both dataset
+ * and alignment sequences. Populated as XML reps of sequence objects are
+ * created.)
+ */
+ Map<String, SequenceI> seqRefIds = null;
- Map<String, SequenceI> incompleteSeqs = null;
+ Map<String, SequenceI> incompleteSeqs = null;
- List<SeqFref> frefedSequence = null;
+ List<forwardRef> frefedSequence = null;
- boolean raiseGUI = true; // whether errors are raised in dialog boxes or not
+ boolean raiseGUI = true; // whether errors are raised in dialog boxes or not
- /*
- * Map of reconstructed AlignFrame objects that appear to have come from
- * SplitFrame objects (have a dna/protein complement view).
- */
- private Map<Viewport, AlignFrame> splitFrameCandidates = new HashMap<>();
+ /*
+ * Map of reconstructed AlignFrame objects that appear to have come from
+ * SplitFrame objects (have a dna/protein complement view).
+ */
+ private Map<Viewport, AlignFrame> splitFrameCandidates = new HashMap<>();
- /*
- * Map from displayed rna structure models to their saved session state jar
- * entry names
- */
- private Map<RnaModel, String> rnaSessions = new HashMap<>();
+ /*
+ * Map from displayed rna structure models to their saved session state jar
+ * entry names
+ */
+ private Map<RnaModel, String> rnaSessions = new HashMap<>();
+
+ /**
+ * contains last error message (if any) encountered by XML loader.
+ */
+ String errorMessage = null;
+
- /**
- * flag to control whether the Jalview2XML_V1 parser should be deferred to if
- * exceptions are raised during project XML parsing
- */
- public boolean attemptversion1parse = false;
-
+ /*
+ * JalviewJS only -- to allow read file bytes to be saved in the
+ * created AlignFrame, allowing File | Reload of a project file to work
- *
++ * TODO: do we need this still ?
+ * BH 2019 JAL-3436
+ */
+ private File jarFile;
+ /**
+ * map from contact matrices to their XML ids
+ */
+ private Map<ContactMatrixI, String> contactMatrices = new HashMap<>();
+
+ private Map<String, ContactMatrixI> contactMatrixRefs = new HashMap<>();
+
+ private List<jalview.xml.binding.jalview.MatrixType> xmlMatrices = new ArrayList<>();
+
- /**
- * A helper method for safely using the value of an optional attribute that
- * may be null if not present in the XML. Answers the boolean value, or false
- * if null.
- *
- * @param b
- * @return
- */
- public static boolean safeBoolean(Boolean b)
- {
- return b == null ? false : b.booleanValue();
- }
-
- /**
- * A helper method for safely using the value of an optional attribute that
- * may be null if not present in the XML. Answers the integer value, or zero
- * if null.
- *
- * @param i
- * @return
- */
- public static int safeInt(Integer i)
- {
- return i == null ? 0 : i.intValue();
- }
-
- /**
- * A helper method for safely using the value of an optional attribute that
- * may be null if not present in the XML. Answers the float value, or zero if
- * null.
- *
- * @param f
- * @return
- */
- public static float safeFloat(Float f)
- {
- return f == null ? 0f : f.floatValue();
- }
-
- /**
- * create/return unique hash string for sq
- *
- * @param sq
- * @return new or existing unique string for sq
- */
- String seqHash(SequenceI sq)
- {
- if (seqsToIds == null)
+ /**
+ * A helper method for safely using the value of an optional attribute that
+ * may be null if not present in the XML. Answers the boolean value, or false
+ * if null.
+ *
+ * @param b
+ * @return
+ */
+ public static boolean safeBoolean(Boolean b)
{
- initSeqRefs();
+ return b == null ? false : b.booleanValue();
}
- if (seqsToIds.containsKey(sq))
+
+ /**
+ * A helper method for safely using the value of an optional attribute that
+ * may be null if not present in the XML. Answers the integer value, or zero
+ * if null.
+ *
+ * @param i
+ * @return
+ */
+ public static int safeInt(Integer i)
{
- return seqsToIds.get(sq);
+ return i == null ? 0 : i.intValue();
}
- else
+
+ /**
+ * A helper method for safely using the value of an optional attribute that
+ * may be null if not present in the XML. Answers the float value, or zero if
+ * null.
+ *
+ * @param f
+ * @return
+ */
+ public static float safeFloat(Float f)
{
- // create sequential key
- String key = "sq" + (seqsToIds.size() + 1);
- key = makeHashCode(sq, key); // check we don't have an external reference
- // for it already.
- seqsToIds.put(sq, key);
- return key;
+ return f == null ? 0f : f.floatValue();
}
- }
- void initSeqRefs()
- {
- if (seqsToIds == null)
+ /**
+ * create/return unique hash string for sq
+ *
+ * @param sq
+ * @return new or existing unique string for sq
+ */
+ String seqHash(SequenceI sq)
{
- seqsToIds = new IdentityHashMap<>();
+ if (seqsToIds == null)
+ {
+ initSeqRefs();
+ }
+ if (seqsToIds.containsKey(sq))
+ {
+ return seqsToIds.get(sq);
+ }
+ else
+ {
+ // create sequential key
+ String key = "sq" + (seqsToIds.size() + 1);
+ key = makeHashCode(sq, key); // check we don't have an external reference
+ // for it already.
+ seqsToIds.put(sq, key);
+ return key;
+ }
}
- if (seqRefIds == null)
+
+ void initSeqRefs()
{
- seqRefIds = new HashMap<>();
+ if (seqsToIds == null)
+ {
+ seqsToIds = new IdentityHashMap<>();
+ }
+ if (seqRefIds == null)
+ {
+ seqRefIds = new HashMap<>();
+ }
+ if (incompleteSeqs == null)
+ {
+ incompleteSeqs = new HashMap<>();
+ }
+ if (frefedSequence == null)
+ {
+ frefedSequence = new ArrayList<>();
+ }
}
- if (incompleteSeqs == null)
+
+ public Jalview2XML()
{
- incompleteSeqs = new HashMap<>();
}
- if (frefedSequence == null)
+
+ public Jalview2XML(boolean raiseGUI)
{
- frefedSequence = new ArrayList<>();
+ this.raiseGUI = raiseGUI;
}
- }
-
- public Jalview2XML()
- {
- }
-
- public Jalview2XML(boolean raiseGUI)
- {
- this.raiseGUI = raiseGUI;
- }
- /**
- * base class for resolving forward references to sequences by their ID
- *
- * @author jprocter
- *
- */
- abstract class SeqFref
- {
- String sref;
+ /**
+ * base class for resolving forward references to an as-yet unmarshalled
+ * object referenced by already unmarshalled objects
+ *
+ * @author jprocter
+ *
+ */
+ abstract class forwardRef
+ {
+ String sref;
- String type;
+ String type;
- public SeqFref(String _sref, String type)
- {
- sref = _sref;
- this.type = type;
- }
+ public forwardRef(String _sref, String type)
+ {
+ sref = _sref;
+ this.type = type;
+ }
- public String getSref()
- {
- return sref;
- }
+ public String getSref()
+ {
+ return sref;
+ }
+
+ public abstract boolean isResolvable();
+
+ /**
+ * @return true if the forward reference was fully resolved
+ */
+ abstract boolean resolve();
+
+ @Override
+ public String toString()
+ {
+ return type + " reference to " + sref;
+ }
+ }
+
+ /**
+ * resolve forward references to sequences by their ID
+ *
+ * @author jprocter
+ */
+ abstract class SeqFref extends forwardRef
+ {
+ public SeqFref(String _sref, String type)
+ {
+ super(_sref, type);
+ }
- public SequenceI getSrefSeq()
- {
- return seqRefIds.get(sref);
- }
+ public SequenceI getSrefSeq()
+ {
+ return seqRefIds.get(sref);
+ }
- public boolean isResolvable()
- {
- return seqRefIds.get(sref) != null;
- }
+ public boolean isResolvable()
+ {
+ return seqRefIds.get(sref) != null;
+ }
- public SequenceI getSrefDatasetSeq()
- {
- SequenceI sq = seqRefIds.get(sref);
- if (sq != null)
- {
- while (sq.getDatasetSequence() != null)
- {
- sq = sq.getDatasetSequence();
- }
- }
- return sq;
- }
-
- /**
- * @return true if the forward reference was fully resolved
- */
- abstract boolean resolve();
-
- @Override
- public String toString()
- {
- return type + " reference to " + sref;
- }
+ public SequenceI getSrefDatasetSeq()
+ {
+ SequenceI sq = seqRefIds.get(sref);
+ if (sq != null)
+ {
+ while (sq.getDatasetSequence() != null)
+ {
+ sq = sq.getDatasetSequence();
+ }
+ }
+ return sq;
}
+ }
- /**
- * create forward reference for a mapping
- *
- * @param sref
- * @param _jmap
- * @return
- */
- public SeqFref newMappingRef(final String sref,
- final jalview.datamodel.Mapping _jmap)
- {
- SeqFref fref = new SeqFref(sref, "Mapping")
+ /**
+ * create forward reference for a mapping
+ *
+ * @param sref
+ * @param _jmap
+ * @return
+ */
+ protected SeqFref newMappingRef(final String sref,
+ final jalview.datamodel.Mapping _jmap)
{
- public jalview.datamodel.Mapping jmap = _jmap;
-
- @Override
- boolean resolve()
- {
- SequenceI seq = getSrefDatasetSeq();
- if (seq == null)
- {
- return false;
- }
- jmap.setTo(seq);
- return true;
- }
- };
- return fref;
- }
+ SeqFref fref = new SeqFref(sref, "Mapping")
+ {
+ public jalview.datamodel.Mapping jmap = _jmap;
- public SeqFref newAlcodMapRef(final String sref,
- final AlignedCodonFrame _cf,
- final jalview.datamodel.Mapping _jmap)
- {
+ @Override
+ boolean resolve()
+ {
+ SequenceI seq = getSrefDatasetSeq();
+ if (seq == null)
+ {
+ return false;
+ }
+ jmap.setTo(seq);
+ return true;
+ }
+ };
+ return fref;
+ }
- SeqFref fref = new SeqFref(sref, "Codon Frame")
+ protected SeqFref newAlcodMapRef(final String sref,
+ final AlignedCodonFrame _cf,
+ final jalview.datamodel.Mapping _jmap)
{
- AlignedCodonFrame cf = _cf;
- public jalview.datamodel.Mapping mp = _jmap;
+ SeqFref fref = new SeqFref(sref, "Codon Frame")
+ {
+ AlignedCodonFrame cf = _cf;
- @Override
- public boolean isResolvable()
- {
- return super.isResolvable() && mp.getTo() != null;
- }
+ public jalview.datamodel.Mapping mp = _jmap;
+
+ @Override
+ public boolean isResolvable()
+ {
+ return super.isResolvable() && mp.getTo() != null;
+ }
- @Override
- boolean resolve()
- {
- SequenceI seq = getSrefDatasetSeq();
- if (seq == null)
- {
- return false;
- }
- cf.addMap(seq, mp.getTo(), mp.getMap());
- return true;
- }
- };
- return fref;
- }
+ @Override
+ boolean resolve()
+ {
+ SequenceI seq = getSrefDatasetSeq();
+ if (seq == null)
+ {
+ return false;
+ }
+ cf.addMap(seq, mp.getTo(), mp.getMap());
+ return true;
+ }
+ };
+ return fref;
+ }
- protected void resolveFrefedSequences()
+ public forwardRef newMatrixFref(final String matRef,
+ final jalview.util.MapList mapping, final AlignmentAnnotation jaa)
+ {
+ forwardRef fref = new forwardRef(matRef,
+ "Matrix Reference for sequence and annotation")
{
- Iterator<SeqFref> nextFref = frefedSequence.iterator();
- int toresolve = frefedSequence.size();
- int unresolved = 0, failedtoresolve = 0;
- while (nextFref.hasNext())
- {
- SeqFref ref = nextFref.next();
- if (ref.isResolvable())
- {
- try
- {
- if (ref.resolve())
- {
- nextFref.remove();
- }
- else
- {
- failedtoresolve++;
- }
- } catch (Exception x)
- {
- System.err.println(
- "IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence "
- + ref.getSref());
- x.printStackTrace();
- failedtoresolve++;
- }
- }
- else
- {
- unresolved++;
- }
- }
- if (unresolved > 0)
- {
- System.err.println("Jalview Project Import: There were " + unresolved
- + " forward references left unresolved on the stack.");
- }
- if (failedtoresolve > 0)
- {
- System.err.println("SERIOUS! " + failedtoresolve
- + " resolvable forward references failed to resolve.");
- }
- if (incompleteSeqs != null && incompleteSeqs.size() > 0)
- {
- System.err.println(
- "Jalview Project Import: There are " + incompleteSeqs.size()
- + " sequences which may have incomplete metadata.");
- if (incompleteSeqs.size() < 10)
- {
- for (SequenceI s : incompleteSeqs.values())
- {
- System.err.println(s.toString());
- }
- }
- else
- {
- System.err.println(
- "Too many to report. Skipping output of incomplete sequences.");
- }
- }
+
+ @Override
+ boolean resolve()
+ {
+ ContactMatrixI cm = contactMatrixRefs.get(matRef);
+ PAEContactMatrix newpae = new PAEContactMatrix(jaa.sequenceRef,
+ mapping, cm);
+
+ jaa.sequenceRef.addContactListFor(jaa, newpae);
+ return true;
+ }
+
+ @Override
+ public boolean isResolvable()
+ {
+ return (contactMatrixRefs.get(matRef) != null);
+ }
+ };
+ return fref;
+ }
+
+ public void resolveFrefedSequences()
+ {
+ Iterator<forwardRef> nextFref = frefedSequence.iterator();
+ int toresolve = frefedSequence.size();
+ int unresolved = 0, failedtoresolve = 0;
+ while (nextFref.hasNext())
+ {
+ forwardRef ref = nextFref.next();
+ if (ref.isResolvable())
+ {
+ try
+ {
+ if (ref.resolve())
+ {
+ nextFref.remove();
+ }
+ else
+ {
+ failedtoresolve++;
+ }
+ } catch (Exception x)
+ {
+ jalview.bin.Console.errPrintln(
+ "IMPLEMENTATION ERROR: Failed to resolve forward reference for sequence "
+ + ref.getSref());
+ x.printStackTrace();
+ failedtoresolve++;
+ }
+ }
+ else
+ {
+ unresolved++;
+ }
+ }
+ if (unresolved > 0)
+ {
+ jalview.bin.Console.errPrintln("Jalview Project Import: There were "
+ + unresolved
+ + " forward references left unresolved on the stack.");
+ }
+ if (failedtoresolve > 0)
+ {
+ jalview.bin.Console.errPrintln("SERIOUS! " + failedtoresolve
+ + " resolvable forward references failed to resolve.");
+ }
+ if (incompleteSeqs != null && incompleteSeqs.size() > 0)
+ {
+ jalview.bin.Console.errPrintln(
+ "Jalview Project Import: There are " + incompleteSeqs.size()
+ + " sequences which may have incomplete metadata.");
+ if (incompleteSeqs.size() < 10)
+ {
+ for (SequenceI s : incompleteSeqs.values())
+ {
+ jalview.bin.Console.errPrintln(s.toString());
+ }
+ }
+ else
+ {
+ jalview.bin.Console.errPrintln(
+ "Too many to report. Skipping output of incomplete sequences.");
+ }
}
+ }
- /**
- * This maintains a map of viewports, the key being the seqSetId. Important to
- * set historyItem and redoList for multiple views
- */
- Map<String, AlignViewport> viewportsAdded = new HashMap<>();
-
- Map<String, AlignmentAnnotation> annotationIds = new HashMap<>();
-
- String uniqueSetSuffix = "";
-
- /**
- * List of pdbfiles added to Jar
- */
- List<String> pdbfiles = null;
-
- // SAVES SEVERAL ALIGNMENT WINDOWS TO SAME JARFILE
- public void saveState(File statefile)
- {
- FileOutputStream fos = null;
-
- try
- {
+ /**
+ * This maintains a map of viewports, the key being the seqSetId. Important to
+ * set historyItem and redoList for multiple views
+ */
+ Map<String, AlignViewport> viewportsAdded = new HashMap<>();
- fos = new FileOutputStream(statefile);
+ Map<String, AlignmentAnnotation> annotationIds = new HashMap<>();
- JarOutputStream jout = new JarOutputStream(fos);
- saveState(jout);
- fos.close();
+ String uniqueSetSuffix = "";
- } catch (Exception e)
- {
- Console.error("Couln't write Jalview state to " + statefile, e);
- // TODO: inform user of the problem - they need to know if their data was
- // not saved !
- if (errorMessage == null)
- {
- errorMessage = "Did't write Jalview Archive to output file '"
- + statefile + "' - See console error log for details";
- }
- else
- {
- errorMessage += "(Didn't write Jalview Archive to output file '"
- + statefile + ")";
- }
- e.printStackTrace();
- } finally
- {
- if (fos != null)
- {
- try
- {
- fos.close();
- } catch (IOException e)
- {
- // ignore
- }
- }
+ /**
+ * List of pdbfiles added to Jar
+ */
+ List<String> pdbfiles = null;
+
+ // SAVES SEVERAL ALIGNMENT WINDOWS TO SAME JARFILE
+ public void saveState(File statefile)
+ {
+ FileOutputStream fos = null;
+
+ try
+ {
+
+ fos = new FileOutputStream(statefile);
+
+ JarOutputStream jout = new JarOutputStream(fos);
+ saveState(jout);
+ fos.close();
+
+ } catch (Exception e)
+ {
+ Console.error("Couln't write Jalview state to " + statefile, e);
+ // TODO: inform user of the problem - they need to know if their data was
+ // not saved !
+ if (errorMessage == null)
+ {
+ errorMessage = "Did't write Jalview Archive to output file '"
+ + statefile + "' - See console error log for details";
+ }
+ else
+ {
+ errorMessage += "(Didn't write Jalview Archive to output file '"
+ + statefile + ")";
+ }
+ e.printStackTrace();
+ } finally
+ {
+ if (fos != null)
+ {
+ try
+ {
+ fos.close();
+ } catch (IOException e)
+ {
+ // ignore
+ }
+ }
+ }
+ reportErrors();
}
- reportErrors();
- }
- /**
- * Writes a jalview project archive to the given Jar output stream.
- *
- * @param jout
- */
- public void saveState(JarOutputStream jout)
+ /**
+ * Writes a jalview project archive to the given Jar output stream.
+ *
+ * @param jout
+ */
+ public void saveState(JarOutputStream jout)
+ {
+ AlignFrame[] frames = Desktop.getDesktopAlignFrames();
+
+ setStateSavedUpToDate(true);
+
+ if (Cache.getDefault("DEBUG_DELAY_SAVE", false))
{
- AlignFrame[] frames = Desktop.getAlignFrames();
+ int n = debugDelaySave;
+ int i = 0;
+ while (i < n)
+ {
+ Console.debug("***** debugging save sleep " + i + "/" + n);
+ try
+ {
+ Thread.sleep(1000);
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ i++;
+ }
+ }
- if (frames == null)
- {
- return;
+ if (frames == null)
+ {
+ return;
+ }
+ saveAllFrames(Arrays.asList(frames), jout);
}
- saveAllFrames(Arrays.asList(frames), jout);
- }
- /**
- * core method for storing state for a set of AlignFrames.
- *
- * @param frames
- * - frames involving all data to be exported (including containing
- * splitframes)
- * @param jout
- * - project output stream
- */
- private void saveAllFrames(List<AlignFrame> frames, JarOutputStream jout)
- {
- Hashtable<String, AlignFrame> dsses = new Hashtable<>();
-
- /*
- * ensure cached data is clear before starting
+ /**
+ * core method for storing state for a set of AlignFrames.
+ *
+ * @param frames
+ * - frames involving all data to be exported (including those
+ * contained in splitframes, though not the split frames themselves)
+ * @param jout
+ * - project output stream
*/
- // todo tidy up seqRefIds, seqsToIds initialisation / reset
- rnaSessions.clear();
- splitFrameCandidates.clear();
-
- try
- {
-
- // NOTE UTF-8 MUST BE USED FOR WRITING UNICODE CHARS
- // //////////////////////////////////////////////////
-
- List<String> shortNames = new ArrayList<>();
- List<String> viewIds = new ArrayList<>();
-
- // REVERSE ORDER
- for (int i = frames.size() - 1; i > -1; i--)
- {
- AlignFrame af = frames.get(i);
- // skip ?
- if (skipList != null && skipList
- .containsKey(af.getViewport().getSequenceSetId()))
- {
- continue;
- }
-
- String shortName = makeFilename(af, shortNames);
-
- int apSize = af.getAlignPanels().size();
-
- for (int ap = 0; ap < apSize; ap++)
- {
- AlignmentPanel apanel = (AlignmentPanel) af.getAlignPanels()
- .get(ap);
- String fileName = apSize == 1 ? shortName : ap + shortName;
- if (!fileName.endsWith(".xml"))
- {
- fileName = fileName + ".xml";
- }
-
- saveState(apanel, fileName, jout, viewIds);
-
- String dssid = getDatasetIdRef(
- af.getViewport().getAlignment().getDataset());
- if (!dsses.containsKey(dssid))
- {
- dsses.put(dssid, af);
- }
- }
- }
-
- writeDatasetFor(dsses, "" + jout.hashCode() + " " + uniqueSetSuffix,
- jout);
-
- try
- {
- jout.flush();
- } catch (Exception foo)
- {
- }
- jout.close();
- } catch (Exception ex)
- {
- // TODO: inform user of the problem - they need to know if their data was
- // not saved !
- if (errorMessage == null)
- {
- errorMessage = "Couldn't write Jalview Archive - see error output for details";
- }
- ex.printStackTrace();
+ private void saveAllFrames(List<AlignFrame> frames, JarOutputStream jout)
+ {
+ Hashtable<String, AlignFrame> dsses = new Hashtable<>();
+
+ /*
+ * ensure cached data is clear before starting
+ */
+ // todo tidy up seqRefIds, seqsToIds initialisation / reset
+ rnaSessions.clear();
+ splitFrameCandidates.clear();
+
+ try
+ {
+
+ // NOTE UTF-8 MUST BE USED FOR WRITING UNICODE CHARS
+ // //////////////////////////////////////////////////
+
+ List<String> shortNames = new ArrayList<>();
+ List<String> viewIds = new ArrayList<>();
+
+ // REVERSE ORDER
+ for (int i = frames.size() - 1; i > -1; i--)
+ {
+ AlignFrame af = frames.get(i);
+ AlignViewport vp = af.getViewport();
+ // skip ?
+ if (skipList != null && skipList
+ .containsKey(vp.getSequenceSetId()))
+ {
+ continue;
+ }
+
+ String shortName = makeFilename(af, shortNames);
+
+ AlignmentI alignment = vp.getAlignment();
+ List<? extends AlignmentViewPanel> panels = af.getAlignPanels();
+ int apSize = panels.size();
+
+ for (int ap = 0; ap < apSize; ap++)
+ {
+ AlignmentPanel apanel = (AlignmentPanel) panels.get(ap);
+ String fileName = apSize == 1 ? shortName : ap + shortName;
+ if (!fileName.endsWith(".xml"))
+ {
+ fileName = fileName + ".xml";
+ }
+
+ saveState(apanel, fileName, jout, viewIds);
+
+ }
+ if (apSize > 0)
+ {
+ // BH moved next bit out of inner loop, not that it really matters.
+ // so we are testing to make sure we actually have an alignment,
+ // apparently.
+ String dssid = getDatasetIdRef(alignment.getDataset());
+ if (!dsses.containsKey(dssid))
+ {
+ // We have not already covered this data by reference from another
+ // frame.
+ dsses.put(dssid, af);
+ }
+ }
+ }
+
+ writeDatasetFor(dsses, "" + jout.hashCode() + " " + uniqueSetSuffix,
+ jout);
+
+ try
+ {
+ jout.flush();
+ } catch (Exception foo)
+ {
+ }
+ jout.close();
+ } catch (Exception ex)
+ {
+ // TODO: inform user of the problem - they need to know if their data was
+ // not saved !
+ if (errorMessage == null)
+ {
+ errorMessage = "Couldn't write Jalview Archive - see error output for details";
+ }
+ ex.printStackTrace();
+ }
}
- }
-
- /**
- * Generates a distinct file name, based on the title of the AlignFrame, by
- * appending _n for increasing n until an unused name is generated. The new
- * name (without its extension) is added to the list.
- *
- * @param af
- * @param namesUsed
- * @return the generated name, with .xml extension
- */
- protected String makeFilename(AlignFrame af, List<String> namesUsed)
- {
- String shortName = af.getTitle();
- if (shortName.indexOf(File.separatorChar) > -1)
+ /**
+ * Generates a distinct file name, based on the title of the AlignFrame, by
+ * appending _n for increasing n until an unused name is generated. The new
+ * name (without its extension) is added to the list.
+ *
+ * @param af
+ * @param namesUsed
+ * @return the generated name, with .xml extension
+ */
+ protected String makeFilename(AlignFrame af, List<String> namesUsed)
{
- shortName = shortName
- .substring(shortName.lastIndexOf(File.separatorChar) + 1);
- }
+ String shortName = af.getTitle();
- int count = 1;
+ if (shortName.indexOf(File.separatorChar) > -1)
+ {
+ shortName = shortName
+ .substring(shortName.lastIndexOf(File.separatorChar) + 1);
+ }
- while (namesUsed.contains(shortName))
- {
- if (shortName.endsWith("_" + (count - 1)))
- {
- shortName = shortName.substring(0, shortName.lastIndexOf("_"));
- }
+ int count = 1;
- shortName = shortName.concat("_" + count);
- count++;
- }
+ while (namesUsed.contains(shortName))
+ {
+ if (shortName.endsWith("_" + (count - 1)))
+ {
+ shortName = shortName.substring(0, shortName.lastIndexOf("_"));
+ }
- namesUsed.add(shortName);
+ shortName = shortName.concat("_" + count);
+ count++;
+ }
- if (!shortName.endsWith(".xml"))
- {
- shortName = shortName + ".xml";
+ namesUsed.add(shortName);
+
+ if (!shortName.endsWith(".xml"))
+ {
+ shortName = shortName + ".xml";
+ }
+ return shortName;
}
- return shortName;
- }
- // USE THIS METHOD TO SAVE A SINGLE ALIGNMENT WINDOW
- public boolean saveAlignment(AlignFrame af, String jarFile,
- String fileName)
- {
- try
+ // USE THIS METHOD TO SAVE A SINGLE ALIGNMENT WINDOW
+ public boolean saveAlignment(AlignFrame af, String jarFile,
+ String fileName)
{
- // create backupfiles object and get new temp filename destination
- boolean doBackup = BackupFiles.getEnabled();
- BackupFiles backupfiles = doBackup ? new BackupFiles(jarFile) : null;
- FileOutputStream fos = new FileOutputStream(
- doBackup ? backupfiles.getTempFilePath() : jarFile);
+ try
+ {
+ // create backupfiles object and get new temp filename destination
+ boolean doBackup = BackupFiles.getEnabled();
+ BackupFiles backupfiles = doBackup ? new BackupFiles(jarFile) : null;
+ FileOutputStream fos = new FileOutputStream(doBackup ?
+ backupfiles.getTempFilePath() : jarFile);
- JarOutputStream jout = new JarOutputStream(fos);
- List<AlignFrame> frames = new ArrayList<>();
+ if (Cache.getDefault("DEBUG_DELAY_SAVE", false))
+ {
+ int n = debugDelaySave;
+ int i = 0;
+ while (i < n)
+ {
+ Console.debug("***** debugging save sleep " + i + "/" + n);
+ try
+ {
+ Thread.sleep(1000);
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ i++;
+ }
+ }
+
+ JarOutputStream jout = new JarOutputStream(fos);
+ List<AlignFrame> frames = new ArrayList<>();
- // resolve splitframes
- if (af.getViewport().getCodingComplement() != null)
- {
- frames = ((SplitFrame) af.getSplitViewContainer()).getAlignFrames();
- }
- else
- {
- frames.add(af);
- }
- saveAllFrames(frames, jout);
- try
- {
- jout.flush();
- } catch (Exception foo)
- {
- }
- jout.close();
- boolean success = true;
-
- if (doBackup)
- {
- backupfiles.setWriteSuccess(success);
- success = backupfiles.rollBackupsAndRenameTempFile();
- }
+ // resolve splitframes
+ if (af.getViewport().getCodingComplement() != null)
+ {
+ frames = ((SplitFrame) af.getSplitViewContainer()).getAlignFrames();
+ }
+ else
+ {
+ frames.add(af);
+ }
+ saveAllFrames(frames, jout);
+ try
+ {
+ jout.flush();
+ } catch (Exception foo)
+ {
+ }
+ jout.close();
+ boolean success = true;
+
+ if (doBackup)
+ {
+ backupfiles.setWriteSuccess(success);
+ success = backupfiles.rollBackupsAndRenameTempFile();
+ }
+
+ return success;
+ } catch (Exception ex)
+ {
+ errorMessage = "Couldn't Write alignment view to Jalview Archive - see error output for details";
+ ex.printStackTrace();
+ return false;
+ }
+ }
- return success;
- } catch (Exception ex)
+ /**
+ * Each AlignFrame has a single data set associated with it. Note that none of
+ * these frames are split frames, because Desktop.getAlignFrames() collects
+ * top and bottom separately here.
+ *
+ * @param dsses
+ * @param fileName
+ * @param jout
+ */
+ private void writeDatasetFor(Hashtable<String, AlignFrame> dsses,
+ String fileName, JarOutputStream jout)
{
- errorMessage = "Couldn't Write alignment view to Jalview Archive - see error output for details";
- ex.printStackTrace();
- return false;
- }
- }
- private void writeDatasetFor(Hashtable<String, AlignFrame> dsses,
- String fileName, JarOutputStream jout)
- {
+ // Note that in saveAllFrames we have associated each specific dataset to
+ // ONE of its associated frames.
+ for (String dssids : dsses.keySet())
+ {
+ AlignFrame _af = dsses.get(dssids);
+ String jfileName = fileName + " Dataset for " + _af.getTitle();
+ if (!jfileName.endsWith(".xml"))
+ {
+ jfileName = jfileName + ".xml";
+ }
+ saveState(_af.alignPanel, jfileName, true, jout, null);
+ }
+ }
- for (String dssids : dsses.keySet())
+ /**
+ * create a JalviewModel from an alignment view and marshall it to a
+ * JarOutputStream
+ *
+ * @param ap
+ * panel to create jalview model for
+ * @param fileName
+ * name of alignment panel written to output stream
+ * @param jout
+ * jar output stream
+ * @param viewIds
+ * @param out
+ * jar entry name
+ */
+ protected JalviewModel saveState(AlignmentPanel ap, String fileName,
+ JarOutputStream jout, List<String> viewIds)
{
- AlignFrame _af = dsses.get(dssids);
- String jfileName = fileName + " Dataset for " + _af.getTitle();
- if (!jfileName.endsWith(".xml"))
- {
- jfileName = jfileName + ".xml";
- }
- saveState(_af.alignPanel, jfileName, true, jout, null);
+ return saveState(ap, fileName, false, jout, viewIds);
}
- }
-
- /**
- * create a JalviewModel from an alignment view and marshall it to a
- * JarOutputStream
- *
- * @param ap
- * panel to create jalview model for
- * @param fileName
- * name of alignment panel written to output stream
- * @param jout
- * jar output stream
- * @param viewIds
- * @param out
- * jar entry name
- */
- public JalviewModel saveState(AlignmentPanel ap, String fileName,
- JarOutputStream jout, List<String> viewIds)
- {
- return saveState(ap, fileName, false, jout, viewIds);
- }
- /**
- * create a JalviewModel from an alignment view and marshall it to a
- * JarOutputStream
- *
- * @param ap
- * panel to create jalview model for
- * @param fileName
- * name of alignment panel written to output stream
- * @param storeDS
- * when true, only write the dataset for the alignment, not the data
- * associated with the view.
- * @param jout
- * jar output stream
- * @param out
- * jar entry name
- */
- public JalviewModel saveState(AlignmentPanel ap, String fileName,
- boolean storeDS, JarOutputStream jout, List<String> viewIds)
- {
- if (viewIds == null)
+ /**
+ * create a JalviewModel from an alignment view and marshall it to a
+ * JarOutputStream
+ *
+ * @param ap
+ * panel to create jalview model for
+ * @param fileName
+ * name of alignment panel written to output stream
+ * @param storeDS
+ * when true, only write the dataset for the alignment, not the data
+ * associated with the view.
+ * @param jout
+ * jar output stream
+ * @param out
+ * jar entry name
+ */
+ protected JalviewModel saveState(AlignmentPanel ap, String fileName,
+ boolean storeDS, JarOutputStream jout, List<String> viewIds)
{
- viewIds = new ArrayList<>();
- }
+ if (viewIds == null)
+ {
+ viewIds = new ArrayList<>();
+ }
- initSeqRefs();
+ initSeqRefs();
- List<UserColourScheme> userColours = new ArrayList<>();
+ List<UserColourScheme> userColours = new ArrayList<>();
- AlignViewport av = ap.av;
- ViewportRanges vpRanges = av.getRanges();
+ AlignViewport av = ap.av;
+ ViewportRanges vpRanges = av.getRanges();
- final ObjectFactory objectFactory = new ObjectFactory();
- JalviewModel object = objectFactory.createJalviewModel();
- object.setVamsasModel(new VAMSAS());
+ final ObjectFactory objectFactory = new ObjectFactory();
+ JalviewModel object = objectFactory.createJalviewModel();
+ object.setVamsasModel(new VAMSAS());
- // object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
- try
- {
- GregorianCalendar c = new GregorianCalendar();
- DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
- XMLGregorianCalendar now = datatypeFactory.newXMLGregorianCalendar(c);// gregorianCalendar);
- object.setCreationDate(now);
- } catch (DatatypeConfigurationException e)
- {
- System.err.println("error writing date: " + e.toString());
- }
- object.setVersion(Cache.getDefault("VERSION", "Development Build"));
+ // object.setCreationDate(new java.util.Date(System.currentTimeMillis()));
+ try
+ {
+ GregorianCalendar c = new GregorianCalendar();
+ DatatypeFactory datatypeFactory = DatatypeFactory.newInstance();
+ XMLGregorianCalendar now = datatypeFactory.newXMLGregorianCalendar(c);// gregorianCalendar);
+ object.setCreationDate(now);
+ } catch (DatatypeConfigurationException e)
+ {
+ jalview.bin.Console.errPrintln("error writing date: " + e.toString());
+ }
+ object.setVersion(Cache.getDefault("VERSION", "Development Build"));
- /**
- * rjal is full height alignment, jal is actual alignment with full metadata
- * but excludes hidden sequences.
- */
- jalview.datamodel.AlignmentI rjal = av.getAlignment(), jal = rjal;
-
- if (av.hasHiddenRows())
- {
- rjal = jal.getHiddenSequences().getFullAlignment();
- }
-
- SequenceSet vamsasSet = new SequenceSet();
- Sequence vamsasSeq;
- // JalviewModelSequence jms = new JalviewModelSequence();
-
- vamsasSet.setGapChar(jal.getGapCharacter() + "");
-
- if (jal.getDataset() != null)
- {
- // dataset id is the dataset's hashcode
- vamsasSet.setDatasetId(getDatasetIdRef(jal.getDataset()));
- if (storeDS)
- {
- // switch jal and the dataset
- jal = jal.getDataset();
- rjal = jal;
- }
- }
- if (jal.getProperties() != null)
- {
- Enumeration en = jal.getProperties().keys();
- while (en.hasMoreElements())
- {
- String key = en.nextElement().toString();
- SequenceSetProperties ssp = new SequenceSetProperties();
- ssp.setKey(key);
- ssp.setValue(jal.getProperties().get(key).toString());
- // vamsasSet.addSequenceSetProperties(ssp);
- vamsasSet.getSequenceSetProperties().add(ssp);
- }
- }
+ /**
+ * rjal is full height alignment, jal is actual alignment with full metadata
+ * but excludes hidden sequences.
+ */
+ jalview.datamodel.AlignmentI rjal = av.getAlignment(), jal = rjal;
+
+ if (av.hasHiddenRows())
+ {
+ rjal = jal.getHiddenSequences().getFullAlignment();
+ }
+
+ SequenceSet vamsasSet = new SequenceSet();
+ Sequence vamsasSeq;
+ // JalviewModelSequence jms = new JalviewModelSequence();
+
+ vamsasSet.setGapChar(jal.getGapCharacter() + "");
+
+ if (jal.getDataset() != null)
+ {
+ // dataset id is the dataset's hashcode
+ vamsasSet.setDatasetId(getDatasetIdRef(jal.getDataset()));
+ if (storeDS)
+ {
+ // switch jal and the dataset
+ jal = jal.getDataset();
+ rjal = jal;
+ }
+ }
+ if (jal.getProperties() != null)
+ {
+ Enumeration en = jal.getProperties().keys();
+ while (en.hasMoreElements())
+ {
+ String key = en.nextElement().toString();
+ SequenceSetProperties ssp = new SequenceSetProperties();
+ ssp.setKey(key);
+ ssp.setValue(jal.getProperties().get(key).toString());
+ // vamsasSet.addSequenceSetProperties(ssp);
+ vamsasSet.getSequenceSetProperties().add(ssp);
+ }
+ }
- JSeq jseq;
- Set<String> calcIdSet = new HashSet<>();
- // record the set of vamsas sequence XML POJO we create.
- HashMap<String, Sequence> vamsasSetIds = new HashMap<>();
- // SAVE SEQUENCES
- for (final SequenceI jds : rjal.getSequences())
- {
- final SequenceI jdatasq = jds.getDatasetSequence() == null ? jds
- : jds.getDatasetSequence();
- String id = seqHash(jds);
- if (vamsasSetIds.get(id) == null)
- {
- if (seqRefIds.get(id) != null && !storeDS)
- {
- // This happens for two reasons: 1. multiple views are being
- // serialised.
- // 2. the hashCode has collided with another sequence's code. This
- // DOES
- // HAPPEN! (PF00072.15.stk does this)
- // JBPNote: Uncomment to debug writing out of files that do not read
- // back in due to ArrayOutOfBoundExceptions.
- // System.err.println("vamsasSeq backref: "+id+"");
- // System.err.println(jds.getName()+"
- // "+jds.getStart()+"-"+jds.getEnd()+" "+jds.getSequenceAsString());
- // System.err.println("Hashcode: "+seqHash(jds));
- // SequenceI rsq = (SequenceI) seqRefIds.get(id + "");
- // System.err.println(rsq.getName()+"
- // "+rsq.getStart()+"-"+rsq.getEnd()+" "+rsq.getSequenceAsString());
- // System.err.println("Hashcode: "+seqHash(rsq));
- }
- else
- {
- vamsasSeq = createVamsasSequence(id, jds);
- // vamsasSet.addSequence(vamsasSeq);
- vamsasSet.getSequence().add(vamsasSeq);
- vamsasSetIds.put(id, vamsasSeq);
- seqRefIds.put(id, jds);
- }
- }
- jseq = new JSeq();
- jseq.setStart(jds.getStart());
- jseq.setEnd(jds.getEnd());
- jseq.setColour(av.getSequenceColour(jds).getRGB());
+ JSeq jseq;
+ Set<String> calcIdSet = new HashSet<>();
+ // record the set of vamsas sequence XML POJO we create.
+ HashMap<String, Sequence> vamsasSetIds = new HashMap<>();
+ // SAVE SEQUENCES
+ for (final SequenceI jds : rjal.getSequences())
+ {
+ final SequenceI jdatasq = jds.getDatasetSequence() == null ? jds
+ : jds.getDatasetSequence();
+ String id = seqHash(jds);
+ if (vamsasSetIds.get(id) == null)
+ {
+ if (seqRefIds.get(id) != null && !storeDS)
+ {
+ // This happens for two reasons: 1. multiple views are being
+ // serialised.
+ // 2. the hashCode has collided with another sequence's code. This
+ // DOES
+ // HAPPEN! (PF00072.15.stk does this)
+ // JBPNote: Uncomment to debug writing out of files that do not read
+ // back in due to ArrayOutOfBoundExceptions.
+ // jalview.bin.Console.errPrintln("vamsasSeq backref: "+id+"");
+ // jalview.bin.Console.errPrintln(jds.getName()+"
+ // "+jds.getStart()+"-"+jds.getEnd()+" "+jds.getSequenceAsString());
+ // jalview.bin.Console.errPrintln("Hashcode: "+seqHash(jds));
+ // SequenceI rsq = (SequenceI) seqRefIds.get(id + "");
+ // jalview.bin.Console.errPrintln(rsq.getName()+"
+ // "+rsq.getStart()+"-"+rsq.getEnd()+" "+rsq.getSequenceAsString());
+ // jalview.bin.Console.errPrintln("Hashcode: "+seqHash(rsq));
+ }
+ else
+ {
+ vamsasSeq = createVamsasSequence(id, jds);
+ // vamsasSet.addSequence(vamsasSeq);
+ vamsasSet.getSequence().add(vamsasSeq);
+ vamsasSetIds.put(id, vamsasSeq);
+ seqRefIds.put(id, jds);
+ }
+ }
+ jseq = new JSeq();
+ jseq.setStart(jds.getStart());
+ jseq.setEnd(jds.getEnd());
+ jseq.setColour(av.getSequenceColour(jds).getRGB());
- jseq.setId(id); // jseq id should be a string not a number
- if (!storeDS)
- {
- // Store any sequences this sequence represents
- if (av.hasHiddenRows())
- {
- // use rjal, contains the full height alignment
- jseq.setHidden(
- av.getAlignment().getHiddenSequences().isHidden(jds));
-
- if (av.isHiddenRepSequence(jds))
- {
- jalview.datamodel.SequenceI[] reps = av
- .getRepresentedSequences(jds).getSequencesInOrder(rjal);
-
- for (int h = 0; h < reps.length; h++)
- {
- if (reps[h] != jds)
- {
- // jseq.addHiddenSequences(rjal.findIndex(reps[h]));
- jseq.getHiddenSequences().add(rjal.findIndex(reps[h]));
- }
- }
- }
- }
- // mark sequence as reference - if it is the reference for this view
- if (jal.hasSeqrep())
- {
- jseq.setViewreference(jds == jal.getSeqrep());
- }
- }
-
- // TODO: omit sequence features from each alignment view's XML dump if we
- // are storing dataset
- List<SequenceFeature> sfs = jds.getSequenceFeatures();
- for (SequenceFeature sf : sfs)
- {
- // Features features = new Features();
- Feature features = new Feature();
-
- features.setBegin(sf.getBegin());
- features.setEnd(sf.getEnd());
- features.setDescription(sf.getDescription());
- features.setType(sf.getType());
- features.setFeatureGroup(sf.getFeatureGroup());
- features.setScore(sf.getScore());
- if (sf.links != null)
- {
- for (int l = 0; l < sf.links.size(); l++)
- {
- OtherData keyValue = new OtherData();
- keyValue.setKey("LINK_" + l);
- keyValue.setValue(sf.links.elementAt(l).toString());
- // features.addOtherData(keyValue);
- features.getOtherData().add(keyValue);
- }
- }
- if (sf.otherDetails != null)
- {
- /*
- * save feature attributes, which may be simple strings or
- * map valued (have sub-attributes)
- */
- for (Entry<String, Object> entry : sf.otherDetails.entrySet())
- {
- String key = entry.getKey();
- Object value = entry.getValue();
- if (value instanceof Map<?, ?>)
- {
- for (Entry<String, Object> subAttribute : ((Map<String, Object>) value)
- .entrySet())
- {
- OtherData otherData = new OtherData();
- otherData.setKey(key);
- otherData.setKey2(subAttribute.getKey());
- otherData.setValue(subAttribute.getValue().toString());
- // features.addOtherData(otherData);
- features.getOtherData().add(otherData);
- }
- }
- else
- {
- OtherData otherData = new OtherData();
- otherData.setKey(key);
- otherData.setValue(value.toString());
- // features.addOtherData(otherData);
- features.getOtherData().add(otherData);
- }
- }
- }
-
- // jseq.addFeatures(features);
- jseq.getFeatures().add(features);
- }
-
- if (jdatasq.getAllPDBEntries() != null)
- {
- Enumeration<PDBEntry> en = jdatasq.getAllPDBEntries().elements();
- while (en.hasMoreElements())
- {
- Pdbids pdb = new Pdbids();
- jalview.datamodel.PDBEntry entry = en.nextElement();
-
- String pdbId = entry.getId();
- pdb.setId(pdbId);
- pdb.setType(entry.getType());
+ jseq.setId(id); // jseq id should be a string not a number
+ if (!storeDS)
+ {
+ // Store any sequences this sequence represents
+ if (av.hasHiddenRows())
+ {
+ // use rjal, contains the full height alignment
+ jseq.setHidden(
+ av.getAlignment().getHiddenSequences().isHidden(jds));
+
+ if (av.isHiddenRepSequence(jds))
+ {
+ jalview.datamodel.SequenceI[] reps = av
+ .getRepresentedSequences(jds).getSequencesInOrder(rjal);
+
+ for (int h = 0; h < reps.length; h++)
+ {
+ if (reps[h] != jds)
+ {
+ // jseq.addHiddenSequences(rjal.findIndex(reps[h]));
+ jseq.getHiddenSequences().add(rjal.findIndex(reps[h]));
+ }
+ }
+ }
+ }
+ // mark sequence as reference - if it is the reference for this view
+ if (jal.hasSeqrep())
+ {
+ jseq.setViewreference(jds == jal.getSeqrep());
+ }
+ }
+
+ // TODO: omit sequence features from each alignment view's XML dump if we
+ // are storing dataset
+ List<SequenceFeature> sfs = jds.getSequenceFeatures();
+ for (SequenceFeature sf : sfs)
+ {
+ // Features features = new Features();
+ Feature features = new Feature();
+
+ features.setBegin(sf.getBegin());
+ features.setEnd(sf.getEnd());
+ features.setDescription(sf.getDescription());
+ features.setType(sf.getType());
+ features.setFeatureGroup(sf.getFeatureGroup());
+ features.setScore(sf.getScore());
+ if (sf.links != null)
+ {
+ for (int l = 0; l < sf.links.size(); l++)
+ {
+ OtherData keyValue = new OtherData();
+ keyValue.setKey("LINK_" + l);
+ keyValue.setValue(sf.links.elementAt(l).toString());
+ // features.addOtherData(keyValue);
+ features.getOtherData().add(keyValue);
+ }
+ }
+ if (sf.otherDetails != null)
+ {
+ /*
+ * save feature attributes, which may be simple strings or
+ * map valued (have sub-attributes)
+ */
+ for (Entry<String, Object> entry : sf.otherDetails.entrySet())
+ {
+ String key = entry.getKey();
+ Object value = entry.getValue();
+ if (value instanceof Map<?, ?>)
+ {
+ for (Entry<String, Object> subAttribute : ((Map<String, Object>) value)
+ .entrySet())
+ {
+ OtherData otherData = new OtherData();
+ otherData.setKey(key);
+ otherData.setKey2(subAttribute.getKey());
+ otherData.setValue(subAttribute.getValue().toString());
+ // features.addOtherData(otherData);
+ features.getOtherData().add(otherData);
+ }
+ }
+ else
+ {
+ OtherData otherData = new OtherData();
+ otherData.setKey(key);
+ otherData.setValue(value.toString());
+ // features.addOtherData(otherData);
+ features.getOtherData().add(otherData);
+ }
+ }
+ }
+
+ // jseq.addFeatures(features);
+ jseq.getFeatures().add(features);
+ }
+
+ /*
+ * save PDB entries for sequence
+ */
+ if (jdatasq.getAllPDBEntries() != null)
+ {
+ Enumeration<PDBEntry> en = jdatasq.getAllPDBEntries().elements();
+ while (en.hasMoreElements())
+ {
+ Pdbids pdb = new Pdbids();
+ jalview.datamodel.PDBEntry entry = en.nextElement();
+
+ String pdbId = entry.getId();
+ pdb.setId(pdbId);
+ pdb.setType(entry.getType());
- /*
- * Store any structure views associated with this sequence. This
- * section copes with duplicate entries in the project, so a dataset
- * only view *should* be coped with sensibly.
- */
- // This must have been loaded, is it still visible?
- JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
- String matchedFile = null;
- for (int f = frames.length - 1; f > -1; f--)
- {
- if (frames[f] instanceof StructureViewerBase)
- {
- StructureViewerBase viewFrame = (StructureViewerBase) frames[f];
- matchedFile = saveStructureViewer(ap, jds, pdb, entry,
- viewIds, matchedFile, viewFrame);
- /*
- * Only store each structure viewer's state once in the project
- * jar. First time through only (storeDS==false)
- */
- String viewId = viewFrame.getViewId();
- String viewerType = viewFrame.getViewerType().toString();
- if (!storeDS && !viewIds.contains(viewId))
- {
- viewIds.add(viewId);
- File viewerState = viewFrame.saveSession();
- if (viewerState != null)
- {
- copyFileToJar(jout, viewerState.getPath(),
- getViewerJarEntryName(viewId), viewerType);
- }
- else
- {
- Console.error(
- "Failed to save viewer state for " + viewerType);
- }
- }
- }
- }
+ /*
+ * Store any structure views associated with this sequence. This
+ * section copes with duplicate entries in the project, so a dataset
+ * only view *should* be coped with sensibly.
+ */
+ // This must have been loaded, is it still visible?
+ List<JalviewStructureDisplayI> viewFrames = new ArrayList<>();
- if (Desktop.desktop != null)
++ if (Desktop.getDesktopPane() != null)
+ {
- JInternalFrame[] jifs = Desktop.desktop.getAllFrames();
++ JInternalFrame[] jifs = Desktop.getDesktopPane().getAllFrames();
+ if (jifs != null)
+ {
+ for (JInternalFrame jif : jifs)
+ {
+ if (jif instanceof JalviewStructureDisplayI)
+ {
+ viewFrames.add((JalviewStructureDisplayI) jif);
+ }
+ }
+ }
+ }
+ else if (Jalview.isHeadlessMode()
+ && Jalview.getInstance().getCommands() != null)
+ {
+ viewFrames.addAll(
+ StructureViewerBase.getAllStructureViewerBases());
+ }
+
+ String matchedFile = null;
+ for (JalviewStructureDisplayI viewFrame : viewFrames)
+ {
+ matchedFile = saveStructureViewer(ap, jds, pdb, entry, viewIds,
+ matchedFile, viewFrame);
+ /*
+ * Only store each structure viewer's state once in the project
+ * jar. First time through only (storeDS==false)
+ */
+ String viewId = viewFrame.getViewId();
+ String viewerType = viewFrame.getViewerType().toString();
+ if (!storeDS && !viewIds.contains(viewId))
+ {
+ viewIds.add(viewId);
+ File viewerState = viewFrame.saveSession();
+ if (viewerState != null)
+ {
+ copyFileToJar(jout, viewerState.getPath(),
+ getViewerJarEntryName(viewId), viewerType);
+ }
+ else
+ {
+ Console.error(
+ "Failed to save viewer state for " + viewerType);
+ }
+ }
+ }
- if (matchedFile != null || entry.getFile() != null)
- {
- if (entry.getFile() != null)
- {
- // use entry's file
- matchedFile = entry.getFile();
- }
- pdb.setFile(matchedFile); // entry.getFile());
- if (pdbfiles == null)
- {
- pdbfiles = new ArrayList<>();
- }
-
- if (!pdbfiles.contains(pdbId))
- {
- pdbfiles.add(pdbId);
- copyFileToJar(jout, matchedFile, pdbId, pdbId);
- }
- }
-
- Enumeration<String> props = entry.getProperties();
- if (props.hasMoreElements())
- {
- // PdbentryItem item = new PdbentryItem();
- while (props.hasMoreElements())
- {
- Property prop = new Property();
- String key = props.nextElement();
- prop.setName(key);
- prop.setValue(entry.getProperty(key).toString());
- // item.addProperty(prop);
- pdb.getProperty().add(prop);
- }
- // pdb.addPdbentryItem(item);
- }
-
- // jseq.addPdbids(pdb);
- jseq.getPdbids().add(pdb);
- }
- }
-
- saveRnaViewers(jout, jseq, jds, viewIds, ap, storeDS);
-
- // jms.addJSeq(jseq);
- object.getJSeq().add(jseq);
- }
-
- if (!storeDS && av.hasHiddenRows())
- {
- jal = av.getAlignment();
- }
- // SAVE MAPPINGS
- // FOR DATASET
- if (storeDS && jal.getCodonFrames() != null)
- {
- List<AlignedCodonFrame> jac = jal.getCodonFrames();
- for (AlignedCodonFrame acf : jac)
- {
- AlcodonFrame alc = new AlcodonFrame();
- if (acf.getProtMappings() != null
- && acf.getProtMappings().length > 0)
- {
- boolean hasMap = false;
- SequenceI[] dnas = acf.getdnaSeqs();
- jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
- for (int m = 0; m < pmaps.length; m++)
- {
- AlcodMap alcmap = new AlcodMap();
- alcmap.setDnasq(seqHash(dnas[m]));
- alcmap.setMapping(
- createVamsasMapping(pmaps[m], dnas[m], null, false));
- // alc.addAlcodMap(alcmap);
- alc.getAlcodMap().add(alcmap);
- hasMap = true;
- }
- if (hasMap)
- {
- // vamsasSet.addAlcodonFrame(alc);
- vamsasSet.getAlcodonFrame().add(alc);
- }
- }
- // TODO: delete this ? dead code from 2.8.3->2.9 ?
- // {
- // AlcodonFrame alc = new AlcodonFrame();
- // vamsasSet.addAlcodonFrame(alc);
- // for (int p = 0; p < acf.aaWidth; p++)
- // {
- // Alcodon cmap = new Alcodon();
- // if (acf.codons[p] != null)
- // {
- // // Null codons indicate a gapped column in the translated peptide
- // // alignment.
- // cmap.setPos1(acf.codons[p][0]);
- // cmap.setPos2(acf.codons[p][1]);
- // cmap.setPos3(acf.codons[p][2]);
- // }
- // alc.addAlcodon(cmap);
- // }
- // if (acf.getProtMappings() != null
- // && acf.getProtMappings().length > 0)
- // {
- // SequenceI[] dnas = acf.getdnaSeqs();
- // jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
- // for (int m = 0; m < pmaps.length; m++)
- // {
- // AlcodMap alcmap = new AlcodMap();
- // alcmap.setDnasq(seqHash(dnas[m]));
- // alcmap.setMapping(createVamsasMapping(pmaps[m], dnas[m], null,
- // false));
- // alc.addAlcodMap(alcmap);
- // }
- // }
- }
- }
-
- // SAVE TREES
- // /////////////////////////////////
- if (!storeDS && av.getCurrentTree() != null)
- {
- // FIND ANY ASSOCIATED TREES
- // NOT IMPLEMENTED FOR HEADLESS STATE AT PRESENT
- if (Desktop.desktop != null)
- {
- JInternalFrame[] frames = Desktop.desktop.getAllFrames();
-
- for (int t = 0; t < frames.length; t++)
- {
- if (frames[t] instanceof TreePanel)
- {
- TreePanel tp = (TreePanel) frames[t];
-
- if (tp.getTreeCanvas().getViewport().getAlignment() == jal)
- {
- JalviewModel.Tree tree = new JalviewModel.Tree();
- tree.setTitle(tp.getTitle());
- tree.setCurrentTree((av.getCurrentTree() == tp.getTree()));
- tree.setNewick(tp.getTree().print());
- tree.setThreshold(tp.getTreeCanvas().getThreshold());
-
- tree.setFitToWindow(tp.fitToWindow.getState());
- tree.setFontName(tp.getTreeFont().getName());
- tree.setFontSize(tp.getTreeFont().getSize());
- tree.setFontStyle(tp.getTreeFont().getStyle());
- tree.setMarkUnlinked(tp.placeholdersMenu.getState());
-
- tree.setShowBootstrap(tp.bootstrapMenu.getState());
- tree.setShowDistances(tp.distanceMenu.getState());
-
- tree.setHeight(tp.getHeight());
- tree.setWidth(tp.getWidth());
- tree.setXpos(tp.getX());
- tree.setYpos(tp.getY());
- tree.setId(makeHashCode(tp, null));
- tree.setLinkToAllViews(
- tp.getTreeCanvas().isApplyToAllViews());
+ if (matchedFile != null || entry.getFile() != null)
+ {
+ if (entry.getFile() != null)
+ {
+ // use entry's file
+ matchedFile = entry.getFile();
+ }
+ pdb.setFile(matchedFile); // entry.getFile());
+ if (pdbfiles == null)
+ {
+ pdbfiles = new ArrayList<>();
+ }
+
+ if (!pdbfiles.contains(pdbId))
+ {
+ pdbfiles.add(pdbId);
+ copyFileToJar(jout, matchedFile, pdbId, pdbId);
+ }
+ }
+
+ Enumeration<String> props = entry.getProperties();
+ if (props.hasMoreElements())
+ {
+ // PdbentryItem item = new PdbentryItem();
+ while (props.hasMoreElements())
+ {
+ Property prop = new Property();
+ String key = props.nextElement();
+ prop.setName(key);
+ prop.setValue(entry.getProperty(key).toString());
+ // item.addProperty(prop);
+ pdb.getProperty().add(prop);
+ }
+ // pdb.addPdbentryItem(item);
+ }
+
+ // jseq.addPdbids(pdb);
+ jseq.getPdbids().add(pdb);
+ }
+ }
+
+ saveRnaViewers(jout, jseq, jds, viewIds, ap, storeDS);
+
+ if (jds.hasHMMProfile())
+ {
+ saveHmmerProfile(jout, jseq, jds);
+ }
+ // jms.addJSeq(jseq);
+ object.getJSeq().add(jseq);
+ }
+
+ if (!storeDS && av.hasHiddenRows())
+ {
+ jal = av.getAlignment();
+ }
+ // SAVE MAPPINGS
+ // FOR DATASET
+ if (storeDS && jal.getCodonFrames() != null)
+ {
+ List<AlignedCodonFrame> jac = jal.getCodonFrames();
+ for (AlignedCodonFrame acf : jac)
+ {
+ AlcodonFrame alc = new AlcodonFrame();
+ if (acf.getProtMappings() != null
+ && acf.getProtMappings().length > 0)
+ {
+ boolean hasMap = false;
+ SequenceI[] dnas = acf.getdnaSeqs();
+ jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
+ for (int m = 0; m < pmaps.length; m++)
+ {
+ AlcodMap alcmap = new AlcodMap();
+ alcmap.setDnasq(seqHash(dnas[m]));
+ alcmap.setMapping(
+ createVamsasMapping(pmaps[m], dnas[m], null, false));
+ // alc.addAlcodMap(alcmap);
+ alc.getAlcodMap().add(alcmap);
+ hasMap = true;
+ }
+ if (hasMap)
+ {
+ // vamsasSet.addAlcodonFrame(alc);
+ vamsasSet.getAlcodonFrame().add(alc);
+ }
+ }
+ // TODO: delete this ? dead code from 2.8.3->2.9 ?
+ // {
+ // AlcodonFrame alc = new AlcodonFrame();
+ // vamsasSet.addAlcodonFrame(alc);
+ // for (int p = 0; p < acf.aaWidth; p++)
+ // {
+ // Alcodon cmap = new Alcodon();
+ // if (acf.codons[p] != null)
+ // {
+ // // Null codons indicate a gapped column in the translated peptide
+ // // alignment.
+ // cmap.setPos1(acf.codons[p][0]);
+ // cmap.setPos2(acf.codons[p][1]);
+ // cmap.setPos3(acf.codons[p][2]);
+ // }
+ // alc.addAlcodon(cmap);
+ // }
+ // if (acf.getProtMappings() != null
+ // && acf.getProtMappings().length > 0)
+ // {
+ // SequenceI[] dnas = acf.getdnaSeqs();
+ // jalview.datamodel.Mapping[] pmaps = acf.getProtMappings();
+ // for (int m = 0; m < pmaps.length; m++)
+ // {
+ // AlcodMap alcmap = new AlcodMap();
+ // alcmap.setDnasq(seqHash(dnas[m]));
+ // alcmap.setMapping(createVamsasMapping(pmaps[m], dnas[m], null,
+ // false));
+ // alc.addAlcodMap(alcmap);
+ // }
+ // }
+ }
+ }
+
+ // SAVE TREES
+ // /////////////////////////////////
+ if (!storeDS && av.getCurrentTree() != null)
+ {
+ // FIND ANY ASSOCIATED TREES
+ // NOT IMPLEMENTED FOR HEADLESS STATE AT PRESENT
+ if (Desktop.getDesktopPane() != null)
+ {
+ JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
+
+ for (int t = 0; t < frames.length; t++)
+ {
+ if (frames[t] instanceof TreePanel)
+ {
+ TreePanel tp = (TreePanel) frames[t];
+
+ if (tp.getTreeCanvas().getViewport().getAlignment() == jal)
+ {
+ JalviewModel.Tree tree = new JalviewModel.Tree();
+ tree.setTitle(tp.getTitle());
+ tree.setCurrentTree((av.getCurrentTree() == tp.getTree()));
+ tree.setNewick(tp.getTree().print());
+ tree.setThreshold(tp.getTreeCanvas().getThreshold());
+
+ tree.setFitToWindow(tp.fitToWindow.getState());
+ tree.setFontName(tp.getTreeFont().getName());
+ tree.setFontSize(tp.getTreeFont().getSize());
+ tree.setFontStyle(tp.getTreeFont().getStyle());
+ tree.setMarkUnlinked(tp.placeholdersMenu.getState());
+
+ tree.setShowBootstrap(tp.bootstrapMenu.getState());
+ tree.setShowDistances(tp.distanceMenu.getState());
+
+ tree.setHeight(tp.getHeight());
+ tree.setWidth(tp.getWidth());
+ tree.setXpos(tp.getX());
+ tree.setYpos(tp.getY());
+ tree.setId(makeHashCode(tp, null));
+ tree.setLinkToAllViews(
+ tp.getTreeCanvas().isApplyToAllViews());
+ // columnWiseTree
+ if (tp.isColumnWise())
+ {
+ tree.setColumnWise(true);
+ String annId = tp.getAssocAnnotation().annotationId;
+ tree.setColumnReference(annId);
+ }
- // jms.addTree(tree);
- object.getTree().add(tree);
- }
- }
- }
- }
- }
+ // jms.addTree(tree);
+ object.getTree().add(tree);
+ }
+ }
+ }
+ }
+ }
+
+ /*
+ * save PCA viewers
+ */
+ if (!storeDS && Desktop.getDesktopPane() != null)
+ {
+ for (JInternalFrame frame : Desktop.getDesktopPane().getAllFrames())
+ {
+ if (frame instanceof PCAPanel)
+ {
+ PCAPanel panel = (PCAPanel) frame;
+ if (panel.getAlignViewport().getAlignment() == jal)
+ {
+ savePCA(panel, object);
+ }
+ }
+ }
+ }
+
+ // SAVE ANNOTATIONS
+ /**
+ * store forward refs from an annotationRow to any groups
+ */
+ IdentityHashMap<SequenceGroup, String> groupRefs = new IdentityHashMap<>();
+ if (storeDS)
+ {
+ for (SequenceI sq : jal.getSequences())
+ {
+ // Store annotation on dataset sequences only
+ AlignmentAnnotation[] aa = sq.getAnnotation();
+ if (aa != null && aa.length > 0)
+ {
+ storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
+ vamsasSet);
+ }
+ }
+ }
+ else
+ {
+ if (jal.getAlignmentAnnotation() != null)
+ {
+ // Store the annotation shown on the alignment.
+ AlignmentAnnotation[] aa = jal.getAlignmentAnnotation();
+ storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
+ vamsasSet);
+ }
+ }
+ // SAVE GROUPS
+ if (jal.getGroups() != null)
+ {
+ JGroup[] groups = new JGroup[jal.getGroups().size()];
+ int i = -1;
+ for (jalview.datamodel.SequenceGroup sg : jal.getGroups())
+ {
+ JGroup jGroup = new JGroup();
+ groups[++i] = jGroup;
+
+ jGroup.setStart(sg.getStartRes());
+ jGroup.setEnd(sg.getEndRes());
+ jGroup.setName(sg.getName());
+ if (groupRefs.containsKey(sg))
+ {
+ // group has references so set its ID field
+ jGroup.setId(groupRefs.get(sg));
+ }
+ ColourSchemeI colourScheme = sg.getColourScheme();
+ if (colourScheme != null)
+ {
+ ResidueShaderI groupColourScheme = sg.getGroupColourScheme();
+ if (groupColourScheme.conservationApplied())
+ {
+ jGroup.setConsThreshold(groupColourScheme.getConservationInc());
+
+ if (colourScheme instanceof jalview.schemes.UserColourScheme)
+ {
+ jGroup.setColour(
+ setUserColourScheme(colourScheme, userColours,
+ object));
+ }
+ else
+ {
+ jGroup.setColour(colourScheme.getSchemeName());
+ }
+ }
+ else if (colourScheme instanceof jalview.schemes.AnnotationColourGradient)
+ {
+ jGroup.setColour("AnnotationColourGradient");
+ jGroup.setAnnotationColours(constructAnnotationColours(
+ (jalview.schemes.AnnotationColourGradient) colourScheme,
+ userColours, object));
+ }
+ else if (colourScheme instanceof jalview.schemes.UserColourScheme)
+ {
+ jGroup.setColour(
+ setUserColourScheme(colourScheme, userColours, object));
+ }
+ else
+ {
+ jGroup.setColour(colourScheme.getSchemeName());
+ }
+
+ jGroup.setPidThreshold(groupColourScheme.getThreshold());
+ }
+
+ jGroup.setOutlineColour(sg.getOutlineColour().getRGB());
+ jGroup.setDisplayBoxes(sg.getDisplayBoxes());
+ jGroup.setDisplayText(sg.getDisplayText());
+ jGroup.setColourText(sg.getColourText());
+ jGroup.setTextCol1(sg.textColour.getRGB());
+ jGroup.setTextCol2(sg.textColour2.getRGB());
+ jGroup.setTextColThreshold(sg.thresholdTextColour);
+ jGroup.setShowUnconserved(sg.getShowNonconserved());
+ jGroup.setIgnoreGapsinConsensus(sg.getIgnoreGapsConsensus());
+ jGroup.setShowConsensusHistogram(sg.isShowConsensusHistogram());
+ jGroup.setShowSequenceLogo(sg.isShowSequenceLogo());
+ jGroup.setNormaliseSequenceLogo(sg.isNormaliseSequenceLogo());
+ for (SequenceI seq : sg.getSequences())
+ {
+ // jGroup.addSeq(seqHash(seq));
+ jGroup.getSeq().add(seqHash(seq));
+ }
+ }
+
+ //jms.setJGroup(groups);
+ Object group;
+ for (JGroup grp : groups)
+ {
+ object.getJGroup().add(grp);
+ }
+ }
+ if (!storeDS)
+ {
+ // /////////SAVE VIEWPORT
+ Viewport view = new Viewport();
+ view.setTitle(ap.alignFrame.getTitle());
+ view.setSequenceSetId(
+ makeHashCode(av.getSequenceSetId(), av.getSequenceSetId()));
+ view.setId(av.getViewId());
+ if (av.getCodingComplement() != null)
+ {
+ view.setComplementId(av.getCodingComplement().getViewId());
+ }
+ view.setViewName(av.getViewName());
+ view.setGatheredViews(av.isGatherViewsHere());
+
+ Rectangle size = ap.av.getExplodedGeometry();
+ Rectangle position = size;
+ if (size == null)
+ {
+ size = ap.alignFrame.getBounds();
+ if (av.getCodingComplement() != null)
+ {
+ position = ((SplitFrame) ap.alignFrame.getSplitViewContainer())
+ .getBounds();
+ }
+ else
+ {
+ position = size;
+ }
+ }
+ view.setXpos(position.x);
+ view.setYpos(position.y);
+
+ view.setWidth(size.width);
+ view.setHeight(size.height);
+
+ view.setStartRes(vpRanges.getStartRes());
+ view.setStartSeq(vpRanges.getStartSeq());
- /*
- * save PCA viewers
- */
- if (!storeDS && Desktop.desktop != null)
- {
- for (JInternalFrame frame : Desktop.desktop.getAllFrames())
++ OverviewPanel ov = ap.getOverviewPanel();
++ if (ov != null)
+ {
- if (frame instanceof PCAPanel)
- {
- PCAPanel panel = (PCAPanel) frame;
- if (panel.getAlignViewport().getAlignment() == jal)
- {
- savePCA(panel, object);
- }
- }
++ Overview overview = new Overview();
++ overview.setTitle(ov.getTitle());
++ Rectangle bounds = ov.getFrameBounds();
++ overview.setXpos(bounds.x);
++ overview.setYpos(bounds.y);
++ overview.setWidth(bounds.width);
++ overview.setHeight(bounds.height);
++ overview.setShowHidden(ov.isShowHiddenRegions());
++ overview.setGapColour(ov.getCanvas().getGapColour().getRGB());
++ overview.setResidueColour(
++ ov.getCanvas().getResidueColour().getRGB());
++ overview.setHiddenColour(ov.getCanvas().getHiddenColour().getRGB());
++ view.setOverview(overview);
+ }
- }
+ if (av.getGlobalColourScheme() instanceof jalview.schemes.UserColourScheme)
+ {
+ view.setBgColour(setUserColourScheme(av.getGlobalColourScheme(),
+ userColours, object));
+ }
+ else if (av
+ .getGlobalColourScheme() instanceof jalview.schemes.AnnotationColourGradient)
+ {
+ AnnotationColourScheme ac = constructAnnotationColours(
+ (jalview.schemes.AnnotationColourGradient) av
+ .getGlobalColourScheme(),
+ userColours, object);
+
+ view.setAnnotationColours(ac);
+ view.setBgColour("AnnotationColourGradient");
+ }
+ else
+ {
+ view.setBgColour(ColourSchemeProperty
+ .getColourName(av.getGlobalColourScheme()));
+ }
+
+ ResidueShaderI vcs = av.getResidueShading();
+ ColourSchemeI cs = av.getGlobalColourScheme();
+
+ if (cs != null)
+ {
+ if (vcs.conservationApplied())
+ {
+ view.setConsThreshold(vcs.getConservationInc());
+ if (cs instanceof jalview.schemes.UserColourScheme)
+ {
+ view.setBgColour(setUserColourScheme(cs, userColours, object));
+ }
+ }
+ view.setPidThreshold(vcs.getThreshold());
+ }
+
+ view.setConservationSelected(av.getConservationSelected());
+ view.setPidSelected(av.getAbovePIDThreshold());
++ view.setCharHeight(av.getCharHeight());
++ view.setCharWidth(av.getCharWidth());
+ final Font font = av.getFont();
+ view.setFontName(font.getName());
+ view.setFontSize(font.getSize());
+ view.setFontStyle(font.getStyle());
+ view.setScaleProteinAsCdna(av.getViewStyle().isScaleProteinAsCdna());
+ view.setRenderGaps(av.isRenderGaps());
+ view.setShowAnnotation(av.isShowAnnotation());
+ view.setShowBoxes(av.getShowBoxes());
+ view.setShowColourText(av.getColourText());
+ view.setShowFullId(av.getShowJVSuffix());
+ view.setRightAlignIds(av.isRightAlignIds());
++ view.setIdWidth(av.getIdWidth());
++ view.setIdWidthManuallyAdjusted(
++ ap.getIdPanel().getIdCanvas().isManuallyAdjusted());
++
+ view.setShowSequenceFeatures(av.isShowSequenceFeatures());
+ view.setShowText(av.getShowText());
+ view.setShowUnconserved(av.getShowUnconserved());
+ view.setWrapAlignment(av.getWrapAlignment());
+ view.setTextCol1(av.getTextColour().getRGB());
+ view.setTextCol2(av.getTextColour2().getRGB());
+ view.setTextColThreshold(av.getThresholdTextColour());
+ view.setShowConsensusHistogram(av.isShowConsensusHistogram());
+ view.setShowSequenceLogo(av.isShowSequenceLogo());
+ view.setNormaliseSequenceLogo(av.isNormaliseSequenceLogo());
+ view.setShowGroupConsensus(av.isShowGroupConsensus());
+ view.setShowGroupConservation(av.isShowGroupConservation());
+ view.setShowNPfeatureTooltip(av.isShowNPFeats());
+ view.setShowDbRefTooltip(av.isShowDBRefs());
+ view.setFollowHighlight(av.isFollowHighlight());
+ view.setFollowSelection(av.followSelection);
+ view.setIgnoreGapsinConsensus(av.isIgnoreGapsConsensus());
+ view.setShowComplementFeatures(av.isShowComplementFeatures());
+ view.setShowComplementFeaturesOnTop(
+ av.isShowComplementFeaturesOnTop());
+ if (av.getFeaturesDisplayed() != null)
+ {
+ FeatureSettings fs = new FeatureSettings();
+
+ FeatureRendererModel fr = ap.getSeqPanel().seqCanvas
+ .getFeatureRenderer();
+ String[] renderOrder = fr.getRenderOrder().toArray(new String[0]);
+
+ Vector<String> settingsAdded = new Vector<>();
+ if (renderOrder != null)
+ {
+ for (String featureType : renderOrder)
+ {
+ FeatureSettings.Setting setting = new FeatureSettings.Setting();
+ setting.setType(featureType);
+
+ /*
+ * save any filter for the feature type
+ */
+ FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
+ if (filter != null) {
+ Iterator<FeatureMatcherI> filters = filter.getMatchers().iterator();
+ FeatureMatcherI firstFilter = filters.next();
+ setting.setMatcherSet(Jalview2XML.marshalFilter(
+ firstFilter, filters, filter.isAnded()));
+ }
+
+ /*
+ * save colour scheme for the feature type
+ */
+ FeatureColourI fcol = fr.getFeatureStyle(featureType);
+ if (!fcol.isSimpleColour())
+ {
+ setting.setColour(fcol.getMaxColour().getRGB());
+ setting.setMincolour(fcol.getMinColour().getRGB());
+ setting.setMin(fcol.getMin());
+ setting.setMax(fcol.getMax());
+ setting.setColourByLabel(fcol.isColourByLabel());
+ if (fcol.isColourByAttribute())
+ {
+ String[] attName = fcol.getAttributeName();
+ setting.getAttributeName().add(attName[0]);
+ if (attName.length > 1)
+ {
+ setting.getAttributeName().add(attName[1]);
+ }
+ }
+ setting.setAutoScale(fcol.isAutoScaled());
+ setting.setThreshold(fcol.getThreshold());
+ Color noColour = fcol.getNoColour();
+ if (noColour == null)
+ {
+ setting.setNoValueColour(NoValueColour.NONE);
+ }
+ else if (noColour.equals(fcol.getMaxColour()))
+ {
+ setting.setNoValueColour(NoValueColour.MAX);
+ }
+ else
+ {
+ setting.setNoValueColour(NoValueColour.MIN);
+ }
+ // -1 = No threshold, 0 = Below, 1 = Above
+ setting.setThreshstate(fcol.isAboveThreshold() ? 1
+ : (fcol.isBelowThreshold() ? 0 : -1));
+ }
+ else
+ {
+ setting.setColour(fcol.getColour().getRGB());
+ }
+
+ setting.setDisplay(
+ av.getFeaturesDisplayed().isVisible(featureType));
+ float rorder = fr
+ .getOrder(featureType);
+ if (rorder > -1)
+ {
+ setting.setOrder(rorder);
+ }
+ /// fs.addSetting(setting);
+ fs.getSetting().add(setting);
+ settingsAdded.addElement(featureType);
+ }
+ }
+
+ // is groups actually supposed to be a map here ?
+ Iterator<String> en = fr.getFeatureGroups().iterator();
+ Vector<String> groupsAdded = new Vector<>();
+ while (en.hasNext())
+ {
+ String grp = en.next();
+ if (groupsAdded.contains(grp))
+ {
+ continue;
+ }
+ Group g = new Group();
+ g.setName(grp);
+ g.setDisplay(((Boolean) fr.checkGroupVisibility(grp, false))
+ .booleanValue());
+ // fs.addGroup(g);
+ fs.getGroup().add(g);
+ groupsAdded.addElement(grp);
+ }
+ // jms.setFeatureSettings(fs);
+ object.setFeatureSettings(fs);
+ }
+
+ if (av.hasHiddenColumns())
+ {
+ jalview.datamodel.HiddenColumns hidden = av.getAlignment()
+ .getHiddenColumns();
+ if (hidden == null)
+ {
+ Console.warn(
+ "REPORT BUG: avoided null columnselection bug (DMAM reported). Please contact Jim about this.");
+ }
+ else
+ {
+ Iterator<int[]> hiddenRegions = hidden.iterator();
+ while (hiddenRegions.hasNext())
+ {
+ int[] region = hiddenRegions.next();
+ HiddenColumns hc = new HiddenColumns();
+ hc.setStart(region[0]);
+ hc.setEnd(region[1]);
+ // view.addHiddenColumns(hc);
+ view.getHiddenColumns().add(hc);
+ }
+ }
+ }
+ if (calcIdSet.size() > 0)
+ {
+ for (String calcId : calcIdSet)
+ {
+ if (calcId.trim().length() > 0)
+ {
+ CalcIdParam cidp = createCalcIdParam(calcId, av);
+ // Some calcIds have no parameters.
+ if (cidp != null)
+ {
+ // view.addCalcIdParam(cidp);
+ view.getCalcIdParam().add(cidp);
+ }
+ }
+ }
+ }
+
+ // jms.addViewport(view);
+ object.getViewport().add(view);
+ }
+
- // SAVE ANNOTATIONS
- /**
- * store forward refs from an annotationRow to any groups
- */
- IdentityHashMap<SequenceGroup, String> groupRefs = new IdentityHashMap<>();
+ if (storeDS)
+ {
- for (SequenceI sq : jal.getSequences())
- {
- // Store annotation on dataset sequences only
- AlignmentAnnotation[] aa = sq.getAnnotation();
- if (aa != null && aa.length > 0)
- {
- storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
- vamsasSet);
- }
- }
- }
- else
- {
- if (jal.getAlignmentAnnotation() != null)
++ // store matrices referenced by any views or annotation in this dataset
++ if (xmlMatrices != null && xmlMatrices.size() > 0)
+ {
- // Store the annotation shown on the alignment.
- AlignmentAnnotation[] aa = jal.getAlignmentAnnotation();
- storeAlignmentAnnotation(aa, groupRefs, av, calcIdSet, storeDS,
- vamsasSet);
++ Console.debug(
++ "Adding " + xmlMatrices.size() + " matrices to dataset.");
++ vamsasSet.getMatrix().addAll(xmlMatrices);
++ xmlMatrices.clear();
+ }
+ }
- // SAVE GROUPS
- if (jal.getGroups() != null)
- {
- JGroup[] groups = new JGroup[jal.getGroups().size()];
- int i = -1;
- for (jalview.datamodel.SequenceGroup sg : jal.getGroups())
- {
- JGroup jGroup = new JGroup();
- groups[++i] = jGroup;
+
- jGroup.setStart(sg.getStartRes());
- jGroup.setEnd(sg.getEndRes());
- jGroup.setName(sg.getName());
- if (groupRefs.containsKey(sg))
- {
- // group has references so set its ID field
- jGroup.setId(groupRefs.get(sg));
- }
- ColourSchemeI colourScheme = sg.getColourScheme();
- if (colourScheme != null)
- {
- ResidueShaderI groupColourScheme = sg.getGroupColourScheme();
- if (groupColourScheme.conservationApplied())
- {
- jGroup.setConsThreshold(groupColourScheme.getConservationInc());
-
- if (colourScheme instanceof jalview.schemes.UserColourScheme)
- {
- jGroup.setColour(setUserColourScheme(colourScheme,
- userColours, object));
- }
- else
- {
- jGroup.setColour(colourScheme.getSchemeName());
- }
- }
- else if (colourScheme instanceof jalview.schemes.AnnotationColourGradient)
- {
- jGroup.setColour("AnnotationColourGradient");
- jGroup.setAnnotationColours(constructAnnotationColours(
- (jalview.schemes.AnnotationColourGradient) colourScheme,
- userColours, object));
- }
- else if (colourScheme instanceof jalview.schemes.UserColourScheme)
- {
- jGroup.setColour(
- setUserColourScheme(colourScheme, userColours, object));
- }
- else
- {
- jGroup.setColour(colourScheme.getSchemeName());
- }
-
- jGroup.setPidThreshold(groupColourScheme.getThreshold());
- }
-
- jGroup.setOutlineColour(sg.getOutlineColour().getRGB());
- jGroup.setDisplayBoxes(sg.getDisplayBoxes());
- jGroup.setDisplayText(sg.getDisplayText());
- jGroup.setColourText(sg.getColourText());
- jGroup.setTextCol1(sg.textColour.getRGB());
- jGroup.setTextCol2(sg.textColour2.getRGB());
- jGroup.setTextColThreshold(sg.thresholdTextColour);
- jGroup.setShowUnconserved(sg.getShowNonconserved());
- jGroup.setIgnoreGapsinConsensus(sg.getIgnoreGapsConsensus());
- jGroup.setShowConsensusHistogram(sg.isShowConsensusHistogram());
- jGroup.setShowSequenceLogo(sg.isShowSequenceLogo());
- jGroup.setNormaliseSequenceLogo(sg.isNormaliseSequenceLogo());
- for (SequenceI seq : sg.getSequences())
- {
- // jGroup.addSeq(seqHash(seq));
- jGroup.getSeq().add(seqHash(seq));
- }
- }
-
- // jms.setJGroup(groups);
- Object group;
- for (JGroup grp : groups)
- {
- object.getJGroup().add(grp);
- }
- }
- if (!storeDS)
- {
- // /////////SAVE VIEWPORT
- Viewport view = new Viewport();
- view.setTitle(ap.alignFrame.getTitle());
- view.setSequenceSetId(
- makeHashCode(av.getSequenceSetId(), av.getSequenceSetId()));
- view.setId(av.getViewId());
- if (av.getCodingComplement() != null)
- {
- view.setComplementId(av.getCodingComplement().getViewId());
- }
- view.setViewName(av.getViewName());
- view.setGatheredViews(av.isGatherViewsHere());
-
- Rectangle size = ap.av.getExplodedGeometry();
- Rectangle position = size;
- if (size == null)
- {
- size = ap.alignFrame.getBounds();
- if (av.getCodingComplement() != null)
- {
- position = ((SplitFrame) ap.alignFrame.getSplitViewContainer())
- .getBounds();
- }
- else
- {
- position = size;
- }
- }
- view.setXpos(position.x);
- view.setYpos(position.y);
-
- view.setWidth(size.width);
- view.setHeight(size.height);
-
- view.setStartRes(vpRanges.getStartRes());
- view.setStartSeq(vpRanges.getStartSeq());
-
- OverviewPanel ov = ap.getOverviewPanel();
- if (ov != null)
- {
- Overview overview = new Overview();
- overview.setTitle(ov.getTitle());
- Rectangle bounds = ov.getFrameBounds();
- overview.setXpos(bounds.x);
- overview.setYpos(bounds.y);
- overview.setWidth(bounds.width);
- overview.setHeight(bounds.height);
- overview.setShowHidden(ov.isShowHiddenRegions());
- overview.setGapColour(ov.getCanvas().getGapColour().getRGB());
- overview.setResidueColour(
- ov.getCanvas().getResidueColour().getRGB());
- overview.setHiddenColour(ov.getCanvas().getHiddenColour().getRGB());
- view.setOverview(overview);
- }
- if (av.getGlobalColourScheme() instanceof jalview.schemes.UserColourScheme)
- {
- view.setBgColour(setUserColourScheme(av.getGlobalColourScheme(),
- userColours, object));
- }
- else if (av
- .getGlobalColourScheme() instanceof jalview.schemes.AnnotationColourGradient)
- {
- AnnotationColourScheme ac = constructAnnotationColours(
- (jalview.schemes.AnnotationColourGradient) av
- .getGlobalColourScheme(),
- userColours, object);
-
- view.setAnnotationColours(ac);
- view.setBgColour("AnnotationColourGradient");
- }
- else
- {
- view.setBgColour(ColourSchemeProperty
- .getColourName(av.getGlobalColourScheme()));
- }
-
- ResidueShaderI vcs = av.getResidueShading();
- ColourSchemeI cs = av.getGlobalColourScheme();
-
- if (cs != null)
- {
- if (vcs.conservationApplied())
- {
- view.setConsThreshold(vcs.getConservationInc());
- if (cs instanceof jalview.schemes.UserColourScheme)
- {
- view.setBgColour(setUserColourScheme(cs, userColours, object));
- }
- }
- view.setPidThreshold(vcs.getThreshold());
- }
-
- view.setConservationSelected(av.getConservationSelected());
- view.setPidSelected(av.getAbovePIDThreshold());
- view.setCharHeight(av.getCharHeight());
- view.setCharWidth(av.getCharWidth());
- final Font font = av.getFont();
- view.setFontName(font.getName());
- view.setFontSize(font.getSize());
- view.setFontStyle(font.getStyle());
- view.setScaleProteinAsCdna(av.getViewStyle().isScaleProteinAsCdna());
- view.setRenderGaps(av.isRenderGaps());
- view.setShowAnnotation(av.isShowAnnotation());
- view.setShowBoxes(av.getShowBoxes());
- view.setShowColourText(av.getColourText());
- view.setShowFullId(av.getShowJVSuffix());
- view.setRightAlignIds(av.isRightAlignIds());
- view.setIdWidth(av.getIdWidth());
- view.setIdWidthManuallyAdjusted(
- ap.getIdPanel().getIdCanvas().isManuallyAdjusted());
-
- view.setShowSequenceFeatures(av.isShowSequenceFeatures());
- view.setShowText(av.getShowText());
- view.setShowUnconserved(av.getShowUnconserved());
- view.setWrapAlignment(av.getWrapAlignment());
- view.setTextCol1(av.getTextColour().getRGB());
- view.setTextCol2(av.getTextColour2().getRGB());
- view.setTextColThreshold(av.getThresholdTextColour());
- view.setShowConsensusHistogram(av.isShowConsensusHistogram());
- view.setShowSequenceLogo(av.isShowSequenceLogo());
- view.setNormaliseSequenceLogo(av.isNormaliseSequenceLogo());
- view.setShowGroupConsensus(av.isShowGroupConsensus());
- view.setShowGroupConservation(av.isShowGroupConservation());
- view.setShowNPfeatureTooltip(av.isShowNPFeats());
- view.setShowDbRefTooltip(av.isShowDBRefs());
- view.setFollowHighlight(av.isFollowHighlight());
- view.setFollowSelection(av.followSelection);
- view.setIgnoreGapsinConsensus(av.isIgnoreGapsConsensus());
- view.setShowComplementFeatures(av.isShowComplementFeatures());
- view.setShowComplementFeaturesOnTop(
- av.isShowComplementFeaturesOnTop());
- if (av.getFeaturesDisplayed() != null)
- {
- FeatureSettings fs = new FeatureSettings();
-
- FeatureRendererModel fr = ap.getSeqPanel().seqCanvas
- .getFeatureRenderer();
- String[] renderOrder = fr.getRenderOrder().toArray(new String[0]);
-
- Vector<String> settingsAdded = new Vector<>();
- if (renderOrder != null)
- {
- for (String featureType : renderOrder)
- {
- FeatureSettings.Setting setting = new FeatureSettings.Setting();
- setting.setType(featureType);
-
- /*
- * save any filter for the feature type
- */
- FeatureMatcherSetI filter = fr.getFeatureFilter(featureType);
- if (filter != null)
- {
- Iterator<FeatureMatcherI> filters = filter.getMatchers()
- .iterator();
- FeatureMatcherI firstFilter = filters.next();
- setting.setMatcherSet(Jalview2XML.marshalFilter(firstFilter,
- filters, filter.isAnded()));
- }
-
- /*
- * save colour scheme for the feature type
- */
- FeatureColourI fcol = fr.getFeatureStyle(featureType);
- if (!fcol.isSimpleColour())
- {
- setting.setColour(fcol.getMaxColour().getRGB());
- setting.setMincolour(fcol.getMinColour().getRGB());
- setting.setMin(fcol.getMin());
- setting.setMax(fcol.getMax());
- setting.setColourByLabel(fcol.isColourByLabel());
- if (fcol.isColourByAttribute())
- {
- String[] attName = fcol.getAttributeName();
- setting.getAttributeName().add(attName[0]);
- if (attName.length > 1)
- {
- setting.getAttributeName().add(attName[1]);
- }
- }
- setting.setAutoScale(fcol.isAutoScaled());
- setting.setThreshold(fcol.getThreshold());
- Color noColour = fcol.getNoColour();
- if (noColour == null)
- {
- setting.setNoValueColour(NoValueColour.NONE);
- }
- else if (noColour.equals(fcol.getMaxColour()))
- {
- setting.setNoValueColour(NoValueColour.MAX);
- }
- else
- {
- setting.setNoValueColour(NoValueColour.MIN);
- }
- // -1 = No threshold, 0 = Below, 1 = Above
- setting.setThreshstate(fcol.isAboveThreshold() ? 1
- : (fcol.isBelowThreshold() ? 0 : -1));
- }
- else
- {
- setting.setColour(fcol.getColour().getRGB());
- }
-
- setting.setDisplay(
- av.getFeaturesDisplayed().isVisible(featureType));
- float rorder = fr.getOrder(featureType);
- if (rorder > -1)
- {
- setting.setOrder(rorder);
- }
- /// fs.addSetting(setting);
- fs.getSetting().add(setting);
- settingsAdded.addElement(featureType);
- }
- }
-
- // is groups actually supposed to be a map here ?
- Iterator<String> en = fr.getFeatureGroups().iterator();
- Vector<String> groupsAdded = new Vector<>();
- while (en.hasNext())
- {
- String grp = en.next();
- if (groupsAdded.contains(grp))
- {
- continue;
- }
- Group g = new Group();
- g.setName(grp);
- g.setDisplay(((Boolean) fr.checkGroupVisibility(grp, false))
- .booleanValue());
- // fs.addGroup(g);
- fs.getGroup().add(g);
- groupsAdded.addElement(grp);
- }
- // jms.setFeatureSettings(fs);
- object.setFeatureSettings(fs);
- }
-
- if (av.hasHiddenColumns())
- {
- jalview.datamodel.HiddenColumns hidden = av.getAlignment()
- .getHiddenColumns();
- if (hidden == null)
- {
- Console.warn(
- "REPORT BUG: avoided null columnselection bug (DMAM reported). Please contact Jim about this.");
- }
- else
- {
- Iterator<int[]> hiddenRegions = hidden.iterator();
- while (hiddenRegions.hasNext())
- {
- int[] region = hiddenRegions.next();
- HiddenColumns hc = new HiddenColumns();
- hc.setStart(region[0]);
- hc.setEnd(region[1]);
- // view.addHiddenColumns(hc);
- view.getHiddenColumns().add(hc);
- }
- }
- }
- if (calcIdSet.size() > 0)
- {
- for (String calcId : calcIdSet)
- {
- if (calcId.trim().length() > 0)
- {
- CalcIdParam cidp = createCalcIdParam(calcId, av);
- // Some calcIds have no parameters.
- if (cidp != null)
- {
- // view.addCalcIdParam(cidp);
- view.getCalcIdParam().add(cidp);
- }
- }
- }
- }
-
- // jms.addViewport(view);
- object.getViewport().add(view);
- }
-
- if (storeDS)
- {
- // store matrices referenced by any views or annotation in this dataset
- if (xmlMatrices != null && xmlMatrices.size() > 0)
- {
- Console.debug(
- "Adding " + xmlMatrices.size() + " matrices to dataset.");
- vamsasSet.getMatrix().addAll(xmlMatrices);
- xmlMatrices.clear();
- }
- }
-
- // object.setJalviewModelSequence(jms);
- // object.getVamsasModel().addSequenceSet(vamsasSet);
- object.getVamsasModel().getSequenceSet().add(vamsasSet);
-
- if (jout != null && fileName != null)
- {
- // We may not want to write the object to disk,
- // eg we can copy the alignViewport to a new view object
- // using save and then load
- try
- {
- fileName = fileName.replace('\\', '/');
- jalview.bin.Console.outPrintln("Writing jar entry " + fileName);
- JarEntry entry = new JarEntry(fileName);
- jout.putNextEntry(entry);
- PrintWriter pout = new PrintWriter(
- new OutputStreamWriter(jout, UTF_8));
- JAXBContext jaxbContext = JAXBContext
- .newInstance(JalviewModel.class);
- Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
-
- // output pretty printed
- // jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
- jaxbMarshaller.marshal(
- new ObjectFactory().createJalviewModel(object), pout);
-
- // jaxbMarshaller.marshal(object, pout);
- // marshaller.marshal(object);
- pout.flush();
- jout.closeEntry();
- } catch (Exception ex)
- {
- // TODO: raise error in GUI if marshalling failed.
- jalview.bin.Console.errPrintln("Error writing Jalview project");
- ex.printStackTrace();
- }
- }
- return object;
- }
-
- /**
- * Writes PCA viewer attributes and computed values to an XML model object and
- * adds it to the JalviewModel. Any exceptions are reported by logging.
- */
- protected void savePCA(PCAPanel panel, JalviewModel object)
- {
- try
- {
- PcaViewer viewer = new PcaViewer();
- viewer.setHeight(panel.getHeight());
- viewer.setWidth(panel.getWidth());
- viewer.setXpos(panel.getX());
- viewer.setYpos(panel.getY());
- viewer.setTitle(panel.getTitle());
- PCAModel pcaModel = panel.getPcaModel();
- viewer.setScoreModelName(pcaModel.getScoreModelName());
- viewer.setXDim(panel.getSelectedDimensionIndex(X));
- viewer.setYDim(panel.getSelectedDimensionIndex(Y));
- viewer.setZDim(panel.getSelectedDimensionIndex(Z));
- viewer.setBgColour(
- panel.getRotatableCanvas().getBackgroundColour().getRGB());
- viewer.setScaleFactor(panel.getRotatableCanvas().getScaleFactor());
- float[] spMin = panel.getRotatableCanvas().getSeqMin();
- SeqPointMin spmin = new SeqPointMin();
- spmin.setXPos(spMin[0]);
- spmin.setYPos(spMin[1]);
- spmin.setZPos(spMin[2]);
- viewer.setSeqPointMin(spmin);
- float[] spMax = panel.getRotatableCanvas().getSeqMax();
- SeqPointMax spmax = new SeqPointMax();
- spmax.setXPos(spMax[0]);
- spmax.setYPos(spMax[1]);
- spmax.setZPos(spMax[2]);
- viewer.setSeqPointMax(spmax);
- viewer.setShowLabels(panel.getRotatableCanvas().isShowLabels());
- viewer.setLinkToAllViews(
- panel.getRotatableCanvas().isApplyToAllViews());
- SimilarityParamsI sp = pcaModel.getSimilarityParameters();
- viewer.setIncludeGaps(sp.includeGaps());
- viewer.setMatchGaps(sp.matchGaps());
- viewer.setIncludeGappedColumns(sp.includeGappedColumns());
- viewer.setDenominateByShortestLength(sp.denominateByShortestLength());
-
- /*
- * sequence points on display
- */
- for (jalview.datamodel.SequencePoint spt : pcaModel
- .getSequencePoints())
- {
- SequencePoint point = new SequencePoint();
- point.setSequenceRef(seqHash(spt.getSequence()));
- point.setXPos(spt.coord.x);
- point.setYPos(spt.coord.y);
- point.setZPos(spt.coord.z);
- viewer.getSequencePoint().add(point);
- }
-
- /*
- * (end points of) axes on display
- */
- for (Point p : panel.getRotatableCanvas().getAxisEndPoints())
- {
-
- Axis axis = new Axis();
- axis.setXPos(p.x);
- axis.setYPos(p.y);
- axis.setZPos(p.z);
- viewer.getAxis().add(axis);
- }
-
- /*
- * raw PCA data (note we are not restoring PCA inputs here -
- * alignment view, score model, similarity parameters)
- */
- PcaDataType data = new PcaDataType();
- viewer.setPcaData(data);
- PCA pca = pcaModel.getPcaData();
-
- DoubleMatrix pm = new DoubleMatrix();
- saveDoubleMatrix(pca.getPairwiseScores(), pm);
- data.setPairwiseMatrix(pm);
-
- DoubleMatrix tm = new DoubleMatrix();
- saveDoubleMatrix(pca.getTridiagonal(), tm);
- data.setTridiagonalMatrix(tm);
-
- DoubleMatrix eigenMatrix = new DoubleMatrix();
- data.setEigenMatrix(eigenMatrix);
- saveDoubleMatrix(pca.getEigenmatrix(), eigenMatrix);
-
- object.getPcaViewer().add(viewer);
- } catch (Throwable t)
- {
- Console.error("Error saving PCA: " + t.getMessage());
- }
- }
-
- /**
- * Stores values from a matrix into an XML element, including (if present) the
- * D or E vectors
- *
- * @param m
- * @param xmlMatrix
- * @see #loadDoubleMatrix(DoubleMatrix)
- */
- protected void saveDoubleMatrix(MatrixI m, DoubleMatrix xmlMatrix)
- {
- xmlMatrix.setRows(m.height());
- xmlMatrix.setColumns(m.width());
- for (int i = 0; i < m.height(); i++)
- {
- DoubleVector row = new DoubleVector();
- for (int j = 0; j < m.width(); j++)
- {
- row.getV().add(m.getValue(i, j));
- }
- xmlMatrix.getRow().add(row);
- }
- if (m.getD() != null)
- {
- DoubleVector dVector = new DoubleVector();
- for (double d : m.getD())
- {
- dVector.getV().add(d);
- }
- xmlMatrix.setD(dVector);
- }
- if (m.getE() != null)
- {
- DoubleVector eVector = new DoubleVector();
- for (double e : m.getE())
- {
- eVector.getV().add(e);
- }
- xmlMatrix.setE(eVector);
- }
- }
-
- /**
- * Loads XML matrix data into a new Matrix object, including the D and/or E
- * vectors (if present)
- *
- * @param mData
- * @return
- * @see Jalview2XML#saveDoubleMatrix(MatrixI, DoubleMatrix)
- */
- protected MatrixI loadDoubleMatrix(DoubleMatrix mData)
- {
- int rows = mData.getRows();
- double[][] vals = new double[rows][];
-
- for (int i = 0; i < rows; i++)
- {
- List<Double> dVector = mData.getRow().get(i).getV();
- vals[i] = new double[dVector.size()];
- int dvi = 0;
- for (Double d : dVector)
- {
- vals[i][dvi++] = d;
- }
- }
-
- MatrixI m = new Matrix(vals);
-
- if (mData.getD() != null)
- {
- List<Double> dVector = mData.getD().getV();
- double[] vec = new double[dVector.size()];
- int dvi = 0;
- for (Double d : dVector)
- {
- vec[dvi++] = d;
- }
- m.setD(vec);
- }
- if (mData.getE() != null)
- {
- List<Double> dVector = mData.getE().getV();
- double[] vec = new double[dVector.size()];
- int dvi = 0;
- for (Double d : dVector)
- {
- vec[dvi++] = d;
- }
- m.setE(vec);
- }
-
- return m;
- }
-
- /**
- * Save any Varna viewers linked to this sequence. Writes an rnaViewer element
- * for each viewer, with
- * <ul>
- * <li>viewer geometry (position, size, split pane divider location)</li>
- * <li>index of the selected structure in the viewer (currently shows gapped
- * or ungapped)</li>
- * <li>the id of the annotation holding RNA secondary structure</li>
- * <li>(currently only one SS is shown per viewer, may be more in future)</li>
- * </ul>
- * Varna viewer state is also written out (in native Varna XML) to separate
- * project jar entries. A separate entry is written for each RNA structure
- * displayed, with the naming convention
- * <ul>
- * <li>rna_viewId_sequenceId_annotationId_[gapped|trimmed]</li>
- * </ul>
- *
- * @param jout
- * @param jseq
- * @param jds
- * @param viewIds
- * @param ap
- * @param storeDataset
- */
- protected void saveRnaViewers(JarOutputStream jout, JSeq jseq,
- final SequenceI jds, List<String> viewIds, AlignmentPanel ap,
- boolean storeDataset)
- {
- if (Desktop.desktop == null)
- {
- return;
- }
- JInternalFrame[] frames = Desktop.desktop.getAllFrames();
- for (int f = frames.length - 1; f > -1; f--)
- {
- if (frames[f] instanceof AppVarna)
- {
- AppVarna varna = (AppVarna) frames[f];
- /*
- * link the sequence to every viewer that is showing it and is linked to
- * its alignment panel
- */
- if (varna.isListeningFor(jds) && ap == varna.getAlignmentPanel())
- {
- String viewId = varna.getViewId();
- RnaViewer rna = new RnaViewer();
- rna.setViewId(viewId);
- rna.setTitle(varna.getTitle());
- rna.setXpos(varna.getX());
- rna.setYpos(varna.getY());
- rna.setWidth(varna.getWidth());
- rna.setHeight(varna.getHeight());
- rna.setDividerLocation(varna.getDividerLocation());
- rna.setSelectedRna(varna.getSelectedIndex());
- // jseq.addRnaViewer(rna);
- jseq.getRnaViewer().add(rna);
-
- /*
- * Store each Varna panel's state once in the project per sequence.
- * First time through only (storeDataset==false)
- */
- // boolean storeSessions = false;
- // String sequenceViewId = viewId + seqsToIds.get(jds);
- // if (!storeDataset && !viewIds.contains(sequenceViewId))
- // {
- // viewIds.add(sequenceViewId);
- // storeSessions = true;
- // }
- for (RnaModel model : varna.getModels())
- {
- if (model.seq == jds)
- {
- /*
- * VARNA saves each view (sequence or alignment secondary
- * structure, gapped or trimmed) as a separate XML file
- */
- String jarEntryName = rnaSessions.get(model);
- if (jarEntryName == null)
- {
-
- String varnaStateFile = varna.getStateInfo(model.rna);
- jarEntryName = RNA_PREFIX + viewId + "_" + nextCounter();
- copyFileToJar(jout, varnaStateFile, jarEntryName, "Varna");
- rnaSessions.put(model, jarEntryName);
- }
- SecondaryStructure ss = new SecondaryStructure();
- String annotationId = varna.getAnnotation(jds).annotationId;
- ss.setAnnotationId(annotationId);
- ss.setViewerState(jarEntryName);
- ss.setGapped(model.gapped);
- ss.setTitle(model.title);
- // rna.addSecondaryStructure(ss);
- rna.getSecondaryStructure().add(ss);
- }
- }
- }
- }
- }
- }
-
- /**
- * Copy the contents of a file to a new entry added to the output jar
- *
- * @param jout
- * @param infilePath
- * @param jarEntryName
- * @param msg
- * additional identifying info to log to the console
- */
- protected void copyFileToJar(JarOutputStream jout, String infilePath,
- String jarEntryName, String msg)
- {
- try (InputStream is = new FileInputStream(infilePath))
- {
- File file = new File(infilePath);
- if (file.exists() && jout != null)
- {
- jalview.bin.Console.outPrintln(
- "Writing jar entry " + jarEntryName + " (" + msg + ")");
- jout.putNextEntry(new JarEntry(jarEntryName));
- copyAll(is, jout);
- jout.closeEntry();
- // dis = new DataInputStream(new FileInputStream(file));
- // byte[] data = new byte[(int) file.length()];
- // dis.readFully(data);
- // writeJarEntry(jout, jarEntryName, data);
- }
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- /**
- * Copies input to output, in 4K buffers; handles any data (text or binary)
- *
- * @param in
- * @param out
- * @throws IOException
- */
- protected void copyAll(InputStream in, OutputStream out)
- throws IOException
- {
- byte[] buffer = new byte[4096];
- int bytesRead = 0;
- while ((bytesRead = in.read(buffer)) != -1)
- {
- out.write(buffer, 0, bytesRead);
- }
- }
-
- /**
- * Save the state of a structure viewer
- *
- * @param ap
- * @param jds
- * @param pdb
- * the archive XML element under which to save the state
- * @param entry
- * @param viewIds
- * @param matchedFile
- * @param viewFrame
- * @return
- */
- protected String saveStructureViewer(AlignmentPanel ap, SequenceI jds,
- Pdbids pdb, PDBEntry entry, List<String> viewIds,
- String matchedFile, JalviewStructureDisplayI viewFrame)
- {
- final AAStructureBindingModel bindingModel = viewFrame.getBinding();
-
- /*
- * Look for any bindings for this viewer to the PDB file of interest
- * (including part matches excluding chain id)
- */
- for (int peid = 0; peid < bindingModel.getPdbCount(); peid++)
- {
- final PDBEntry pdbentry = bindingModel.getPdbEntry(peid);
- final String pdbId = pdbentry.getId();
- if (!pdbId.equals(entry.getId()) && !(entry.getId().length() > 4
- && entry.getId().toLowerCase(Locale.ROOT)
- .startsWith(pdbId.toLowerCase(Locale.ROOT))))
- {
- /*
- * not interested in a binding to a different PDB entry here
- */
- continue;
- }
- if (matchedFile == null)
- {
- matchedFile = pdbentry.getFile();
- }
- else if (!matchedFile.equals(pdbentry.getFile()))
- {
- Console.warn(
- "Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
- + pdbentry.getFile());
- }
- // record the
- // file so we
- // can get at it if the ID
- // match is ambiguous (e.g.
- // 1QIP==1qipA)
-
- for (int smap = 0; smap < viewFrame.getBinding()
- .getSequence()[peid].length; smap++)
- {
- // if (jal.findIndex(jmol.jmb.sequence[peid][smap]) > -1)
- if (jds == viewFrame.getBinding().getSequence()[peid][smap])
- {
- StructureState state = new StructureState();
- state.setVisible(true);
- state.setXpos(viewFrame.getY());
- state.setYpos(viewFrame.getY());
- state.setWidth(viewFrame.getWidth());
- state.setHeight(viewFrame.getHeight());
- final String viewId = viewFrame.getViewId();
- state.setViewId(viewId);
- state.setAlignwithAlignPanel(viewFrame.isUsedforaligment(ap));
- state.setColourwithAlignPanel(viewFrame.isUsedForColourBy(ap));
- state.setColourByJmol(viewFrame.isColouredByViewer());
- state.setType(viewFrame.getViewerType().toString());
- // pdb.addStructureState(state);
- pdb.getStructureState().add(state);
- }
- }
- }
- return matchedFile;
- }
-
- /**
- * Populates the AnnotationColourScheme xml for save. This captures the
- * settings of the options in the 'Colour by Annotation' dialog.
- *
- * @param acg
- * @param userColours
- * @param jm
- * @return
- */
- private AnnotationColourScheme constructAnnotationColours(
- AnnotationColourGradient acg, List<UserColourScheme> userColours,
- JalviewModel jm)
- {
- AnnotationColourScheme ac = new AnnotationColourScheme();
- ac.setAboveThreshold(acg.getAboveThreshold());
- ac.setThreshold(acg.getAnnotationThreshold());
- // 2.10.2 save annotationId (unique) not annotation label
- ac.setAnnotation(acg.getAnnotation().annotationId);
- if (acg.getBaseColour() instanceof UserColourScheme)
- {
- ac.setColourScheme(
- setUserColourScheme(acg.getBaseColour(), userColours, jm));
- }
- else
- {
- ac.setColourScheme(
- ColourSchemeProperty.getColourName(acg.getBaseColour()));
- }
-
- ac.setMaxColour(acg.getMaxColour().getRGB());
- ac.setMinColour(acg.getMinColour().getRGB());
- ac.setPerSequence(acg.isSeqAssociated());
- ac.setPredefinedColours(acg.isPredefinedColours());
- return ac;
- }
-
- private void storeAlignmentAnnotation(AlignmentAnnotation[] aa,
- IdentityHashMap<SequenceGroup, String> groupRefs,
- AlignmentViewport av, Set<String> calcIdSet, boolean storeDS,
- SequenceSet vamsasSet)
- {
-
- for (int i = 0; i < aa.length; i++)
- {
- Annotation an = new Annotation();
-
- AlignmentAnnotation annotation = aa[i];
- if (annotation.annotationId != null)
- {
- annotationIds.put(annotation.annotationId, annotation);
- }
-
- an.setId(annotation.annotationId);
-
- an.setVisible(annotation.visible);
-
- an.setDescription(annotation.description);
-
- if (annotation.sequenceRef != null)
- {
- // 2.9 JAL-1781 xref on sequence id rather than name
- an.setSequenceRef(seqsToIds.get(annotation.sequenceRef));
- }
- if (annotation.groupRef != null)
- {
- String groupIdr = groupRefs.get(annotation.groupRef);
- if (groupIdr == null)
- {
- // make a locally unique String
- groupRefs.put(annotation.groupRef,
- groupIdr = ("" + System.currentTimeMillis()
- + annotation.groupRef.getName()
- + groupRefs.size()));
- }
- an.setGroupRef(groupIdr.toString());
- }
-
- // store all visualization attributes for annotation
- an.setGraphHeight(annotation.graphHeight);
- an.setCentreColLabels(annotation.centreColLabels);
- an.setScaleColLabels(annotation.scaleColLabel);
- an.setShowAllColLabels(annotation.showAllColLabels);
- an.setBelowAlignment(annotation.belowAlignment);
-
- if (annotation.graph > 0)
- {
- an.setGraph(true);
- an.setGraphType(annotation.graph);
- an.setGraphGroup(annotation.graphGroup);
- if (annotation.getThreshold() != null)
- {
- ThresholdLine line = new ThresholdLine();
- line.setLabel(annotation.getThreshold().label);
- line.setValue(annotation.getThreshold().value);
- line.setColour(annotation.getThreshold().colour.getRGB());
- an.setThresholdLine(line);
- }
- if (annotation.graph == AlignmentAnnotation.CONTACT_MAP)
- {
- if (annotation.sequenceRef.getContactMaps() != null)
- {
- ContactMatrixI cm = annotation.sequenceRef
- .getContactMatrixFor(annotation);
- if (cm != null)
- {
- storeMatrixFor(vamsasSet, an, annotation, cm);
- }
- }
- }
- }
- else
- {
- an.setGraph(false);
- }
-
- an.setLabel(annotation.label);
-
- if (annotation == av.getAlignmentQualityAnnot()
- || annotation == av.getAlignmentConservationAnnotation()
- || annotation == av.getAlignmentConsensusAnnotation()
- || annotation.autoCalculated)
- {
- // new way of indicating autocalculated annotation -
- an.setAutoCalculated(annotation.autoCalculated);
- }
- if (annotation.hasScore())
- {
- an.setScore(annotation.getScore());
- }
-
- if (annotation.getCalcId() != null)
- {
- calcIdSet.add(annotation.getCalcId());
- an.setCalcId(annotation.getCalcId());
- }
- if (annotation.hasProperties())
- {
- for (String pr : annotation.getProperties())
- {
- jalview.xml.binding.jalview.Property prop = new jalview.xml.binding.jalview.Property();
- prop.setName(pr);
- prop.setValue(annotation.getProperty(pr));
- an.getProperty().add(prop);
- }
- }
-
- AnnotationElement ae;
- if (annotation.annotations != null)
- {
- an.setScoreOnly(false);
- for (int a = 0; a < annotation.annotations.length; a++)
- {
- if ((annotation == null) || (annotation.annotations[a] == null))
- {
- continue;
- }
-
- ae = new AnnotationElement();
- if (annotation.annotations[a].description != null)
- {
- ae.setDescription(annotation.annotations[a].description);
- }
- if (annotation.annotations[a].displayCharacter != null)
- {
- ae.setDisplayCharacter(
- annotation.annotations[a].displayCharacter);
- }
-
- if (!Float.isNaN(annotation.annotations[a].value))
- {
- ae.setValue(annotation.annotations[a].value);
- }
-
- ae.setPosition(a);
- if (annotation.annotations[a].secondaryStructure > ' ')
- {
- ae.setSecondaryStructure(
- annotation.annotations[a].secondaryStructure + "");
- }
-
- if (annotation.annotations[a].colour != null
- && annotation.annotations[a].colour != java.awt.Color.black)
- {
- ae.setColour(annotation.annotations[a].colour.getRGB());
- }
-
- // an.addAnnotationElement(ae);
- an.getAnnotationElement().add(ae);
- if (annotation.autoCalculated)
- {
- // only write one non-null entry into the annotation row -
- // sufficient to get the visualization attributes necessary to
- // display data
- continue;
- }
- }
- }
- else
- {
- an.setScoreOnly(true);
- }
- if (!storeDS || (storeDS && !annotation.autoCalculated))
- {
- // skip autocalculated annotation - these are only provided for
- // alignments
- // vamsasSet.addAnnotation(an);
- vamsasSet.getAnnotation().add(an);
- }
- }
-
- }
-
- private void storeMatrixFor(SequenceSet root, Annotation an,
- AlignmentAnnotation annotation, ContactMatrixI cm)
- {
- String cmId = contactMatrices.get(cm);
- MatrixType xmlmat = null;
-
- // first create an xml ref for the matrix data, if none exist
- if (cmId == null)
- {
- xmlmat = new MatrixType();
- xmlmat.setType(cm.getType());
- xmlmat.setRows(BigInteger.valueOf(cm.getWidth()));
- xmlmat.setCols(BigInteger.valueOf(cm.getHeight()));
- // consider using an opaque to/from -> allow instance to control
- // its representation ?
- xmlmat.setElements(ContactMatrix.contactToFloatString(cm));
- if (cm.hasGroups())
- {
- for (BitSet gp : cm.getGroups())
- {
- xmlmat.getGroups().add(stringifyBitset(gp));
- }
- }
- if (cm.hasTree())
- {
- // provenance object for tree ?
- xmlmat.getNewick().add(cm.getNewick());
- xmlmat.setTreeMethod(cm.getTreeMethod());
- }
- if (cm.hasCutHeight())
- {
- xmlmat.setCutHeight(cm.getCutHeight());
- }
- xmlmat.setId(cmId = "m" + contactMatrices.size()
- + System.currentTimeMillis());
- Console.trace("Matrix data stored :" + cmId);
- contactMatrices.put(cm, cmId);
- contactMatrixRefs.put(cmId, cm);
- xmlMatrices.add(xmlmat);
- }
- else
- {
- Console.trace("Existing Matrix stored :" + cmId);
- }
-
- // now store mapping
-
- MapOnAMatrixType xmlmatmapping = new MapOnAMatrixType();
- xmlmatmapping.setMatrix(cmId);
-
- // Pretty much all matrices currently managed in this way are
- // mappableContactMatrixI implementations - but check anyway
- if (cm instanceof MappableContactMatrixI)
- {
- jalview.util.MapList mlst = ((MappableContactMatrixI) cm)
- .getMapFor(annotation.sequenceRef);
- if (mlst != null)
- {
- MapListType mp = new MapListType();
- List<int[]> r = mlst.getFromRanges();
- for (int[] range : r)
- {
- MapListFrom mfrom = new MapListFrom();
- mfrom.setStart(range[0]);
- mfrom.setEnd(range[1]);
- // mp.addMapListFrom(mfrom);
- mp.getMapListFrom().add(mfrom);
- }
- r = mlst.getToRanges();
- for (int[] range : r)
- {
- MapListTo mto = new MapListTo();
- mto.setStart(range[0]);
- mto.setEnd(range[1]);
- // mp.addMapListTo(mto);
- mp.getMapListTo().add(mto);
- }
- mp.setMapFromUnit(BigInteger.valueOf(mlst.getFromRatio()));
- mp.setMapToUnit(BigInteger.valueOf(mlst.getToRatio()));
- xmlmatmapping.setMapping(mp);
- }
- }
- // and add to model
- an.getContactmatrix().add(xmlmatmapping);
- }
-
- private String stringifyBitset(BitSet gp)
- {
- StringBuilder sb = new StringBuilder();
- for (long val : gp.toLongArray())
- {
- if (sb.length() > 0)
- {
- sb.append(",");
- }
- sb.append(val);
- }
- return sb.toString();
- }
-
- private BitSet deStringifyBitset(String stringified)
- {
- if ("".equals(stringified) || stringified == null)
- {
- return new BitSet();
- }
- String[] longvals = stringified.split(",");
- long[] newlongvals = new long[longvals.length];
- for (int lv = 0; lv < longvals.length; lv++)
- {
- try
- {
- newlongvals[lv] = Long.valueOf(longvals[lv]);
- } catch (Exception x)
- {
- errorMessage += "Couldn't destringify bitset from: '" + stringified
- + "'";
- newlongvals[lv] = 0;
- }
- }
- return BitSet.valueOf(newlongvals);
-
- }
-
- private CalcIdParam createCalcIdParam(String calcId, AlignViewport av)
- {
- AutoCalcSetting settings = av.getCalcIdSettingsFor(calcId);
- if (settings != null)
- {
- CalcIdParam vCalcIdParam = new CalcIdParam();
- vCalcIdParam.setCalcId(calcId);
- // vCalcIdParam.addServiceURL(settings.getServiceURI());
- vCalcIdParam.getServiceURL().add(settings.getServiceURI());
- // generic URI allowing a third party to resolve another instance of the
- // service used for this calculation
- for (String url : settings.getServiceURLs())
- {
- // vCalcIdParam.addServiceURL(urls);
- vCalcIdParam.getServiceURL().add(url);
- }
- vCalcIdParam.setVersion("1.0");
- if (settings.getPreset() != null)
- {
- WsParamSetI setting = settings.getPreset();
- vCalcIdParam.setName(setting.getName());
- vCalcIdParam.setDescription(setting.getDescription());
- }
- else
- {
- vCalcIdParam.setName("");
- vCalcIdParam.setDescription("Last used parameters");
- }
- // need to be able to recover 1) settings 2) user-defined presets or
- // recreate settings from preset 3) predefined settings provided by
- // service - or settings that can be transferred (or discarded)
- vCalcIdParam.setParameters(
- settings.getWsParamFile().replace("\n", "|\\n|"));
- vCalcIdParam.setAutoUpdate(settings.isAutoUpdate());
- // todo - decide if updateImmediately is needed for any projects.
-
- return vCalcIdParam;
- }
- return null;
- }
-
- private boolean recoverCalcIdParam(CalcIdParam calcIdParam,
- AlignViewport av)
- {
- if (calcIdParam.getVersion().equals("1.0"))
- {
- final String[] calcIds = calcIdParam.getServiceURL()
- .toArray(new String[0]);
- Jws2Instance service = Jws2Discoverer.getDiscoverer()
- .getPreferredServiceFor(calcIds);
- if (service != null)
- {
- WsParamSetI parmSet = null;
- try
- {
- parmSet = service.getParamStore().parseServiceParameterFile(
- calcIdParam.getName(), calcIdParam.getDescription(),
- calcIds,
- calcIdParam.getParameters().replace("|\\n|", "\n"));
- } catch (IOException x)
- {
- Console.warn("Couldn't parse parameter data for "
- + calcIdParam.getCalcId(), x);
- return false;
- }
- List<ArgumentI> argList = null;
- if (calcIdParam.getName().length() > 0)
- {
- parmSet = service.getParamStore()
- .getPreset(calcIdParam.getName());
- if (parmSet != null)
- {
- // TODO : check we have a good match with settings in AACon -
- // otherwise we'll need to create a new preset
- }
- }
- else
- {
- argList = parmSet.getArguments();
- parmSet = null;
- }
- AAConSettings settings = new AAConSettings(
- calcIdParam.isAutoUpdate(), service, parmSet, argList);
- av.setCalcIdSettingsFor(calcIdParam.getCalcId(), settings,
- calcIdParam.isNeedsUpdate());
- return true;
- }
- else
- {
- Console.warn(
- "Cannot resolve a service for the parameters used in this project. Try configuring a JABAWS server.");
- return false;
- }
- }
- throw new Error(MessageManager.formatMessage(
- "error.unsupported_version_calcIdparam", new Object[]
- { calcIdParam.toString() }));
- }
-
- /**
- * External mapping between jalview objects and objects yielding a valid and
- * unique object ID string. This is null for normal Jalview project IO, but
- * non-null when a jalview project is being read or written as part of a
- * vamsas session.
- */
- IdentityHashMap jv2vobj = null;
-
- /**
- * Construct a unique ID for jvobj using either existing bindings or if none
- * exist, the result of the hashcode call for the object.
- *
- * @param jvobj
- * jalview data object
- * @return unique ID for referring to jvobj
- */
- private String makeHashCode(Object jvobj, String altCode)
- {
- if (jv2vobj != null)
- {
- Object id = jv2vobj.get(jvobj);
- if (id != null)
- {
- return id.toString();
- }
- // check string ID mappings
- if (jvids2vobj != null && jvobj instanceof String)
- {
- id = jvids2vobj.get(jvobj);
- }
- if (id != null)
- {
- return id.toString();
- }
- // give up and warn that something has gone wrong
- Console.warn(
- "Cannot find ID for object in external mapping : " + jvobj);
- }
- return altCode;
- }
-
- /**
- * return local jalview object mapped to ID, if it exists
- *
- * @param idcode
- * (may be null)
- * @return null or object bound to idcode
- */
- private Object retrieveExistingObj(String idcode)
- {
- if (idcode != null && vobj2jv != null)
- {
- return vobj2jv.get(idcode);
- }
- return null;
- }
-
- /**
- * binding from ID strings from external mapping table to jalview data model
- * objects.
- */
- private Hashtable vobj2jv;
-
- private Sequence createVamsasSequence(String id, SequenceI jds)
- {
- return createVamsasSequence(true, id, jds, null);
- }
-
- private Sequence createVamsasSequence(boolean recurse, String id,
- SequenceI jds, SequenceI parentseq)
- {
- Sequence vamsasSeq = new Sequence();
- vamsasSeq.setId(id);
- vamsasSeq.setName(jds.getName());
- vamsasSeq.setSequence(jds.getSequenceAsString());
- vamsasSeq.setDescription(jds.getDescription());
- List<DBRefEntry> dbrefs = null;
- if (jds.getDatasetSequence() != null)
- {
- vamsasSeq.setDsseqid(seqHash(jds.getDatasetSequence()));
- }
- else
- {
- // seqId==dsseqid so we can tell which sequences really are
- // dataset sequences only
- vamsasSeq.setDsseqid(id);
- dbrefs = jds.getDBRefs();
- if (parentseq == null)
- {
- parentseq = jds;
- }
- }
-
- /*
- * save any dbrefs; special subclass GeneLocus is flagged as 'locus'
- */
- if (dbrefs != null)
- {
- for (int d = 0, nd = dbrefs.size(); d < nd; d++)
- {
- DBRef dbref = new DBRef();
- DBRefEntry ref = dbrefs.get(d);
- dbref.setSource(ref.getSource());
- dbref.setVersion(ref.getVersion());
- dbref.setAccessionId(ref.getAccessionId());
- dbref.setCanonical(ref.isCanonical());
- if (ref instanceof GeneLocus)
- {
- dbref.setLocus(true);
- }
- if (ref.hasMap())
- {
- Mapping mp = createVamsasMapping(ref.getMap(), parentseq, jds,
- recurse);
- dbref.setMapping(mp);
- }
- vamsasSeq.getDBRef().add(dbref);
- }
- }
- return vamsasSeq;
- }
-
- private Mapping createVamsasMapping(jalview.datamodel.Mapping jmp,
- SequenceI parentseq, SequenceI jds, boolean recurse)
- {
- Mapping mp = null;
- if (jmp.getMap() != null)
- {
- mp = new Mapping();
-
- jalview.util.MapList mlst = jmp.getMap();
- List<int[]> r = mlst.getFromRanges();
- for (int[] range : r)
- {
- MapListFrom mfrom = new MapListFrom();
- mfrom.setStart(range[0]);
- mfrom.setEnd(range[1]);
- // mp.addMapListFrom(mfrom);
- mp.getMapListFrom().add(mfrom);
- }
- r = mlst.getToRanges();
- for (int[] range : r)
- {
- MapListTo mto = new MapListTo();
- mto.setStart(range[0]);
- mto.setEnd(range[1]);
- // mp.addMapListTo(mto);
- mp.getMapListTo().add(mto);
- }
- mp.setMapFromUnit(BigInteger.valueOf(mlst.getFromRatio()));
- mp.setMapToUnit(BigInteger.valueOf(mlst.getToRatio()));
- if (jmp.getTo() != null)
- {
- // MappingChoice mpc = new MappingChoice();
-
- // check/create ID for the sequence referenced by getTo()
-
- String jmpid = "";
- SequenceI ps = null;
- if (parentseq != jmp.getTo()
- && parentseq.getDatasetSequence() != jmp.getTo())
- {
- // chaining dbref rather than a handshaking one
- jmpid = seqHash(ps = jmp.getTo());
- }
- else
- {
- jmpid = seqHash(ps = parentseq);
- }
- // mpc.setDseqFor(jmpid);
- mp.setDseqFor(jmpid);
- if (!seqRefIds.containsKey(jmpid))
- {
- Console.debug("creatign new DseqFor ID");
- seqRefIds.put(jmpid, ps);
- }
- else
- {
- Console.debug("reusing DseqFor ID");
- }
-
- // mp.setMappingChoice(mpc);
- }
- }
- return mp;
- }
-
- String setUserColourScheme(jalview.schemes.ColourSchemeI cs,
- List<UserColourScheme> userColours, JalviewModel jm)
- {
- String id = null;
- jalview.schemes.UserColourScheme ucs = (jalview.schemes.UserColourScheme) cs;
- boolean newucs = false;
- if (!userColours.contains(ucs))
- {
- userColours.add(ucs);
- newucs = true;
- }
- id = "ucs" + userColours.indexOf(ucs);
- if (newucs)
- {
- // actually create the scheme's entry in the XML model
- java.awt.Color[] colours = ucs.getColours();
- UserColours uc = new UserColours();
- // UserColourScheme jbucs = new UserColourScheme();
- JalviewUserColours jbucs = new JalviewUserColours();
-
- for (int i = 0; i < colours.length; i++)
- {
- Colour col = new Colour();
- col.setName(ResidueProperties.aa[i]);
- col.setRGB(jalview.util.Format.getHexString(colours[i]));
- // jbucs.addColour(col);
- jbucs.getColour().add(col);
- }
- if (ucs.getLowerCaseColours() != null)
- {
- colours = ucs.getLowerCaseColours();
- for (int i = 0; i < colours.length; i++)
- {
- Colour col = new Colour();
- col.setName(ResidueProperties.aa[i].toLowerCase(Locale.ROOT));
- col.setRGB(jalview.util.Format.getHexString(colours[i]));
- // jbucs.addColour(col);
- jbucs.getColour().add(col);
- }
- }
-
- uc.setId(id);
- uc.setUserColourScheme(jbucs);
- // jm.addUserColours(uc);
- jm.getUserColours().add(uc);
- }
-
- return id;
- }
-
- jalview.schemes.UserColourScheme getUserColourScheme(JalviewModel jm,
- String id)
- {
- List<UserColours> uc = jm.getUserColours();
- UserColours colours = null;
- /*
- for (int i = 0; i < uc.length; i++)
- {
- if (uc[i].getId().equals(id))
- {
- colours = uc[i];
- break;
- }
- }
- */
- for (UserColours c : uc)
- {
- if (c.getId().equals(id))
- {
- colours = c;
- break;
- }
- }
-
- java.awt.Color[] newColours = new java.awt.Color[24];
-
- for (int i = 0; i < 24; i++)
- {
- newColours[i] = new java.awt.Color(Integer.parseInt(
- // colours.getUserColourScheme().getColour(i).getRGB(), 16));
- colours.getUserColourScheme().getColour().get(i).getRGB(),
- 16));
- }
-
- jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(
- newColours);
-
- if (colours.getUserColourScheme().getColour().size()/*Count()*/ > 24)
- {
- newColours = new java.awt.Color[23];
- for (int i = 0; i < 23; i++)
- {
- newColours[i] = new java.awt.Color(
- Integer.parseInt(colours.getUserColourScheme().getColour()
- .get(i + 24).getRGB(), 16));
- }
- ucs.setLowerCaseColours(newColours);
- }
-
- return ucs;
- }
-
- /**
- * contains last error message (if any) encountered by XML loader.
- */
- String errorMessage = null;
-
- /**
- * flag to control whether the Jalview2XML_V1 parser should be deferred to if
- * exceptions are raised during project XML parsing
- */
- public boolean attemptversion1parse = false;
-
- /**
- * Load a jalview project archive from a jar file
- *
- * @param file
- * - HTTP URL or filename
- */
- public AlignFrame loadJalviewAlign(final Object file)
- {
-
- jalview.gui.AlignFrame af = null;
-
- try
- {
- // create list to store references for any new Jmol viewers created
- newStructureViewers = new Vector<>();
- // UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING
- // Workaround is to make sure caller implements the JarInputStreamProvider
- // interface
- // so we can re-open the jar input stream for each entry.
-
- jarInputStreamProvider jprovider = createjarInputStreamProvider(file);
- af = loadJalviewAlign(jprovider);
- if (af != null)
- {
- af.setMenusForViewport();
- }
- } catch (MalformedURLException e)
- {
- errorMessage = "Invalid URL format for '" + file + "'";
- reportErrors();
- } finally
- {
- try
- {
- SwingUtilities.invokeAndWait(new Runnable()
- {
- @Override
- public void run()
- {
- setLoadingFinishedForNewStructureViewers();
- }
- });
- } catch (Exception x)
- {
- jalview.bin.Console
- .errPrintln("Error loading alignment: " + x.getMessage());
- }
- }
- return af;
- }
-
- @SuppressWarnings("unused")
- private jarInputStreamProvider createjarInputStreamProvider(
- final Object ofile) throws MalformedURLException
- {
-
- // BH 2018 allow for bytes already attached to File object
- try
- {
- String file = (ofile instanceof File
- ? ((File) ofile).getCanonicalPath()
- : ofile.toString());
- byte[] bytes = Platform.isJS() ? Platform.getFileBytes((File) ofile)
- : null;
- URL url = null;
- errorMessage = null;
- uniqueSetSuffix = null;
- seqRefIds = null;
- viewportsAdded.clear();
- frefedSequence = null;
-
- if (HttpUtils.startsWithHttpOrHttps(file))
- {
- url = new URL(file);
- }
- final URL _url = url;
- return new jarInputStreamProvider()
- {
-
- @Override
- public JarInputStream getJarInputStream() throws IOException
- {
- if (bytes != null)
- {
- // jalview.bin.Console.outPrintln("Jalview2XML: opening byte
- // jarInputStream for
- // bytes.length=" + bytes.length);
- return new JarInputStream(new ByteArrayInputStream(bytes));
- }
- if (_url != null)
- {
- // jalview.bin.Console.outPrintln("Jalview2XML: opening url
- // jarInputStream for "
- // + _url);
- return new JarInputStream(_url.openStream());
- }
- else
- {
- // jalview.bin.Console.outPrintln("Jalview2XML: opening file
- // jarInputStream for
- // " + file);
- return new JarInputStream(new FileInputStream(file));
- }
- }
-
- @Override
- public String getFilename()
- {
- return file;
- }
- };
- } catch (IOException e)
- {
- e.printStackTrace();
- return null;
- }
- }
-
- /**
- * Recover jalview session from a jalview project archive. Caller may
- * initialise uniqueSetSuffix, seqRefIds, viewportsAdded and frefedSequence
- * themselves. Any null fields will be initialised with default values,
- * non-null fields are left alone.
- *
- * @param jprovider
- * @return
- */
- public AlignFrame loadJalviewAlign(final jarInputStreamProvider jprovider)
- {
- errorMessage = null;
- if (uniqueSetSuffix == null)
- {
- uniqueSetSuffix = System.currentTimeMillis() % 100000 + "";
- }
- if (seqRefIds == null)
- {
- initSeqRefs();
- }
- AlignFrame af = null, _af = null;
- List<AlignFrame> toRepaint = new ArrayList<AlignFrame>();
- IdentityHashMap<AlignmentI, AlignmentI> importedDatasets = new IdentityHashMap<>();
- Map<String, AlignFrame> gatherToThisFrame = new HashMap<>();
- final String file = jprovider.getFilename();
- try
- {
- JarInputStream jin = null;
- JarEntry jarentry = null;
- int entryCount = 1;
-
- do
- {
- jin = jprovider.getJarInputStream();
- for (int i = 0; i < entryCount; i++)
- {
- jarentry = jin.getNextJarEntry();
- }
-
- if (jarentry != null && jarentry.getName().endsWith(".xml"))
- {
- JAXBContext jc = JAXBContext
- .newInstance("jalview.xml.binding.jalview");
- XMLStreamReader streamReader = XMLInputFactory.newInstance()
- .createXMLStreamReader(jin);
- javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
- JAXBElement<JalviewModel> jbe = um.unmarshal(streamReader,
- JalviewModel.class);
- JalviewModel object = jbe.getValue();
-
- if (true) // !skipViewport(object))
- {
- _af = loadFromObject(object, file, true, jprovider);
- if (_af != null && object.getViewport().size() > 0)
- // getJalviewModelSequence().getViewportCount() > 0)
- {
- toRepaint.add(_af);
- if (af == null)
- {
- // store a reference to the first view
- af = _af;
- }
- if (_af.getViewport().isGatherViewsHere())
- {
- // if this is a gathered view, keep its reference since
- // after gathering views, only this frame will remain
- af = _af;
- gatherToThisFrame.put(_af.getViewport().getSequenceSetId(),
- _af);
- }
- // Save dataset to register mappings once all resolved
- importedDatasets.put(
- af.getViewport().getAlignment().getDataset(),
- af.getViewport().getAlignment().getDataset());
- }
- }
- entryCount++;
- }
- else if (jarentry != null)
- {
- // Some other file here.
- entryCount++;
- }
- } while (jarentry != null);
- jin.close();
- resolveFrefedSequences();
- for (AlignFrame alignFrame : toRepaint)
- {
- alignFrame.repaint();
- }
- } catch (IOException ex)
- {
- ex.printStackTrace();
- errorMessage = "Couldn't locate Jalview XML file : " + file;
- jalview.bin.Console.errPrintln(
- "Exception whilst loading jalview XML file : " + ex + "\n");
- } catch (Exception ex)
- {
- jalview.bin.Console
- .errPrintln("Parsing as Jalview Version 2 file failed.");
- ex.printStackTrace(System.err);
- if (attemptversion1parse)
- {
- // used to attempt to parse as V1 castor-generated xml
- }
- if (Desktop.instance != null)
- {
- Desktop.instance.stopLoading();
- }
- if (af != null)
- {
- jalview.bin.Console.outPrintln("Successfully loaded archive file");
- return af;
- }
- ex.printStackTrace();
-
- jalview.bin.Console.errPrintln(
- "Exception whilst loading jalview XML file : " + ex + "\n");
- } catch (OutOfMemoryError e)
- {
- // Don't use the OOM Window here
- errorMessage = "Out of memory loading jalview XML file";
- jalview.bin.Console
- .errPrintln("Out of memory whilst loading jalview XML file");
- e.printStackTrace();
- }
-
- /*
- * Regather multiple views (with the same sequence set id) to the frame (if
- * any) that is flagged as the one to gather to, i.e. convert them to tabbed
- * views instead of separate frames. Note this doesn't restore a state where
- * some expanded views in turn have tabbed views - the last "first tab" read
- * in will play the role of gatherer for all.
- */
- for (AlignFrame fr : gatherToThisFrame.values())
- {
- Desktop.instance.gatherViews(fr);
- }
-
- restoreSplitFrames();
- for (AlignmentI ds : importedDatasets.keySet())
- {
- if (ds.getCodonFrames() != null)
- {
- StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance)
- .registerMappings(ds.getCodonFrames());
- }
- }
- if (errorMessage != null)
- {
- reportErrors();
- }
-
- if (Desktop.instance != null)
- {
- Desktop.instance.stopLoading();
- }
-
- return af;
- }
-
- /**
- * Try to reconstruct and display SplitFrame windows, where each contains
- * complementary dna and protein alignments. Done by pairing up AlignFrame
- * objects (created earlier) which have complementary viewport ids associated.
- */
- protected void restoreSplitFrames()
- {
- List<SplitFrame> gatherTo = new ArrayList<>();
- List<AlignFrame> addedToSplitFrames = new ArrayList<>();
- Map<String, AlignFrame> dna = new HashMap<>();
-
- /*
- * Identify the DNA alignments
- */
- for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
- .entrySet())
- {
- AlignFrame af = candidate.getValue();
- if (af.getViewport().getAlignment().isNucleotide())
- {
- dna.put(candidate.getKey().getId(), af);
- }
- }
-
- /*
- * Try to match up the protein complements
- */
- for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
- .entrySet())
- {
- AlignFrame af = candidate.getValue();
- if (!af.getViewport().getAlignment().isNucleotide())
- {
- String complementId = candidate.getKey().getComplementId();
- // only non-null complements should be in the Map
- if (complementId != null && dna.containsKey(complementId))
- {
- final AlignFrame dnaFrame = dna.get(complementId);
- SplitFrame sf = createSplitFrame(dnaFrame, af);
- addedToSplitFrames.add(dnaFrame);
- addedToSplitFrames.add(af);
- dnaFrame.setMenusForViewport();
- af.setMenusForViewport();
- if (af.getViewport().isGatherViewsHere())
- {
- gatherTo.add(sf);
- }
- }
- }
- }
-
- /*
- * Open any that we failed to pair up (which shouldn't happen!) as
- * standalone AlignFrame's.
- */
- for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
- .entrySet())
- {
- AlignFrame af = candidate.getValue();
- if (!addedToSplitFrames.contains(af))
- {
- Viewport view = candidate.getKey();
- Desktop.addInternalFrame(af, view.getTitle(),
- safeInt(view.getWidth()), safeInt(view.getHeight()));
- af.setMenusForViewport();
- jalview.bin.Console.errPrintln("Failed to restore view "
- + view.getTitle() + " to split frame");
- }
- }
-
- /*
- * Gather back into tabbed views as flagged.
- */
- for (SplitFrame sf : gatherTo)
- {
- Desktop.instance.gatherViews(sf);
+ // object.setJalviewModelSequence(jms);
+ // object.getVamsasModel().addSequenceSet(vamsasSet);
+ object.getVamsasModel().getSequenceSet().add(vamsasSet);
+
+ if (jout != null && fileName != null)
+ {
+ // We may not want to write the object to disk,
+ // eg we can copy the alignViewport to a new view object
+ // using save and then load
+ try
+ {
+ fileName = fileName.replace('\\', '/');
- System.out.println("Writing jar entry " + fileName);
++ jalview.bin.Console.outPrintln("Writing jar entry " + fileName);
+ JarEntry entry = new JarEntry(fileName);
+ jout.putNextEntry(entry);
+ PrintWriter pout = new PrintWriter(
+ new OutputStreamWriter(jout, UTF_8));
+ JAXBContext jaxbContext = JAXBContext
+ .newInstance(JalviewModel.class);
+ Marshaller jaxbMarshaller = jaxbContext.createMarshaller();
+
+ // output pretty printed
+ // jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, true);
+ jaxbMarshaller.marshal(
+ new ObjectFactory().createJalviewModel(object), pout);
+
+ // jaxbMarshaller.marshal(object, pout);
+ // marshaller.marshal(object);
+ pout.flush();
+ jout.closeEntry();
+ } catch (Exception ex)
+ {
+ // TODO: raise error in GUI if marshalling failed.
- System.err.println("Error writing Jalview project");
++ jalview.bin.Console.errPrintln("Error writing Jalview project");
+ ex.printStackTrace();
+ }
+ }
+ return object;
}
-
- splitFrameCandidates.clear();
- }
-
- /**
- * Construct and display one SplitFrame holding DNA and protein alignments.
- *
- * @param dnaFrame
- * @param proteinFrame
- * @return
- */
- protected SplitFrame createSplitFrame(AlignFrame dnaFrame,
- AlignFrame proteinFrame)
- {
- SplitFrame splitFrame = new SplitFrame(dnaFrame, proteinFrame);
- String title = MessageManager.getString("label.linked_view_title");
- int width = (int) dnaFrame.getBounds().getWidth();
- int height = (int) (dnaFrame.getBounds().getHeight()
- + proteinFrame.getBounds().getHeight() + 50);
-
- /*
- * SplitFrame location is saved to both enclosed frames
+ /**
+ * Saves the HMMER profile associated with the sequence as a file in the jar,
+ * in HMMER format, and saves the name of the file as a child element of the
+ * XML sequence element
+ *
+ * @param jout
+ * @param xmlSeq
+ * @param seq
*/
- splitFrame.setLocation(dnaFrame.getX(), dnaFrame.getY());
- Desktop.addInternalFrame(splitFrame, title, width, height);
-
- /*
- * And compute cDNA consensus (couldn't do earlier with consensus as
- * mappings were not yet present)
+ protected void saveHmmerProfile(JarOutputStream jout, JSeq xmlSeq,
+ SequenceI seq)
+ {
+ HiddenMarkovModel profile = seq.getHMM();
+ if (profile == null)
+ {
+ Console.warn("Want to save HMM profile for " + seq.getName()
+ + " but none found");
+ return;
+ }
+ HMMFile hmmFile = new HMMFile(profile);
+ String hmmAsString = hmmFile.print();
+ String jarEntryName = HMMER_PREFIX + nextCounter();
+ try
+ {
+ writeJarEntry(jout, jarEntryName, hmmAsString.getBytes());
+ xmlSeq.setHmmerProfile(jarEntryName);
+ } catch (IOException e)
+ {
+ Console.warn("Error saving HMM profile: " + e.getMessage());
+ }
+ }
+
+
+ /**
+ * Writes PCA viewer attributes and computed values to an XML model object and
+ * adds it to the JalviewModel. Any exceptions are reported by logging.
*/
- proteinFrame.getViewport().alignmentChanged(proteinFrame.alignPanel);
-
- return splitFrame;
- }
-
- /**
- * check errorMessage for a valid error message and raise an error box in the
- * GUI or write the current errorMessage to stderr and then clear the error
- * state.
- */
- protected void reportErrors()
- {
- reportErrors(false);
- }
-
- protected void reportErrors(final boolean saving)
- {
- if (errorMessage != null)
- {
- final String finalErrorMessage = errorMessage;
- if (raiseGUI)
- {
- javax.swing.SwingUtilities.invokeLater(new Runnable()
- {
- @Override
- public void run()
- {
- JvOptionPane.showInternalMessageDialog(Desktop.desktop,
- finalErrorMessage,
- "Error " + (saving ? "saving" : "loading")
- + " Jalview file",
- JvOptionPane.WARNING_MESSAGE);
- }
- });
- }
- else
- {
- jalview.bin.Console.errPrintln(
- "Problem loading Jalview file: " + errorMessage);
- }
+ protected void savePCA(PCAPanel panel, JalviewModel object)
+ {
+ try
+ {
+ PcaViewer viewer = new PcaViewer();
+ viewer.setHeight(panel.getHeight());
+ viewer.setWidth(panel.getWidth());
+ viewer.setXpos(panel.getX());
+ viewer.setYpos(panel.getY());
+ viewer.setTitle(panel.getTitle());
+ PCAModel pcaModel = panel.getPcaModel();
+ viewer.setScoreModelName(pcaModel.getScoreModelName());
+ viewer.setXDim(panel.getSelectedDimensionIndex(X));
+ viewer.setYDim(panel.getSelectedDimensionIndex(Y));
+ viewer.setZDim(panel.getSelectedDimensionIndex(Z));
+ viewer.setBgColour(
+ panel.getRotatableCanvas().getBackgroundColour().getRGB());
+ viewer.setScaleFactor(panel.getRotatableCanvas().getScaleFactor());
+ float[] spMin = panel.getRotatableCanvas().getSeqMin();
+ SeqPointMin spmin = new SeqPointMin();
+ spmin.setXPos(spMin[0]);
+ spmin.setYPos(spMin[1]);
+ spmin.setZPos(spMin[2]);
+ viewer.setSeqPointMin(spmin);
+ float[] spMax = panel.getRotatableCanvas().getSeqMax();
+ SeqPointMax spmax = new SeqPointMax();
+ spmax.setXPos(spMax[0]);
+ spmax.setYPos(spMax[1]);
+ spmax.setZPos(spMax[2]);
+ viewer.setSeqPointMax(spmax);
+ viewer.setShowLabels(panel.getRotatableCanvas().isShowLabels());
+ viewer.setLinkToAllViews(
+ panel.getRotatableCanvas().isApplyToAllViews());
+ SimilarityParamsI sp = pcaModel.getSimilarityParameters();
+ viewer.setIncludeGaps(sp.includeGaps());
+ viewer.setMatchGaps(sp.matchGaps());
+ viewer.setIncludeGappedColumns(sp.includeGappedColumns());
+ viewer.setDenominateByShortestLength(sp.denominateByShortestLength());
+
+ /*
+ * sequence points on display
+ */
+ for (jalview.datamodel.SequencePoint spt : pcaModel
+ .getSequencePoints())
+ {
+ SequencePoint point = new SequencePoint();
+ point.setSequenceRef(seqHash(spt.getSequence()));
+ point.setXPos(spt.coord.x);
+ point.setYPos(spt.coord.y);
+ point.setZPos(spt.coord.z);
+ viewer.getSequencePoint().add(point);
+ }
+
+ /*
+ * (end points of) axes on display
+ */
+ for (Point p : panel.getRotatableCanvas().getAxisEndPoints())
+ {
+
+ Axis axis = new Axis();
+ axis.setXPos(p.x);
+ axis.setYPos(p.y);
+ axis.setZPos(p.z);
+ viewer.getAxis().add(axis);
+ }
+
+ /*
+ * raw PCA data (note we are not restoring PCA inputs here -
+ * alignment view, score model, similarity parameters)
+ */
+ PcaDataType data = new PcaDataType();
+ viewer.setPcaData(data);
+ PCA pca = pcaModel.getPcaData();
+
+ DoubleMatrix pm = new DoubleMatrix();
+ saveDoubleMatrix(pca.getPairwiseScores(), pm);
+ data.setPairwiseMatrix(pm);
+
+ DoubleMatrix tm = new DoubleMatrix();
+ saveDoubleMatrix(pca.getTridiagonal(), tm);
+ data.setTridiagonalMatrix(tm);
+
+ DoubleMatrix eigenMatrix = new DoubleMatrix();
+ data.setEigenMatrix(eigenMatrix);
+ saveDoubleMatrix(pca.getEigenmatrix(), eigenMatrix);
+
+ object.getPcaViewer().add(viewer);
+ } catch (Throwable t)
+ {
+ Console.error("Error saving PCA: " + t.getMessage());
+ }
}
- errorMessage = null;
- }
-
- Map<String, String> alreadyLoadedPDB = new HashMap<>();
- /**
- * when set, local views will be updated from view stored in JalviewXML
- * Currently (28th Sep 2008) things will go horribly wrong in vamsas document
- * sync if this is set to true.
- */
- private final boolean updateLocalViews = false;
-
- /**
- * Returns the path to a temporary file holding the PDB file for the given PDB
- * id. The first time of asking, searches for a file of that name in the
- * Jalview project jar, and copies it to a new temporary file. Any repeat
- * requests just return the path to the file previously created.
- *
- * @param jprovider
- * @param pdbId
- * @return
- */
- String loadPDBFile(jarInputStreamProvider jprovider, String pdbId,
- String origFile)
- {
- if (alreadyLoadedPDB.containsKey(pdbId))
- {
- return alreadyLoadedPDB.get(pdbId).toString();
+ /**
+ * Stores values from a matrix into an XML element, including (if present) the
+ * D or E vectors
+ *
+ * @param m
+ * @param xmlMatrix
+ * @see #loadDoubleMatrix(DoubleMatrix)
+ */
+ protected void saveDoubleMatrix(MatrixI m, DoubleMatrix xmlMatrix)
+ {
+ xmlMatrix.setRows(m.height());
+ xmlMatrix.setColumns(m.width());
+ for (int i = 0; i < m.height(); i++)
+ {
+ DoubleVector row = new DoubleVector();
+ for (int j = 0; j < m.width(); j++)
+ {
+ row.getV().add(m.getValue(i, j));
+ }
+ xmlMatrix.getRow().add(row);
+ }
+ if (m.getD() != null)
+ {
+ DoubleVector dVector = new DoubleVector();
+ for (double d : m.getD())
+ {
+ dVector.getV().add(d);
+ }
+ xmlMatrix.setD(dVector);
+ }
+ if (m.getE() != null)
+ {
+ DoubleVector eVector = new DoubleVector();
+ for (double e : m.getE())
+ {
+ eVector.getV().add(e);
+ }
+ xmlMatrix.setE(eVector);
+ }
}
- String tempFile = copyJarEntry(jprovider, pdbId, "jalview_pdb",
- origFile);
- if (tempFile != null)
- {
- alreadyLoadedPDB.put(pdbId, tempFile);
+ /**
+ * Loads XML matrix data into a new Matrix object, including the D and/or E
+ * vectors (if present)
+ *
+ * @param mData
+ * @return
+ * @see Jalview2XML#saveDoubleMatrix(MatrixI, DoubleMatrix)
+ */
+ protected MatrixI loadDoubleMatrix(DoubleMatrix mData)
+ {
+ int rows = mData.getRows();
+ double[][] vals = new double[rows][];
+
+ for (int i = 0; i < rows; i++)
+ {
+ List<Double> dVector = mData.getRow().get(i).getV();
+ vals[i] = new double[dVector.size()];
+ int dvi = 0;
+ for (Double d : dVector)
+ {
+ vals[i][dvi++] = d;
+ }
+ }
+
+ MatrixI m = new Matrix(vals);
+
+ if (mData.getD() != null)
+ {
+ List<Double> dVector = mData.getD().getV();
+ double[] vec = new double[dVector.size()];
+ int dvi = 0;
+ for (Double d : dVector)
+ {
+ vec[dvi++] = d;
+ }
+ m.setD(vec);
+ }
+ if (mData.getE() != null)
+ {
+ List<Double> dVector = mData.getE().getV();
+ double[] vec = new double[dVector.size()];
+ int dvi = 0;
+ for (Double d : dVector)
+ {
+ vec[dvi++] = d;
+ }
+ m.setE(vec);
+ }
+
+ return m;
+ }
+
+ /**
+ * Save any Varna viewers linked to this sequence. Writes an rnaViewer element
+ * for each viewer, with
+ * <ul>
+ * <li>viewer geometry (position, size, split pane divider location)</li>
+ * <li>index of the selected structure in the viewer (currently shows gapped
+ * or ungapped)</li>
+ * <li>the id of the annotation holding RNA secondary structure</li>
+ * <li>(currently only one SS is shown per viewer, may be more in future)</li>
+ * </ul>
+ * Varna viewer state is also written out (in native Varna XML) to separate
+ * project jar entries. A separate entry is written for each RNA structure
+ * displayed, with the naming convention
+ * <ul>
+ * <li>rna_viewId_sequenceId_annotationId_[gapped|trimmed]</li>
+ * </ul>
+ *
+ * @param jout
+ * @param jseq
+ * @param jds
+ * @param viewIds
+ * @param ap
+ * @param storeDataset
+ */
+ protected void saveRnaViewers(JarOutputStream jout, JSeq jseq,
+ final SequenceI jds, List<String> viewIds, AlignmentPanel ap,
+ boolean storeDataset)
+ {
+ if (Desktop.getDesktopPane() == null)
+ {
+ return;
+ }
+ JInternalFrame[] frames = Desktop.getDesktopPane().getAllFrames();
+ for (int f = frames.length - 1; f > -1; f--)
+ {
+ if (frames[f] instanceof AppVarna)
+ {
+ AppVarna varna = (AppVarna) frames[f];
+ /*
+ * link the sequence to every viewer that is showing it and is linked to
+ * its alignment panel
+ */
+ if (varna.isListeningFor(jds) && ap == varna.getAlignmentPanel())
+ {
+ String viewId = varna.getViewId();
+ RnaViewer rna = new RnaViewer();
+ rna.setViewId(viewId);
+ rna.setTitle(varna.getTitle());
+ rna.setXpos(varna.getX());
+ rna.setYpos(varna.getY());
+ rna.setWidth(varna.getWidth());
+ rna.setHeight(varna.getHeight());
+ rna.setDividerLocation(varna.getDividerLocation());
+ rna.setSelectedRna(varna.getSelectedIndex());
+ // jseq.addRnaViewer(rna);
+ jseq.getRnaViewer().add(rna);
+
+ /*
+ * Store each Varna panel's state once in the project per sequence.
+ * First time through only (storeDataset==false)
+ */
+ // boolean storeSessions = false;
+ // String sequenceViewId = viewId + seqsToIds.get(jds);
+ // if (!storeDataset && !viewIds.contains(sequenceViewId))
+ // {
+ // viewIds.add(sequenceViewId);
+ // storeSessions = true;
+ // }
+ for (RnaModel model : varna.getModels())
+ {
+ if (model.seq == jds)
+ {
+ /*
+ * VARNA saves each view (sequence or alignment secondary
+ * structure, gapped or trimmed) as a separate XML file
+ */
+ String jarEntryName = rnaSessions.get(model);
+ if (jarEntryName == null)
+ {
+
+ String varnaStateFile = varna.getStateInfo(model.rna);
+ jarEntryName = RNA_PREFIX + viewId + "_" + nextCounter();
+ copyFileToJar(jout, varnaStateFile, jarEntryName, "Varna");
+ rnaSessions.put(model, jarEntryName);
+ }
+ SecondaryStructure ss = new SecondaryStructure();
+ String annotationId = varna.getAnnotation(jds).annotationId;
+ ss.setAnnotationId(annotationId);
+ ss.setViewerState(jarEntryName);
+ ss.setGapped(model.gapped);
+ ss.setTitle(model.title);
+ // rna.addSecondaryStructure(ss);
+ rna.getSecondaryStructure().add(ss);
+ }
+ }
+ }
+ }
+ }
}
- return tempFile;
- }
- /**
- * Copy the contents of a file to a new entry added to the output jar
- *
- * @param jout
- * @param infilePath
- * @param jarEntryName
- * @param msg
- * additional identifying info to log to the console
- */
- protected void copyFileToJar(JarOutputStream jout, String infilePath,
- String jarEntryName, String msg)
+ /**
- * Copies the jar entry of given name to a new temporary file and returns the
- * path to the file, or null if the entry is not found.
++ * Copy the contents of a file to a new entry added to the output jar
+ *
- * @param jprovider
++ * @param jout
++ * @param infilePath
+ * @param jarEntryName
- * @param prefix
- * a prefix for the temporary file name, must be at least three
- * characters long
- * @param suffixModel
- * null or original file - so new file can be given the same suffix
- * as the old one
- * @return
++ * @param msg
++ * additional identifying info to log to the console
+ */
- protected String copyJarEntry(jarInputStreamProvider jprovider,
- String jarEntryName, String prefix, String suffixModel)
++ protected void copyFileToJar(JarOutputStream jout, String infilePath,
++ String jarEntryName, String msg)
+ {
- String suffix = ".tmp";
- if (suffixModel == null)
- {
- suffixModel = jarEntryName;
- }
- int sfpos = suffixModel.lastIndexOf(".");
- if (sfpos > -1 && sfpos < (suffixModel.length() - 1))
- {
- suffix = "." + suffixModel.substring(sfpos + 1);
- }
-
- try (JarInputStream jin = jprovider.getJarInputStream())
++ try (InputStream is = new FileInputStream(infilePath))
{
- try (InputStream is = new FileInputStream(infilePath))
- {
- File file = new File(infilePath);
- if (file.exists() && jout != null)
- {
- System.out.println(
- "Writing jar entry " + jarEntryName + " (" + msg + ")");
- jout.putNextEntry(new JarEntry(jarEntryName));
- copyAll(is, jout);
- jout.closeEntry();
- // dis = new DataInputStream(new FileInputStream(file));
- // byte[] data = new byte[(int) file.length()];
- // dis.readFully(data);
- // writeJarEntry(jout, jarEntryName, data);
- }
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- JarEntry entry = null;
- do
- {
- entry = jin.getNextJarEntry();
- } while (entry != null && !entry.getName().equals(jarEntryName));
-
- if (entry != null)
- {
- // in = new BufferedReader(new InputStreamReader(jin, UTF_8));
- File outFile = File.createTempFile(prefix, suffix);
- outFile.deleteOnExit();
- try (OutputStream os = new FileOutputStream(outFile))
- {
- copyAll(jin, os);
- }
- String t = outFile.getAbsolutePath();
- return t;
- }
- else
++ File file = new File(infilePath);
++ if (file.exists() && jout != null)
+ {
- Console.warn(
- "Couldn't find entry in Jalview Jar for " + jarEntryName);
++ jalview.bin.Console.outPrintln(
++ "Writing jar entry " + jarEntryName + " (" + msg + ")");
++ jout.putNextEntry(new JarEntry(jarEntryName));
++ copyAll(is, jout);
++ jout.closeEntry();
++ // dis = new DataInputStream(new FileInputStream(file));
++ // byte[] data = new byte[(int) file.length()];
++ // dis.readFully(data);
++ // writeJarEntry(jout, jarEntryName, data);
+ }
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
}
-
- return null;
+ }
- private class JvAnnotRow
- {
- public JvAnnotRow(int i, AlignmentAnnotation jaa)
- {
- order = i;
- template = jaa;
- }
/**
- * persisted version of annotation row from which to take vis properties
+ * Write the data to a new entry of given name in the output jar file
+ *
+ * @param jout
+ * @param jarEntryName
+ * @param data
+ * @throws IOException
*/
- public jalview.datamodel.AlignmentAnnotation template;
+ protected void writeJarEntry(JarOutputStream jout, String jarEntryName,
+ byte[] data) throws IOException
+ {
+ if (jout != null)
+ {
+ jarEntryName = jarEntryName.replace('\\','/');
- System.out.println("Writing jar entry " + jarEntryName);
++ jalview.bin.Console.outPrintln("Writing jar entry " + jarEntryName);
+ jout.putNextEntry(new JarEntry(jarEntryName));
+ DataOutputStream dout = new DataOutputStream(jout);
+ dout.write(data, 0, data.length);
+ dout.flush();
+ jout.closeEntry();
+ }
+ }
/**
- * original position of the annotation row in the alignment
+ * Copies input to output, in 4K buffers; handles any data (text or binary)
+ *
+ * @param in
+ * @param out
+ * @throws IOException
*/
- public int order;
- }
+ protected void copyAll(InputStream in, OutputStream out)
+ throws IOException
+ {
+ byte[] buffer = new byte[4096];
+ int bytesRead = 0;
+ while ((bytesRead = in.read(buffer)) != -1)
+ {
+ out.write(buffer, 0, bytesRead);
+ }
+ }
- /**
- * Save the state of a structure viewer
- *
- * @param ap
- * @param jds
- * @param pdb
- * the archive XML element under which to save the state
- * @param entry
- * @param viewIds
- * @param matchedFile
- * @param viewFrame
- * @return
- */
- protected String saveStructureViewer(AlignmentPanel ap, SequenceI jds,
- Pdbids pdb, PDBEntry entry, List<String> viewIds,
- String matchedFile, StructureViewerBase viewFrame)
- {
- final AAStructureBindingModel bindingModel = viewFrame.getBinding();
+ /**
- * Load alignment frame from jalview XML DOM object
++ * Save the state of a structure viewer
+ *
- * @param jalviewModel
- * DOM
- * @param file
- * filename source string
- * @param loadTreesAndStructures
- * when false only create Viewport
- * @param jprovider
- * data source provider
- * @return alignment frame created from view stored in DOM
++ * @param ap
++ * @param jds
++ * @param pdb
++ * the archive XML element under which to save the state
++ * @param entry
++ * @param viewIds
++ * @param matchedFile
++ * @param viewFrame
++ * @return
+ */
- AlignFrame loadFromObject(JalviewModel jalviewModel, String file,
- boolean loadTreesAndStructures, jarInputStreamProvider jprovider)
++ protected String saveStructureViewer(AlignmentPanel ap, SequenceI jds,
++ Pdbids pdb, PDBEntry entry, List<String> viewIds,
++ String matchedFile, JalviewStructureDisplayI viewFrame)
+ {
- SequenceSet vamsasSet = jalviewModel.getVamsasModel().getSequenceSet()
- .get(0);
- List<Sequence> vamsasSeqs = vamsasSet.getSequence();
-
- // JalviewModelSequence jms = object.getJalviewModelSequence();
-
- // Viewport view = (jms.getViewportCount() > 0) ? jms.getViewport(0)
- // : null;
- Viewport view = (jalviewModel.getViewport().size() > 0)
- ? jalviewModel.getViewport().get(0)
- : null;
++ final AAStructureBindingModel bindingModel = viewFrame.getBinding();
- // ////////////////////////////////
- // INITIALISE ALIGNMENT SEQUENCESETID AND VIEWID
- //
- //
- // If we just load in the same jar file again, the sequenceSetId
- // will be the same, and we end up with multiple references
- // to the same sequenceSet. We must modify this id on load
- // so that each load of the file gives a unique id
+ /*
+ * Look for any bindings for this viewer to the PDB file of interest
+ * (including part matches excluding chain id)
+ */
+ for (int peid = 0; peid < bindingModel.getPdbCount(); peid++)
+ {
+ final PDBEntry pdbentry = bindingModel.getPdbEntry(peid);
+ final String pdbId = pdbentry.getId();
+ if (!pdbId.equals(entry.getId())
+ && !(entry.getId().length() > 4 && entry.getId().toLowerCase(Locale.ROOT)
+ .startsWith(pdbId.toLowerCase(Locale.ROOT))))
+ {
+ /*
+ * not interested in a binding to a different PDB entry here
+ */
+ continue;
+ }
+ if (matchedFile == null)
+ {
+ matchedFile = pdbentry.getFile();
+ }
+ else if (!matchedFile.equals(pdbentry.getFile()))
+ {
+ Console.warn(
+ "Probably lost some PDB-Sequence mappings for this structure file (which apparently has same PDB Entry code): "
+ + pdbentry.getFile());
+ }
+ // record the
+ // file so we
+ // can get at it if the ID
+ // match is ambiguous (e.g.
+ // 1QIP==1qipA)
+
+ for (int smap = 0; smap < viewFrame.getBinding()
+ .getSequence()[peid].length; smap++)
+ {
+ // if (jal.findIndex(jmol.jmb.sequence[peid][smap]) > -1)
+ if (jds == viewFrame.getBinding().getSequence()[peid][smap])
+ {
+ StructureState state = new StructureState();
+ state.setVisible(true);
+ state.setXpos(viewFrame.getX());
+ state.setYpos(viewFrame.getY());
+ state.setWidth(viewFrame.getWidth());
+ state.setHeight(viewFrame.getHeight());
+ final String viewId = viewFrame.getViewId();
+ state.setViewId(viewId);
+ state.setAlignwithAlignPanel(viewFrame.isUsedforaligment(ap));
+ state.setColourwithAlignPanel(viewFrame.isUsedForColourBy(ap));
+ state.setColourByJmol(viewFrame.isColouredByViewer());
+ state.setType(viewFrame.getViewerType().toString());
+ // pdb.addStructureState(state);
+ pdb.getStructureState().add(state);
+ }
+ }
+ }
+ return matchedFile;
+ }
/**
- * used to resolve correct alignment dataset for alignments with multiple
- * views
+ * Populates the AnnotationColourScheme xml for save. This captures the
+ * settings of the options in the 'Colour by Annotation' dialog.
+ *
+ * @param acg
+ * @param userColours
+ * @param jm
+ * @return
*/
- String uniqueSeqSetId = null;
- String viewId = null;
- if (view != null)
- {
- uniqueSeqSetId = view.getSequenceSetId() + uniqueSetSuffix;
- viewId = (view.getId() == null ? null
- : view.getId() + uniqueSetSuffix);
- }
-
- // ////////////////////////////////
- // LOAD MATRICES (IF ANY)
-
- if (vamsasSet.getMatrix() != null && vamsasSet.getMatrix().size() > 0)
- {
- importMatrixData(vamsasSet.getMatrix());
- }
-
- // ////////////////////////////////
- // LOAD SEQUENCES
-
- List<SequenceI> hiddenSeqs = null;
+ private AnnotationColourScheme constructAnnotationColours(
+ AnnotationColourGradient acg, List<UserColourScheme> userColours,
+ JalviewModel jm)
+ {
+ AnnotationColourScheme ac = new AnnotationColourScheme();
+ ac.setAboveThreshold(acg.getAboveThreshold());
+ ac.setThreshold(acg.getAnnotationThreshold());
+ // 2.10.2 save annotationId (unique) not annotation label
+ ac.setAnnotation(acg.getAnnotation().annotationId);
+ if (acg.getBaseColour() instanceof UserColourScheme)
+ {
+ ac.setColourScheme(
+ setUserColourScheme(acg.getBaseColour(), userColours, jm));
+ }
+ else
+ {
+ ac.setColourScheme(
+ ColourSchemeProperty.getColourName(acg.getBaseColour()));
+ }
+
+ ac.setMaxColour(acg.getMaxColour().getRGB());
+ ac.setMinColour(acg.getMinColour().getRGB());
+ ac.setPerSequence(acg.isSeqAssociated());
+ ac.setPredefinedColours(acg.isPredefinedColours());
+ return ac;
+ }
+
+ private void storeAlignmentAnnotation(AlignmentAnnotation[] aa,
+ IdentityHashMap<SequenceGroup, String> groupRefs,
+ AlignmentViewport av, Set<String> calcIdSet, boolean storeDS,
+ SequenceSet vamsasSet)
+ {
+
+ for (int i = 0; i < aa.length; i++)
+ {
+ Annotation an = new Annotation();
+
+ AlignmentAnnotation annotation = aa[i];
+ if (annotation.annotationId != null)
+ {
+ annotationIds.put(annotation.annotationId, annotation);
+ }
+
+ an.setId(annotation.annotationId);
+
+ an.setVisible(annotation.visible);
+
+ an.setDescription(annotation.description);
+
+ if (annotation.sequenceRef != null)
+ {
+ // 2.9 JAL-1781 xref on sequence id rather than name
+ an.setSequenceRef(seqsToIds.get(annotation.sequenceRef));
+ }
+ if (annotation.groupRef != null)
+ {
+ String groupIdr = groupRefs.get(annotation.groupRef);
+ if (groupIdr == null)
+ {
+ // make a locally unique String
+ groupRefs.put(annotation.groupRef,
+ groupIdr = ("" + System.currentTimeMillis()
+ + annotation.groupRef.getName()
+ + groupRefs.size()));
+ }
+ an.setGroupRef(groupIdr.toString());
+ }
+
+ // store all visualization attributes for annotation
+ an.setGraphHeight(annotation.graphHeight);
+ an.setCentreColLabels(annotation.centreColLabels);
+ an.setScaleColLabels(annotation.scaleColLabel);
+ an.setShowAllColLabels(annotation.showAllColLabels);
+ an.setBelowAlignment(annotation.belowAlignment);
- if (annotation.graph > 0)
- {
- an.setGraph(true);
- an.setGraphType(annotation.graph);
- an.setGraphGroup(annotation.graphGroup);
- if (annotation.getThreshold() != null)
- {
- ThresholdLine line = new ThresholdLine();
- line.setLabel(annotation.getThreshold().label);
- line.setValue(annotation.getThreshold().value);
- line.setColour(annotation.getThreshold().colour.getRGB());
- an.setThresholdLine(line);
- }
- }
- else
- {
- an.setGraph(false);
- }
- List<SequenceI> tmpseqs = new ArrayList<>();
-
- boolean multipleView = false;
- SequenceI referenceseqForView = null;
- // JSeq[] jseqs = object.getJalviewModelSequence().getJSeq();
- List<JSeq> jseqs = jalviewModel.getJSeq();
- int vi = 0; // counter in vamsasSeq array
- for (int i = 0; i < jseqs.size(); i++)
- {
- JSeq jseq = jseqs.get(i);
- String seqId = jseq.getId();
-
- SequenceI tmpSeq = seqRefIds.get(seqId);
- if (tmpSeq != null)
++ if (annotation.graph > 0)
+ {
- if (!incompleteSeqs.containsKey(seqId))
- {
- // may not need this check, but keep it for at least 2.9,1 release
- if (tmpSeq.getStart() != jseq.getStart()
- || tmpSeq.getEnd() != jseq.getEnd())
- {
- jalview.bin.Console.errPrintln(String.format(
- "Warning JAL-2154 regression: updating start/end for sequence %s from %d/%d to %d/%d",
- tmpSeq.getName(), tmpSeq.getStart(), tmpSeq.getEnd(),
- jseq.getStart(), jseq.getEnd()));
- }
- }
- else
- {
- incompleteSeqs.remove(seqId);
- }
- if (vamsasSeqs.size() > vi
- && vamsasSeqs.get(vi).getId().equals(seqId))
++ an.setGraph(true);
++ an.setGraphType(annotation.graph);
++ an.setGraphGroup(annotation.graphGroup);
++ if (annotation.getThreshold() != null)
+ {
- // most likely we are reading a dataset XML document so
- // update from vamsasSeq section of XML for this sequence
- tmpSeq.setName(vamsasSeqs.get(vi).getName());
- tmpSeq.setDescription(vamsasSeqs.get(vi).getDescription());
- tmpSeq.setSequence(vamsasSeqs.get(vi).getSequence());
- vi++;
++ ThresholdLine line = new ThresholdLine();
++ line.setLabel(annotation.getThreshold().label);
++ line.setValue(annotation.getThreshold().value);
++ line.setColour(annotation.getThreshold().colour.getRGB());
++ an.setThresholdLine(line);
+ }
- else
++ if (annotation.graph == AlignmentAnnotation.CONTACT_MAP)
+ {
- // reading multiple views, so vamsasSeq set is a subset of JSeq
- multipleView = true;
++ if (annotation.sequenceRef.getContactMaps() != null)
++ {
++ ContactMatrixI cm = annotation.sequenceRef
++ .getContactMatrixFor(annotation);
++ if (cm != null)
++ {
++ storeMatrixFor(vamsasSet, an, annotation, cm);
++ }
++ }
+ }
- tmpSeq.setStart(jseq.getStart());
- tmpSeq.setEnd(jseq.getEnd());
- tmpseqs.add(tmpSeq);
+ }
+ else
+ {
- Sequence vamsasSeq = vamsasSeqs.get(vi);
- tmpSeq = new jalview.datamodel.Sequence(vamsasSeq.getName(),
- vamsasSeq.getSequence());
- tmpSeq.setDescription(vamsasSeq.getDescription());
- tmpSeq.setStart(jseq.getStart());
- tmpSeq.setEnd(jseq.getEnd());
- tmpSeq.setVamsasId(uniqueSetSuffix + seqId);
- seqRefIds.put(vamsasSeq.getId(), tmpSeq);
- tmpseqs.add(tmpSeq);
- vi++;
++ an.setGraph(false);
+ }
- if (safeBoolean(jseq.isViewreference()))
+ an.setLabel(annotation.label);
+
+ if (annotation == av.getAlignmentQualityAnnot()
+ || annotation == av.getAlignmentConservationAnnotation()
+ || annotation == av.getAlignmentConsensusAnnotation()
+ || annotation.autoCalculated)
+ {
+ // new way of indicating autocalculated annotation -
+ an.setAutoCalculated(annotation.autoCalculated);
+ }
+ if (annotation.hasScore())
+ {
+ an.setScore(annotation.getScore());
+ }
+
- if (annotation.getCalcId() != null)
- {
- calcIdSet.add(annotation.getCalcId());
- an.setCalcId(annotation.getCalcId());
- }
- if (annotation.hasProperties())
- {
- for (String pr : annotation.getProperties())
- {
- jalview.xml.binding.jalview.Annotation.Property prop = new jalview.xml.binding.jalview.Annotation.Property();
- prop.setName(pr);
- prop.setValue(annotation.getProperty(pr));
- // an.addProperty(prop);
- an.getProperty().add(prop);
- }
- }
++ if (annotation.getCalcId() != null)
+ {
- referenceseqForView = tmpseqs.get(tmpseqs.size() - 1);
++ calcIdSet.add(annotation.getCalcId());
++ an.setCalcId(annotation.getCalcId());
+ }
-
- if (jseq.isHidden() != null && jseq.isHidden().booleanValue())
++ if (annotation.hasProperties())
+ {
- if (hiddenSeqs == null)
++ for (String pr : annotation.getProperties())
+ {
- hiddenSeqs = new ArrayList<>();
++ jalview.xml.binding.jalview.Property prop = new jalview.xml.binding.jalview.Property();
++ prop.setName(pr);
++ prop.setValue(annotation.getProperty(pr));
++ an.getProperty().add(prop);
+ }
-
- hiddenSeqs.add(tmpSeq);
+ }
- }
- // /
- // Create the alignment object from the sequence set
- // ///////////////////////////////
- SequenceI[] orderedSeqs = tmpseqs
- .toArray(new SequenceI[tmpseqs.size()]);
+ AnnotationElement ae;
+ if (annotation.annotations != null)
+ {
+ an.setScoreOnly(false);
+ for (int a = 0; a < annotation.annotations.length; a++)
+ {
+ if ((annotation == null) || (annotation.annotations[a] == null))
+ {
+ continue;
+ }
+
+ ae = new AnnotationElement();
+ if (annotation.annotations[a].description != null)
+ {
+ ae.setDescription(annotation.annotations[a].description);
+ }
+ if (annotation.annotations[a].displayCharacter != null)
+ {
+ ae.setDisplayCharacter(
+ annotation.annotations[a].displayCharacter);
+ }
+
+ if (!Float.isNaN(annotation.annotations[a].value))
+ {
+ ae.setValue(annotation.annotations[a].value);
+ }
+
+ ae.setPosition(a);
+ if (annotation.annotations[a].secondaryStructure > ' ')
+ {
+ ae.setSecondaryStructure(
+ annotation.annotations[a].secondaryStructure + "");
+ }
+
+ if (annotation.annotations[a].colour != null
+ && annotation.annotations[a].colour != java.awt.Color.black)
+ {
+ ae.setColour(annotation.annotations[a].colour.getRGB());
+ }
+
+ // an.addAnnotationElement(ae);
+ an.getAnnotationElement().add(ae);
+ if (annotation.autoCalculated)
+ {
+ // only write one non-null entry into the annotation row -
+ // sufficient to get the visualization attributes necessary to
+ // display data
+ continue;
+ }
+ }
+ }
+ else
+ {
+ an.setScoreOnly(true);
+ }
+ if (!storeDS || (storeDS && !annotation.autoCalculated))
+ {
+ // skip autocalculated annotation - these are only provided for
+ // alignments
+ // vamsasSet.addAnnotation(an);
+ vamsasSet.getAnnotation().add(an);
+ }
+ }
+
++ }
++
++ private void storeMatrixFor(SequenceSet root, Annotation an,
++ AlignmentAnnotation annotation, ContactMatrixI cm)
++ {
++ String cmId = contactMatrices.get(cm);
++ MatrixType xmlmat = null;
+
- AlignmentI al = null;
- // so we must create or recover the dataset alignment before going further
- // ///////////////////////////////
- if (vamsasSet.getDatasetId() == null || vamsasSet.getDatasetId() == "")
++ // first create an xml ref for the matrix data, if none exist
++ if (cmId == null)
+ {
- // older jalview projects do not have a dataset - so creat alignment and
- // dataset
- al = new Alignment(orderedSeqs);
- al.setDataset(null);
++ xmlmat = new MatrixType();
++ xmlmat.setType(cm.getType());
++ xmlmat.setRows(BigInteger.valueOf(cm.getWidth()));
++ xmlmat.setCols(BigInteger.valueOf(cm.getHeight()));
++ // consider using an opaque to/from -> allow instance to control
++ // its representation ?
++ xmlmat.setElements(ContactMatrix.contactToFloatString(cm));
++ if (cm.hasGroups())
++ {
++ for (BitSet gp : cm.getGroups())
++ {
++ xmlmat.getGroups().add(stringifyBitset(gp));
++ }
++ }
++ if (cm.hasTree())
++ {
++ // provenance object for tree ?
++ xmlmat.getNewick().add(cm.getNewick());
++ xmlmat.setTreeMethod(cm.getTreeMethod());
++ }
++ if (cm.hasCutHeight())
++ {
++ xmlmat.setCutHeight(cm.getCutHeight());
++ }
++ xmlmat.setId(cmId = "m" + contactMatrices.size()
++ + System.currentTimeMillis());
++ Console.trace("Matrix data stored :" + cmId);
++ contactMatrices.put(cm, cmId);
++ contactMatrixRefs.put(cmId, cm);
++ xmlMatrices.add(xmlmat);
+ }
+ else
+ {
- boolean isdsal = jalviewModel.getViewport().isEmpty();
- if (isdsal)
++ Console.trace("Existing Matrix stored :" + cmId);
++ }
++
++ // now store mapping
++
++ MapOnAMatrixType xmlmatmapping = new MapOnAMatrixType();
++ xmlmatmapping.setMatrix(cmId);
++
++ // Pretty much all matrices currently managed in this way are
++ // mappableContactMatrixI implementations - but check anyway
++ if (cm instanceof MappableContactMatrixI)
++ {
++ jalview.util.MapList mlst = ((MappableContactMatrixI) cm)
++ .getMapFor(annotation.sequenceRef);
++ if (mlst != null)
+ {
- // we are importing a dataset record, so
- // recover reference to an alignment already materialsed as dataset
- al = getDatasetFor(vamsasSet.getDatasetId());
++ MapListType mp = new MapListType();
++ List<int[]> r = mlst.getFromRanges();
++ for (int[] range : r)
++ {
++ MapListFrom mfrom = new MapListFrom();
++ mfrom.setStart(range[0]);
++ mfrom.setEnd(range[1]);
++ // mp.addMapListFrom(mfrom);
++ mp.getMapListFrom().add(mfrom);
++ }
++ r = mlst.getToRanges();
++ for (int[] range : r)
++ {
++ MapListTo mto = new MapListTo();
++ mto.setStart(range[0]);
++ mto.setEnd(range[1]);
++ // mp.addMapListTo(mto);
++ mp.getMapListTo().add(mto);
++ }
++ mp.setMapFromUnit(BigInteger.valueOf(mlst.getFromRatio()));
++ mp.setMapToUnit(BigInteger.valueOf(mlst.getToRatio()));
++ xmlmatmapping.setMapping(mp);
+ }
- if (al == null)
++ }
++ // and add to model
++ an.getContactmatrix().add(xmlmatmapping);
++ }
++
++ private String stringifyBitset(BitSet gp)
++ {
++ StringBuilder sb = new StringBuilder();
++ for (long val : gp.toLongArray())
++ {
++ if (sb.length() > 0)
+ {
- // materialse the alignment
- al = new Alignment(orderedSeqs);
++ sb.append(",");
+ }
- if (isdsal)
++ sb.append(val);
++ }
++ return sb.toString();
++ }
++
++ private BitSet deStringifyBitset(String stringified)
++ {
++ if ("".equals(stringified) || stringified == null)
++ {
++ return new BitSet();
++ }
++ String[] longvals = stringified.split(",");
++ long[] newlongvals = new long[longvals.length];
++ for (int lv = 0; lv < longvals.length; lv++)
++ {
++ try
+ {
- addDatasetRef(vamsasSet.getDatasetId(), al);
++ newlongvals[lv] = Long.valueOf(longvals[lv]);
++ } catch (Exception x)
++ {
++ errorMessage += "Couldn't destringify bitset from: '" + stringified
++ + "'";
++ newlongvals[lv] = 0;
+ }
+ }
++ return BitSet.valueOf(newlongvals);
+
- // finally, verify all data in vamsasSet is actually present in al
- // passing on flag indicating if it is actually a stored dataset
- recoverDatasetFor(vamsasSet, al, isdsal, uniqueSeqSetId);
++ }
+
+ private CalcIdParam createCalcIdParam(String calcId, AlignViewport av)
+ {
+ AutoCalcSetting settings = av.getCalcIdSettingsFor(calcId);
+ if (settings != null)
+ {
+ CalcIdParam vCalcIdParam = new CalcIdParam();
+ vCalcIdParam.setCalcId(calcId);
+ // vCalcIdParam.addServiceURL(settings.getServiceURI());
+ vCalcIdParam.getServiceURL().add(settings.getServiceURI());
+ // generic URI allowing a third party to resolve another instance of the
+ // service used for this calculation
+ for (String url : settings.getServiceURLs())
+ {
+ // vCalcIdParam.addServiceURL(urls);
+ vCalcIdParam.getServiceURL().add(url);
+ }
+ vCalcIdParam.setVersion("1.0");
+ if (settings.getPreset() != null)
+ {
+ WsParamSetI setting = settings.getPreset();
+ vCalcIdParam.setName(setting.getName());
+ vCalcIdParam.setDescription(setting.getDescription());
+ }
+ else
+ {
+ vCalcIdParam.setName("");
+ vCalcIdParam.setDescription("Last used parameters");
+ }
+ // need to be able to recover 1) settings 2) user-defined presets or
+ // recreate settings from preset 3) predefined settings provided by
+ // service - or settings that can be transferred (or discarded)
+ vCalcIdParam.setParameters(
+ settings.getWsParamFile().replace("\n", "|\\n|"));
+ vCalcIdParam.setAutoUpdate(settings.isAutoUpdate());
+ // todo - decide if updateImmediately is needed for any projects.
+
+ return vCalcIdParam;
+ }
+ return null;
+ }
+
+ private boolean recoverCalcIdParam(CalcIdParam calcIdParam,
+ AlignViewport av)
+ {
+ if (calcIdParam.getVersion().equals("1.0"))
+ {
+ final String[] calcIds = calcIdParam.getServiceURL().toArray(new String[0]);
+ ServiceWithParameters service = PreferredServiceRegistry.getRegistry()
+ .getPreferredServiceFor(calcIds);
+ if (service != null)
+ {
+ WsParamSetI parmSet = null;
+ try
+ {
+ parmSet = service.getParamStore().parseServiceParameterFile(
+ calcIdParam.getName(), calcIdParam.getDescription(),
+ calcIds,
+ calcIdParam.getParameters().replace("|\\n|", "\n"));
+ } catch (IOException x)
+ {
+ Console.warn("Couldn't parse parameter data for "
+ + calcIdParam.getCalcId(), x);
+ return false;
+ }
+ List<ArgumentI> argList = null;
+ if (calcIdParam.getName().length() > 0)
+ {
+ parmSet = service.getParamStore()
+ .getPreset(calcIdParam.getName());
+ if (parmSet != null)
+ {
+ // TODO : check we have a good match with settings in AACon -
+ // otherwise we'll need to create a new preset
+ }
+ }
+ else
+ {
+ argList = parmSet.getArguments();
+ parmSet = null;
+ }
+ AutoCalcSetting settings = new AAConSettings(
+ calcIdParam.isAutoUpdate(), service, parmSet, argList);
+ av.setCalcIdSettingsFor(calcIdParam.getCalcId(), settings,
+ calcIdParam.isNeedsUpdate());
+ return true;
+ }
+ else
+ {
+ Console.warn(
+ "Cannot resolve a service for the parameters used in this project. Try configuring a JABAWS server.");
+ return false;
+ }
+ }
+ throw new Error(MessageManager.formatMessage(
+ "error.unsupported_version_calcIdparam", new Object[]
+ { calcIdParam.toString() }));
}
- if (referenceseqForView != null)
- {
- al.setSeqrep(referenceseqForView);
+ /**
+ * External mapping between jalview objects and objects yielding a valid and
+ * unique object ID string. This is null for normal Jalview project IO, but
+ * non-null when a jalview project is being read or written as part of a
+ * vamsas session.
+ */
+ IdentityHashMap jv2vobj = null;
+
+ /**
+ * Construct a unique ID for jvobj using either existing bindings or if none
+ * exist, the result of the hashcode call for the object.
+ *
+ * @param jvobj
+ * jalview data object
+ * @return unique ID for referring to jvobj
+ */
+ private String makeHashCode(Object jvobj, String altCode)
+ {
+ if (jv2vobj != null)
+ {
+ Object id = jv2vobj.get(jvobj);
+ if (id != null)
+ {
+ return id.toString();
+ }
+ // check string ID mappings
+ if (jvids2vobj != null && jvobj instanceof String)
+ {
+ id = jvids2vobj.get(jvobj);
+ }
+ if (id != null)
+ {
+ return id.toString();
+ }
+ // give up and warn that something has gone wrong
+ Console.warn(
+ "Cannot find ID for object in external mapping : " + jvobj);
+ }
+ return altCode;
}
- // / Add the alignment properties
- for (int i = 0; i < vamsasSet.getSequenceSetProperties().size(); i++)
+
+ /**
+ * return local jalview object mapped to ID, if it exists
+ *
+ * @param idcode
+ * (may be null)
+ * @return null or object bound to idcode
+ */
+ private Object retrieveExistingObj(String idcode)
{
- SequenceSetProperties ssp = vamsasSet.getSequenceSetProperties()
- .get(i);
- al.setProperty(ssp.getKey(), ssp.getValue());
+ if (idcode != null && vobj2jv != null)
+ {
+ return vobj2jv.get(idcode);
+ }
+ return null;
}
- // ///////////////////////////////
+ /**
+ * binding from ID strings from external mapping table to jalview data model
+ * objects.
+ */
+ private Hashtable vobj2jv;
+
+ private Sequence createVamsasSequence(String id, SequenceI jds)
+ {
+ return createVamsasSequence(true, id, jds, null);
+ }
+
+ private Sequence createVamsasSequence(boolean recurse, String id,
+ SequenceI jds, SequenceI parentseq)
+ {
+ Sequence vamsasSeq = new Sequence();
+ vamsasSeq.setId(id);
+ vamsasSeq.setName(jds.getName());
+ vamsasSeq.setSequence(jds.getSequenceAsString());
+ vamsasSeq.setDescription(jds.getDescription());
+ List<DBRefEntry> dbrefs = null;
+ if (jds.getDatasetSequence() != null)
+ {
+ vamsasSeq.setDsseqid(seqHash(jds.getDatasetSequence()));
+ }
+ else
+ {
+ // seqId==dsseqid so we can tell which sequences really are
+ // dataset sequences only
+ vamsasSeq.setDsseqid(id);
+ dbrefs = jds.getDBRefs();
+ if (parentseq == null)
+ {
+ parentseq = jds;
+ }
+ }
+
+ /*
+ * save any dbrefs; special subclass GeneLocus is flagged as 'locus'
+ */
+ if (dbrefs != null)
+ {
+ for (int d = 0, nd = dbrefs.size(); d < nd; d++)
+ {
+ DBRef dbref = new DBRef();
+ DBRefEntry ref = dbrefs.get(d);
+ dbref.setSource(ref.getSource());
+ dbref.setVersion(ref.getVersion());
+ dbref.setAccessionId(ref.getAccessionId());
+ dbref.setCanonical(ref.isCanonical());
+ if (ref instanceof GeneLocus)
+ {
+ dbref.setLocus(true);
+ }
+ if (ref.hasMap())
+ {
+ Mapping mp = createVamsasMapping(ref.getMap(), parentseq,
+ jds, recurse);
+ dbref.setMapping(mp);
+ }
+ vamsasSeq.getDBRef().add(dbref);
+ }
+ }
+ return vamsasSeq;
+ }
+
+ private Mapping createVamsasMapping(jalview.datamodel.Mapping jmp,
+ SequenceI parentseq, SequenceI jds, boolean recurse)
+ {
+ Mapping mp = null;
+ if (jmp.getMap() != null)
+ {
+ mp = new Mapping();
+
+ jalview.util.MapList mlst = jmp.getMap();
+ List<int[]> r = mlst.getFromRanges();
+ for (int[] range : r)
+ {
+ MapListFrom mfrom = new MapListFrom();
+ mfrom.setStart(range[0]);
+ mfrom.setEnd(range[1]);
+ // mp.addMapListFrom(mfrom);
+ mp.getMapListFrom().add(mfrom);
+ }
+ r = mlst.getToRanges();
+ for (int[] range : r)
+ {
+ MapListTo mto = new MapListTo();
+ mto.setStart(range[0]);
+ mto.setEnd(range[1]);
+ // mp.addMapListTo(mto);
+ mp.getMapListTo().add(mto);
+ }
+ mp.setMapFromUnit(BigInteger.valueOf(mlst.getFromRatio()));
+ mp.setMapToUnit(BigInteger.valueOf(mlst.getToRatio()));
+ if (jmp.getTo() != null)
+ {
+ // MappingChoice mpc = new MappingChoice();
+
+ // check/create ID for the sequence referenced by getTo()
+
+ String jmpid = "";
+ SequenceI ps = null;
+ if (parentseq != jmp.getTo()
+ && parentseq.getDatasetSequence() != jmp.getTo())
+ {
+ // chaining dbref rather than a handshaking one
+ jmpid = seqHash(ps = jmp.getTo());
+ }
+ else
+ {
+ jmpid = seqHash(ps = parentseq);
+ }
+ // mpc.setDseqFor(jmpid);
+ mp.setDseqFor(jmpid);
+ if (!seqRefIds.containsKey(jmpid))
+ {
+ Console.debug("creatign new DseqFor ID");
+ seqRefIds.put(jmpid, ps);
+ }
+ else
+ {
+ Console.debug("reusing DseqFor ID");
+ }
+
+ // mp.setMappingChoice(mpc);
+ }
+ }
+ return mp;
+ }
+
+ String setUserColourScheme(jalview.schemes.ColourSchemeI cs,
+ List<UserColourScheme> userColours, JalviewModel jm)
+ {
+ String id = null;
+ jalview.schemes.UserColourScheme ucs = (jalview.schemes.UserColourScheme) cs;
+ boolean newucs = false;
+ if (!userColours.contains(ucs))
+ {
+ userColours.add(ucs);
+ newucs = true;
+ }
+ id = "ucs" + userColours.indexOf(ucs);
+ if (newucs)
+ {
+ // actually create the scheme's entry in the XML model
+ java.awt.Color[] colours = ucs.getColours();
+ UserColours uc = new UserColours();
+ // UserColourScheme jbucs = new UserColourScheme();
+ JalviewUserColours jbucs = new JalviewUserColours();
+
+ for (int i = 0; i < colours.length; i++)
+ {
+ Colour col = new Colour();
+ col.setName(ResidueProperties.aa[i]);
+ col.setRGB(jalview.util.Format.getHexString(colours[i]));
+ // jbucs.addColour(col);
+ jbucs.getColour().add(col);
+ }
+ if (ucs.getLowerCaseColours() != null)
+ {
+ colours = ucs.getLowerCaseColours();
+ for (int i = 0; i < colours.length; i++)
+ {
+ Colour col = new Colour();
+ col.setName(ResidueProperties.aa[i].toLowerCase(Locale.ROOT));
+ col.setRGB(jalview.util.Format.getHexString(colours[i]));
+ // jbucs.addColour(col);
+ jbucs.getColour().add(col);
+ }
+ }
+
+ uc.setId(id);
+ uc.setUserColourScheme(jbucs);
+ // jm.addUserColours(uc);
+ jm.getUserColours().add(uc);
+ }
+
+ return id;
+ }
+
+ jalview.schemes.UserColourScheme getUserColourScheme(JalviewModel jm,
+ String id)
+ {
+ List<UserColours> uc = jm.getUserColours();
+ UserColours colours = null;
+ /*
+ for (int i = 0; i < uc.length; i++)
+ {
+ if (uc[i].getId().equals(id))
+ {
+ colours = uc[i];
+ break;
+ }
+ }
+ */
+ for (UserColours c : uc)
+ {
+ if (c.getId().equals(id))
+ {
+ colours = c;
+ break;
+ }
+ }
+
+ java.awt.Color[] newColours = new java.awt.Color[24];
+
+ for (int i = 0; i < 24; i++)
+ {
+ newColours[i] = new java.awt.Color(Integer.parseInt(
+ // colours.getUserColourScheme().getColour(i).getRGB(), 16));
+ colours.getUserColourScheme().getColour().get(i).getRGB(),
+ 16));
+ }
+
+ jalview.schemes.UserColourScheme ucs = new jalview.schemes.UserColourScheme(
+ newColours);
+
+ if (colours.getUserColourScheme().getColour().size()/*Count()*/ > 24)
+ {
+ newColours = new java.awt.Color[23];
+ for (int i = 0; i < 23; i++)
+ {
+ newColours[i] = new java.awt.Color(
+ Integer.parseInt(colours.getUserColourScheme().getColour()
+ .get(i + 24).getRGB(), 16));
+ }
+ ucs.setLowerCaseColours(newColours);
+ }
+
+ return ucs;
+ }
- Hashtable pdbloaded = new Hashtable(); // TODO nothing writes to this??
- if (!multipleView)
- {
- // load sequence features, database references and any associated PDB
- // structures for the alignment
- //
- // prior to 2.10, this part would only be executed the first time a
- // sequence was encountered, but not afterwards.
- // now, for 2.10 projects, this is also done if the xml doc includes
- // dataset sequences not actually present in any particular view.
- //
- for (int i = 0; i < vamsasSeqs.size(); i++)
- {
- JSeq jseq = jseqs.get(i);
- if (jseq.getFeatures().size() > 0)
+ /**
+ * Load a jalview project archive from a jar file
+ *
+ * @param file
+ * - HTTP URL or filename
+ */
+ public AlignFrame loadJalviewAlign(final Object file)
+ {
+
+ jalview.gui.AlignFrame af = null;
+
+ try
+ {
+ // create list to store references for any new Jmol viewers created
+ newStructureViewers = new Vector<>();
+ // UNMARSHALLER SEEMS TO CLOSE JARINPUTSTREAM, MOST ANNOYING
+ // Workaround is to make sure caller implements the JarInputStreamProvider
+ // interface
+ // so we can re-open the jar input stream for each entry.
+
+ jarInputStreamProvider jprovider = createjarInputStreamProvider(file);
+ af = loadJalviewAlign(jprovider);
+ if (af != null)
+ {
+ af.setMenusForViewport();
+ }
+ } catch (MalformedURLException e)
+ {
+ errorMessage = "Invalid URL format for '" + file + "'";
+ reportErrors();
+ } finally
+ {
+ try
+ {
+ // was invokeAndWait
+
+ // BH 2019 -- can't wait
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ setLoadingFinishedForNewStructureViewers();
+ }
+ });
+ } catch (Exception x)
+ {
- System.err.println("Error loading alignment: " + x.getMessage());
++ jalview.bin.Console
++ .errPrintln("Error loading alignment: " + x.getMessage());
+ }
+ }
+ this.jarFile = null;
+ return af;
+ }
+
+ @SuppressWarnings("unused")
+ private jarInputStreamProvider createjarInputStreamProvider(
+ final Object ofile) throws MalformedURLException
+ {
+
+ try
+ {
+ String file = (ofile instanceof File
+ ? ((File) ofile).getCanonicalPath()
+ : ofile.toString());
+ byte[] bytes = Platform.isJS() ? Platform.getFileBytes((File) ofile)
+ : null;
+ if (bytes != null)
+ {
+ this.jarFile = (File) ofile;
+ }
+ URL url;
+ errorMessage = null;
+ uniqueSetSuffix = null;
+ seqRefIds = null;
+ viewportsAdded.clear();
+ frefedSequence = null;
+
+ if (HttpUtils.startsWithHttpOrHttps(file))
+ {
+ url = new URL(file);
+ } else {
+ url = null;
+ }
++ final URL _url = url;
+ return new jarInputStreamProvider()
+ {
+
- @Override
- public JarInputStream getJarInputStream() throws IOException
- {
- InputStream is = bytes != null ? new ByteArrayInputStream(bytes)
- : (url != null ? url.openStream()
- : new FileInputStream(file));
- return new JarInputStream(is);
- }
++ @Override
++ public JarInputStream getJarInputStream() throws IOException
+ {
- List<Feature> features = jseq.getFeatures();
- for (int f = 0; f < features.size(); f++)
++ if (bytes != null)
+ {
- Feature feat = features.get(f);
- SequenceFeature sf = new SequenceFeature(feat.getType(),
- feat.getDescription(), feat.getBegin(), feat.getEnd(),
- safeFloat(feat.getScore()), feat.getFeatureGroup());
- sf.setStatus(feat.getStatus());
-
- /*
- * load any feature attributes - include map-valued attributes
- */
- Map<String, Map<String, String>> mapAttributes = new HashMap<>();
- for (int od = 0; od < feat.getOtherData().size(); od++)
- {
- OtherData keyValue = feat.getOtherData().get(od);
- String attributeName = keyValue.getKey();
- String attributeValue = keyValue.getValue();
- if (attributeName.startsWith("LINK"))
- {
- sf.addLink(attributeValue);
- }
- else
- {
- String subAttribute = keyValue.getKey2();
- if (subAttribute == null)
- {
- // simple string-valued attribute
- sf.setValue(attributeName, attributeValue);
- }
- else
- {
- // attribute 'key' has sub-attribute 'key2'
- if (!mapAttributes.containsKey(attributeName))
- {
- mapAttributes.put(attributeName, new HashMap<>());
- }
- mapAttributes.get(attributeName).put(subAttribute,
- attributeValue);
- }
- }
- }
- for (Entry<String, Map<String, String>> mapAttribute : mapAttributes
- .entrySet())
- {
- sf.setValue(mapAttribute.getKey(), mapAttribute.getValue());
- }
-
- // adds feature to datasequence's feature set (since Jalview 2.10)
- al.getSequenceAt(i).addSequenceFeature(sf);
++ // jalview.bin.Console.outPrintln("Jalview2XML: opening byte
++ // jarInputStream for
++ // bytes.length=" + bytes.length);
++ return new JarInputStream(new ByteArrayInputStream(bytes));
+ }
- }
- if (vamsasSeqs.get(i).getDBRef().size() > 0)
- {
- // adds dbrefs to datasequence's set (since Jalview 2.10)
- addDBRefs(
- al.getSequenceAt(i).getDatasetSequence() == null
- ? al.getSequenceAt(i)
- : al.getSequenceAt(i).getDatasetSequence(),
- vamsasSeqs.get(i));
- }
- if (jseq.getPdbids().size() > 0)
- {
- List<Pdbids> ids = jseq.getPdbids();
- for (int p = 0; p < ids.size(); p++)
++ if (_url != null)
+ {
- Pdbids pdbid = ids.get(p);
- jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();
- entry.setId(pdbid.getId());
- if (pdbid.getType() != null)
- {
- if (PDBEntry.Type.getType(pdbid.getType()) != null)
- {
- entry.setType(PDBEntry.Type.getType(pdbid.getType()));
- }
- else
- {
- entry.setType(PDBEntry.Type.FILE);
- }
- }
- // jprovider is null when executing 'New View'
- if (pdbid.getFile() != null && jprovider != null)
- {
- if (!pdbloaded.containsKey(pdbid.getFile()))
- {
- entry.setFile(loadPDBFile(jprovider, pdbid.getId(),
- pdbid.getFile()));
- }
- else
- {
- entry.setFile(pdbloaded.get(pdbid.getId()).toString());
- }
- }
- /*
- if (pdbid.getPdbentryItem() != null)
- {
- for (PdbentryItem item : pdbid.getPdbentryItem())
- {
- for (Property pr : item.getProperty())
- {
- entry.setProperty(pr.getName(), pr.getValue());
- }
- }
- }
- */
- for (Property prop : pdbid.getProperty())
- {
- entry.setProperty(prop.getName(), prop.getValue());
- }
- StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance)
- .registerPDBEntry(entry);
- // adds PDBEntry to datasequence's set (since Jalview 2.10)
- if (al.getSequenceAt(i).getDatasetSequence() != null)
- {
- al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
- }
- else
- {
- al.getSequenceAt(i).addPDBId(entry);
- }
++ // jalview.bin.Console.outPrintln("Jalview2XML: opening url
++ // jarInputStream for "
++ // + _url);
++ return new JarInputStream(_url.openStream());
++ }
++ else
++ {
++ // jalview.bin.Console.outPrintln("Jalview2XML: opening file
++ // jarInputStream for
++ // " + file);
++ return new JarInputStream(new FileInputStream(file));
+ }
+ }
- }
- } // end !multipleview
- // ///////////////////////////////
- // LOAD SEQUENCE MAPPINGS
+ @Override
+ public File getFile()
+ {
+ return jarFile;
+ }
- if (vamsasSet.getAlcodonFrame().size() > 0)
+ @Override
+ public String getFilename()
+ {
+ return file;
+ }
+ };
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ return null;
+ }
+ }
+
+ /**
+ * Recover jalview session from a jalview project archive. Caller may
+ * initialise uniqueSetSuffix, seqRefIds, viewportsAdded and frefedSequence
+ * themselves. Any null fields will be initialised with default values,
+ * non-null fields are left alone.
+ *
+ * @param jprovider
+ * @return
+ */
+ public AlignFrame loadJalviewAlign(final jarInputStreamProvider jprovider)
+ {
+ errorMessage = null;
+ if (uniqueSetSuffix == null)
+ {
+ uniqueSetSuffix = System.currentTimeMillis() % 100000 + "";
+ }
+ if (seqRefIds == null)
+ {
+ initSeqRefs();
+ }
+ AlignFrame af = null, _af = null;
+ IdentityHashMap<AlignmentI, AlignmentI> importedDatasets = new IdentityHashMap<>();
+ Map<String, AlignFrame> gatherToThisFrame = new HashMap<>();
- String fileName = jprovider.getFilename();
++ final String fileName = jprovider.getFilename();
+ File file = jprovider.getFile();
- List<AlignFrame> alignFrames = new ArrayList<>();
++ List<AlignFrame> toRepaint = new ArrayList<>(); // loaded alignframes
+ try
+ {
+ JarInputStream jin = null;
+ JarEntry jarentry = null;
+ int entryCount = 1;
+
+ // Look for all the entry names ending with ".xml"
+ // This includes all panels and at least one frame.
+ // Platform.timeCheck(null, Platform.TIME_MARK);
+ do
+ {
+ jin = jprovider.getJarInputStream();
+ for (int i = 0; i < entryCount; i++)
+ {
+ jarentry = jin.getNextJarEntry();
+ }
+ String name = (jarentry == null ? null : jarentry.getName());
+
+ // System.out.println("Jalview2XML opening " + name);
+ if (name != null && name.endsWith(".xml"))
+ {
+ // DataSet for.... is read last.
+
+
+ // The question here is what to do with the two
+ // .xml files in the jvp file.
+ // Some number of them, "...Dataset for...", will be the
+ // Only AlignPanels and will have Viewport.
+ // One or more will be the source data, with the DBRefs.
+ //
+ // JVP file writing (above) ensures tha the AlignPanels are written
+ // first, then all relevant datasets (which are
+ // Jalview.datamodel.Alignment).
+ //
+
+ // Platform.timeCheck("Jalview2XML JAXB " + name, Platform.TIME_MARK);
+ JAXBContext jc = JAXBContext
+ .newInstance("jalview.xml.binding.jalview");
+ XMLStreamReader streamReader = XMLInputFactory.newInstance()
+ .createXMLStreamReader(jin);
+ javax.xml.bind.Unmarshaller um = jc.createUnmarshaller();
+ JAXBElement<JalviewModel> jbe = um
+ .unmarshal(streamReader, JalviewModel.class);
+ JalviewModel model = jbe.getValue();
+
+ if (true) // !skipViewport(object))
+ {
+ // Q: Do we have to load from the model, even if it
+ // does not have a viewport, could we discover that early on?
+ // Q: Do we need to load this object?
+ _af = loadFromObject(model, fileName, file, true, jprovider);
+ // Platform.timeCheck("Jalview2XML.loadFromObject",
+ // Platform.TIME_MARK);
+
- if (_af != null)
- {
- alignFrames.add(_af);
- }
- if (_af != null && model.getViewport().size() > 0)
++ if (_af != null && model.getViewport().size() > 0)
+ {
+
+ // That is, this is one of the AlignmentPanel models
++ toRepaint.add(_af);
+ if (af == null)
+ {
+ // store a reference to the first view
+ af = _af;
+ }
+ if (_af.getViewport().isGatherViewsHere())
+ {
+ // if this is a gathered view, keep its reference since
+ // after gathering views, only this frame will remain
+ af = _af;
+ gatherToThisFrame.put(_af.getViewport().getSequenceSetId(),
+ _af);
+ }
+ // Save dataset to register mappings once all resolved
+ importedDatasets.put(
+ af.getViewport().getAlignment().getDataset(),
+ af.getViewport().getAlignment().getDataset());
+ }
+ }
+ entryCount++;
+ }
+ else if (jarentry != null)
+ {
+ // Some other file here.
+ entryCount++;
+ }
+ } while (jarentry != null);
+ jin.close();
+ resolveFrefedSequences();
- } catch (IOException ex)
++ } catch (IOException ex)
+ {
+ ex.printStackTrace();
+ errorMessage = "Couldn't locate Jalview XML file : " + fileName;
- System.err.println(
++ jalview.bin.Console.errPrintln(
+ "Exception whilst loading jalview XML file : " + ex + "\n");
+ } catch (Exception ex)
+ {
- System.err.println("Parsing as Jalview Version 2 file failed.");
++ jalview.bin.Console
++ .errPrintln("Parsing as Jalview Version 2 file failed.");
+ ex.printStackTrace(System.err);
- if (attemptversion1parse)
- {
- // used to attempt to parse as V1 castor-generated xml
- }
+ if (Desktop.getInstance() != null)
+ {
+ Desktop.getInstance().stopLoading();
+ }
+ if (af != null)
+ {
- System.out.println("Successfully loaded archive file");
++ jalview.bin.Console.outPrintln("Successfully loaded archive file");
+ return af;
+ }
+ ex.printStackTrace();
+
- System.err.println(
++ jalview.bin.Console.errPrintln(
+ "Exception whilst loading jalview XML file : " + ex + "\n");
+ } catch (OutOfMemoryError e)
+ {
+ // Don't use the OOM Window here
+ errorMessage = "Out of memory loading jalview XML file";
- System.err.println("Out of memory whilst loading jalview XML file");
++ jalview.bin.Console
++ .errPrintln("Out of memory whilst loading jalview XML file");
+ e.printStackTrace();
+ } finally
+ {
- for (AlignFrame alf : alignFrames)
++ for (AlignFrame alf : toRepaint)
+ {
- alf.alignPanel.setHoldRepaint(false);
++ alf.alignPanel.setHoldRepaint(false); // 2.11 called repaint() directly
+ }
+ }
+
+ /*
+ * Regather multiple views (with the same sequence set id) to the frame (if
+ * any) that is flagged as the one to gather to, i.e. convert them to tabbed
+ * views instead of separate frames. Note this doesn't restore a state where
+ * some expanded views in turn have tabbed views - the last "first tab" read
+ * in will play the role of gatherer for all.
+ */
+ for (AlignFrame fr : gatherToThisFrame.values())
+ {
+ Desktop.getInstance().gatherViews(fr);
+ }
+
+ restoreSplitFrames();
+ for (AlignmentI ds : importedDatasets.keySet())
+ {
+ if (ds.getCodonFrames() != null)
+ {
+ Desktop.getStructureSelectionManager()
+ .registerMappings(ds.getCodonFrames());
+ }
+ }
+ if (errorMessage != null)
+ {
+ reportErrors();
+ }
+
+ if (Desktop.getInstance() != null)
+ {
+ Desktop.getInstance().stopLoading();
+ }
+
+ return af;
+ }
+
+ /**
+ * Try to reconstruct and display SplitFrame windows, where each contains
+ * complementary dna and protein alignments. Done by pairing up AlignFrame
+ * objects (created earlier) which have complementary viewport ids associated.
+ */
+ protected void restoreSplitFrames()
+ {
+ List<SplitFrame> gatherTo = new ArrayList<>();
+ List<AlignFrame> addedToSplitFrames = new ArrayList<>();
+ Map<String, AlignFrame> dna = new HashMap<>();
+
+ /*
+ * Identify the DNA alignments
+ */
+ for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+ .entrySet())
+ {
+ AlignFrame af = candidate.getValue();
+ if (af.getViewport().getAlignment().isNucleotide())
+ {
+ dna.put(candidate.getKey().getId(), af);
+ }
+ }
+
+ /*
+ * Try to match up the protein complements
+ */
+ for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+ .entrySet())
+ {
+ AlignFrame af = candidate.getValue();
+ if (!af.getViewport().getAlignment().isNucleotide())
+ {
+ String complementId = candidate.getKey().getComplementId();
+ // only non-null complements should be in the Map
+ if (complementId != null && dna.containsKey(complementId))
+ {
+ final AlignFrame dnaFrame = dna.get(complementId);
+ SplitFrame sf = createSplitFrame(dnaFrame, af);
+ addedToSplitFrames.add(dnaFrame);
+ addedToSplitFrames.add(af);
+ dnaFrame.setMenusForViewport();
+ af.setMenusForViewport();
+ if (af.getViewport().isGatherViewsHere())
+ {
+ gatherTo.add(sf);
+ }
+ }
+ }
+ }
+
+ /*
+ * Open any that we failed to pair up (which shouldn't happen!) as
+ * standalone AlignFrame's.
+ */
+ for (Entry<Viewport, AlignFrame> candidate : splitFrameCandidates
+ .entrySet())
+ {
+ AlignFrame af = candidate.getValue();
+ if (!addedToSplitFrames.contains(af))
+ {
+ Viewport view = candidate.getKey();
+ Desktop.addInternalFrame(af, view.getTitle(),
+ safeInt(view.getWidth()), safeInt(view.getHeight()));
+ af.setMenusForViewport();
- System.err.println("Failed to restore view " + view.getTitle()
- + " to split frame");
++ jalview.bin.Console.errPrintln("Failed to restore view "
++ + view.getTitle() + " to split frame");
+ }
+ }
+
+ /*
+ * Gather back into tabbed views as flagged.
+ */
+ for (SplitFrame sf : gatherTo)
+ {
+ Desktop.getInstance().gatherViews(sf);
+ }
+
+ splitFrameCandidates.clear();
+ }
+
+ /**
+ * Construct and display one SplitFrame holding DNA and protein alignments.
+ *
+ * @param dnaFrame
+ * @param proteinFrame
+ * @return
+ */
+ protected SplitFrame createSplitFrame(AlignFrame dnaFrame,
+ AlignFrame proteinFrame)
{
- // TODO Potentially this should only be done once for all views of an
- // alignment
- List<AlcodonFrame> alc = vamsasSet.getAlcodonFrame();
- for (int i = 0; i < alc.size(); i++)
- {
- AlignedCodonFrame cf = new AlignedCodonFrame();
- if (alc.get(i).getAlcodMap().size() > 0)
- {
- List<AlcodMap> maps = alc.get(i).getAlcodMap();
- for (int m = 0; m < maps.size(); m++)
- {
- AlcodMap map = maps.get(m);
- SequenceI dnaseq = seqRefIds.get(map.getDnasq());
- // Load Mapping
- jalview.datamodel.Mapping mapping = null;
- // attach to dna sequence reference.
- if (map.getMapping() != null)
- {
- mapping = addMapping(map.getMapping());
- if (dnaseq != null && mapping.getTo() != null)
- {
- cf.addMap(dnaseq, mapping.getTo(), mapping.getMap());
- }
- else
- {
- // defer to later
- frefedSequence
- .add(newAlcodMapRef(map.getDnasq(), cf, mapping));
- }
- }
- }
- al.addCodonFrame(cf);
- }
- }
+ SplitFrame splitFrame = new SplitFrame(dnaFrame, proteinFrame);
+ String title = MessageManager.getString("label.linked_view_title");
+ int width = (int) dnaFrame.getBounds().getWidth();
+ int height = (int) (dnaFrame.getBounds().getHeight()
+ + proteinFrame.getBounds().getHeight() + 50);
+
+ /*
+ * SplitFrame location is saved to both enclosed frames
+ */
+ splitFrame.setLocation(dnaFrame.getX(), dnaFrame.getY());
+ Desktop.addInternalFrame(splitFrame, title, width, height);
+
+ /*
+ * And compute cDNA consensus (couldn't do earlier with consensus as
+ * mappings were not yet present)
+ */
+ proteinFrame.getViewport().alignmentChanged(proteinFrame.alignPanel);
+
+ return splitFrame;
}
- // ////////////////////////////////
- // LOAD ANNOTATIONS
- List<JvAnnotRow> autoAlan = new ArrayList<>();
+ /**
+ * check errorMessage for a valid error message and raise an error box in the
+ * GUI or write the current errorMessage to stderr and then clear the error
+ * state.
+ */
+ protected void reportErrors()
+ {
+ reportErrors(false);
+ }
+
+ protected void reportErrors(final boolean saving)
+ {
+ if (errorMessage != null)
+ {
+ final String finalErrorMessage = errorMessage;
+ if (raiseGUI)
+ {
+ javax.swing.SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ JvOptionPane.showInternalMessageDialog(Desktop.getDesktopPane(),
+ finalErrorMessage,
+ "Error " + (saving ? "saving" : "loading")
+ + " Jalview file",
+ JvOptionPane.WARNING_MESSAGE);
+ }
+ });
+ }
+ else
+ {
- System.err.println("Problem loading Jalview file: " + errorMessage);
++ jalview.bin.Console.errPrintln(
++ "Problem loading Jalview file: " + errorMessage);
+ }
+ }
+ errorMessage = null;
+ }
- /*
- * store any annotations which forward reference a group's ID
+ Map<String, String> alreadyLoadedPDB = new HashMap<>();
+
+ /**
+ * when set, local views will be updated from view stored in JalviewXML
+ * Currently (28th Sep 2008) things will go horribly wrong in vamsas document
+ * sync if this is set to true.
*/
- Map<String, List<AlignmentAnnotation>> groupAnnotRefs = new Hashtable<>();
+ private final boolean updateLocalViews = false;
- if (vamsasSet.getAnnotation().size()/*Count()*/ > 0)
+ /**
+ * Returns the path to a temporary file holding the PDB file for the given PDB
+ * id. The first time of asking, searches for a file of that name in the
+ * Jalview project jar, and copies it to a new temporary file. Any repeat
+ * requests just return the path to the file previously created.
+ *
+ * @param jprovider
+ * @param pdbId
+ * @return
+ */
+ String loadPDBFile(jarInputStreamProvider jprovider, String pdbId,
+ String origFile)
{
- List<Annotation> an = vamsasSet.getAnnotation();
+ if (alreadyLoadedPDB.containsKey(pdbId))
+ {
+ return alreadyLoadedPDB.get(pdbId).toString();
+ }
- for (int i = 0; i < an.size(); i++)
- {
- Annotation annotation = an.get(i);
+ String tempFile = copyJarEntry(jprovider, pdbId, "jalview_pdb",
+ origFile);
+ if (tempFile != null)
+ {
+ alreadyLoadedPDB.put(pdbId, tempFile);
+ }
+ return tempFile;
+ }
- /**
- * test if annotation is automatically calculated for this view only
- */
- boolean autoForView = false;
- if (annotation.getLabel().equals("Quality")
- || annotation.getLabel().equals("Conservation")
- || annotation.getLabel().equals("Consensus"))
- {
- // Kludge for pre 2.5 projects which lacked the autocalculated flag
- autoForView = true;
- // JAXB has no has() test; schema defaults value to false
- // if (!annotation.hasAutoCalculated())
- // {
- // annotation.setAutoCalculated(true);
- // }
- }
- if (autoForView || annotation.isAutoCalculated())
- {
- // remove ID - we don't recover annotation from other views for
- // view-specific annotation
- annotation.setId(null);
- }
+ /**
+ * Copies the jar entry of given name to a new temporary file and returns the
+ * path to the file, or null if the entry is not found.
+ *
+ * @param jprovider
+ * @param jarEntryName
+ * @param prefix
+ * a prefix for the temporary file name, must be at least three
+ * characters long
+ * @param suffixModel
+ * null or original file - so new file can be given the same suffix
+ * as the old one
+ * @return
+ */
+ protected String copyJarEntry(jarInputStreamProvider jprovider,
+ String jarEntryName, String prefix, String suffixModel)
+ {
+ BufferedReader in = null;
+ PrintWriter out = null;
+ String suffix = ".tmp";
+ if (suffixModel == null)
+ {
+ suffixModel = jarEntryName;
+ }
+ int sfpos = suffixModel.lastIndexOf(".");
+ if (sfpos > -1 && sfpos < (suffixModel.length() - 1))
+ {
+ suffix = "." + suffixModel.substring(sfpos + 1);
+ }
+
+ try (JarInputStream jin = jprovider.getJarInputStream())
+ {
+ JarEntry entry = null;
+ do
+ {
+ entry = jin.getNextJarEntry();
+ } while (entry != null && !entry.getName().equals(jarEntryName));
+
+ if (entry != null)
+ {
+ // in = new BufferedReader(new InputStreamReader(jin, UTF_8));
+ File outFile = File.createTempFile(prefix, suffix);
+ outFile.deleteOnExit();
+ try (OutputStream os = new FileOutputStream(outFile))
+ {
+ copyAll(jin, os);
+ }
+ String t = outFile.getAbsolutePath();
+ return t;
+ }
+ else
+ {
+ Console.warn(
+ "Couldn't find entry in Jalview Jar for " + jarEntryName);
+ }
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+
+ return null;
+ }
+
+ private class JvAnnotRow
+ {
+ public JvAnnotRow(int i, AlignmentAnnotation jaa)
+ {
+ order = i;
+ template = jaa;
+ }
+
+ /**
+ * persisted version of annotation row from which to take vis properties
+ */
+ public jalview.datamodel.AlignmentAnnotation template;
+
+ /**
+ * original position of the annotation row in the alignment
+ */
+ public int order;
+ }
- // set visibility for other annotation in this view
- String annotationId = annotation.getId();
- if (annotationId != null && annotationIds.containsKey(annotationId))
- {
- AlignmentAnnotation jda = annotationIds.get(annotationId);
- // in principle Visible should always be true for annotation displayed
- // in multiple views
- if (annotation.isVisible() != null)
- {
- jda.visible = annotation.isVisible();
- }
+ /**
+ * Load alignment frame from jalview XML DOM object. For a DOM object that
+ * includes one or more Viewport elements (one with a title that does NOT
+ * contain "Dataset for"), create the frame.
+ *
+ * @param jalviewModel
+ * DOM
+ * @param fileName
+ * filename source string
+ * @param file
+ * @param loadTreesAndStructures
+ * when false only create Viewport
+ * @param jprovider
+ * data source provider
+ * @return alignment frame created from view stored in DOM
+ */
+ AlignFrame loadFromObject(JalviewModel jalviewModel, String fileName,
+ File file, boolean loadTreesAndStructures, jarInputStreamProvider jprovider)
+ {
+ SequenceSet vamsasSet = jalviewModel.getVamsasModel().getSequenceSet().get(0);
+ List<Sequence> vamsasSeqs = vamsasSet.getSequence();
- al.addAnnotation(jda);
+ // JalviewModelSequence jms = object.getJalviewModelSequence();
- continue;
- }
- // Construct new annotation from model.
- List<AnnotationElement> ae = annotation.getAnnotationElement();
- jalview.datamodel.Annotation[] anot = null;
- java.awt.Color firstColour = null;
- int anpos;
- if (!annotation.isScoreOnly())
- {
- anot = new jalview.datamodel.Annotation[al.getWidth()];
- for (int aa = 0; aa < ae.size() && aa < anot.length; aa++)
- {
- AnnotationElement annElement = ae.get(aa);
- anpos = annElement.getPosition();
+ // Viewport view = (jms.getViewportCount() > 0) ? jms.getViewport(0)
+ // : null;
+ Viewport view = (jalviewModel.getViewport().size() > 0)
+ ? jalviewModel.getViewport().get(0)
+ : null;
- if (anpos >= anot.length)
- {
- continue;
- }
+ // ////////////////////////////////
+ // INITIALISE ALIGNMENT SEQUENCESETID AND VIEWID
+ //
+ //
+ // If we just load in the same jar file again, the sequenceSetId
+ // will be the same, and we end up with multiple references
+ // to the same sequenceSet. We must modify this id on load
+ // so that each load of the file gives a unique id
+
+ /**
+ * used to resolve correct alignment dataset for alignments with multiple
+ * views
+ */
+ String uniqueSeqSetId = null;
+ String viewId = null;
+ if (view != null)
+ {
+ uniqueSeqSetId = view.getSequenceSetId() + uniqueSetSuffix;
+ viewId = (view.getId() == null ? null
+ : view.getId() + uniqueSetSuffix);
+ }
- float value = safeFloat(annElement.getValue());
- anot[anpos] = new jalview.datamodel.Annotation(
- annElement.getDisplayCharacter(),
- annElement.getDescription(),
- (annElement.getSecondaryStructure() == null
- || annElement.getSecondaryStructure()
- .length() == 0)
- ? ' '
- : annElement
- .getSecondaryStructure()
- .charAt(0),
- value);
- anot[anpos].colour = new Color(safeInt(annElement.getColour()));
- if (firstColour == null)
- {
- firstColour = anot[anpos].colour;
- }
- }
- }
- jalview.datamodel.AlignmentAnnotation jaa = null;
++ // ////////////////////////////////
++ // LOAD MATRICES (IF ANY)
+
- if (annotation.isGraph())
- {
- float llim = 0, hlim = 0;
- // if (autoForView || an[i].isAutoCalculated()) {
- // hlim=11f;
- // }
- jaa = new jalview.datamodel.AlignmentAnnotation(
- annotation.getLabel(), annotation.getDescription(), anot,
- llim, hlim, safeInt(annotation.getGraphType()));
-
- jaa.graphGroup = safeInt(annotation.getGraphGroup());
- jaa._linecolour = firstColour;
- if (annotation.getThresholdLine() != null)
- {
- jaa.setThreshold(new jalview.datamodel.GraphLine(
- safeFloat(annotation.getThresholdLine().getValue()),
- annotation.getThresholdLine().getLabel(),
- new java.awt.Color(safeInt(
- annotation.getThresholdLine().getColour()))));
- }
- if (autoForView || annotation.isAutoCalculated())
- {
- // Hardwire the symbol display line to ensure that labels for
- // histograms are displayed
- jaa.hasText = true;
- }
- }
- else
- {
- jaa = new jalview.datamodel.AlignmentAnnotation(
- annotation.getLabel(), annotation.getDescription(), anot);
- jaa._linecolour = firstColour;
- }
- // register new annotation
- if (annotation.getId() != null)
- {
- annotationIds.put(annotation.getId(), jaa);
- jaa.annotationId = annotation.getId();
- }
- // recover sequence association
- String sequenceRef = annotation.getSequenceRef();
- if (sequenceRef != null)
- {
- // from 2.9 sequenceRef is to sequence id (JAL-1781)
- SequenceI sequence = seqRefIds.get(sequenceRef);
- if (sequence == null)
- {
- // in pre-2.9 projects sequence ref is to sequence name
- sequence = al.findName(sequenceRef);
- }
- if (sequence != null)
- {
- jaa.createSequenceMapping(sequence, 1, true);
- sequence.addAlignmentAnnotation(jaa);
- }
- }
- // and make a note of any group association
- if (annotation.getGroupRef() != null
- && annotation.getGroupRef().length() > 0)
- {
- List<jalview.datamodel.AlignmentAnnotation> aal = groupAnnotRefs
- .get(annotation.getGroupRef());
- if (aal == null)
- {
- aal = new ArrayList<>();
- groupAnnotRefs.put(annotation.getGroupRef(), aal);
- }
- aal.add(jaa);
- }
++ if (vamsasSet.getMatrix() != null && vamsasSet.getMatrix().size() > 0)
++ {
++ importMatrixData(vamsasSet.getMatrix());
++ }
+
- if (annotation.getScore() != null)
- {
- jaa.setScore(annotation.getScore().doubleValue());
- }
- if (annotation.isVisible() != null)
- {
- jaa.visible = annotation.isVisible().booleanValue();
- }
+ // ////////////////////////////////
+ // LOAD SEQUENCES
+
+ List<SequenceI> hiddenSeqs = null;
+
+ List<SequenceI> tmpseqs = new ArrayList<>();
+
+ boolean multipleView = false;
+ SequenceI referenceseqForView = null;
+ // JSeq[] jseqs = object.getJalviewModelSequence().getJSeq();
+ List<JSeq> jseqs = jalviewModel.getJSeq();
+ int vi = 0; // counter in vamsasSeq array
+ for (int i = 0; i < jseqs.size(); i++)
+ {
+ JSeq jseq = jseqs.get(i);
+ String seqId = jseq.getId();
+
+ SequenceI tmpSeq = seqRefIds.get(seqId);
+ if (tmpSeq != null)
+ {
+ if (!incompleteSeqs.containsKey(seqId))
+ {
+ // may not need this check, but keep it for at least 2.9,1 release
+ if (tmpSeq.getStart() != jseq.getStart()
+ || tmpSeq.getEnd() != jseq.getEnd())
+ {
+ Console.warn(
+ String.format("Warning JAL-2154 regression: updating start/end for sequence %s from %d/%d to %d/%d",
+ tmpSeq.getName(), tmpSeq.getStart(),
+ tmpSeq.getEnd(), jseq.getStart(),
+ jseq.getEnd()));
+ }
+ }
+ else
+ {
+ incompleteSeqs.remove(seqId);
+ }
+ if (vamsasSeqs.size() > vi
+ && vamsasSeqs.get(vi).getId().equals(seqId))
+ {
+ // most likely we are reading a dataset XML document so
+ // update from vamsasSeq section of XML for this sequence
+ tmpSeq.setName(vamsasSeqs.get(vi).getName());
+ tmpSeq.setDescription(vamsasSeqs.get(vi).getDescription());
+ tmpSeq.setSequence(vamsasSeqs.get(vi).getSequence());
+ vi++;
+ }
+ else
+ {
+ // reading multiple views, so vamsasSeq set is a subset of JSeq
+ multipleView = true;
+ }
+ tmpSeq.setStart(jseq.getStart());
+ tmpSeq.setEnd(jseq.getEnd());
+ tmpseqs.add(tmpSeq);
+ }
+ else
+ {
+ Sequence vamsasSeq = vamsasSeqs.get(vi);
+ tmpSeq = new jalview.datamodel.Sequence(vamsasSeq.getName(),
+ vamsasSeq.getSequence());
+ tmpSeq.setDescription(vamsasSeq.getDescription());
+ tmpSeq.setStart(jseq.getStart());
+ tmpSeq.setEnd(jseq.getEnd());
+ tmpSeq.setVamsasId(uniqueSetSuffix + seqId);
+ seqRefIds.put(vamsasSeq.getId(), tmpSeq);
+ tmpseqs.add(tmpSeq);
+ vi++;
+ }
+
+ if (safeBoolean(jseq.isViewreference()))
+ {
+ referenceseqForView = tmpseqs.get(tmpseqs.size() - 1);
+ }
+
+ if (jseq.isHidden() != null && jseq.isHidden().booleanValue())
+ {
+ if (hiddenSeqs == null)
+ {
+ hiddenSeqs = new ArrayList<>();
+ }
+
+ hiddenSeqs.add(tmpSeq);
+ }
+ }
+
+ // /
+ // Create the alignment object from the sequence set
+ // ///////////////////////////////
+ SequenceI[] orderedSeqs = tmpseqs
+ .toArray(new SequenceI[tmpseqs.size()]);
- if (annotation.isCentreColLabels() != null)
- {
- jaa.centreColLabels = annotation.isCentreColLabels()
- .booleanValue();
- }
+ AlignmentI al = null;
+ // so we must create or recover the dataset alignment before going further
+ // ///////////////////////////////
+ if (vamsasSet.getDatasetId() == null || vamsasSet.getDatasetId() == "")
+ {
+ // older jalview projects do not have a dataset - so creat alignment and
+ // dataset
+ al = new Alignment(orderedSeqs);
+ al.setDataset(null);
+ }
+ else
+ {
+ boolean isdsal = jalviewModel.getViewport().isEmpty();
+ if (isdsal)
+ {
+ // we are importing a dataset record, so
+ // recover reference to an alignment already materialsed as dataset
+ al = getDatasetFor(vamsasSet.getDatasetId());
+ }
+ if (al == null)
+ {
+ // materialse the alignment
+ al = new Alignment(orderedSeqs);
+ }
+ if (isdsal)
+ {
+ addDatasetRef(vamsasSet.getDatasetId(), al);
+ }
+
+ // finally, verify all data in vamsasSet is actually present in al
+ // passing on flag indicating if it is actually a stored dataset
+ recoverDatasetFor(vamsasSet, al, isdsal, uniqueSeqSetId);
+ }
+
+ if (referenceseqForView != null)
+ {
+ al.setSeqrep(referenceseqForView);
+ }
+ // / Add the alignment properties
+ for (int i = 0; i < vamsasSet.getSequenceSetProperties().size(); i++)
+ {
+ SequenceSetProperties ssp = vamsasSet.getSequenceSetProperties()
+ .get(i);
+ al.setProperty(ssp.getKey(), ssp.getValue());
+ }
+
+ // ///////////////////////////////
+
+ Hashtable pdbloaded = new Hashtable(); // TODO nothing writes to this??
+ if (!multipleView)
+ {
+ // load sequence features, database references and any associated PDB
+ // structures for the alignment
+ //
+ // prior to 2.10, this part would only be executed the first time a
+ // sequence was encountered, but not afterwards.
+ // now, for 2.10 projects, this is also done if the xml doc includes
+ // dataset sequences not actually present in any particular view.
+ //
+ for (int i = 0; i < vamsasSeqs.size(); i++)
+ {
+ JSeq jseq = jseqs.get(i);
+ if (jseq.getFeatures().size() > 0)
+ {
+ List<Feature> features = jseq.getFeatures();
+ for (int f = 0; f < features.size(); f++)
+ {
+ Feature feat = features.get(f);
+ SequenceFeature sf = new SequenceFeature(feat.getType(),
+ feat.getDescription(), feat.getBegin(), feat.getEnd(),
+ safeFloat(feat.getScore()), feat.getFeatureGroup());
+ sf.setStatus(feat.getStatus());
+
+ /*
+ * load any feature attributes - include map-valued attributes
+ */
+ Map<String, Map<String, String>> mapAttributes = new HashMap<>();
+ for (int od = 0; od < feat.getOtherData().size(); od++)
+ {
+ OtherData keyValue = feat.getOtherData().get(od);
+ String attributeName = keyValue.getKey();
+ String attributeValue = keyValue.getValue();
+ if (attributeName.startsWith("LINK"))
+ {
+ sf.addLink(attributeValue);
+ }
+ else
+ {
+ String subAttribute = keyValue.getKey2();
+ if (subAttribute == null)
+ {
+ // simple string-valued attribute
+ sf.setValue(attributeName, attributeValue);
+ }
+ else
+ {
+ // attribute 'key' has sub-attribute 'key2'
+ if (!mapAttributes.containsKey(attributeName))
+ {
+ mapAttributes.put(attributeName, new HashMap<>());
+ }
+ mapAttributes.get(attributeName).put(subAttribute,
+ attributeValue);
+ }
+ }
+ }
+ for (Entry<String, Map<String, String>> mapAttribute : mapAttributes
+ .entrySet())
+ {
+ sf.setValue(mapAttribute.getKey(), mapAttribute.getValue());
+ }
+
+ // adds feature to datasequence's feature set (since Jalview 2.10)
+ al.getSequenceAt(i).addSequenceFeature(sf);
+ }
+ }
+ if (vamsasSeqs.get(i).getDBRef().size() > 0)
+ {
+ // adds dbrefs to datasequence's set (since Jalview 2.10)
+ addDBRefs(
+ al.getSequenceAt(i).getDatasetSequence() == null
+ ? al.getSequenceAt(i)
+ : al.getSequenceAt(i).getDatasetSequence(),
+ vamsasSeqs.get(i));
+ }
+ if (jseq.getPdbids().size() > 0)
+ {
+ List<Pdbids> ids = jseq.getPdbids();
+ for (int p = 0; p < ids.size(); p++)
+ {
+ Pdbids pdbid = ids.get(p);
+ jalview.datamodel.PDBEntry entry = new jalview.datamodel.PDBEntry();
+ entry.setId(pdbid.getId());
+ if (pdbid.getType() != null)
+ {
+ if (PDBEntry.Type.getType(pdbid.getType()) != null)
+ {
+ entry.setType(PDBEntry.Type.getType(pdbid.getType()));
+ }
+ else
+ {
+ entry.setType(PDBEntry.Type.FILE);
+ }
+ }
+ // jprovider is null when executing 'New View'
+ if (pdbid.getFile() != null && jprovider != null)
+ {
+ if (!pdbloaded.containsKey(pdbid.getFile()))
+ {
+ entry.setFile(loadPDBFile(jprovider, pdbid.getId(),
+ pdbid.getFile()));
+ }
+ else
+ {
+ entry.setFile(pdbloaded.get(pdbid.getId()).toString());
+ }
+ }
+ /*
+ if (pdbid.getPdbentryItem() != null)
+ {
+ for (PdbentryItem item : pdbid.getPdbentryItem())
+ {
+ for (Property pr : item.getProperty())
+ {
+ entry.setProperty(pr.getName(), pr.getValue());
+ }
+ }
+ }
+ */
+ for (Property prop : pdbid.getProperty())
+ {
+ entry.setProperty(prop.getName(), prop.getValue());
+ }
+ Desktop.getStructureSelectionManager()
+ .registerPDBEntry(entry);
+ // adds PDBEntry to datasequence's set (since Jalview 2.10)
+ if (al.getSequenceAt(i).getDatasetSequence() != null)
+ {
+ al.getSequenceAt(i).getDatasetSequence().addPDBId(entry);
+ }
+ else
+ {
+ al.getSequenceAt(i).addPDBId(entry);
+ }
+ }
+ }
+ /*
+ * load any HMMER profile
+ */
+ // TODO fix this
+
+ String hmmJarFile = jseqs.get(i).getHmmerProfile();
+ if (hmmJarFile != null && jprovider != null)
+ {
+ loadHmmerProfile(jprovider, hmmJarFile, al.getSequenceAt(i));
+ }
+ }
+ } // end !multipleview
+
+ // ///////////////////////////////
+ // LOAD SEQUENCE MAPPINGS
+
+ if (vamsasSet.getAlcodonFrame().size() > 0)
+ {
+ // TODO Potentially this should only be done once for all views of an
+ // alignment
+ List<AlcodonFrame> alc = vamsasSet.getAlcodonFrame();
+ for (int i = 0; i < alc.size(); i++)
+ {
+ AlignedCodonFrame cf = new AlignedCodonFrame();
+ if (alc.get(i).getAlcodMap().size() > 0)
+ {
+ List<AlcodMap> maps = alc.get(i).getAlcodMap();
+ for (int m = 0; m < maps.size(); m++)
+ {
+ AlcodMap map = maps.get(m);
+ SequenceI dnaseq = seqRefIds.get(map.getDnasq());
+ // Load Mapping
+ jalview.datamodel.Mapping mapping = null;
+ // attach to dna sequence reference.
+ if (map.getMapping() != null)
+ {
+ mapping = addMapping(map.getMapping());
+ if (dnaseq != null && mapping.getTo() != null)
+ {
+ cf.addMap(dnaseq, mapping.getTo(), mapping.getMap());
+ }
+ else
+ {
+ // defer to later
+ frefedSequence.add(
+ newAlcodMapRef(map.getDnasq(), cf, mapping));
+ }
+ }
+ }
+ al.addCodonFrame(cf);
+ }
+ }
+ }
+
+ // ////////////////////////////////
+ // LOAD ANNOTATIONS
+ List<JvAnnotRow> autoAlan = new ArrayList<>();
+
+ /*
+ * store any annotations which forward reference a group's ID
+ */
+ Map<String, List<AlignmentAnnotation>> groupAnnotRefs = new Hashtable<>();
+
+ if (vamsasSet.getAnnotation().size()/*Count()*/ > 0)
+ {
+ List<Annotation> an = vamsasSet.getAnnotation();
+
+ for (int i = 0; i < an.size(); i++)
+ {
+ Annotation annotation = an.get(i);
+
+ /**
+ * test if annotation is automatically calculated for this view only
+ */
+ boolean autoForView = false;
+ if (annotation.getLabel().equals("Quality")
+ || annotation.getLabel().equals("Conservation")
+ || annotation.getLabel().equals("Consensus"))
+ {
+ // Kludge for pre 2.5 projects which lacked the autocalculated flag
+ autoForView = true;
+ // JAXB has no has() test; schema defaults value to false
+ // if (!annotation.hasAutoCalculated())
+ // {
+ // annotation.setAutoCalculated(true);
+ // }
+ }
+ if (autoForView || annotation.isAutoCalculated())
+ {
+ // remove ID - we don't recover annotation from other views for
+ // view-specific annotation
+ annotation.setId(null);
+ }
+
+ // set visibility for other annotation in this view
+ String annotationId = annotation.getId();
+ if (annotationId != null && annotationIds.containsKey(annotationId))
+ {
+ AlignmentAnnotation jda = annotationIds.get(annotationId);
+ // in principle Visible should always be true for annotation displayed
+ // in multiple views
+ if (annotation.isVisible() != null)
+ {
+ jda.visible = annotation.isVisible();
+ }
+
+ al.addAnnotation(jda);
+
+ continue;
+ }
+ // Construct new annotation from model.
+ List<AnnotationElement> ae = annotation.getAnnotationElement();
+ jalview.datamodel.Annotation[] anot = null;
+ java.awt.Color firstColour = null;
+ int anpos;
+ if (!annotation.isScoreOnly())
+ {
+ anot = new jalview.datamodel.Annotation[al.getWidth()];
+ for (int aa = 0; aa < ae.size() && aa < anot.length; aa++)
+ {
+ AnnotationElement annElement = ae.get(aa);
+ anpos = annElement.getPosition();
+
+ if (anpos >= anot.length)
+ {
+ continue;
+ }
+
+ float value = safeFloat(annElement.getValue());
+ anot[anpos] = new jalview.datamodel.Annotation(
+ annElement.getDisplayCharacter(),
+ annElement.getDescription(),
+ (annElement.getSecondaryStructure() == null
+ || annElement.getSecondaryStructure()
+ .length() == 0)
+ ? ' '
+ : annElement
+ .getSecondaryStructure()
+ .charAt(0),
+ value);
+ anot[anpos].colour = new Color(safeInt(annElement.getColour()));
+ if (firstColour == null)
+ {
+ firstColour = anot[anpos].colour;
+ }
+ }
+ }
+ // create the new AlignmentAnnotation
+ jalview.datamodel.AlignmentAnnotation jaa = null;
+
+ if (annotation.isGraph())
+ {
+ float llim = 0, hlim = 0;
+ // if (autoForView || an[i].isAutoCalculated()) {
+ // hlim=11f;
+ // }
+ jaa = new jalview.datamodel.AlignmentAnnotation(
+ annotation.getLabel(), annotation.getDescription(), anot,
+ llim, hlim, safeInt(annotation.getGraphType()));
+
+ jaa.graphGroup = safeInt(annotation.getGraphGroup());
+ jaa._linecolour = firstColour;
+ if (annotation.getThresholdLine() != null)
+ {
+ jaa.setThreshold(new jalview.datamodel.GraphLine(
+ safeFloat(annotation.getThresholdLine().getValue()),
+ annotation.getThresholdLine().getLabel(),
+ new java.awt.Color(safeInt(
+ annotation.getThresholdLine().getColour()))));
+ }
+ if (autoForView || annotation.isAutoCalculated())
+ {
+ // Hardwire the symbol display line to ensure that labels for
+ // histograms are displayed
+ jaa.hasText = true;
+ }
+ }
+ else
+ {
+ jaa = new jalview.datamodel.AlignmentAnnotation(
+ annotation.getLabel(), annotation.getDescription(), anot);
+ jaa._linecolour = firstColour;
+ }
+ // register new annotation
+ // Annotation graphs such as Conservation will not have id.
+ if (annotation.getId() != null)
+ {
+ annotationIds.put(annotation.getId(), jaa);
+ jaa.annotationId = annotation.getId();
+ }
+ // recover sequence association
+ String sequenceRef = annotation.getSequenceRef();
+ if (sequenceRef != null)
+ {
+ // from 2.9 sequenceRef is to sequence id (JAL-1781)
+ SequenceI sequence = seqRefIds.get(sequenceRef);
+ if (sequence == null)
+ {
+ // in pre-2.9 projects sequence ref is to sequence name
+ sequence = al.findName(sequenceRef);
+ }
+ if (sequence != null)
+ {
+ jaa.createSequenceMapping(sequence, 1, true);
+ sequence.addAlignmentAnnotation(jaa);
+ }
+ }
+ // and make a note of any group association
+ if (annotation.getGroupRef() != null
+ && annotation.getGroupRef().length() > 0)
+ {
+ List<jalview.datamodel.AlignmentAnnotation> aal = groupAnnotRefs
+ .get(annotation.getGroupRef());
+ if (aal == null)
+ {
+ aal = new ArrayList<>();
+ groupAnnotRefs.put(annotation.getGroupRef(), aal);
+ }
+ aal.add(jaa);
+ }
+
+ if (annotation.getScore() != null)
+ {
+ jaa.setScore(annotation.getScore().doubleValue());
+ }
+ if (annotation.isVisible() != null)
+ {
+ jaa.visible = annotation.isVisible().booleanValue();
+ }
+
+ if (annotation.isCentreColLabels() != null)
+ {
+ jaa.centreColLabels = annotation.isCentreColLabels()
+ .booleanValue();
+ }
- if (annotation.isScaleColLabels() != null)
- {
- jaa.scaleColLabel = annotation.isScaleColLabels().booleanValue();
- }
- if (annotation.isAutoCalculated())
- {
- // newer files have an 'autoCalculated' flag and store calculation
- // state in viewport properties
- jaa.autoCalculated = true; // means annotation will be marked for
- // update at end of load.
- }
- if (annotation.getGraphHeight() != null)
- {
- jaa.graphHeight = annotation.getGraphHeight().intValue();
- }
- jaa.belowAlignment = annotation.isBelowAlignment();
- jaa.setCalcId(annotation.getCalcId());
- if (annotation.getProperty().size() > 0)
- {
- for (Annotation.Property prop : annotation
- .getProperty())
- {
- jaa.setProperty(prop.getName(), prop.getValue());
- }
- }
- if (jaa.autoCalculated)
- {
- autoAlan.add(new JvAnnotRow(i, jaa));
- }
- else
- // if (!autoForView)
- {
- // add autocalculated group annotation and any user created annotation
- // for the view
- al.addAnnotation(jaa);
- }
- }
- }
- // ///////////////////////
- // LOAD GROUPS
- // Create alignment markup and styles for this view
- if (jalviewModel.getJGroup().size() > 0)
- {
- List<JGroup> groups = jalviewModel.getJGroup();
- boolean addAnnotSchemeGroup = false;
- for (int i = 0; i < groups.size(); i++)
- {
- JGroup jGroup = groups.get(i);
- ColourSchemeI cs = null;
- if (jGroup.getColour() != null)
- {
- if (jGroup.getColour().startsWith("ucs"))
- {
- cs = getUserColourScheme(jalviewModel, jGroup.getColour());
- }
- else if (jGroup.getColour().equals("AnnotationColourGradient")
- && jGroup.getAnnotationColours() != null)
- {
- addAnnotSchemeGroup = true;
- }
- else
- {
- cs = ColourSchemeProperty.getColourScheme(null, al,
- jGroup.getColour());
- }
- }
- int pidThreshold = safeInt(jGroup.getPidThreshold());
+ if (annotation.isScaleColLabels() != null)
+ {
+ jaa.scaleColLabel = annotation.isScaleColLabels().booleanValue();
+ }
+ if (annotation.isAutoCalculated())
+ {
+ // newer files have an 'autoCalculated' flag and store calculation
+ // state in viewport properties
+ jaa.autoCalculated = true; // means annotation will be marked for
+ // update at end of load.
+ }
+ if (annotation.getGraphHeight() != null)
+ {
+ jaa.graphHeight = annotation.getGraphHeight().intValue();
+ }
+ jaa.belowAlignment = annotation.isBelowAlignment();
+ jaa.setCalcId(annotation.getCalcId());
+ if (annotation.getProperty().size() > 0)
+ {
+ for (jalview.xml.binding.jalview.Property prop : annotation
+ .getProperty())
+ {
+ jaa.setProperty(prop.getName(), prop.getValue());
+ }
+ }
+ if (jaa.graph == AlignmentAnnotation.CONTACT_MAP)
+ {
+ if (annotation.getContactmatrix() != null
+ && annotation.getContactmatrix().size() > 0)
+ {
+ for (MapOnAMatrixType xmlmat : annotation.getContactmatrix())
+ {
+ restoreMatrixFor(jaa.sequenceRef, jaa, xmlmat);
+ }
+ }
+ }
+
+ if (jaa.autoCalculated)
+ {
+ autoAlan.add(new JvAnnotRow(i, jaa));
+ }
+ else
+ // if (!autoForView)
+ {
+ // add autocalculated group annotation and any user created annotation
+ // for the view
+ al.addAnnotation(jaa);
+ }
+ }
+ }
+ // ///////////////////////
+ // LOAD GROUPS
+ // Create alignment markup and styles for this view
+ if (jalviewModel.getJGroup().size() > 0)
+ {
+ List<JGroup> groups = jalviewModel.getJGroup();
+ boolean addAnnotSchemeGroup = false;
+ for (int i = 0; i < groups.size(); i++)
+ {
+ JGroup jGroup = groups.get(i);
+ ColourSchemeI cs = null;
+ if (jGroup.getColour() != null)
+ {
+ if (jGroup.getColour().startsWith("ucs"))
+ {
+ cs = getUserColourScheme(jalviewModel, jGroup.getColour());
+ }
+ else if (jGroup.getColour().equals("AnnotationColourGradient")
+ && jGroup.getAnnotationColours() != null)
+ {
+ addAnnotSchemeGroup = true;
+ }
+ else
+ {
+ cs = ColourSchemeProperty.getColourScheme(null, al,
+ jGroup.getColour());
+ }
+ }
+ int pidThreshold = safeInt(jGroup.getPidThreshold());
- Vector<SequenceI> seqs = new Vector<>();
-
- for (int s = 0; s < jGroup.getSeq().size(); s++)
- {
- String seqId = jGroup.getSeq().get(s);
- SequenceI ts = seqRefIds.get(seqId);
-
- if (ts != null)
- {
- seqs.addElement(ts);
- }
- }
-
- if (seqs.size() < 1)
- {
- continue;
- }
-
- SequenceGroup sg = new SequenceGroup(seqs, jGroup.getName(), cs,
- safeBoolean(jGroup.isDisplayBoxes()),
- safeBoolean(jGroup.isDisplayText()),
- safeBoolean(jGroup.isColourText()),
- safeInt(jGroup.getStart()), safeInt(jGroup.getEnd()));
- sg.getGroupColourScheme().setThreshold(pidThreshold, true);
- sg.getGroupColourScheme()
- .setConservationInc(safeInt(jGroup.getConsThreshold()));
- sg.setOutlineColour(new Color(safeInt(jGroup.getOutlineColour())));
-
- sg.textColour = new Color(safeInt(jGroup.getTextCol1()));
- sg.textColour2 = new Color(safeInt(jGroup.getTextCol2()));
- sg.setShowNonconserved(safeBoolean(jGroup.isShowUnconserved()));
- sg.thresholdTextColour = safeInt(jGroup.getTextColThreshold());
- // attributes with a default in the schema are never null
- sg.setShowConsensusHistogram(jGroup.isShowConsensusHistogram());
- sg.setshowSequenceLogo(jGroup.isShowSequenceLogo());
- sg.setNormaliseSequenceLogo(jGroup.isNormaliseSequenceLogo());
- sg.setIgnoreGapsConsensus(jGroup.isIgnoreGapsinConsensus());
- if (jGroup.getConsThreshold() != null
- && jGroup.getConsThreshold().intValue() != 0)
- {
- Conservation c = new Conservation("All", sg.getSequences(null), 0,
- sg.getWidth() - 1);
- c.calculate();
- c.verdict(false, 25);
- sg.cs.setConservation(c);
- }
-
- if (jGroup.getId() != null && groupAnnotRefs.size() > 0)
- {
- // re-instate unique group/annotation row reference
- List<AlignmentAnnotation> jaal = groupAnnotRefs
- .get(jGroup.getId());
- if (jaal != null)
- {
- for (AlignmentAnnotation jaa : jaal)
- {
- jaa.groupRef = sg;
- if (jaa.autoCalculated)
- {
- // match up and try to set group autocalc alignment row for this
- // annotation
- if (jaa.label.startsWith("Consensus for "))
- {
- sg.setConsensus(jaa);
- }
- // match up and try to set group autocalc alignment row for this
- // annotation
- if (jaa.label.startsWith("Conservation for "))
- {
- sg.setConservationRow(jaa);
- }
- }
- }
- }
- }
- al.addGroup(sg);
- if (addAnnotSchemeGroup)
- {
- // reconstruct the annotation colourscheme
- sg.setColourScheme(
- constructAnnotationColour(jGroup.getAnnotationColours(),
- null, al, jalviewModel, false));
- }
- }
- }
- if (view == null)
- {
- // only dataset in this model, so just return.
- return null;
- }
- // ///////////////////////////////
- // LOAD VIEWPORT
+ Vector<SequenceI> seqs = new Vector<>();
+
+ for (int s = 0; s < jGroup.getSeq().size(); s++)
+ {
+ String seqId = jGroup.getSeq().get(s);
+ SequenceI ts = seqRefIds.get(seqId);
+
+ if (ts != null)
+ {
+ seqs.addElement(ts);
+ }
+ }
+
+ if (seqs.size() < 1)
+ {
+ continue;
+ }
+
+ SequenceGroup sg = new SequenceGroup(seqs, jGroup.getName(), cs,
+ safeBoolean(jGroup.isDisplayBoxes()),
+ safeBoolean(jGroup.isDisplayText()),
+ safeBoolean(jGroup.isColourText()),
+ safeInt(jGroup.getStart()), safeInt(jGroup.getEnd()));
+ sg.getGroupColourScheme().setThreshold(pidThreshold, true);
+ sg.getGroupColourScheme()
+ .setConservationInc(safeInt(jGroup.getConsThreshold()));
+ sg.setOutlineColour(new Color(safeInt(jGroup.getOutlineColour())));
+
+ sg.textColour = new Color(safeInt(jGroup.getTextCol1()));
+ sg.textColour2 = new Color(safeInt(jGroup.getTextCol2()));
+ sg.setShowNonconserved(safeBoolean(jGroup.isShowUnconserved()));
+ sg.thresholdTextColour = safeInt(jGroup.getTextColThreshold());
+ // attributes with a default in the schema are never null
+ sg.setShowConsensusHistogram(jGroup.isShowConsensusHistogram());
+ sg.setshowSequenceLogo(jGroup.isShowSequenceLogo());
+ sg.setNormaliseSequenceLogo(jGroup.isNormaliseSequenceLogo());
+ sg.setIgnoreGapsConsensus(jGroup.isIgnoreGapsinConsensus());
+ if (jGroup.getConsThreshold() != null
+ && jGroup.getConsThreshold().intValue() != 0)
+ {
+ Conservation c = new Conservation("All", sg.getSequences(null), 0,
+ sg.getWidth() - 1);
+ c.calculate();
+ c.verdict(false, 25);
+ sg.cs.setConservation(c);
+ }
+
+ if (jGroup.getId() != null && groupAnnotRefs.size() > 0)
+ {
+ // re-instate unique group/annotation row reference
+ List<AlignmentAnnotation> jaal = groupAnnotRefs
+ .get(jGroup.getId());
+ if (jaal != null)
+ {
+ for (AlignmentAnnotation jaa : jaal)
+ {
+ jaa.groupRef = sg;
+ if (jaa.autoCalculated)
+ {
+ // match up and try to set group autocalc alignment row for this
+ // annotation
+ if (jaa.label.startsWith("Consensus for "))
+ {
+ sg.setConsensus(jaa);
+ }
+ // match up and try to set group autocalc alignment row for this
+ // annotation
+ if (jaa.label.startsWith("Conservation for "))
+ {
+ sg.setConservationRow(jaa);
+ }
+ }
+ }
+ }
+ }
+ al.addGroup(sg);
+ if (addAnnotSchemeGroup)
+ {
+ // reconstruct the annotation colourscheme
+ sg.setColourScheme(
+ constructAnnotationColour(jGroup.getAnnotationColours(),
+ null, al, jalviewModel, false));
+ }
+ }
+ }
+ if (view == null)
+ {
+ // only dataset in this model, so just return.
+ return null;
+ }
+ // ///////////////////////////////
+ // LOAD VIEWPORT
- // now check to see if we really need to create a new viewport.
- if (multipleView && viewportsAdded.size() == 0)
- {
- // We recovered an alignment for which a viewport already exists.
- // TODO: fix up any settings necessary for overlaying stored state onto
- // state recovered from another document. (may not be necessary).
- // we may need a binding from a viewport in memory to one recovered from
- // XML.
- // and then recover its containing af to allow the settings to be applied.
- // TODO: fix for vamsas demo
- System.err.println(
- "About to recover a viewport for existing alignment: Sequence set ID is "
- + uniqueSeqSetId);
- Object seqsetobj = retrieveExistingObj(uniqueSeqSetId);
- if (seqsetobj != null)
- {
- if (seqsetobj instanceof String)
- {
- uniqueSeqSetId = (String) seqsetobj;
- System.err.println(
- "Recovered extant sequence set ID mapping for ID : New Sequence set ID is "
- + uniqueSeqSetId);
- }
- else
- {
- System.err.println(
- "Warning : Collision between sequence set ID string and existing jalview object mapping.");
- }
+ AlignFrame af = null;
+ AlignViewport av = null;
+ // now check to see if we really need to create a new viewport.
+ if (multipleView && viewportsAdded.size() == 0)
+ {
+ // We recovered an alignment for which a viewport already exists.
+ // TODO: fix up any settings necessary for overlaying stored state onto
+ // state recovered from another document. (may not be necessary).
+ // we may need a binding from a viewport in memory to one recovered from
+ // XML.
+ // and then recover its containing af to allow the settings to be applied.
+ // TODO: fix for vamsas demo
+ jalview.bin.Console.errPrintln(
+ "About to recover a viewport for existing alignment: Sequence set ID is "
+ + uniqueSeqSetId);
+ Object seqsetobj = retrieveExistingObj(uniqueSeqSetId);
+ if (seqsetobj != null)
+ {
+ if (seqsetobj instanceof String)
+ {
+ uniqueSeqSetId = (String) seqsetobj;
- jalview.bin.Console.errPrintln(
- "Recovered extant sequence set ID mapping for ID : New Sequence set ID is "
- + uniqueSeqSetId);
- }
- else
- {
- jalview.bin.Console.errPrintln(
- "Warning : Collision between sequence set ID string and existing jalview object mapping.");
- }
-
- }
- }
- /**
- * indicate that annotation colours are applied across all groups (pre
- * Jalview 2.8.1 behaviour)
- */
- boolean doGroupAnnColour = Jalview2XML.isVersionStringLaterThan("2.8.1",
- jalviewModel.getVersion());
-
- AlignmentPanel ap = null;
- boolean isnewview = true;
- if (viewId != null)
- {
- // Check to see if this alignment already has a view id == viewId
- jalview.gui.AlignmentPanel views[] = Desktop
- .getAlignmentPanels(uniqueSeqSetId);
- if (views != null && views.length > 0)
- {
- for (int v = 0; v < views.length; v++)
++ jalview.bin.Console.errPrintln(
++ "Recovered extant sequence set ID mapping for ID : New Sequence set ID is "
++ + uniqueSeqSetId);
++ }
++ else
+ {
- if (views[v].av.getViewId().equalsIgnoreCase(viewId))
- {
- // recover the existing alignpanel, alignframe, viewport
- af = views[v].alignFrame;
- av = views[v].av;
- ap = views[v];
- // TODO: could even skip resetting view settings if we don't want to
- // change the local settings from other jalview processes
- isnewview = false;
- }
++ jalview.bin.Console.errPrintln(
++ "Warning : Collision between sequence set ID string and existing jalview object mapping.");
+ }
- }
- }
- if (isnewview)
- {
- af = loadViewport(file, jseqs, hiddenSeqs, al, jalviewModel, view,
- uniqueSeqSetId, viewId, autoAlan);
- av = af.getViewport();
- ap = af.alignPanel;
+ }
+ }
+ /**
+ * indicate that annotation colours are applied across all groups (pre
+ * Jalview 2.8.1 behaviour)
+ */
+ boolean doGroupAnnColour = Jalview2XML.isVersionStringLaterThan("2.8.1",
+ jalviewModel.getVersion());
+
- AlignFrame af = null;
+ AlignmentPanel ap = null;
- AlignViewport av = null;
++
+ if (viewId != null)
+ {
+ // Check to see if this alignment already has a view id == viewId
+ jalview.gui.AlignmentPanel views[] = Desktop
+ .getAlignmentPanels(uniqueSeqSetId);
+ if (views != null && views.length > 0)
+ {
+ for (int v = 0; v < views.length; v++)
+ {
+ ap = views[v];
+ av = ap.av;
+ if (av.getViewId().equalsIgnoreCase(viewId))
+ {
+ // recover the existing alignpanel, alignframe, viewport
+ af = ap.alignFrame;
+ break;
+ // TODO: could even skip resetting view settings if we don't want to
+ // change the local settings from other jalview processes
+ }
+ }
+ }
+ }
+
+ if (af == null)
+ {
+ af = loadViewport(fileName, file, jseqs, hiddenSeqs, al, jalviewModel, view,
+ uniqueSeqSetId, viewId, autoAlan);
+ av = af.getViewport();
+ // note that this only retrieves the most recently accessed
+ // tab of an AlignFrame.
+ ap = af.alignPanel;
+ }
+
+ /*
- * Load any trees, PDB structures and viewers
++ * Load any trees, PDB structures and viewers, Overview
+ *
+ * Not done if flag is false (when this method is used for New View)
+ */
+ final AlignFrame af0 = af;
+ final AlignViewport av0 = av;
+ final AlignmentPanel ap0 = ap;
+ // Platform.timeCheck("Jalview2XML.loadFromObject-beforetree",
+ // Platform.TIME_MARK);
+ if (loadTreesAndStructures)
+ {
+ if (!jalviewModel.getTree().isEmpty())
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // Platform.timeCheck(null, Platform.TIME_MARK);
+ loadTrees(jalviewModel, view, af0, av0, ap0);
+ // Platform.timeCheck("Jalview2XML.loadTrees", Platform.TIME_MARK);
+ }
+ });
+ }
+ if (!jalviewModel.getPcaViewer().isEmpty())
+ {
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // Platform.timeCheck(null, Platform.TIME_MARK);
+ loadPCAViewers(jalviewModel, ap0);
+ // Platform.timeCheck("Jalview2XML.loadPCA", Platform.TIME_MARK);
+ }
+ });
+ }
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ // Platform.timeCheck(null, Platform.TIME_MARK);
+ loadPDBStructures(jprovider, jseqs, af0, ap0);
+ // Platform.timeCheck("Jalview2XML.loadPDB", Platform.TIME_MARK);
+ }
+ });
+ SwingUtilities.invokeLater(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ loadRnaViewers(jprovider, jseqs, ap0);
+ }
+ });
- }
++ SwingUtilities.invokeLater(new Runnable()
++ {
++ @Override
++ public void run()
++ {
++ loadOverview(view, jalviewModel.getVersion(), af0);
++ }
++ });
++
++ }
+ // and finally return.
+ // but do not set holdRepaint true just yet, because this could be the
+ // initial frame with just its dataset.
+ return af;
}
- /*
- * Load any trees, PDB structures and viewers, Overview
+ /**
+ * Loads a HMMER profile from a file stored in the project, and associates it
+ * with the specified sequence
*
- * Not done if flag is false (when this method is used for New View)
+ * @param jprovider
+ * @param hmmJarFile
+ * @param seq
*/
- if (loadTreesAndStructures)
- {
- loadTrees(jalviewModel, view, af, av, ap);
- loadPCAViewers(jalviewModel, ap);
- loadPDBStructures(jprovider, jseqs, af, ap);
- loadRnaViewers(jprovider, jseqs, ap);
- loadOverview(view, jalviewModel.getVersion(), af);
+ protected void loadHmmerProfile(jarInputStreamProvider jprovider,
+ String hmmJarFile, SequenceI seq)
+ {
+ try
+ {
+ String hmmFile = copyJarEntry(jprovider, hmmJarFile, "hmm", null);
+ HMMFile parser = new HMMFile(hmmFile, DataSourceType.FILE);
+ HiddenMarkovModel hmmModel = parser.getHMM();
+ hmmModel = new HiddenMarkovModel(hmmModel, seq);
+ seq.setHMM(hmmModel);
+ } catch (IOException e)
+ {
+ Console.warn("Error loading HMM profile for " + seq.getName() + ": "
+ + e.getMessage());
+ }
}
- // and finally return.
- return af;
- }
+ private void importMatrixData(List<MatrixType> xmlmatrices)
+ {
+ for (MatrixType xmlmat : xmlmatrices)
+ {
+ if (!PAEContactMatrix.PAEMATRIX.equals(xmlmat.getType()))
+ {
+ Console.error("Ignoring matrix '" + xmlmat.getId() + "' of type '"
+ + xmlmat.getType());
+ continue;
+ }
+
+ if (!xmlmat.getRows().equals(xmlmat.getCols()))
+ {
+ Console.error("Can't handle non square matrices");
+ continue;
+ }
+
+ float[][] elements = ContactMatrix.fromFloatStringToContacts(
+ xmlmat.getElements(), xmlmat.getCols().intValue(),
+ xmlmat.getRows().intValue());
+
+ List<BitSet> newgroups = new ArrayList<BitSet>();
+ if (xmlmat.getGroups().size() > 0)
+ {
+ for (String sgroup : xmlmat.getGroups())
+ {
+ newgroups.add(deStringifyBitset(sgroup));
+ }
+ }
+ String nwk = xmlmat.getNewick().size() > 0 ? xmlmat.getNewick().get(0)
+ : null;
+ if (xmlmat.getNewick().size() > 1)
+ {
+ Console.log
+ .info("Ignoring additional clusterings for contact matrix");
+ }
+ String treeMethod = xmlmat.getTreeMethod();
+ double thresh = xmlmat.getCutHeight() != null ? xmlmat.getCutHeight()
+ : 0;
+ GroupSet grpset = new GroupSet();
+ grpset.restoreGroups(newgroups, treeMethod, nwk, thresh);
+
+ FloatContactMatrix newcm = new FloatContactMatrix(elements, grpset);
+ contactMatrixRefs.put(xmlmat.getId(), newcm);
+ Console.trace("Restored base contact matrix " + xmlmat.getId());
+ }
+ }
+
+ private void restoreMatrixFor(SequenceI sequenceRef,
+ AlignmentAnnotation jaa, MapOnAMatrixType xmlmatmapping)
+ {
+ // restore mapping data to matrix data
+ jalview.util.MapList mapping = null;
+ if (xmlmatmapping.getMapping() != null)
+ {
+ MapListType m = xmlmatmapping.getMapping();
+ // Mapping m = dr.getMapping();
+ int fr[] = new int[m.getMapListFrom().size() * 2];
+ Iterator<MapListFrom> from = m.getMapListFrom().iterator();// enumerateMapListFrom();
+ for (int _i = 0; from.hasNext(); _i += 2)
+ {
+ MapListFrom mf = from.next();
+ fr[_i] = mf.getStart();
+ fr[_i + 1] = mf.getEnd();
+ }
+ int fto[] = new int[m.getMapListTo().size() * 2];
+ Iterator<MapListTo> to = m.getMapListTo().iterator();// enumerateMapListTo();
+ for (int _i = 0; to.hasNext(); _i += 2)
+ {
+ MapListTo mf = to.next();
+ fto[_i] = mf.getStart();
+ fto[_i + 1] = mf.getEnd();
+ }
+
+ mapping = new jalview.util.MapList(fr, fto,
+ m.getMapFromUnit().intValue(), m.getMapToUnit().intValue());
+ }
+
+ // locate matrix data in project XML and import
+ ContactMatrixI cm = contactMatrixRefs.get(xmlmatmapping.getMatrix());
+ if (cm == null)
+ {
+ frefedSequence
+ .add(newMatrixFref(xmlmatmapping.getMatrix(), mapping, jaa));
+ }
+ else
+ {
+ // create the PAEMatrix now
+ PAEContactMatrix newpae = new PAEContactMatrix(jaa.sequenceRef,
+ mapping, cm);
+
+ jaa.sequenceRef.addContactListFor(jaa, newpae);
+ }
+
+ return;
+ }
+
+ /**
+ * Load Overview window, restoring colours, 'show hidden regions' flag, title
+ * and geometry as saved
+ *
+ * @param view
+ * @param af
+ */
+ protected void loadOverview(Viewport view, String version, AlignFrame af)
+ {
+ if (!isVersionStringLaterThan("2.11.3", version)
+ && view.getOverview() == null)
+ {
+ return;
+ }
+ /*
+ * first close any Overview that was opened automatically
+ * (if so configured in Preferences) so that the view is
+ * restored in the same state as saved
+ */
+ af.alignPanel.closeOverviewPanel();
+
+ Overview overview = view.getOverview();
+ if (overview != null)
+ {
+ OverviewPanel overviewPanel = af
+ .openOverviewPanel(overview.isShowHidden());
+ overviewPanel.setTitle(overview.getTitle());
+ overviewPanel.setFrameBounds(overview.getXpos(), overview.getYpos(),
+ overview.getWidth(), overview.getHeight());
+ Color gap = new Color(overview.getGapColour());
+ Color residue = new Color(overview.getResidueColour());
+ Color hidden = new Color(overview.getHiddenColour());
+ overviewPanel.getCanvas().setColours(gap, residue, hidden);
+ }
+ }
+
- /**
- * Instantiate and link any saved RNA (Varna) viewers. The state of the Varna
- * panel is restored from separate jar entries, two (gapped and trimmed) per
- * sequence and secondary structure.
- *
- * Currently each viewer shows just one sequence and structure (gapped and
- * trimmed), however this method is designed to support multiple sequences or
- * structures in viewers if wanted in future.
- *
- * @param jprovider
- * @param jseqs
- * @param ap
- */
- private void loadRnaViewers(jarInputStreamProvider jprovider,
- List<JSeq> jseqs, AlignmentPanel ap)
- {
- /*
- * scan the sequences for references to viewers; create each one the first
- * time it is referenced, add Rna models to existing viewers
+ /**
+ * Instantiate and link any saved RNA (Varna) viewers. The state of the Varna
+ * panel is restored from separate jar entries, two (gapped and trimmed) per
+ * sequence and secondary structure.
+ *
+ * Currently each viewer shows just one sequence and structure (gapped and
+ * trimmed), however this method is designed to support multiple sequences or
+ * structures in viewers if wanted in future.
+ *
+ * @param jprovider
+ * @param jseqs
+ * @param ap
*/
- for (JSeq jseq : jseqs)
- {
- for (int i = 0; i < jseq.getRnaViewer().size(); i++)
- {
- RnaViewer viewer = jseq.getRnaViewer().get(i);
- AppVarna appVarna = findOrCreateVarnaViewer(viewer, uniqueSetSuffix,
- ap);
-
- for (int j = 0; j < viewer.getSecondaryStructure().size(); j++)
- {
- SecondaryStructure ss = viewer.getSecondaryStructure().get(j);
- SequenceI seq = seqRefIds.get(jseq.getId());
- AlignmentAnnotation ann = this.annotationIds
- .get(ss.getAnnotationId());
-
- /*
- * add the structure to the Varna display (with session state copied
- * from the jar to a temporary file)
- */
- boolean gapped = safeBoolean(ss.isGapped());
- String rnaTitle = ss.getTitle();
- String sessionState = ss.getViewerState();
- String tempStateFile = copyJarEntry(jprovider, sessionState,
- "varna", null);
- RnaModel rna = new RnaModel(rnaTitle, ann, seq, null, gapped);
- appVarna.addModelSession(rna, rnaTitle, tempStateFile);
- }
- appVarna.setInitialSelection(safeInt(viewer.getSelectedRna()));
- }
+ protected void loadRnaViewers(jarInputStreamProvider jprovider,
+ List<JSeq> jseqs, AlignmentPanel ap)
+ {
+ /*
+ * scan the sequences for references to viewers; create each one the first
+ * time it is referenced, add Rna models to existing viewers
+ */
+ for (JSeq jseq : jseqs)
+ {
+ for (int i = 0; i < jseq.getRnaViewer().size(); i++)
+ {
+ RnaViewer viewer = jseq.getRnaViewer().get(i);
+ AppVarna appVarna = findOrCreateVarnaViewer(viewer, uniqueSetSuffix,
+ ap);
+
+ for (int j = 0; j < viewer.getSecondaryStructure().size(); j++)
+ {
+ SecondaryStructure ss = viewer.getSecondaryStructure().get(j);
+ SequenceI seq = seqRefIds.get(jseq.getId());
+ AlignmentAnnotation ann = this.annotationIds
+ .get(ss.getAnnotationId());
+
+ /*
+ * add the structure to the Varna display (with session state copied
+ * from the jar to a temporary file)
+ */
+ boolean gapped = safeBoolean(ss.isGapped());
+ String rnaTitle = ss.getTitle();
+ String sessionState = ss.getViewerState();
+ String tempStateFile = copyJarEntry(jprovider, sessionState,
+ "varna", null);
+ RnaModel rna = new RnaModel(rnaTitle, ann, seq, null, gapped);
+ appVarna.addModelSession(rna, rnaTitle, tempStateFile);
+ }
+ appVarna.setInitialSelection(safeInt(viewer.getSelectedRna()));
+ }
+ }
}
- }
- /**
- * Locate and return an already instantiated matching AppVarna, or create one
- * if not found
- *
- * @param viewer
- * @param viewIdSuffix
- * @param ap
- * @return
- */
- protected AppVarna findOrCreateVarnaViewer(RnaViewer viewer,
- String viewIdSuffix, AlignmentPanel ap)
- {
- /*
- * on each load a suffix is appended to the saved viewId, to avoid conflicts
- * if load is repeated
+ /**
+ * Locate and return an already instantiated matching AppVarna, or create one
+ * if not found
+ *
+ * @param viewer
+ * @param viewIdSuffix
+ * @param ap
+ * @return
*/
- String postLoadId = viewer.getViewId() + viewIdSuffix;
- for (JInternalFrame frame : getAllFrames())
- {
- if (frame instanceof AppVarna)
- {
- AppVarna varna = (AppVarna) frame;
- if (postLoadId.equals(varna.getViewId()))
- {
- // this viewer is already instantiated
- // could in future here add ap as another 'parent' of the
- // AppVarna window; currently just 1-to-many
- return varna;
- }
- }
+ protected AppVarna findOrCreateVarnaViewer(RnaViewer viewer,
+ String viewIdSuffix, AlignmentPanel ap)
+ {
+ /*
+ * on each load a suffix is appended to the saved viewId, to avoid conflicts
+ * if load is repeated
+ */
+ String postLoadId = viewer.getViewId() + viewIdSuffix;
+ for (JInternalFrame frame : getAllFrames())
+ {
+ if (frame instanceof AppVarna)
+ {
+ AppVarna varna = (AppVarna) frame;
+ if (postLoadId.equals(varna.getViewId()))
+ {
+ // this viewer is already instantiated
+ // could in future here add ap as another 'parent' of the
+ // AppVarna window; currently just 1-to-many
+ return varna;
+ }
+ }
+ }
+
+ /*
+ * viewer not found - make it
+ */
+ RnaViewerModel model = new RnaViewerModel(postLoadId, viewer.getTitle(),
+ safeInt(viewer.getXpos()), safeInt(viewer.getYpos()),
+ safeInt(viewer.getWidth()), safeInt(viewer.getHeight()),
+ safeInt(viewer.getDividerLocation()));
+ AppVarna varna = new AppVarna(model, ap);
+
+ return varna;
}
- /*
- * viewer not found - make it
+ /**
+ * Load any saved trees
+ *
+ * @param jm
+ * @param view
+ * @param af
+ * @param av
+ * @param ap
*/
- RnaViewerModel model = new RnaViewerModel(postLoadId, viewer.getTitle(),
- safeInt(viewer.getXpos()), safeInt(viewer.getYpos()),
- safeInt(viewer.getWidth()), safeInt(viewer.getHeight()),
- safeInt(viewer.getDividerLocation()));
- AppVarna varna = new AppVarna(model, ap);
-
- return varna;
- }
-
- /**
- * Load any saved trees
- *
- * @param jm
- * @param view
- * @param af
- * @param av
- * @param ap
- */
- protected void loadTrees(JalviewModel jm, Viewport view, AlignFrame af,
- AlignViewport av, AlignmentPanel ap)
- {
- // TODO result of automated refactoring - are all these parameters needed?
- try
+ protected void loadTrees(JalviewModel jm, Viewport view,
+ AlignFrame af, AlignViewport av, AlignmentPanel ap)
{
- for (int t = 0; t < jm.getTree().size(); t++)
- {
+ // TODO result of automated refactoring - are all these parameters needed?
+ try
+ {
+ for (int t = 0; t < jm.getTree().size(); t++)
+ {
- Tree tree = jm.getTree().get(t);
+ Tree tree = jm.getTree().get(t);
- TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId());
- if (tp == null)
- {
- tp = af.showNewickTree(new NewickFile(tree.getNewick()),
- tree.getTitle(), safeInt(tree.getWidth()),
- safeInt(tree.getHeight()), safeInt(tree.getXpos()),
- safeInt(tree.getYpos()));
- if (tp == null)
- {
- Console.warn("There was a problem recovering stored Newick tree: \n"
- + tree.getNewick());
- continue;
- }
- if (tree.getId() != null)
- {
- // perhaps bind the tree id to something ?
- }
- }
- else
- {
- // update local tree attributes ?
- // TODO: should check if tp has been manipulated by user - if so its
- // settings shouldn't be modified
- tp.setTitle(tree.getTitle());
- tp.setBounds(new Rectangle(safeInt(tree.getXpos()),
- safeInt(tree.getYpos()), safeInt(tree.getWidth()),
- safeInt(tree.getHeight())));
- tp.setViewport(av); // af.viewport;
- // TODO: verify 'associate with all views' works still
- tp.getTreeCanvas().setViewport(av); // af.viewport;
- tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
- }
- tp.getTreeCanvas().setApplyToAllViews(tree.isLinkToAllViews());
- TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId());
- if (tp == null)
++ TreePanel tp = (TreePanel) retrieveExistingObj(tree.getId());
++ if (tp == null)
++ {
++ if (tree.isColumnWise())
+ {
- if (tree.isColumnWise())
- {
- AlignmentAnnotation aa = annotationIds
- .get(tree.getColumnReference());
- if (aa == null)
- {
- Console.warn(
- "Null alignment annotation when restoring columnwise tree");
- }
- tp = af.showColumnWiseTree(new NewickFile(tree.getNewick()), aa,
- tree.getTitle(), safeInt(tree.getWidth()),
- safeInt(tree.getHeight()), safeInt(tree.getXpos()),
- safeInt(tree.getYpos()));
-
- }
- else
- {
- tp = af.showNewickTree(new NewickFile(tree.getNewick()),
- tree.getTitle(), safeInt(tree.getWidth()),
- safeInt(tree.getHeight()), safeInt(tree.getXpos()),
- safeInt(tree.getYpos()));
- }
- if (tree.getId() != null)
++ AlignmentAnnotation aa = annotationIds
++ .get(tree.getColumnReference());
++ if (aa == null)
+ {
- // perhaps bind the tree id to something ?
++ Console.warn(
++ "Null alignment annotation when restoring columnwise tree");
+ }
- }
- else
- {
- // update local tree attributes ?
- // TODO: should check if tp has been manipulated by user - if so its
- // settings shouldn't be modified
- tp.setTitle(tree.getTitle());
- tp.setBounds(new Rectangle(safeInt(tree.getXpos()),
- safeInt(tree.getYpos()), safeInt(tree.getWidth()),
- safeInt(tree.getHeight())));
- tp.setViewport(av); // af.viewport;
- // TODO: verify 'associate with all views' works still
- tp.getTreeCanvas().setViewport(av); // af.viewport;
- tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
- }
- tp.getTreeCanvas().setApplyToAllViews(tree.isLinkToAllViews());
- if (tp == null)
- {
- Console.warn(
- "There was a problem recovering stored Newick tree: \n"
- + tree.getNewick());
- continue;
- }
-
- tp.fitToWindow.setState(safeBoolean(tree.isFitToWindow()));
- tp.fitToWindow_actionPerformed(null);
++ tp = af.showColumnWiseTree(new NewickFile(tree.getNewick()), aa,
++ tree.getTitle(), safeInt(tree.getWidth()),
++ safeInt(tree.getHeight()), safeInt(tree.getXpos()),
++ safeInt(tree.getYpos()));
+
- if (tree.getFontName() != null)
- {
- tp.setTreeFont(
- new Font(tree.getFontName(), safeInt(tree.getFontStyle()),
- safeInt(tree.getFontSize())));
+ }
+ else
+ {
- tp.setTreeFont(
- new Font(view.getFontName(), safeInt(view.getFontStyle()),
- safeInt(view.getFontSize())));
- }
-
- tp.showPlaceholders(safeBoolean(tree.isMarkUnlinked()));
- tp.showBootstrap(safeBoolean(tree.isShowBootstrap()));
- tp.showDistances(safeBoolean(tree.isShowDistances()));
-
- tp.getTreeCanvas().setThreshold(safeFloat(tree.getThreshold()));
-
- if (safeBoolean(tree.isCurrentTree()))
- {
- af.getViewport().setCurrentTree(tp.getTree());
++ tp = af.showNewickTree(new NewickFile(tree.getNewick()),
++ tree.getTitle(), safeInt(tree.getWidth()),
++ safeInt(tree.getHeight()), safeInt(tree.getXpos()),
++ safeInt(tree.getYpos()));
+ }
- }
-
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-
- /**
- * Load and link any saved structure viewers.
- *
- * @param jprovider
- * @param jseqs
- * @param af
- * @param ap
- */
- protected void loadPDBStructures(jarInputStreamProvider jprovider,
- List<JSeq> jseqs, AlignFrame af, AlignmentPanel ap)
- {
- /*
- * Run through all PDB ids on the alignment, and collect mappings between
- * distinct view ids and all sequences referring to that view.
- */
- Map<String, StructureViewerModel> structureViewers = new LinkedHashMap<>();
-
- for (int i = 0; i < jseqs.size(); i++)
- {
- JSeq jseq = jseqs.get(i);
- if (jseq.getPdbids().size() > 0)
- {
- List<Pdbids> ids = jseq.getPdbids();
- for (int p = 0; p < ids.size(); p++)
++ if (tree.getId() != null)
+ {
- Pdbids pdbid = ids.get(p);
- final int structureStateCount = pdbid.getStructureState().size();
- for (int s = 0; s < structureStateCount; s++)
- {
- // check to see if we haven't already created this structure view
- final StructureState structureState = pdbid.getStructureState()
- .get(s);
- String sviewid = (structureState.getViewId() == null) ? null
- : structureState.getViewId() + uniqueSetSuffix;
- jalview.datamodel.PDBEntry jpdb = new jalview.datamodel.PDBEntry();
- // Originally : pdbid.getFile()
- // : TODO: verify external PDB file recovery still works in normal
- // jalview project load
- jpdb.setFile(
- loadPDBFile(jprovider, pdbid.getId(), pdbid.getFile()));
- jpdb.setId(pdbid.getId());
-
- int x = safeInt(structureState.getXpos());
- int y = safeInt(structureState.getYpos());
- int width = safeInt(structureState.getWidth());
- int height = safeInt(structureState.getHeight());
-
- // Probably don't need to do this anymore...
- // Desktop.desktop.getComponentAt(x, y);
- // TODO: NOW: check that this recovers the PDB file correctly.
- String pdbFile = loadPDBFile(jprovider, pdbid.getId(),
- pdbid.getFile());
- jalview.datamodel.SequenceI seq = seqRefIds
- .get(jseq.getId() + "");
- if (sviewid == null)
- {
- sviewid = "_jalview_pre2_4_" + x + "," + y + "," + width + ","
- + height;
- }
- if (!structureViewers.containsKey(sviewid))
- {
- String viewerType = structureState.getType();
- if (viewerType == null) // pre Jalview 2.9
- {
- viewerType = ViewerType.JMOL.toString();
- }
- structureViewers.put(sviewid,
- new StructureViewerModel(x, y, width, height, false,
- false, true, structureState.getViewId(),
- viewerType));
- // Legacy pre-2.7 conversion JAL-823 :
- // do not assume any view has to be linked for colour by
- // sequence
- }
-
- // assemble String[] { pdb files }, String[] { id for each
- // file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
- // seqs_file 2}, boolean[] {
- // linkAlignPanel,superposeWithAlignpanel}} from hash
- StructureViewerModel jmoldat = structureViewers.get(sviewid);
- jmoldat.setAlignWithPanel(jmoldat.isAlignWithPanel()
- || structureState.isAlignwithAlignPanel());
-
- /*
- * Default colour by linked panel to false if not specified (e.g.
- * for pre-2.7 projects)
- */
- boolean colourWithAlignPanel = jmoldat.isColourWithAlignPanel();
- colourWithAlignPanel |= structureState.isColourwithAlignPanel();
- jmoldat.setColourWithAlignPanel(colourWithAlignPanel);
-
- /*
- * Default colour by viewer to true if not specified (e.g. for
- * pre-2.7 projects)
- */
- boolean colourByViewer = jmoldat.isColourByViewer();
- colourByViewer &= structureState.isColourByJmol();
- jmoldat.setColourByViewer(colourByViewer);
-
- if (jmoldat.getStateData().length() < structureState.getValue()
- /*Content()*/.length())
- {
- jmoldat.setStateData(structureState.getValue());// Content());
- }
- if (pdbid.getFile() != null)
- {
- File mapkey = new File(pdbid.getFile());
- StructureData seqstrmaps = jmoldat.getFileData().get(mapkey);
- if (seqstrmaps == null)
- {
- jmoldat.getFileData().put(mapkey,
- seqstrmaps = jmoldat.new StructureData(pdbFile,
- pdbid.getId()));
- }
- if (!seqstrmaps.getSeqList().contains(seq))
- {
- seqstrmaps.getSeqList().add(seq);
- // TODO and chains?
- }
- }
- else
- {
- errorMessage = ("The Jmol views in this project were imported\nfrom an older version of Jalview.\nPlease review the sequence colour associations\nin the Colour by section of the Jmol View menu.\n\nIn the case of problems, see note at\nhttp://issues.jalview.org/browse/JAL-747");
- Console.warn(errorMessage);
- }
- }
++ // perhaps bind the tree id to something ?
+ }
+ }
- }
- // Instantiate the associated structure views
- for (Entry<String, StructureViewerModel> entry : structureViewers
- .entrySet())
- {
- try
++ else
+ {
- createOrLinkStructureViewer(entry, af, ap, jprovider);
- } catch (Exception e)
++ // update local tree attributes ?
++ // TODO: should check if tp has been manipulated by user - if so its
++ // settings shouldn't be modified
++ tp.setTitle(tree.getTitle());
++ tp.setBounds(new Rectangle(safeInt(tree.getXpos()),
++ safeInt(tree.getYpos()), safeInt(tree.getWidth()),
++ safeInt(tree.getHeight())));
++ tp.setViewport(av); // af.viewport;
++ // TODO: verify 'associate with all views' works still
++ tp.getTreeCanvas().setViewport(av); // af.viewport;
++ tp.getTreeCanvas().setAssociatedPanel(ap); // af.alignPanel;
++ }
++ tp.getTreeCanvas().setApplyToAllViews(tree.isLinkToAllViews());
++ if (tp == null)
+ {
- jalview.bin.Console.errPrintln(
- "Error loading structure viewer: " + e.getMessage());
- // failed - try the next one
++ Console.warn(
++ "There was a problem recovering stored Newick tree: \n"
++ + tree.getNewick());
++ continue;
+ }
- }
- }
- /**
- *
- * @param viewerData
- * @param af
- * @param ap
- * @param jprovider
- */
- protected void createOrLinkStructureViewer(
- Entry<String, StructureViewerModel> viewerData, AlignFrame af,
- AlignmentPanel ap, jarInputStreamProvider jprovider)
- {
- final StructureViewerModel stateData = viewerData.getValue();
+ tp.fitToWindow.setState(safeBoolean(tree.isFitToWindow()));
+ tp.fitToWindow_actionPerformed(null);
- /*
- * Search for any viewer windows already open from other alignment views
- * that exactly match the stored structure state
- */
- StructureViewerBase comp = findMatchingViewer(viewerData);
+ if (tree.getFontName() != null)
+ {
+ tp.setTreeFont(
+ new Font(tree.getFontName(), safeInt(tree.getFontStyle()),
+ safeInt(tree.getFontSize())));
+ }
+ else
+ {
+ tp.setTreeFont(
+ new Font(view.getFontName(), safeInt(view.getFontStyle()),
+ safeInt(view.getFontSize())));
+ }
- if (comp != null)
- {
- linkStructureViewer(ap, comp, stateData);
- return;
- }
+ tp.showPlaceholders(safeBoolean(tree.isMarkUnlinked()));
+ tp.showBootstrap(safeBoolean(tree.isShowBootstrap()));
+ tp.showDistances(safeBoolean(tree.isShowDistances()));
- String type = stateData.getType();
- try
- {
- ViewerType viewerType = ViewerType.valueOf(type);
- createStructureViewer(viewerType, viewerData, af, jprovider);
- } catch (IllegalArgumentException | NullPointerException e)
- {
- // TODO JAL-3619 show error dialog / offer an alternative viewer
- Console.error("Invalid structure viewer type: " + type);
- }
- }
+ tp.getTreeCanvas().setThreshold(safeFloat(tree.getThreshold()));
- /**
- * Generates a name for the entry in the project jar file to hold state
- * information for a structure viewer
- *
- * @param viewId
- * @return
- */
- protected String getViewerJarEntryName(String viewId)
- {
- return VIEWER_PREFIX + viewId;
- }
+ if (safeBoolean(tree.isCurrentTree()))
+ {
+ af.getViewport().setCurrentTree(tp.getTree());
+ }
+ }
- /**
- * Returns any open frame that matches given structure viewer data. The match
- * is based on the unique viewId, or (for older project versions) the frame's
- * geometry.
- *
- * @param viewerData
- * @return
- */
- protected StructureViewerBase findMatchingViewer(
- Entry<String, StructureViewerModel> viewerData)
- {
- final String sviewid = viewerData.getKey();
- final StructureViewerModel svattrib = viewerData.getValue();
- StructureViewerBase comp = null;
- JInternalFrame[] frames = getAllFrames();
- for (JInternalFrame frame : frames)
- {
- if (frame instanceof StructureViewerBase)
- {
- /*
- * Post jalview 2.4 schema includes structure view id
- */
- if (sviewid != null && ((StructureViewerBase) frame).getViewId()
- .equals(sviewid))
- {
- comp = (StructureViewerBase) frame;
- break; // break added in 2.9
- }
- /*
- * Otherwise test for matching position and size of viewer frame
- */
- else if (frame.getX() == svattrib.getX()
- && frame.getY() == svattrib.getY()
- && frame.getHeight() == svattrib.getHeight()
- && frame.getWidth() == svattrib.getWidth())
- {
- comp = (StructureViewerBase) frame;
- // no break in faint hope of an exact match on viewId
- }
- }
+ } catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
}
- return comp;
- }
-
- /**
- * Link an AlignmentPanel to an existing structure viewer.
- *
- * @param ap
- * @param viewer
- * @param oldFiles
- * @param useinViewerSuperpos
- * @param usetoColourbyseq
- * @param viewerColouring
- */
- protected void linkStructureViewer(AlignmentPanel ap,
- StructureViewerBase viewer, StructureViewerModel stateData)
- {
- // NOTE: if the jalview project is part of a shared session then
- // view synchronization should/could be done here.
-
- final boolean useinViewerSuperpos = stateData.isAlignWithPanel();
- final boolean usetoColourbyseq = stateData.isColourWithAlignPanel();
- final boolean viewerColouring = stateData.isColourByViewer();
- Map<File, StructureData> oldFiles = stateData.getFileData();
- /*
- * Add mapping for sequences in this view to an already open viewer
+ /**
+ * Load and link any saved structure viewers.
+ *
+ * @param jprovider
+ * @param jseqs
+ * @param af
+ * @param ap
*/
- final AAStructureBindingModel binding = viewer.getBinding();
- for (File id : oldFiles.keySet())
- {
- // add this and any other pdb files that should be present in the
- // viewer
- StructureData filedat = oldFiles.get(id);
- String pdbFile = filedat.getFilePath();
- SequenceI[] seq = filedat.getSeqList().toArray(new SequenceI[0]);
- binding.getSsm().setMapping(seq, null, pdbFile, DataSourceType.FILE,
- null);
- binding.addSequenceForStructFile(pdbFile, seq);
+ protected void loadPDBStructures(jarInputStreamProvider jprovider,
+ List<JSeq> jseqs, AlignFrame af, AlignmentPanel ap)
+ {
+ /*
+ * Run through all PDB ids on the alignment, and collect mappings between
+ * distinct view ids and all sequences referring to that view.
+ */
+ Map<String, StructureViewerModel> structureViewers = new LinkedHashMap<>();
+
+ for (int i = 0; i < jseqs.size(); i++)
+ {
+ JSeq jseq = jseqs.get(i);
+ if (jseq.getPdbids().size() > 0)
+ {
+ List<Pdbids> ids = jseq.getPdbids();
+ for (int p = 0; p < ids.size(); p++)
+ {
+ Pdbids pdbid = ids.get(p);
+ final int structureStateCount = pdbid.getStructureState().size();
+ for (int s = 0; s < structureStateCount; s++)
+ {
+ // check to see if we haven't already created this structure view
+ final StructureState structureState = pdbid
+ .getStructureState().get(s);
+ String sviewid = (structureState.getViewId() == null) ? null
+ : structureState.getViewId() + uniqueSetSuffix;
+ jalview.datamodel.PDBEntry jpdb = new jalview.datamodel.PDBEntry();
+ // Originally : pdbid.getFile()
+ // : TODO: verify external PDB file recovery still works in normal
+ // jalview project load
+ jpdb.setFile(
+ loadPDBFile(jprovider, pdbid.getId(), pdbid.getFile()));
+ jpdb.setId(pdbid.getId());
+
+ int x = safeInt(structureState.getXpos());
+ int y = safeInt(structureState.getYpos());
+ int width = safeInt(structureState.getWidth());
+ int height = safeInt(structureState.getHeight());
+
+ // Probably don't need to do this anymore...
+ // Desktop.getDesktop().getComponentAt(x, y);
+ // TODO: NOW: check that this recovers the PDB file correctly.
+ String pdbFile = loadPDBFile(jprovider, pdbid.getId(),
+ pdbid.getFile());
+ jalview.datamodel.SequenceI seq = seqRefIds
+ .get(jseq.getId() + "");
+ if (sviewid == null)
+ {
+ sviewid = "_jalview_pre2_4_" + x + "," + y + "," + width + ","
+ + height;
+ }
+ if (!structureViewers.containsKey(sviewid))
+ {
+ String viewerType = structureState.getType();
+ if (viewerType == null) // pre Jalview 2.9
+ {
+ viewerType = ViewerType.JMOL.toString();
+ }
+ structureViewers.put(sviewid,
+ new StructureViewerModel(x, y, width, height, false,
+ false, true, structureState.getViewId(),
+ viewerType));
+ // Legacy pre-2.7 conversion JAL-823 :
+ // do not assume any view has to be linked for colour by
+ // sequence
+ }
+
+ // assemble String[] { pdb files }, String[] { id for each
+ // file }, orig_fileloc, SequenceI[][] {{ seqs_file 1 }, {
+ // seqs_file 2}, boolean[] {
+ // linkAlignPanel,superposeWithAlignpanel}} from hash
+ StructureViewerModel jmoldat = structureViewers.get(sviewid);
+ jmoldat.setAlignWithPanel(jmoldat.isAlignWithPanel()
+ || structureState.isAlignwithAlignPanel());
+
+ /*
+ * Default colour by linked panel to false if not specified (e.g.
+ * for pre-2.7 projects)
+ */
+ boolean colourWithAlignPanel = jmoldat.isColourWithAlignPanel();
+ colourWithAlignPanel |= structureState.isColourwithAlignPanel();
+ jmoldat.setColourWithAlignPanel(colourWithAlignPanel);
+
+ /*
+ * Default colour by viewer to true if not specified (e.g. for
+ * pre-2.7 projects)
+ */
+ boolean colourByViewer = jmoldat.isColourByViewer();
+ colourByViewer &= structureState.isColourByJmol();
+ jmoldat.setColourByViewer(colourByViewer);
+
+ if (jmoldat.getStateData().length() < structureState
+ .getValue()/*Content()*/.length())
+ {
+ jmoldat.setStateData(structureState.getValue());// Content());
+ }
+ if (pdbid.getFile() != null)
+ {
+ File mapkey = new File(pdbid.getFile());
+ StructureData seqstrmaps = jmoldat.getFileData().get(mapkey);
+ if (seqstrmaps == null)
+ {
+ jmoldat.getFileData().put(mapkey,
+ seqstrmaps = jmoldat.new StructureData(pdbFile,
+ pdbid.getId()));
+ }
+ if (!seqstrmaps.getSeqList().contains(seq))
+ {
+ seqstrmaps.getSeqList().add(seq);
+ // TODO and chains?
+ }
+ }
+ else
+ {
+ errorMessage = ("The Jmol views in this project were imported\nfrom an older version of Jalview.\nPlease review the sequence colour associations\nin the Colour by section of the Jmol View menu.\n\nIn the case of problems, see note at\nhttp://issues.jalview.org/browse/JAL-747");
+ Console.warn(errorMessage);
+ }
+ }
+ }
+ }
+ }
+ // Instantiate the associated structure views
+ for (Entry<String, StructureViewerModel> entry : structureViewers
+ .entrySet())
+ {
+ try
+ {
+ createOrLinkStructureViewer(entry, af, ap, jprovider);
+ } catch (Exception e)
+ {
- System.err.println(
++ jalview.bin.Console.errPrintln(
+ "Error loading structure viewer: " + e.getMessage());
+ // failed - try the next one
+ }
+ }
}
- // and add the AlignmentPanel's reference to the view panel
- viewer.addAlignmentPanel(ap);
- if (useinViewerSuperpos)
- {
- viewer.useAlignmentPanelForSuperposition(ap);
+
+ /**
+ *
+ * @param viewerData
+ * @param af
+ * @param ap
+ * @param jprovider
+ */
+ protected void createOrLinkStructureViewer(
+ Entry<String, StructureViewerModel> viewerData, AlignFrame af,
+ AlignmentPanel ap, jarInputStreamProvider jprovider)
+ {
+ final StructureViewerModel stateData = viewerData.getValue();
+
+ /*
+ * Search for any viewer windows already open from other alignment views
+ * that exactly match the stored structure state
+ */
+ StructureViewerBase comp = findMatchingViewer(viewerData);
+
+ if (comp != null)
+ {
+ linkStructureViewer(ap, comp, stateData);
+ return;
+ }
+
+ String type = stateData.getType();
+ try
+ {
+ ViewerType viewerType = ViewerType.valueOf(type);
+ createStructureViewer(viewerType, viewerData, af, jprovider);
+ } catch (IllegalArgumentException | NullPointerException e)
+ {
+ // TODO JAL-3619 show error dialog / offer an alternative viewer
+ Console.error("Invalid structure viewer type: " + type);
+ }
}
- else
+ /**
+ * Generates a name for the entry in the project jar file to hold state
+ * information for a structure viewer
+ *
+ * @param viewId
+ * @return
+ */
+ protected String getViewerJarEntryName(String viewId)
{
- viewer.excludeAlignmentPanelForSuperposition(ap);
+ return VIEWER_PREFIX + viewId;
}
- if (usetoColourbyseq)
- {
- viewer.useAlignmentPanelForColourbyseq(ap, !viewerColouring);
+
+ /**
+ * Returns any open frame that matches given structure viewer data. The match
+ * is based on the unique viewId, or (for older project versions) the frame's
+ * geometry.
+ *
+ * @param viewerData
+ * @return
+ */
+ protected StructureViewerBase findMatchingViewer(
+ Entry<String, StructureViewerModel> viewerData)
+ {
+ final String sviewid = viewerData.getKey();
+ final StructureViewerModel svattrib = viewerData.getValue();
+ StructureViewerBase comp = null;
+ JInternalFrame[] frames = getAllFrames();
+ for (JInternalFrame frame : frames)
+ {
+ if (frame instanceof StructureViewerBase)
+ {
+ /*
+ * Post jalview 2.4 schema includes structure view id
+ */
+ if (sviewid != null && ((StructureViewerBase) frame).getViewId()
+ .equals(sviewid))
+ {
+ comp = (StructureViewerBase) frame;
+ break; // break added in 2.9
+ }
+ /*
+ * Otherwise test for matching position and size of viewer frame
+ */
+ else if (frame.getX() == svattrib.getX()
+ && frame.getY() == svattrib.getY()
+ && frame.getHeight() == svattrib.getHeight()
+ && frame.getWidth() == svattrib.getWidth())
+ {
+ comp = (StructureViewerBase) frame;
+ // no break in faint hope of an exact match on viewId
+ }
+ }
+ }
+ return comp;
}
- else
- {
- viewer.excludeAlignmentPanelForColourbyseq(ap);
+
+ /**
+ * Link an AlignmentPanel to an existing structure viewer.
+ *
+ * @param ap
+ * @param viewer
+ * @param oldFiles
+ * @param useinViewerSuperpos
+ * @param usetoColourbyseq
+ * @param viewerColouring
+ */
+ protected void linkStructureViewer(AlignmentPanel ap,
+ StructureViewerBase viewer, StructureViewerModel stateData)
+ {
+ // NOTE: if the jalview project is part of a shared session then
+ // view synchronization should/could be done here.
+
+ final boolean useinViewerSuperpos = stateData.isAlignWithPanel();
+ final boolean usetoColourbyseq = stateData.isColourWithAlignPanel();
+ final boolean viewerColouring = stateData.isColourByViewer();
+ Map<File, StructureData> oldFiles = stateData.getFileData();
+
+ /*
+ * Add mapping for sequences in this view to an already open viewer
+ */
+ final AAStructureBindingModel binding = viewer.getBinding();
+ for (File id : oldFiles.keySet())
+ {
+ // add this and any other pdb files that should be present in the
+ // viewer
+ StructureData filedat = oldFiles.get(id);
+ String pdbFile = filedat.getFilePath();
+ SequenceI[] seq = filedat.getSeqList().toArray(new SequenceI[0]);
+ binding.getSsm().setMapping(seq, null, pdbFile, DataSourceType.FILE,
+ null);
+ binding.addSequenceForStructFile(pdbFile, seq);
+ }
+ // and add the AlignmentPanel's reference to the view panel
+ viewer.addAlignmentPanel(ap);
+ if (useinViewerSuperpos)
+ {
+ viewer.useAlignmentPanelForSuperposition(ap);
+ }
+ else
+ {
+ viewer.excludeAlignmentPanelForSuperposition(ap);
+ }
+ if (usetoColourbyseq)
+ {
+ viewer.useAlignmentPanelForColourbyseq(ap, !viewerColouring);
+ }
+ else
+ {
+ viewer.excludeAlignmentPanelForColourbyseq(ap);
+ }
}
- }
- /**
- * Get all frames within the Desktop.
- *
- * @return
- */
- protected JInternalFrame[] getAllFrames()
- {
- JInternalFrame[] frames = null;
- // TODO is this necessary - is it safe - risk of hanging?
- do
- {
- try
- {
- frames = Desktop.desktop.getAllFrames();
- } catch (ArrayIndexOutOfBoundsException e)
- {
- // occasional No such child exceptions are thrown here...
- try
- {
- Thread.sleep(10);
- } catch (InterruptedException f)
- {
- }
- }
- } while (frames == null);
- return frames;
- }
+ /**
+ * Get all frames within the Desktop.
+ *
+ * @return
+ */
+ protected JInternalFrame[] getAllFrames()
+ {
+ JInternalFrame[] frames = null;
+ // TODO is this necessary - is it safe - risk of hanging?
+ do
+ {
+ try
+ {
+ frames = Desktop.getDesktopPane().getAllFrames();
+ } catch (ArrayIndexOutOfBoundsException e)
+ {
+ // occasional No such child exceptions are thrown here...
+ try
+ {
+ Thread.sleep(10);
+ } catch (InterruptedException f)
+ {
+ }
+ }
+ } while (frames == null);
+ return frames;
+ }
- /**
- * Answers true if 'version' is equal to or later than 'supported', where each
- * is formatted as major/minor versions like "2.8.3" or "2.3.4b1" for bugfix
- * changes. Development and test values for 'version' are leniently treated
- * i.e. answer true.
- *
- * @param supported
- * - minimum version we are comparing against
- * @param version
- * - version of data being processsed
- * @return true if version is equal to or later than supported
- */
- public static boolean isVersionStringLaterThan(String supported,
- String version)
+ /**
+ * Answers true if 'version' is equal to or later than 'supported', where each
+ * is formatted as major/minor versions like "2.8.3" or "2.3.4b1" for bugfix
+ * changes. Development and test values for 'version' are leniently treated
+ * i.e. answer true.
+ *
+ * @param supported
+ * - minimum version we are comparing against
+ * @param version
+ * - version of data being processsed
- * @return
++ * @return true if version is equal to or later than supported
+ */
+ public static boolean isVersionStringLaterThan(String supported,
+ String version)
{
if (supported == null || version == null
|| version.equalsIgnoreCase("DEVELOPMENT BUILD")
viewport.setViewName(view.getViewName());
af.setInitialTabVisible();
}
- af.setBounds(safeInt(view.getXpos()), safeInt(view.getYpos()),
- safeInt(view.getWidth()), safeInt(view.getHeight()));
+ int x = safeInt(view.getXpos());
+ int y = safeInt(view.getYpos());
+ int w = safeInt(view.getWidth());
+ int h = safeInt(view.getHeight());
+ // // BH we cannot let the title bar go off the top
+ // if (Platform.isJS())
+ // {
+ // x = Math.max(50 - w, x);
+ // y = Math.max(0, y);
+ // }
+
+ af.setBounds(x, y, w, h);
+
+ af.alignPanel.fontChanged(); // make sure font is updated *before* we set ID
+ // width
+ if (view.getIdWidth() == null)
+ {
+ if (!isVersionStringLaterThan("2.11.3", jm.getVersion()))
+ {
+ // Pre 2.11.3 jalview projects do not store the id width
+ // idWidth was also calculated in a different way.
+ viewport.setIdWidth(af.alignPanel.getLegacyIdWidth());
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(true);
+ }
+ }
+ else
+ {
+ viewport.setIdWidth(view.getIdWidth());
+ af.alignPanel.getIdPanel().getIdCanvas()
+ .setManuallyAdjusted(view.isIdWidthManuallyAdjusted());
+ }
+
// startSeq set in af.alignPanel.updateLayout below
af.alignPanel.updateLayout();
ColourSchemeI cs = null;
*/
package jalview.renderer;
-import java.awt.BasicStroke;
-import java.awt.Color;
-import java.awt.Font;
-import java.awt.FontMetrics;
-import java.awt.Graphics;
-import java.awt.Graphics2D;
-import java.awt.Image;
-import java.awt.RenderingHints;
-import java.awt.Stroke;
-import java.awt.geom.AffineTransform;
-import java.awt.image.ImageObserver;
-import java.util.BitSet;
-import java.util.Hashtable;
-
+ import org.jfree.graphics2d.svg.SVGGraphics2D;
+ import org.jibble.epsgraphics.EpsGraphics2D;
+
import jalview.analysis.AAFrequency;
import jalview.analysis.CodingUtils;
import jalview.analysis.Rna;
import jalview.datamodel.Annotation;
import jalview.datamodel.ColumnSelection;
import jalview.datamodel.HiddenColumns;
+import jalview.datamodel.HiddenMarkovModel;
import jalview.datamodel.ProfilesI;
+ import jalview.renderer.api.AnnotationRendererFactoryI;
+ import jalview.renderer.api.AnnotationRowRendererI;
import jalview.schemes.ColourSchemeI;
import jalview.schemes.NucleotideColourScheme;
import jalview.schemes.ResidueProperties;
import jalview.schemes.ZappoColourScheme;
import jalview.util.Platform;
+import jalview.workers.InformationThread;
+
+import java.awt.BasicStroke;
+import java.awt.Color;
+import java.awt.Font;
+import java.awt.FontMetrics;
+import java.awt.Graphics;
+import java.awt.Graphics2D;
+import java.awt.Image;
+import java.awt.geom.AffineTransform;
+import java.awt.image.ImageObserver;
++import java.awt.RenderingHints;
++import java.awt.Stroke;
+import java.util.BitSet;
+import java.util.Hashtable;
public class AnnotationRenderer
{
private boolean av_ignoreGapsConsensus;
+ private boolean av_ignoreBelowBackground;
+
+ private boolean renderingVectors = false;
+
+ private boolean glyphLineDrawn = false;
+
/**
* attributes set from AwtRenderPanelI
*/
*/
package jalview.schemes;
- import java.util.Locale;
-
-import java.util.LinkedHashMap;
-import java.util.Locale;
-import java.util.Map;
-
import jalview.api.AlignViewportI;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.datamodel.AnnotatedCollectionI;
import jalview.datamodel.SequenceCollectionI;
import jalview.datamodel.SequenceI;
+import jalview.util.ColorUtils;
-public class ColourSchemes
-{
- /*
- * singleton instance of this class
- */
- private static ColourSchemes instance = new ColourSchemes();
+import java.awt.Color;
+import java.util.LinkedHashMap;
++import java.util.Locale;
+import java.util.Map;
- /*
- * a map from scheme name (lower-cased) to an instance of it
- */
- private Map<String, ColourSchemeI> schemes;
+public class ColourSchemes implements ApplicationSingletonI
+{
/**
* Returns the singleton instance of this class
import java.util.Map;
import java.util.Vector;
+ import jalview.analysis.GeneticCodes;
+
public class ResidueProperties
{
+ // alphabet names used in Hidden Markov Model files
+ public static final String ALPHABET_RNA = "RNA";
+
+ public static final String ALPHABET_DNA = "DNA";
+
+ public static final String ALPHABET_AMINO = "amino";
+
// Stores residue codes/names and colours and other things
public static final int[] aaIndex; // aaHash version 2.1.1 and below
*/
package jalview.structure;
+
import java.util.Locale;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+
+
import jalview.datamodel.PDBEntry;
import jalview.datamodel.PDBEntry.Type;
+ import jalview.util.MessageManager;
/**
* bean holding settings for structure IO. TODO: tests for validation of values
* Determines the parser used for parsing PDB format file. Possible options
* are : JMolParser|JalveiwParser
*/
- private static StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
+ private StructureParser defaultPDBFileParser = StructureParser.JMOL_PARSER;
+ private static TFType temperatureFactorType;
+
public static void addSettings(boolean addAlignmentAnnotations,
boolean processSecStr, boolean externalSecStr)
{
public static boolean isVisibleChainAnnotation()
{
- return visibleChainAnnotation;
+ return getInstance().visibleChainAnnotation;
}
+ public static void setTemperatureFactorType(TFType t)
+ {
+ StructureImportSettings.temperatureFactorType = t;
+ }
+
public static void setVisibleChainAnnotation(
boolean visibleChainAnnotation)
{
import jalview.analysis.AlignSeq;
import jalview.api.StructureSelectionManagerProvider;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
+ import jalview.bin.Cache;
import jalview.bin.Console;
import jalview.commands.CommandI;
import jalview.commands.EditCommand;
*/
package jalview.util;
+import java.util.Objects;
+
+ import java.util.Arrays;
+
public class ArrayUtils
{
/**
}
}
+ /**
+ * Return the index of the first occurrence of the item in the array or -1 if
+ * the array doesn't contain the item.
+ *
+ * @param arr
+ * array to be searched
+ * @param item
+ * item to search for
+ * @return index of the first occurrence of the item or -1 if not found
+ */
+ public static int indexOf(Object[] arr, Object item)
+ {
+ for (int i = 0; i < arr.length; i++)
+ {
+ if (Objects.equals(arr[i], item))
+ return i;
+ }
+ return -1;
+ }
++
+ public static <T> T[] concatArrays(T[]... arrays)
+ {
+ if (arrays == null)
+ return null;
+ if (arrays.length == 1)
+ return arrays[0];
+
+ T[] result = arrays[0];
+ for (int i = 1; i < arrays.length; i++)
+ {
+ result = concatTwoArrays(result, arrays[i]);
+ }
+ return result;
+ }
+
+ private static <T> T[] concatTwoArrays(T[] array1, T[] array2)
+ {
+ T[] result = Arrays.copyOf(array1, array1.length + array2.length);
+ System.arraycopy(array2, 0, result, array1.length, array2.length);
+ return result;
+ }
+
}
colour = colour.trim();
Color col = null;
+
+ if ("random".equals(colour))
+ {
+ return generateRandomColor(null);
+ }
+
- try
- {
- int value = Integer.parseInt(colour, 16);
- col = new Color(value);
- } catch (NumberFormatException ex)
+ if (StringUtils.isHexString(colour))
{
+ try
+ {
+ int value = Integer.parseInt(colour, 16);
+ col = new Color(value);
+ } catch (NumberFormatException ex)
+ {
+ }
}
if (col == null)
import java.io.File;
import java.io.IOException;
+import java.nio.file.DirectoryStream;
import java.nio.file.FileSystems;
+ import java.nio.file.FileVisitOption;
+ import java.nio.file.FileVisitResult;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.nio.file.Paths;
- import java.util.ArrayList;
+ import java.nio.file.SimpleFileVisitor;
+ import java.nio.file.attribute.BasicFileAttributes;
+import java.util.Arrays;
+ import java.util.ArrayList;
+ import java.util.Collections;
+ import java.util.EnumSet;
import java.util.List;
+ import java.util.stream.Collectors;
+
+ import jalview.bin.Console;
+
-public class FileUtils
++
+
+/**
+ * Miscellaneous file-related functions
+ */
+public final class FileUtils
{
+
+ /**
+ * Answers the executable file for the given command, or null if not found or
+ * not executable. The path to the executable is the command name prefixed by
+ * the given folder path, optionally with .exe appended.
+ *
+ * @param cmd
+ * command short name, for example hmmbuild
+ * @param binaryPath
+ * parent folder for the executable
+ * @return
+ */
+ public static File getExecutable(String cmd, String binaryPath)
+ {
+ File file = new File(binaryPath, cmd);
+ if (!file.canExecute())
+ {
+ file = new File(binaryPath, cmd + ".exe");
+ {
+ if (!file.canExecute())
+ {
+ file = null;
+ }
+ }
+ }
+ return file;
+ }
+
+ /**
+ * Answers the path to the folder containing the given executable file, by
+ * searching the PATH environment variable. Answers null if no such executable
+ * can be found.
+ *
+ * @param cmd
+ * @return
+ */
+ public static String getPathTo(String cmd)
+ {
+ String paths = System.getenv("PATH");
+ // backslash is to escape regular expression argument
+ for (String path : paths.split("\\" + File.pathSeparator))
+ {
+ if (getExecutable(cmd, path) != null)
+ {
+ return path;
+ }
+ }
+ return null;
+ }
+
+ /**
+ * A convenience method to create a temporary file that is deleted on exit of
+ * the JVM
+ *
+ * @param prefix
+ * @param suffix
+ * @return
+ * @throws IOException
+ */
+ public static File createTempFile(String prefix, String suffix)
+ throws IOException
+ {
+ File f = File.createTempFile(prefix, suffix);
+ f.deleteOnExit();
+ return f;
+ }
+
+ /**
+ * Answers a (possibly empty) list of file paths found by searching below
+ * <code>from</code> that match the supplied regular expression
+ * <code>pattern</code>. Results may include <code>from</code> itself if it
+ * matches. If an exception occurs it is written to syserr and any results up to
+ * that point are returned. Note that the regular expression match applies to
+ * the whole path of any matched file.
+ * <p>
+ * WARNING: because the whole directory tree below <code>from</code> is
+ * searched, this method may be slow if used for a high level directory, or may
+ * exit prematurely if security or other exceptions occur.
+ *
+ * <pre>
+ * Example:
+ * findMatchingPaths(Paths.get("C:/Program Files"), ".*/chimera.exe$")
+ * </pre>
+ *
+ * @param from
+ * @param pattern
+ *
+ * @return
+ * @see https://stackoverflow.com/questions/794381/how-to-find-files-that-match-a-wildcard-string-in-java/31685610#comment62441832_31685610
+ */
+ public static List<String> findMatchingPaths(Path from, String pattern)
+ {
+ List<String> matches = new ArrayList<>();
+ PathMatcher pathMatcher = FileSystems.getDefault()
+ .getPathMatcher("regex:" + pattern);
+ try
+ {
+ Files.walk(from).filter(pathMatcher::matches)
+ .forEach(m -> matches.add(m.toString()));
+ } catch (IOException e)
+ {
+ System.err.println(
+ "Error searching for " + pattern + " : " + e.toString());
+ }
+
+ return matches;
+ }
+
+ /**
+ * Answers a (possibly empty) list of paths to files below the given root path,
+ * that match the given pattern. The pattern should be a '/' delimited set of
+ * glob patterns, each of which is used to match child file names (not full
+ * paths). Note that 'directory spanning' glob patterns (**) are <em>not</em>
+ * supported by this method.
+ * <p>
+ * For example
+ *
+ * <pre>
+ * findMatches("C:\\", "Program Files*/Chimera*/bin/{chimera,chimera.exe}"
+ * </pre>
+ *
+ * would match "C:\Program Files\Chimera 1.11\bin\chimera.exe" and "C:\Program
+ * Files (x86)\Chimera 1.10.1\bin\chimera"
+ *
+ * @param root
+ * @param pattern
+ * @return
+ * @see https://docs.oracle.com/javase/tutorial/essential/io/fileOps.html#glob
+ */
+ public static List<String> findMatches(String root, String pattern)
+ {
+ List<String> results = new ArrayList<>();
+ try
+ {
+ Path from = Paths.get(root);
+ findMatches(results, from, Arrays.asList(pattern.split("/")));
+ } catch (Throwable e)
+ {
+ // Paths.get can throw IllegalArgumentException
+ System.err.println(String.format("Error searching %s for %s: %s",
+ root, pattern, e.toString()));
+ }
+
+ return results;
+ }
+
+ /**
+ * A helper method that performs recursive search of file patterns and adds any
+ * 'leaf node' matches to the results list
+ *
+ * @param results
+ * @param from
+ * @param patterns
+ */
+ protected static void findMatches(List<String> results, Path from,
+ List<String> patterns)
+ {
+ if (patterns.isEmpty())
+ {
+ /*
+ * reached end of recursion with all components matched
+ */
+ results.add(from.toString());
+ return;
+ }
+
+ String pattern = patterns.get(0);
+ try (DirectoryStream<Path> dirStream = Files.newDirectoryStream(from,
+ pattern))
+ {
+ dirStream.forEach(p -> {
+
+ /*
+ * matched a next level file - search below it
+ * (ignore non-directory non-leaf matches)
+ */
+ List<String> subList = patterns.subList(1, patterns.size());
+ if (subList.isEmpty() || p.toFile().isDirectory())
+ {
+ findMatches(results, p, subList);
+ }
+ });
+ } catch (IOException e)
+ {
+ System.err.println(String.format("Error searching %s: %s", pattern,
+ e.toString()));
+ }
+ }
++
+ /*
+ * Given string glob pattern (see
+ * https://docs.oracle.com/javase/7/docs/api/java/nio/file/FileSystem.html#getPathMatcher(java.lang.String)
+ * ) return a List of Files that match the pattern.
+ * Note this is a java style glob, not necessarily a bash-style glob, though there are sufficient similarities.
+ */
+ public static List<File> getFilesFromGlob(String pattern)
+ {
+ return getFilesFromGlob(pattern, true);
+ }
+
+ public static List<File> getFilesFromGlob(String pattern,
+ boolean allowSingleFilenameThatDoesNotExist)
+ {
+ pattern = substituteHomeDir(pattern);
+ String relativePattern = pattern.startsWith(File.separator) ? null
+ : pattern;
+ List<File> files = new ArrayList<>();
+ /*
+ * For efficiency of the Files.walkFileTree(), let's find the longest path that doesn't need globbing.
+ * We look for the first glob character * { ? and then look for the last File.separator before that.
+ * Then we can reset the path to look at and shorten the globbing pattern.
+ * Relative paths can be used in pattern, which work from the pwd (though these are converted into
+ * full paths in the match).
+ */
+ int firstGlobChar = -1;
+ boolean foundGlobChar = false;
+ for (char c : new char[] { '*', '{', '?' })
+ {
+ if (pattern.indexOf(c) > -1
+ && (pattern.indexOf(c) < firstGlobChar || !foundGlobChar))
+ {
+ firstGlobChar = pattern.indexOf(c);
+ foundGlobChar = true;
+ }
+ }
+ int lastFS = pattern.lastIndexOf(File.separatorChar, firstGlobChar);
+ if (foundGlobChar)
+ {
+ String pS = pattern.substring(0, lastFS + 1);
+ String rest = pattern.substring(lastFS + 1);
+ if ("".equals(pS))
+ {
+ pS = ".";
+ }
+ Path parentDir = Paths.get(pS);
+ if (parentDir.toFile().exists())
+ {
+ try
+ {
+ String glob = "glob:" + parentDir.toString() + File.separator
+ + rest;
+ PathMatcher pm = FileSystems.getDefault().getPathMatcher(glob);
+ int maxDepth = rest.contains("**") ? 1028
+ : (int) (rest.chars()
+ .filter(ch -> ch == File.separatorChar).count())
+ + 1;
+
+ Files.walkFileTree(parentDir,
+ EnumSet.of(FileVisitOption.FOLLOW_LINKS), maxDepth,
+ new SimpleFileVisitor<Path>()
+ {
+ @Override
+ public FileVisitResult visitFile(Path path,
+ BasicFileAttributes attrs) throws IOException
+ {
+ if (pm.matches(path))
+ {
+ files.add(path.toFile());
+ }
+ return FileVisitResult.CONTINUE;
+ }
+
+ @Override
+ public FileVisitResult visitFileFailed(Path file,
+ IOException exc) throws IOException
+ {
+ return FileVisitResult.CONTINUE;
+ }
+ });
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
+ else
+ {
+ // no wildcards
+ File f = new File(pattern);
+ if (allowSingleFilenameThatDoesNotExist || f.exists())
+ {
+ files.add(f);
+ }
+ }
+ Collections.sort(files);
+
+ return files;
+ }
+
+ public static List<String> getFilenamesFromGlob(String pattern)
+ {
+ // convert list of Files to list of File.getPath() Strings
+ return getFilesFromGlob(pattern).stream().map(f -> f.getPath())
+ .collect(Collectors.toList());
+ }
+
+ public static String substituteHomeDir(String path)
+ {
+ return path.startsWith("~" + File.separator)
+ ? System.getProperty("user.home") + path.substring(1)
+ : path;
+ }
+
+ /*
+ * This method returns the basename of File file
+ */
+ public static String getBasename(File file)
+ {
+ return getBasenameOrExtension(file, false);
+ }
+
+ /*
+ * This method returns the extension of File file.
+ */
+ public static String getExtension(File file)
+ {
+ return getBasenameOrExtension(file, true);
+ }
+
+ public static String getBasenameOrExtension(File file, boolean extension)
+ {
+ if (file == null)
+ return null;
+
+ String value = null;
+ String filename = file.getName();
+ int lastDot = filename.lastIndexOf('.');
+ if (lastDot > 0) // don't truncate if starts with '.'
+ {
+ value = extension ? filename.substring(lastDot + 1)
+ : filename.substring(0, lastDot);
+ }
+ else
+ {
+ value = extension ? "" : filename;
+ }
+ return value;
+ }
+
+ /*
+ * This method returns the dirname of the first --append or --open value.
+ * Used primarily for substitutions in output filenames.
+ */
+ public static String getDirname(File file)
+ {
+ if (file == null)
+ return null;
+
+ String dirname = null;
+ File p = file.getParentFile();
+ if (p == null)
+ {
+ p = new File(".");
+ }
+ File d = new File(substituteHomeDir(p.getPath()));
+ dirname = d.getPath();
+ return dirname;
+ }
+
+ public static String convertWildcardsToPath(String value, String wildcard,
+ String dirname, String basename)
+ {
+ if (value == null)
+ {
+ return null;
+ }
+ StringBuilder path = new StringBuilder();
+ int lastFileSeparatorIndex = value.lastIndexOf(File.separatorChar);
+ int wildcardBeforeIndex = value.indexOf(wildcard);
+ if (lastFileSeparatorIndex > wildcard.length() - 1
+ && wildcardBeforeIndex < lastFileSeparatorIndex)
+ {
+ path.append(value.substring(0, wildcardBeforeIndex));
+ path.append(dirname);
+ path.append(value.substring(wildcardBeforeIndex + wildcard.length(),
+ lastFileSeparatorIndex + 1));
+ }
+ else
+ {
+ path.append(value.substring(0, lastFileSeparatorIndex + 1));
+ }
+ int wildcardAfterIndex = value.indexOf(wildcard,
+ lastFileSeparatorIndex);
+ if (wildcardAfterIndex > lastFileSeparatorIndex)
+ {
+ path.append(value.substring(lastFileSeparatorIndex + 1,
+ wildcardAfterIndex));
+ path.append(basename);
+ path.append(value.substring(wildcardAfterIndex + wildcard.length()));
+ }
+ else
+ {
+ path.append(value.substring(lastFileSeparatorIndex + 1));
+ }
+ return path.toString();
+ }
+
+ public static File getParentDir(File file)
+ {
+ if (file == null)
+ {
+ return null;
+ }
+ File parentDir = file.getAbsoluteFile().getParentFile();
+ return parentDir;
+ }
+
+ public static boolean checkParentDir(File file, boolean mkdirs)
+ {
+ if (file == null)
+ {
+ return false;
+ }
+ File parentDir = getParentDir(file);
+ if (parentDir.exists())
+ {
+ // already exists, nothing to do so nothing to worry about!
+ return true;
+ }
+
+ if (!mkdirs)
+ {
+ return false;
+ }
+
+ Path path = file.toPath();
+ for (int i = 0; i < path.getNameCount(); i++)
+ {
+ Path p = path.getName(i);
+ if ("..".equals(p.toString()))
+ {
+ Console.warn("Cautiously not running mkdirs on " + file.toString()
+ + " because the path to be made contains '..'");
+ return false;
+ }
+ }
+
+ return parentDir.mkdirs();
+ }
}
* @throws IOException
* @throws ProtocolException
*/
- public static boolean checkUrlAvailable(URL url, int readTimeout)
- throws IOException, ProtocolException
+ public static boolean checkUrlAvailable(URL url,
+ int readTimeout) throws IOException, ProtocolException
{
- // System.out.println(System.currentTimeMillis() + " " + url);
+ // jalview.bin.Console.outPrintln(System.currentTimeMillis() + " " + url);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
return connection.getResponseCode() == 200;
}
+ /**
+ * download from given URL and return a pointer to temporary file
+ */
+ public static File fetchURLToTemp(String url) throws OutOfMemoryError,
+ IOException
+ {
+ long time = System.currentTimeMillis();
+ URL rcall = new URL(url);
+
+ InputStream is = new BufferedInputStream(rcall.openStream());
+ File outFile = null;
+ try
+ {
+ outFile = File.createTempFile("jalview", ".xml");
+ outFile.deleteOnExit();
+ if (outFile.length() == 0)
+ {
+ outFile.delete();
+ return null;
+ }
+ } catch (Exception ex)
+ {
+ }
+
+ if (outFile != null)
+ {
+ FileOutputStream fio = new FileOutputStream(outFile);
+ byte[] bb = new byte[32 * 1024];
+ int l;
+ while ((l = is.read(bb)) > 0)
+ {
+ fio.write(bb, 0, l);
+ }
+ fio.close();
+ is.close();
+ return outFile;
+ }
+ else
+ {
+ return null;
+ }
+ }
+ public static String getUserAgent()
+ {
+ return getUserAgent(null);
+ }
+
+ public static String getUserAgent(String className)
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append("Jalview");
+ sb.append('/');
+ sb.append(Cache.getDefault("VERSION", "Unknown"));
+ sb.append(" (");
+ sb.append(System.getProperty("os.name"));
+ sb.append("; ");
+ sb.append(System.getProperty("os.arch"));
+ sb.append(' ');
+ sb.append(System.getProperty("os.name"));
+ sb.append(' ');
+ sb.append(System.getProperty("os.version"));
+ sb.append("; ");
+ sb.append("java/");
+ sb.append(System.getProperty("java.version"));
+ sb.append("; ");
+ sb.append("jalview/");
+ sb.append(ChannelProperties.getProperty("channel"));
+ if (className != null)
+ {
+ sb.append("; ");
+ sb.append(className);
+ }
- String installation = Cache.applicationProperties
- .getProperty("INSTALLATION");
++ String installation = Cache.getProperty("INSTALLATION");
+ if (installation != null)
+ {
+ sb.append("; ");
+ sb.append(installation);
+ }
+ sb.append(')');
+ sb.append(" help@jalview.org");
+ return sb.toString();
+ }
+
}
loc = Locale.getDefault();
// Locale.setDefault(loc);
/* Getting messages for GV */
- log.info("Getting messages for lang: " + loc);
+ Console.info("Getting messages for lang: " + loc);
Control control = Control.getControl(Control.FORMAT_PROPERTIES);
- rb = ResourceBundle.getBundle("lang.Messages", loc, control);
+ rb = ResourceBundle.getBundle("lang.Messages", Platform.getLocaleOrNone(loc), control);
// if (log.isLoggable(Level.FINEST))
// {
// // this might take a while, so we only do it if it will be shown
*/
package jalview.util;
+import java.awt.Component;
+import java.awt.Dimension;
+import java.awt.GraphicsEnvironment;
-
import java.awt.Toolkit;
+import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;
import java.io.BufferedReader;
import java.io.File;
private static Boolean isHeadless = null;
+ // If launched from CLI with launcher script then -DCOLUMNWIDTH is set
+ private static final int CONSOLEWIDTH;
+
+ private static final String CONSOLEWIDTHPROPERTY = "CONSOLEWIDTH";
+
+ static
+ {
+ int cw = 80;
+ if (System.getProperty(CONSOLEWIDTHPROPERTY) != null
+ && System.getProperty(CONSOLEWIDTHPROPERTY).length() > 0)
+ {
+ try
+ {
+ cw = Integer.parseInt(System.getProperty(CONSOLEWIDTHPROPERTY));
+ } catch (NumberFormatException e)
+ {
+ }
+ }
+ CONSOLEWIDTH = cw;
+ }
+
+ private static swingjs.api.JSUtilI jsutil;
+
+ static
+ {
+ if (isJS)
+ {
+ try
+ {
+ // this is ok - it's a highly embedded method in Java; the deprecation
+ // is
+ // really a recommended best practice.
+ jsutil = ((JSUtilI) Class.forName("swingjs.JSUtil").newInstance());
+ } catch (InstantiationException | IllegalAccessException
+ | ClassNotFoundException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ }
/**
* added to group mouse events into Windows and nonWindows (mac, unix, linux)
*
{
case TIME_RESET:
time = mark = t;
+ duration = 0;
if (msg != null)
{
- System.err.println("Platform: timer reset\t\t\t" + msg);
+ jalview.bin.Console.errPrintln("Platform: timer reset\t\t\t" + msg);
}
break;
case TIME_MARK:
*/
public static void readInfoProperties(String prefix, Properties p)
{
- if (!isJS())
+ if (isJS)
{
- return;
- }
- String id = getUniqueAppletID();
- String key = "", value = "";
- /**
- * @j2sNative var info = swingjs.JSUtil.getApplet$().__Info || {}; for (var
- * key in info) { if (key.indexOf(prefix) == 0) { value = "" +
- * info[key];
- */
+ String id = getUniqueAppletID();
- jalview.bin.Console.outPrintln(
- "Platform id=" + id + " reading Info." + key + " = " + value);
- p.put(id + "_" + key, value);
+ String key = "";
+ String value = "";
+ @SuppressWarnings("unused")
+ Object info = jsutil.getAppletAttribute("__Info");
+ /**
+ * @j2sNative for (key in info) { value = info[key];
+ */
+ if (key.indexOf(prefix) == 0)
+ {
- System.out.println("Platform id=" + id + " reading Info." + key
++ jalview.bin.Console.outPrintln("Platform id=" + id + " reading Info." + key
+ + " = " + value);
+ p.put(key, value);
-
+ }
-
- /**
- * @j2sNative }
- */
- }
+ /**
- * @j2sNative
- *
- *
- * } }
++ * @j2sNative }
+ */
++ }
}
public static void setAjaxJSON(URL url)
public static void addJ2SDirectDatabaseCall(String domain)
{
- if (isJS())
+ if (isJS)
{
+ jsutil.addDirectDatabaseCall(domain);
- System.out.println(
+ jalview.bin.Console.outPrintln(
- "Platform adding known access-control-allow-origin * for domain "
- + domain);
+ "Platform adding known access-control-allow-origin * for domain "
+ + domain);
/**
* @j2sNative
*
* Retrieve the first query field as command arguments to Jalview. Include
* only if prior to "?j2s" or "&j2s" or "#". Assign the applet's
* __Info.args element to this value.
-- *
++ * // NB. we use systen.out.println here - should it be console.ouprintln ? (from 2.11 ?)
* @j2sNative var a =
* decodeURI((document.location.href.replace("&","?").split("?j2s")[0]
- * + "?").split("?")[1].split("#")[0]); a &&
- * (jalview.bin.Console.outPrintln("URL arguments detected were
- * "+a)) && (J2S.thisApplet.__Info.urlargs = a.split(" "));
- * (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args
- * == "" || J2S.thisApplet.__Info.args == "??") &&
- * (J2S.thisApplet.__Info.args = a) &&
- * (jalview.bin.Console.outPrintln("URL arguments were passed
- * to J2S main."));
+ * + "?").split("?")[1].split("#")[0]); a && (System.out.println("URL arguments detected were "+a)) &&
+ * (J2S.thisApplet.__Info.urlargs = a.split(" "));
+ * (!J2S.thisApplet.__Info.args || J2S.thisApplet.__Info.args == "" || J2S.thisApplet.__Info.args == "??") && (J2S.thisApplet.__Info.args = a) && (System.out.println("URL arguments were passed to J2S main."));
*/
} catch (Throwable t)
{
String p2 = path2.replace('\\', '/');
return p1.equals(p2);
}
+ ///////////// JAL-3253 Applet additions //////////////
+
+ /**
+ * Retrieve the object's embedded size from a div's style on a page if
+ * embedded in SwingJS.
+ *
+ * @param frame
+ * JFrame or JInternalFrame
+ * @param defaultWidth
+ * use -1 to return null (no default size)
+ * @param defaultHeight
+ * @return the embedded dimensions or null (no default size or not embedded)
+ */
+ public static Dimension getDimIfEmbedded(Component frame,
+ int defaultWidth, int defaultHeight)
+ {
+ Dimension d = null;
+ if (isJS)
+ {
+ d = (Dimension) getEmbeddedAttribute(frame, "dim");
+ }
+ return (d == null && defaultWidth >= 0
+ ? new Dimension(defaultWidth, defaultHeight)
+ : d);
+
+ }
+
+ public static Regex newRegex(String regex)
+ {
+ return newRegex(regex, null);
+ }
+
+ public static Regex newRegex(String searchString, String replaceString)
+ {
+ ensureRegex();
+ return (replaceString == null ? new Regex(searchString)
+ : new Regex(searchString, replaceString));
+ }
+
+ public static Regex newRegexPerl(String code)
+ {
+ ensureRegex();
+ return Regex.perlCode(code);
+ }
+
+ /**
+ * Initialize Java debug logging. A representative sample -- adapt as desired.
+ */
+ public static void startJavaLogging()
+ {
+ /**
+ * @j2sIgnore
+ */
+ {
+ logClass("java.awt.EventDispatchThread", "java.awt.EventQueue",
+ "java.awt.Component", "java.awt.focus.Component",
+ "java.awt.event.Component",
+ "java.awt.focus.DefaultKeyboardFocusManager");
+ }
+ }
+
+ /**
+ * Initiate Java logging for a given class. Only for Java, not JavaScript;
+ * Allows debugging of complex event processing.
+ *
+ * @param className
+ */
+ public static void logClass(String... classNames)
+ {
+ /**
+ * @j2sIgnore
+ *
+ *
+ */
+ {
+ Logger rootLogger = Logger.getLogger("");
+ rootLogger.setLevel(Level.ALL);
+ ConsoleHandler consoleHandler = new ConsoleHandler();
+ consoleHandler.setLevel(Level.ALL);
+ for (int i = classNames.length; --i >= 0;)
+ {
+ Logger logger = Logger.getLogger(classNames[i]);
+ logger.setLevel(Level.ALL);
+ logger.addHandler(consoleHandler);
+ }
+ }
+ }
+
+ /**
+ * load a resource -- probably a core file -- if and only if a particular
+ * class has not been instantialized. We use a String here because if we used
+ * a .class object, that reference itself would simply load the class, and we
+ * want the core package to include that as well.
+ *
+ * @param resourcePath
+ * @param className
+ */
+ public static void loadStaticResource(String resourcePath,
+ String className)
+ {
+ if (isJS)
+ {
+ jsutil.loadResourceIfClassUnknown(resourcePath, className);
+ }
+ }
+
+ public static void ensureRegex()
+ {
+ if (isJS)
+ {
+ loadStaticResource("core/core_stevesoft.z.js",
+ "com.stevesoft.pat.Regex");
+ }
+ }
+
+ /**
+ * Set the "app" property of the HTML5 applet object, for example,
+ * "testApplet.app", to point to the Jalview instance. This will be the object
+ * that page developers use that is similar to the original Java applet object
+ * that was accessed via LiveConnect.
+ *
+ * @param j
+ */
+ public static void setAppClass(Object j)
+ {
+ if (isJS)
+ {
+ jsutil.setAppClass(j);
+ }
+ }
+
+ /**
+ *
+ * If this frame is embedded in a web page, return a known type.
+ *
+ * @param frame
+ * a JFrame or JInternalFrame
+ * @param type
+ * "name", "node", "init", "dim", or any DOM attribute, such as "id"
+ * @return null if frame is not embedded.
+ */
+ public static Object getEmbeddedAttribute(Component frame, String type)
+ {
+ return (isJS ? jsutil.getEmbeddedAttribute(frame, type) : null);
+ }
+
+ public static void stackTrace()
+ {
+ try
+ {
+ throw new NullPointerException();
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ }
+
+ }
+
+ public static URL getDocumentBase()
+ {
+ return (isJS ? jsutil.getDocumentBase() : null);
+ }
+
+ public static URL getCodeBase()
+ {
+ return (isJS ? jsutil.getCodeBase() : null);
+ }
+
+ public static String getUserPath(String subpath)
+ {
+ char sep = File.separatorChar;
+ return System.getProperty("user.home") + sep
+ + subpath.replace('/', sep);
+ }
+
+ /**
+ * This method enables checking if a cached file has exceeded a certain
+ * threshold(in days)
+ *
+ * @param file
+ * the cached file
+ * @param noOfDays
+ * the threshold in days
+ * @return
+ */
+ public static boolean isFileOlderThanThreshold(File file, int noOfDays)
+ {
+ if (isJS())
+ {
+ // not meaningful in SwingJS -- this is a session-specific temp file. It
+ // doesn't have a timestamp.
+ return false;
+ }
+ Path filePath = file.toPath();
+ BasicFileAttributes attr;
+ int diffInDays = 0;
+ try
+ {
+ attr = Files.readAttributes(filePath, BasicFileAttributes.class);
+ diffInDays = (int) ((new Date().getTime()
+ - attr.lastModifiedTime().toMillis())
+ / (1000 * 60 * 60 * 24));
+ // System.out.println("Diff in days : " + diffInDays);
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return noOfDays <= diffInDays;
+ }
+
+ /**
+ * Get the leading integer part of a string that begins with an integer.
+ *
+ * @param input
+ * - the string input to process
+ * @param failValue
+ * - value returned if unsuccessful
+ * @return
+ */
+ public static int getLeadingIntegerValue(String input, int failValue)
+ {
+ if (input == null)
+ {
+ return failValue;
+ }
+ if (isJS)
+ {
+ int val = /** @j2sNative 1 ? parseInt(input) : */
+ 0;
+ return (val == val + 0 ? val : failValue);
+ }
+ // JavaScript does not support Regex ? lookahead
+ String[] parts = input.split("(?=\\D)(?<=\\d)");
+ if (parts != null && parts.length > 0 && parts[0].matches("[0-9]+"))
+ {
+ return Integer.valueOf(parts[0]);
+ }
+ return failValue;
+ }
+
+ public static Map<String, Object> getAppletInfoAsMap()
+ {
+ return (isJS ? jsutil.getAppletInfoAsMap() : null);
+ }
+
+ /**
+ * Get the SwingJS applet ID and combine that with the frameType
+ *
+ * @param frameType
+ * "alignment", "desktop", etc., or null
+ * @return
+ */
+ public static String getAppID(String frameType)
+ {
+
+ String id = Jalview.getInstance().j2sAppletID;
+ if (id == null)
+ {
+ Jalview.getInstance().j2sAppletID = id = (isJS
+ ? (String) jsutil.getAppletAttribute("_id")
+ : "jalview");
+ }
+ return id + (frameType == null ? "" : "-" + frameType);
+ }
+
+ /**
+ * Option to avoid unnecessary seeking of nonexistent resources in JavaScript.
+ * Works in Java as well.
+ *
+ * @param loc
+ * @return
+ */
+ public static Locale getLocaleOrNone(Locale loc)
+ {
+ return (isJS && loc.getLanguage() == "en" ? new Locale("") : loc);
+ }
+
+ /**
+ * From UrlDownloadClient; trivial in JavaScript; painful in Java.
+ *
+ * @param urlstring
+ * @param outfile
+ * @throws IOException
+ */
+ public static void download(String urlstring, String outfile)
+ throws IOException
+ {
+ Path temp = null;
+ try (InputStream is = new URL(urlstring).openStream())
+ {
+ if (isJS)
+ { // so much easier!
+ streamToFile(is, new File(outfile));
+ return;
+ }
+ temp = Files.createTempFile(".jalview_", ".tmp");
+ try (FileOutputStream fos = new FileOutputStream(temp.toString());
+ ReadableByteChannel rbc = Channels.newChannel(is))
+ {
+ fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
+ // copy tempfile to outfile once our download completes
+ // incase something goes wrong
+ Files.copy(temp, Paths.get(outfile),
+ StandardCopyOption.REPLACE_EXISTING);
+ }
+ } catch (IOException e)
+ {
+ throw e;
+ } finally
+ {
+ try
+ {
+ if (temp != null)
+ {
+ Files.deleteIfExists(temp);
+ }
+ } catch (IOException e)
+ {
+ System.out.println("Exception while deleting download temp file: "
+ + e.getMessage());
+ }
+ }
+ }
+
+ /**
+ * If started on command line using launch script, return the console width
+ */
+ public static int consoleWidth()
+ {
+ return CONSOLEWIDTH;
+ }
}
{
return false;
}
- if (calculator.workingInvolvedWith(alignmentAnnotation))
+ if (calculator.isWorkingWithAnnotation(alignmentAnnotation))
{
- // System.err.println("grey out ("+alignmentAnnotation.label+")");
+ // jalview.bin.Console.errPrintln("grey out
+ // ("+alignmentAnnotation.label+")");
return true;
}
return false;
return (alignment.getHiddenColumns().getVisContigsIterator(start, end,
false));
}
+ /**
+ * Filters out sequences with an eValue higher than the specified value. The
+ * filtered sequences are hidden or deleted. Sequences with no eValues are also
+ * filtered out.
+ *
+ * @param eValue
+ * @param delete
+ */
+ public void filterByEvalue(double eValue)
+ {
+ for (SequenceI seq : alignment.getSequencesArray())
+ {
+ if ((seq.getAnnotation("Search Scores") == null
+ || seq.getAnnotation("Search Scores")[0].getEValue() > eValue)
+ && seq.getHMM() == null)
+ {
+ hideSequence(new SequenceI[] { seq });
+ }
+ }
+ }
+
+ /**
+ * Filters out sequences with an score lower than the specified value. The
+ * filtered sequences are hidden or deleted.
+ *
+ * @param score
+ * @param delete
+ */
+ public void filterByScore(double score)
+ {
+ for (SequenceI seq : alignment.getSequencesArray())
+ {
+ if ((seq.getAnnotation("Search Scores") == null
+ || seq.getAnnotation("Search Scores")[0]
+ .getBitScore() < score)
+ && seq.getHMM() == null)
+ {
+ hideSequence(new SequenceI[] { seq });
+ }
+ }
+ }
+
+ /**
+ * Notify TreePanel and AlignmentPanel of some sort of alignment change.
+ */
+ public void notifyAlignment()
+ {
+ changeSupport.firePropertyChange(PROPERTY_ALIGNMENT, null, alignment.getSequences());
+ }
+
+ /**
+ * Notify AlignmentPanel of a sequence column selection or visibility changes.
+ */
+ public void notifySequence()
+ {
+ changeSupport.firePropertyChange(PROPERTY_SEQUENCE, null, null);
+ }
+
+ public void setSavedUpToDate(boolean s)
+ {
+ setSavedUpToDate(s, QuitHandler.Message.UNSAVED_CHANGES);
+ }
+
+ public void setSavedUpToDate(boolean s, QuitHandler.Message m)
+ {
+ Console.debug(
+ "Setting " + this.getViewId() + " setSavedUpToDate to " + s);
+ savedUpToDate = s;
+ QuitHandler.setMessage(m);
+ }
+
+ public boolean savedUpToDate()
+ {
+ Console.debug("Returning " + this.getViewId() + " savedUpToDate value: "
+ + savedUpToDate);
+ return savedUpToDate;
+ }
}
{
return;
}
- calcMan.notifyStart(this);
- // long started = System.currentTimeMillis();
- try
+ if (alignViewport.isClosed())
{
- AlignmentAnnotation consensus = getConsensusAnnotation();
- AlignmentAnnotation gap = getGapAnnotation();
- if ((consensus == null && gap == null) || calcMan.isPending(this))
- {
- calcMan.workerComplete(this);
- return;
- }
- while (!calcMan.notifyWorking(this))
- {
- // jalview.bin.Console.errPrintln("Thread
- // (Consensus"+Thread.currentThread().getName()+") Waiting around.");
- try
- {
- if (ap != null)
- {
- ap.paintAlignment(false, false);
- }
- Thread.sleep(200);
- } catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
- if (alignViewport.isClosed())
- {
- abortAndDestroy();
- return;
- }
- AlignmentI alignment = alignViewport.getAlignment();
+ abortAndDestroy();
+ return;
+ }
+ AlignmentI alignment = alignViewport.getAlignment();
- int aWidth = -1;
+ int aWidth = -1;
- if (alignment == null || (aWidth = alignment.getWidth()) < 0)
- {
- calcMan.workerComplete(this);
- return;
- }
+ if (alignment == null || (aWidth = alignment.getWidth()) < 0)
+ {
+ return;
+ }
++ try
++ {
- eraseConsensus(aWidth);
- computeConsensus(alignment);
- updateResultAnnotation(true);
+ eraseConsensus(aWidth);
+ computeConsensus(alignment);
+ updateResultAnnotation(true);
-
- if (ap != null)
- {
- ap.paintAlignment(true, true);
- }
+ } catch (OutOfMemoryError error)
+ {
- calcMan.disableWorker(this);
+ ap.raiseOOMWarning("calculating consensus", error);
- } finally
++ }
+
+ if (ap != null)
{
- /*
- * e.g. ArrayIndexOutOfBoundsException can happen due to a race condition
- * - alignment was edited at same time as calculation was running
- */
- calcMan.workerComplete(this);
+ ap.paintAlignment(true, true);
}
}
*/
package jalview.ws;
+import jalview.bin.ApplicationSingletonProvider;
+import jalview.bin.ApplicationSingletonProvider.ApplicationSingletonI;
import jalview.ext.ensembl.EnsemblGene;
+ import jalview.ws.dbsources.EBIAlfaFold;
import jalview.ws.dbsources.EmblCdsSource;
import jalview.ws.dbsources.EmblSource;
import jalview.ws.dbsources.Pdb;
}
/**
+ * get an alphafold pAE for the given id and return the File object of the
+ * downloaded (temp) file
+ *
+ * @param id
+ * @param pdbAlignment
+ * @param retrievalUrl
+ * - URL of .mmcif from EBI-AlphaFold - will be used to generate the
+ * pAE URL automatically
+ * @throws IOException
+ * @throws Exception
+ */
+ public static File fetchAlphaFoldPAE(String id, String retrievalUrl)
+ throws IOException
+ {
+ // import PAE as contact matrix - assume this will work if there was a
+ // model
+ String paeURL = getAlphaFoldPaeDownloadUrl(id, AF_VERSION);
+
+ if (retrievalUrl != null)
+ {
+ // manufacture the PAE url from a url like ...-model-vN.cif
+ paeURL = retrievalUrl.replace("model", "predicted_aligned_error")
+ .replace(".cif", ".json");
+ }
+
+ // check the cache
+ File pae = paeDownloadCache.get(paeURL);
+ if (pae != null && pae.exists() && (new Date().getTime()
+ - pae.lastModified()) < PAE_CACHE_STALE_TIME)
+ {
+ Console.debug(
+ "Using existing file in PAE cache for '" + paeURL + "'");
+ return pae;
+ }
+
+ try
+ {
+ pae = File.createTempFile(id == null ? "af_pae" : id, "pae_json");
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ Console.debug("Downloading pae from " + paeURL + " to " + pae.toString()
+ + "");
+ try
+ {
+ UrlDownloadClient.download(paeURL, pae);
+ } catch (IOException e)
+ {
+ throw e;
+ }
+ // cache and it if successful
+ paeDownloadCache.put(paeURL, pae);
+ return pae;
+ }
+
+ /**
+ * get an alphafold pAE for the given id, and add it to sequence 0 in
+ * pdbAlignment (assuming it came from structurefile parser).
+ *
+ * @param id
+ * @param pdbAlignment
+ * @param retrievalUrl
+ * - URL of .mmcif from EBI-AlphaFold - will be used to generate the
+ * pAE URL automatically
+ * @throws IOException
+ * @throws Exception
+ */
+ public static void retrieve_AlphaFold_pAE(String id,
+ AlignmentI pdbAlignment, String retrievalUrl) throws IOException
+ {
+ File pae = fetchAlphaFoldPAE(id, retrievalUrl);
+ addAlphaFoldPAE(pdbAlignment, pae, 0, null, false, false, null);
+ }
+
+ public static void addAlphaFoldPAE(AlignmentI pdbAlignment, File pae,
+ int index, String id, boolean isStruct, boolean isStructId,
+ String label)
+ {
+ FileInputStream paeInput = null;
+ try
+ {
+ paeInput = new FileInputStream(pae);
+ } catch (FileNotFoundException e)
+ {
+ Console.error(
+ "Could not find pAE file '" + pae.getAbsolutePath() + "'", e);
+ return;
+ }
+
+ if (isStruct)
+ {
+ // ###### WRITE A TEST for this bit of the logic addAlphaFoldPAE with
+ // different params.
+ StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
++ .getStructureSelectionManager(Desktop.getInstance());
+ if (ssm != null)
+ {
+ String structFilename = isStructId ? ssm.findFileForPDBId(id) : id;
+ addPAEToStructure(ssm, structFilename, pae, label);
+ }
+
+ }
+ else
+ {
+ // attach to sequence?!
+ try
+ {
+ if (!importPaeJSONAsContactMatrixToSequence(pdbAlignment, paeInput,
+ index, id, label))
+ {
+ Console.warn("Could not import contact matrix from '"
+ + pae.getAbsolutePath() + "' to sequence.");
+ }
+ } catch (IOException e1)
+ {
+ Console.error("Error when importing pAE file '"
+ + pae.getAbsolutePath() + "'", e1);
+ } catch (ParseException e2)
+ {
+ Console.error("Error when parsing pAE file '"
+ + pae.getAbsolutePath() + "'", e2);
+ }
+ }
+
+ }
+
+ public static void addPAEToStructure(StructureSelectionManager ssm,
+ String structFilename, File pae, String label)
+ {
+ FileInputStream paeInput = null;
+ try
+ {
+ paeInput = new FileInputStream(pae);
+ } catch (FileNotFoundException e)
+ {
+ Console.error(
+ "Could not find pAE file '" + pae.getAbsolutePath() + "'", e);
+ return;
+ }
+ if (ssm == null)
+ {
+ ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
++ .getStructureSelectionManager(Desktop.getInstance());
+ }
+ if (ssm != null)
+ {
+ StructureMapping[] smArray = ssm.getMapping(structFilename);
+
+ try
+ {
+ if (!importPaeJSONAsContactMatrixToStructure(smArray, paeInput,
+ label))
+ {
+ Console.warn("Could not import contact matrix from '"
+ + pae.getAbsolutePath() + "' to structure.");
+ }
+ } catch (IOException e1)
+ {
+ Console.error("Error when importing pAE file '"
+ + pae.getAbsolutePath() + "'", e1);
+ } catch (ParseException e2)
+ {
+ Console.error("Error when parsing pAE file '"
+ + pae.getAbsolutePath() + "'", e2);
+ }
+ }
+ }
+
+ /**
+ * parses the given pAE matrix and adds it to sequence 0 in the given
+ * alignment
+ *
+ * @param pdbAlignment
+ * @param pae_input
+ * @return true if there was a pAE matrix added
+ * @throws ParseException
+ * @throws IOException
+ * @throws Exception
+ */
+ public static boolean importPaeJSONAsContactMatrixToSequence(
+ AlignmentI pdbAlignment, InputStream pae_input, int index,
+ String seqId, String label) throws IOException, ParseException
+ {
+ SequenceI sequence = null;
+ if (seqId == null)
+ {
+ int seqToGet = index > 0 ? index : 0;
+ sequence = pdbAlignment.getSequenceAt(seqToGet);
+ }
+ if (sequence == null)
+ {
+ SequenceI[] sequences = pdbAlignment.findSequenceMatch(seqId);
+ if (sequences == null || sequences.length < 1)
+ {
+ Console.warn("Could not find sequence with id '" + seqId
+ + "' to attach pAE matrix to. Ignoring matrix.");
+ return false;
+ }
+ else
+ {
+ sequence = sequences[0]; // just use the first sequence with this seqId
+ }
+ }
+ if (sequence == null)
+ {
+ return false;
+ }
+ return importPaeJSONAsContactMatrixToSequence(pdbAlignment, pae_input,
+ sequence, label);
+ }
+
+ public static boolean importPaeJSONAsContactMatrixToSequence(
+ AlignmentI pdbAlignment, InputStream pae_input,
+ SequenceI sequence, String label)
+ throws IOException, ParseException
+ {
+ JSONObject paeDict = parseJSONtoPAEContactMatrix(pae_input);
+ if (paeDict == null)
+ {
+ Console.debug("JSON file did not parse properly.");
+ return false;
+ }
+ ContactMatrixI matrix = new PAEContactMatrix(sequence,
+ (Map<String, Object>) paeDict);
+
+ AlignmentAnnotation cmannot = sequence.addContactList(matrix);
+ if (label != null)
+ cmannot.label = label;
+ pdbAlignment.addAnnotation(cmannot);
+
+ return true;
+ }
+
+ public static JSONObject parseJSONtoPAEContactMatrix(
+ InputStream pae_input) throws IOException, ParseException
+ {
+ Object paeJson = Platform.parseJSON(pae_input);
+ JSONObject paeDict = null;
+ if (paeJson instanceof JSONObject)
+ {
+ paeDict = (JSONObject) paeJson;
+ }
+ else if (paeJson instanceof JSONArray)
+ {
+ JSONArray jsonArray = (JSONArray) paeJson;
+ if (jsonArray.size() > 0)
+ paeDict = (JSONObject) jsonArray.get(0);
+ }
+
+ return paeDict;
+ }
+
+ // ###### TEST THIS
+ public static boolean importPaeJSONAsContactMatrixToStructure(
+ StructureMapping[] smArray, InputStream paeInput, String label)
+ throws IOException, ParseException
+ {
+ boolean someDone = false;
+ for (StructureMapping sm : smArray)
+ {
+ boolean thisDone = importPaeJSONAsContactMatrixToStructure(sm,
+ paeInput, label);
+ someDone |= thisDone;
+ }
+ return someDone;
+ }
+
+ public static boolean importPaeJSONAsContactMatrixToStructure(
+ StructureMapping sm, InputStream paeInput, String label)
+ throws IOException, ParseException
+ {
+ JSONObject pae_obj = parseJSONtoPAEContactMatrix(paeInput);
+ if (pae_obj == null)
+ {
+ Console.debug("JSON file did not parse properly.");
+ return false;
+ }
+
+ SequenceI seq = sm.getSequence();
+ ContactMatrixI matrix = new PAEContactMatrix(seq,
+ (Map<String, Object>) pae_obj);
+ AlignmentAnnotation cmannot = sm.getSequence().addContactList(matrix);
+ /* this already happens in Sequence.addContactList()
+ seq.addAlignmentAnnotation(cmannot);
+ */
+ return true;
+ }
+
+ /**
* general purpose structure importer - designed to yield alignment useful for
* transfer of annotation to associated sequences
*
*/
public class Uniprot extends DbSourceProxyImpl
{
- private static final String DEFAULT_UNIPROT_DOMAIN = "https://www.uniprot.org";
+ private static final String DEFAULT_UNIPROT_DOMAIN = "https://rest.uniprot.org";
private static final String BAR_DELIMITER = "|";
+ private static Regex ACCESSION_REGEX;
/**
* Constructor
serviceClientBindings.put("SecStrPred", new JPredClient());
serviceClientBindings.put("SeqSearch", new SeqSearchWSClient());
}
- WS1Client instance = serviceClientBindings.get(sh.getAbstractName());
+ WS1Client instance = serviceClientBindings
+ .get(sh.getAbstractName());
if (instance == null)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"WARNING - POSSIBLE IMPLEMENTATION ERROR - cannot find WSClient implementation for "
+ sh.getAbstractName());
}
oldthread = Thread.currentThread();
try
{
- Class foo = getClass().getClassLoader()
- .loadClass("compbio.ws.client.Jws2Client");
+ getClass().getClassLoader().loadClass("compbio.ws.client.Jws2Client");
} catch (ClassNotFoundException e)
{
- System.err.println(
+ jalview.bin.Console.errPrintln(
"Not enabling JABA Webservices : client jar is not available."
+ "\nPlease check that your webstart JNLP file is up to date!");
running = false;
*/
public static void main(String[] args)
{
+ Jws2Discoverer instance = getInstance();
if (args.length > 0)
{
- testUrls = new ArrayList<>();
+ instance.testUrls = new ArrayList<>();
for (String url : args)
{
- testUrls.add(url);
+ instance.testUrls.add(url);
}
}
- Thread runner = getDiscoverer()
- .startDiscoverer(new PropertyChangeListener()
- {
-
- @Override
- public void propertyChange(PropertyChangeEvent evt)
- {
- if (getDiscoverer().services != null)
- {
- jalview.bin.Console
+ var discoverer = getInstance();
+ discoverer.addServiceChangeListener((_discoverer, _services) -> {
+ if (discoverer.services != null)
+ {
- System.out.println("Changesupport: There are now "
- + discoverer.services.size() + " services");
++ jalview.bin.Console
+ .outPrintln("Changesupport: There are now "
- + getDiscoverer().services.size()
++ + discoverer.services.size()
+ + " services");
- int i = 1;
- for (Jws2Instance instance : getDiscoverer().services)
- {
- jalview.bin.Console.outPrintln("Service " + i++ + " "
- + instance.getClass() + "@" + instance.getHost()
- + ": " + instance.getActionText());
- }
+ int i = 1;
+ for (ServiceWithParameters s_instance : discoverer.services)
+ {
- System.out.println(
++ jalview.bin.Console.outPrintln(
+ "Service " + i++ + " " + s_instance.getClass()
+ + "@" + s_instance.getHostURL() + ": "
+ + s_instance.getActionText());
+ }
- }
- }
- });
- while (runner.isAlive())
- {
- try
- {
- Thread.sleep(50);
- } catch (InterruptedException e)
- {
}
+ });
+ try
+ {
+ discoverer.startDiscoverer().get();
+ } catch (InterruptedException | ExecutionException e)
+ {
}
try
{
}
} catch (Exception ex)
{
- System.err.println("Exception when retrieving presets for service "
- + getServiceType() + " at " + getHostURL());
+ jalview.bin.Console
+ .errPrintln("Exception when retrieving presets for service "
- + serviceType + " at " + hosturl);
++ + getServiceType() + " at " + getHostURL());
}
}
return presets;
*/
private Entry parseSIFTs(File siftFile) throws SiftsException
{
- try (InputStream in = new FileInputStream(siftFile);
- GZIPInputStream gzis = new GZIPInputStream(in);)
+ try (InputStream in = new FileInputStream(siftFile)) {
+ return parseSIFTs(in);
+ } catch (Exception e)
+ {
+ e.printStackTrace();
+ throw new SiftsException(e.getMessage());
+ }
+ }
+
+ private static Entry parseSIFTs(InputStream in) throws Exception {
+ try (GZIPInputStream gzis = new GZIPInputStream(in);)
{
- // System.out.println("File : " + siftFile.getAbsolutePath());
+ // jalview.bin.Console.outPrintln("File : " + siftFile.getAbsolutePath());
JAXBContext jc = JAXBContext.newInstance("jalview.xml.binding.sifts");
XMLStreamReader streamReader = XMLInputFactory.newInstance()
.createXMLStreamReader(gzis);
if (siftsFile.exists())
{
// The line below is required for unit testing... don't comment it out!!!
- System.out.println(">>> SIFTS File already downloaded for " + pdbId);
+ jalview.bin.Console
+ .outPrintln(">>> SIFTS File already downloaded for " + pdbId);
- if (isFileOlderThanThreshold(siftsFile,
+ if (Platform.isFileOlderThanThreshold(siftsFile,
SiftsSettings.getCacheThresholdInDays()))
{
File oldSiftsFile = new File(siftsFileName + "_old");
}
/**
- * This method enables checking if a cached file has exceeded a certain
- * threshold(in days)
+ * Download a SIFTs XML file for a given PDB Id from an FTP repository
*
- * @param file
- * the cached file
- * @param noOfDays
- * the threshold in days
- * @return
+ * @param pdbId
+ * @return downloaded SIFTs XML file
+ * @throws SiftsException
+ * @throws IOException
*/
+ public static boolean isFileOlderThanThreshold(File file, int noOfDays)
+ {
+ Path filePath = file.toPath();
+ BasicFileAttributes attr;
+ int diffInDays = 0;
+ try
+ {
+ attr = Files.readAttributes(filePath, BasicFileAttributes.class);
+ diffInDays = (int) ((new Date().getTime()
+ - attr.lastModifiedTime().toMillis())
+ / (1000 * 60 * 60 * 24));
+ // jalview.bin.Console.outPrintln("Diff in days : " + diffInDays);
+ } catch (IOException e)
+ {
+ e.printStackTrace();
+ }
+ return noOfDays <= diffInDays;
+ }
++ // 2.12 entry point
+ public static File downloadSiftsFile(String pdbId)
- throws SiftsException, IOException
++ throws SiftsException, IOException
+ {
+ return (File) downloadSifts(pdbId, CACHE_FILE);
+ }
/**
- * Download a SIFTs XML file for a given PDB Id from an FTP repository
+ * Download SIFTs XML with the option to cache a file or to get a stream.
*
* @param pdbId
- * @return downloaded SIFTs XML file
- * @throws SiftsException
+ * @param asFile
+ * @return
* @throws IOException
*/
- public static File downloadSiftsFile(String pdbId)
- throws SiftsException, IOException
+ private static Object downloadSifts(String pdbId, boolean asFile) throws IOException
{
+ pdbId = pdbId.toLowerCase(Locale.ROOT);
if (pdbId.contains(".cif"))
{
pdbId = pdbId.replace(".cif", "");
}
String siftFile = pdbId + ".xml.gz";
+ String siftsFileFTPURL = getDownloadUrlFor(siftFile);
+
+ /*
+ * Download the file from URL to either
+ * Java: directory of cached downloaded SIFTS files
+ * Javascript: temporary 'file' (in-memory cache)
+ */
File downloadTo = null;
- if (Platform.isJS())
- {
- downloadTo = File.createTempFile(siftFile, ".xml.gz");
- }
- else
+ if (asFile)
{
downloadTo = new File(
SiftsSettings.getSiftDownloadDirectory() + siftFile);
}
}
- String siftsFileFTPURL = SIFTS_FTP_BASE_URL + siftFile;
+ // jalview.bin.Console.outPrintln(">> Download ftp url : " +
+ // siftsFileFTPURL);
+ // long now = System.currentTimeMillis();
URL url = new URL(siftsFileFTPURL);
URLConnection conn = url.openConnection();
- InputStream inputStream = conn.getInputStream();
- FileOutputStream outputStream = new FileOutputStream(downloadTo);
- byte[] buffer = new byte[BUFFER_SIZE];
- int bytesRead = -1;
- while ((bytesRead = inputStream.read(buffer)) != -1)
- {
- outputStream.write(buffer, 0, bytesRead);
- }
- outputStream.close();
- inputStream.close();
- // jalview.bin.Console.outPrintln(">>> File downloaded : " +
- // downloadedSiftsFile
- // + " took " + (System.currentTimeMillis() - now) + "ms");
+ InputStream is = conn.getInputStream();
+ if (!asFile)
+ return is;
+ // This is MUCH more efficent in JavaScript, as we already have the bytes
+ Platform.streamToFile(is, downloadTo);
+ is.close();
return downloadTo;
}
if (mapping.isEmpty())
{
- throw new SiftsException("SIFTS mapping failed");
+ throw new SiftsException("SIFTS mapping failed for " + entityId
+ + " and " + seq.getName());
}
- // also construct a mapping object between the seq-coord sys and the PDB
- // seq's coord sys
+ // also construct a mapping object between the seq-coord sys and the PDB seq's coord sys
Integer[] keys = mapping.keySet().toArray(new Integer[0]);
Arrays.sort(keys);
--- /dev/null
+package jalview.ws2.gui;
+
+import java.awt.Color;
+import java.awt.event.MouseAdapter;
+import java.awt.event.MouseEvent;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.TreeMap;
+import java.util.concurrent.CompletionStage;
+
+import javax.swing.JCheckBoxMenuItem;
+import javax.swing.JLabel;
+import javax.swing.JMenu;
+import javax.swing.JMenuItem;
+import javax.swing.ToolTipManager;
+import javax.swing.border.EmptyBorder;
+
+import jalview.bin.Console;
+import jalview.datamodel.AlignmentI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.gui.JvSwingUtils;
+import jalview.gui.WsJobParameters;
+import jalview.util.MessageManager;
+import jalview.viewmodel.AlignmentViewport;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.ParamDatastoreI;
+import jalview.ws.params.WsParamSetI;
+import jalview.ws2.actions.BaseAction;
+import jalview.ws2.actions.BaseTask;
+import jalview.ws2.actions.PollingTaskExecutor;
+import jalview.ws2.actions.alignment.AlignmentAction;
+import jalview.ws2.actions.alignment.AlignmentResult;
+import jalview.ws2.actions.annotation.AlignCalcWorkerAdapter;
+import jalview.ws2.actions.annotation.AnnotationAction;
+import jalview.ws2.actions.api.ActionI;
+import jalview.ws2.actions.api.TaskEventListener;
+import jalview.ws2.actions.api.TaskI;
+import jalview.ws2.actions.hmmer.PhmmerAction;
+import jalview.ws2.actions.secstructpred.SecStructPredAction;
+import jalview.ws2.api.Credentials;
+import jalview.ws2.api.WebService;
+import jalview.ws2.client.api.WebServiceProviderI;
+
+public class WebServicesMenuManager
+{
+ private final JMenu menu;
+
+ private final AlignFrame frame;
+
+ private JMenuItem inProgressItem = new JMenuItem("Service discovery in progress");
+
+ private JMenuItem noServicesItem = new JMenuItem("No services available");
+ {
+ inProgressItem.setEnabled(false);
+ inProgressItem.setVisible(false);
+ noServicesItem.setEnabled(false);
+ }
+
+ public WebServicesMenuManager(String name, AlignFrame frame)
+ {
+ this.frame = frame;
+ menu = new JMenu(name);
+ menu.add(inProgressItem);
+ menu.add(noServicesItem);
+ }
+
+ public JMenu getMenu()
+ {
+ return menu;
+ }
+
+ public void setNoServices(boolean noServices)
+ {
+ noServicesItem.setVisible(noServices);
+ }
+
+ public void setInProgress(boolean inProgress)
+ {
+ inProgressItem.setVisible(inProgress);
+ }
+
+ public void setServices(WebServiceProviderI services)
+ {
+ menu.removeAll();
+ // services grouped by their category
+ Map<String, List<WebService<?>>> oneshotServices = new HashMap<>();
+ Map<String, List<WebService<?>>> interactiveServices = new HashMap<>();
+ for (WebService<?> service : services.getServices())
+ {
+ var map = service.isInteractive() ? interactiveServices : oneshotServices;
+ map.computeIfAbsent(service.getCategory(), k -> new ArrayList<>())
+ .add(service);
+ }
+ var allKeysSet = new HashSet<>(oneshotServices.keySet());
+ allKeysSet.addAll(interactiveServices.keySet());
+ var allKeys = new ArrayList<>(allKeysSet);
+ allKeys.sort(Comparator.naturalOrder());
+ for (String category : allKeys)
+ {
+ var categoryMenu = new JMenu(category);
+ var oneshot = oneshotServices.get(category);
+ if (oneshot != null)
+ addOneshotEntries(oneshot, categoryMenu);
+ var interactive = interactiveServices.get(category);
+ if (interactive != null)
+ {
+ if (oneshot != null)
+ categoryMenu.addSeparator();
+ addInteractiveEntries(interactive, categoryMenu);
+ }
+ menu.add(categoryMenu);
+ }
+ menu.add(inProgressItem);
+ menu.add(noServicesItem);
+ }
+
+ private void addOneshotEntries(List<WebService<?>> services, JMenu menu)
+ {
+ // Workaround. Comparator methods not working in j2s
+ services.sort((ws1, ws2) -> {
+ var res = ws1.getUrl().toString().compareTo(ws2.getUrl().toString());
+ if (res == 0)
+ res = ws1.getName().compareTo(ws2.getName());
+ return res;
+ });
+ URL lastHost = null;
+ for (WebService<?> service : services)
+ {
+ // if new host differs from the last one, add entry separating them
+ URL host = service.getUrl();
+ if (!host.equals(lastHost))
+ {
+ if (lastHost != null)
+ menu.addSeparator();
+ var item = new JMenuItem(host.toString());
+ item.setForeground(Color.BLUE);
+ item.addActionListener(e -> Desktop.showUrl(host.toString()));
+ menu.add(item);
+ lastHost = host;
+ }
+ menu.addSeparator();
+ // group actions by their subcategory, sorted
+ var actionsByCategory = new TreeMap<String, List<ActionI<?>>>();
+ for (ActionI<?> action : service.getActions())
+ {
+ actionsByCategory
+ .computeIfAbsent(
+ action.getSubcategory() != null ? action.getSubcategory() : "",
+ k -> new ArrayList<>())
+ .add(action);
+ }
+ for (var entry : actionsByCategory.entrySet())
+ {
+ var category = entry.getKey();
+ var actions = entry.getValue();
+ // create submenu named {subcategory} with {service} or use root menu
+ var atMenu = category.isEmpty() ? menu : new JMenu(String.format("%s with %s", category, service.getName()));
+ if (atMenu != menu)
+ menu.add(atMenu); // add only if submenu
+ // sort actions by name pulling nulls to the front
+ actions.sort(Comparator.comparing(
+ ActionI::getName, Comparator.nullsFirst(Comparator.naturalOrder())));
+ for (int i = 0; i < actions.size(); i++)
+ {
+ addEntriesForAction(actions.get(i), atMenu, atMenu == menu);
+ }
+ }
+ }
+ }
+
+ private void addEntriesForAction(ActionI<?> action, JMenu menu, boolean isTopLevel)
+ {
+ var enabled = isActionEnabled(action);
+ var service = action.getWebService();
+ String itemName;
+ if (isTopLevel)
+ {
+ itemName = service.getName();
+ if (action.getName() != null && !action.getName().isEmpty())
+ itemName += " " + action.getName();
+ }
+ else
+ {
+ if (action.getName() == null || action.getName().isEmpty())
+ itemName = "Run";
+ else
+ itemName = action.getName();
+ }
+ var datastore = service.getParamDatastore();
+ {
+ String text = itemName;
+ if (datastore.hasParameters() || datastore.hasPresets())
+ text += " with defaults";
+ JMenuItem item = new JMenuItem(text);
+ item.setEnabled(enabled);
+ item.addActionListener(e -> {
+ runAction(action, frame.getCurrentView(), Collections.emptyList(),
+ Credentials.empty());
+ });
+ menu.add(item);
+ }
+ if (datastore.hasParameters())
+ {
+ JMenuItem item = new JMenuItem("Edit settings and run...");
+ item.setEnabled(enabled);
+ item.addActionListener(e -> {
+ openEditParamsDialog(datastore, null, null).thenAccept(args -> {
+ if (args != null)
+ runAction(action, frame.getCurrentView(), args, Credentials.empty());
+ });
+ });
+ menu.add(item);
+ }
+ var presets = datastore.getPresets();
+ if (presets != null && presets.size() > 0)
+ {
+ final var presetsMenu = new JMenu(MessageManager.formatMessage(
+ "label.run_with_preset_params", service.getName()));
+ presetsMenu.setEnabled(enabled);
+ final int dismissDelay = ToolTipManager.sharedInstance()
+ .getDismissDelay();
+ final int QUICK_TOOLTIP = 1500;
+ for (var preset : presets)
+ {
+ var item = new JMenuItem(preset.getName());
+ item.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseEntered(MouseEvent evt)
+ {
+ ToolTipManager.sharedInstance().setDismissDelay(QUICK_TOOLTIP);
+ }
+
+ @Override
+ public void mouseExited(MouseEvent evt)
+ {
+ ToolTipManager.sharedInstance().setDismissDelay(dismissDelay);
+ }
+ });
+ String tooltipTitle = MessageManager.getString(
+ preset.isModifiable() ? "label.user_preset" : "label.service_preset");
+ String tooltip = String.format("<strong>%s</strong><br/>%s",
+ tooltipTitle, preset.getDescription());
+ tooltip = JvSwingUtils.wrapTooltip(true, tooltip);
+ item.setToolTipText(tooltip);
+ item.addActionListener(event -> {
+ runAction(action, frame.getCurrentView(), preset.getArguments(),
+ Credentials.empty());
+ });
+ presetsMenu.add(item);
+ }
+ menu.add(presetsMenu);
+ }
+ }
+
+ private void addInteractiveEntries(List<WebService<?>> services, JMenu menu)
+ {
+ Map<String, List<WebService<?>>> byServiceName = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
+ for (var service : services)
+ {
+ byServiceName.computeIfAbsent(service.getName(), k -> new ArrayList<>())
+ .add(service);
+ }
+ for (var entry : byServiceName.entrySet())
+ {
+ var group = new InteractiveServiceEntryGroup(entry.getKey(), entry.getValue());
+ group.appendTo(menu);
+ }
+ }
+
+ private class InteractiveServiceEntryGroup
+ {
+ JLabel serviceLabel;
+
+ JMenuItem urlItem = new JMenuItem();
+
+ JCheckBoxMenuItem serviceItem = new JCheckBoxMenuItem();
+
+ JMenuItem editParamsItem = new JMenuItem("Edit parameters...");
+
+ JMenu presetsMenu = new JMenu("Change preset");
+
+ JMenu alternativesMenu = new JMenu("Choose action");
+ {
+ urlItem.setForeground(Color.BLUE);
+ urlItem.setVisible(false);
+ serviceItem.setVisible(false);
+ editParamsItem.setVisible(false);
+ presetsMenu.setVisible(false);
+ }
+
+ InteractiveServiceEntryGroup(String name, List<WebService<?>> services)
+ {
+ serviceLabel = new JLabel(name);
+ serviceLabel.setBorder(new EmptyBorder(0, 6, 0, 6));
+ buildAlternativesMenu(services);
+ }
+
+ private void buildAlternativesMenu(List<WebService<?>> services)
+ {
+ var menu = alternativesMenu;
+ services.sort((ws1, ws2) -> {
+ var res = ws1.getUrl().toString().compareTo(ws2.getUrl().toString());
+ if (res == 0)
+ res = ws1.getName().compareTo(ws2.getName());
+ return res;
+ });
+ URL lastHost = null;
+ for (var service : services)
+ {
+ // Adding url "separator" before each group
+ URL host = service.getUrl();
+ if (!host.equals(lastHost))
+ {
+ if (lastHost != null)
+ menu.addSeparator();
+ var item = new JMenuItem(host.toString());
+ item.setForeground(Color.BLUE);
+ item.addActionListener(e -> Desktop.showUrl(host.toString()));
+ menu.add(item);
+ lastHost = host;
+ }
+ menu.addSeparator();
+ var actionsByCategory = new TreeMap<String, List<ActionI<?>>>();
+ for (ActionI<?> action : service.getActions())
+ {
+ actionsByCategory
+ .computeIfAbsent(
+ action.getSubcategory() != null ? action.getSubcategory() : "",
+ k -> new ArrayList<>())
+ .add(action);
+ }
+ actionsByCategory.forEach((key, actions) -> {
+ var atMenu = key.isEmpty() ? menu : new JMenu(key + " with " + service.getName());
+ boolean topLevel = atMenu == menu;
+ if (!topLevel)
+ menu.add(atMenu);
+ actions.sort(Comparator.comparing(
+ a -> a.getName(),
+ Comparator.nullsFirst(Comparator.naturalOrder())));
+ for (ActionI<?> action : actions)
+ {
+ var item = new JMenuItem(action.getFullName());
+ item.setEnabled(isActionEnabled(action));
+ item.addActionListener(e -> setAlternative(action));
+ atMenu.add(item);
+ }
+ });
+ }
+ }
+
+ private void setAlternative(ActionI<?> action)
+ {
+ final var arguments = new ArrayList<ArgumentI>();
+ final WsParamSetI[] lastPreset = { null };
+
+ // update selected url menu item
+ String url = action.getWebService().getUrl().toString();
+ urlItem.setText(url);
+ urlItem.setVisible(true);
+ for (var l : urlItem.getActionListeners())
+ urlItem.removeActionListener(l);
+ urlItem.addActionListener(e -> Desktop.showUrl(url));
+
+ // update selected service menu item
+ serviceItem.setText(action.getFullName());
+ serviceItem.setVisible(true);
+ for (var l : serviceItem.getActionListeners())
+ serviceItem.removeActionListener(l);
+ WebService<?> service = action.getWebService();
+ serviceItem.addActionListener(e -> {
+ runAction(action, frame.getCurrentView(), arguments,
+ Credentials.empty());
+ });
+ serviceItem.setSelected(true);
+
+ // update edit parameters menu item
+ var datastore = service.getParamDatastore();
+ editParamsItem.setVisible(datastore.hasParameters());
+ for (var l : editParamsItem.getActionListeners())
+ editParamsItem.removeActionListener(l);
+ if (datastore.hasParameters())
+ {
+ editParamsItem.addActionListener(e -> {
+ openEditParamsDialog(service.getParamDatastore(), lastPreset[0], arguments)
+ .thenAccept(args -> {
+ if (args != null)
+ {
+ lastPreset[0] = null;
+ arguments.clear();
+ arguments.addAll(args);
+ runAction(action, frame.getCurrentView(),
+ arguments, Credentials.empty());
+ }
+ });
+ });
+ }
+
+ // update presets menu
+ presetsMenu.removeAll();
+ presetsMenu.setEnabled(datastore.hasPresets());
+ if (datastore.hasPresets())
+ {
+ for (WsParamSetI preset : datastore.getPresets())
+ {
+ var item = new JMenuItem(preset.getName());
+ item.addActionListener(e -> {
+ lastPreset[0] = preset;
+ runAction(action, frame.getCurrentView(),
+ preset.getArguments(), Credentials.empty());
+ });
+ presetsMenu.add(item);
+ }
+ }
+
+ runAction(action, frame.getCurrentView(), arguments,
+ Credentials.empty());
+ }
+
+ void appendTo(JMenu menu)
+ {
+ menu.add(serviceLabel);
+ menu.add(urlItem);
+ menu.add(serviceItem);
+ menu.add(editParamsItem);
+ menu.add(presetsMenu);
+ menu.add(alternativesMenu);
+ }
+ }
+
+ private boolean isActionEnabled(ActionI<?> action)
+ {
++ if (frame==null || frame.getViewport()==null || frame.getViewport().getAlignment()==null)
++ {
++ // no data to check
++ return false;
++ }
+ var isNa = frame.getViewport().getAlignment().isNucleotide();
+ return ((isNa && action.doAllowNucleotide()) ||
+ (!isNa && action.doAllowProtein()));
+ }
+
+ private void runAction(ActionI<?> action, AlignmentViewport viewport,
+ List<ArgumentI> args, Credentials credentials)
+ {
+ // casting and instance checks can be avoided with some effort,
+ // let them be for now.
+ if (action instanceof AlignmentAction)
+ {
+ // TODO: test if selection contains enough sequences
+ var _action = (AlignmentAction) action;
+ var handler = new AlignmentServiceGuiHandler(_action, frame);
+ BaseTask<?, AlignmentResult> task = _action.createTask(viewport, args, credentials);
+ var executor = PollingTaskExecutor.fromPool(viewport.getServiceExecutor());
+ task.addTaskEventListener(handler);
+ var future = executor.submit(task);
+ task.setCancelAction(() -> { future.cancel(true); });
+ return;
+ }
+ if (action instanceof AnnotationAction)
+ {
+ var calcManager = viewport.getCalcManager();
+
+ var _action = (AnnotationAction) action;
+ var worker = new AlignCalcWorkerAdapter(viewport, frame.alignPanel,
+ _action, args, credentials);
+ var handler = new AnnotationServiceGuiHandler(_action, frame);
+ worker.setWorkerListener(handler);
+ for (var w : calcManager.getWorkers())
+ {
+ if (worker.getCalcName() != null && worker.getCalcName().equals(w.getCalcName()))
+ {
+ calcManager.cancelWorker(w);
+ calcManager.removeWorker(w);
+ }
+ }
+ if (action.getWebService().isInteractive())
+ calcManager.registerWorker(worker);
+ else
+ calcManager.startWorker(worker);
+ return;
+ }
+ if (action instanceof PhmmerAction || action instanceof SecStructPredAction)
+ {
+ var _action = (BaseAction<AlignmentI>) action;
+ var handler = new SearchServiceGuiHandler(_action, frame);
+ var task = (BaseTask<?, AlignmentI>) _action // FIXME: unsafe cast
+ .createTask(viewport, args, credentials);
+ var executor = PollingTaskExecutor.fromPool(viewport.getServiceExecutor());
+ task.addTaskEventListener(handler);
+ var future = executor.submit(task);
+ task.setCancelAction(() -> {
+ future.cancel(true);
+ });
+ return;
+ }
+ Console.warn(String.format(
+ "No known handler for action type %s. All output will be discarded.",
+ action.getClass().getName()));
+ var task = action.createTask(viewport, args, credentials);
+ task.addTaskEventListener(TaskEventListener.nullListener());
+ PollingTaskExecutor.fromPool(viewport.getServiceExecutor())
+ .submit(task);
+ }
+
+ private static CompletionStage<List<ArgumentI>> openEditParamsDialog(
+ ParamDatastoreI paramStore, WsParamSetI preset, List<ArgumentI> arguments)
+ {
+ final WsJobParameters jobParams;
+ if (preset == null && arguments != null && arguments.size() > 0)
+ jobParams = new WsJobParameters(paramStore, null, arguments);
+ else
+ jobParams = new WsJobParameters(paramStore, preset, null);
+ if (preset != null)
+ jobParams.setName(MessageManager.getString(
+ "label.adjusting_parameters_for_calculation"));
+ var stage = jobParams.showRunDialog();
+ return stage.thenApply(startJob -> {
+ if (!startJob)
+ return null; // null if cancelled
+ if (jobParams.getPreset() != null)
+ return jobParams.getPreset().getArguments();
+ if (jobParams.isServiceDefaults())
+ return Collections.emptyList();
+ else
+ return jobParams.getJobParams();
+ });
+ }
+}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="alcodon" maxOccurs="unbounded"
-- * minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
-- * &lt;attribute name="pos2"
-- * type="{http://www.w3.org/2001/XMLSchema}integer" /&gt; &lt;attribute
-- * name="pos3" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
-- * name="alcodMap" maxOccurs="unbounded" minOccurs="0"&gt;
-- * &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="dnasq" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;/restriction&gt;
-- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="alcodon" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="pos2" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="pos3" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="alcodMap" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/>
++ * </sequence>
++ * <attribute name="dnasq" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "", propOrder = { "alcodon", "alcodMap" })
++@XmlType(name = "", propOrder = {
++ "alcodon",
++ "alcodMap"
++})
@XmlRootElement(name = "AlcodonFrame")
--public class AlcodonFrame
--{
--
-- protected List<AlcodonFrame.Alcodon> alcodon;
--
-- protected List<AlcodonFrame.AlcodMap> alcodMap;
--
-- /**
-- * Gets the value of the alcodon property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the alcodon property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAlcodon().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link AlcodonFrame.Alcodon }
-- *
-- *
-- */
-- public List<AlcodonFrame.Alcodon> getAlcodon()
-- {
-- if (alcodon == null)
-- {
-- alcodon = new ArrayList<AlcodonFrame.Alcodon>();
-- }
-- return this.alcodon;
-- }
--
-- /**
-- * Gets the value of the alcodMap property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the alcodMap property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAlcodMap().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link AlcodonFrame.AlcodMap }
-- *
-- *
-- */
-- public List<AlcodonFrame.AlcodMap> getAlcodMap()
-- {
-- if (alcodMap == null)
-- {
-- alcodMap = new ArrayList<AlcodonFrame.AlcodMap>();
-- }
-- return this.alcodMap;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="dnasq" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "", propOrder = { "mapping" })
-- public static class AlcodMap
-- {
++public class AlcodonFrame {
-- @XmlElement(name = "Mapping", required = true)
-- protected Mapping mapping;
--
-- @XmlAttribute(name = "dnasq", required = true)
-- protected String dnasq;
++ protected List<AlcodonFrame.Alcodon> alcodon;
++ protected List<AlcodonFrame.AlcodMap> alcodMap;
/**
++ * Gets the value of the alcodon property.
*
-- * a Mapping entry and an associated protein sequence
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the alcodon property.</p>
*
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAlcodon().add(newItem);
++ * </pre>
*
-- * @return possible object is {@link Mapping }
*
-- */
-- public Mapping getMapping()
-- {
-- return mapping;
-- }
--
-- /**
-- * Sets the value of the mapping property.
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link AlcodonFrame.Alcodon }
++ * </p>
*
-- * @param value
-- * allowed object is {@link Mapping }
*
++ * @return
++ * The value of the alcodon property.
*/
-- public void setMapping(Mapping value)
-- {
-- this.mapping = value;
++ public List<AlcodonFrame.Alcodon> getAlcodon() {
++ if (alcodon == null) {
++ alcodon = new ArrayList<AlcodonFrame.Alcodon>();
++ }
++ return this.alcodon;
}
/**
-- * Gets the value of the dnasq property.
++ * Gets the value of the alcodMap property.
*
-- * @return possible object is {@link String }
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the alcodMap property.</p>
*
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAlcodMap().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link AlcodonFrame.AlcodMap }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the alcodMap property.
*/
-- public String getDnasq()
-- {
-- return dnasq;
++ public List<AlcodonFrame.AlcodMap> getAlcodMap() {
++ if (alcodMap == null) {
++ alcodMap = new ArrayList<AlcodonFrame.AlcodMap>();
++ }
++ return this.alcodMap;
}
++
/**
-- * Sets the value of the dnasq property.
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Mapping"/>
++ * </sequence>
++ * <attribute name="dnasq" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
-- * @param value
-- * allowed object is {@link String }
*
*/
-- public void setDnasq(String value)
-- {
-- this.dnasq = value;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "", propOrder = {
++ "mapping"
++ })
++ public static class AlcodMap {
-- }
++ /**
++ * a Mapping entry and an associated protein
++ * sequence
++ *
++ */
++ @XmlElement(name = "Mapping", required = true)
++ protected Mapping mapping;
++ /**
++ * internal jalview id for the dnasq for this
++ * mapping.
++ *
++ */
++ @XmlAttribute(name = "dnasq", required = true)
++ protected String dnasq;
-- /**
-- *
-- * specifies a series of aligned codons from an associated DNA sequence
-- * alignment that when translated correspond to columns of a peptide
-- * alignment. Element may have either all pos1,2,3 attributes specified, or
-- * none at all (indicating a gapped column with no translated peptide).
-- *
-- *
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
-- * &lt;attribute name="pos2"
-- * type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
-- * &lt;attribute name="pos3"
-- * type="{http://www.w3.org/2001/XMLSchema}integer" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "")
-- public static class Alcodon
-- {
++ /**
++ * a Mapping entry and an associated protein
++ * sequence
++ *
++ * @return
++ * possible object is
++ * {@link Mapping }
++ *
++ */
++ public Mapping getMapping() {
++ return mapping;
++ }
-- @XmlAttribute(name = "pos1")
-- protected BigInteger pos1;
++ /**
++ * Sets the value of the mapping property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Mapping }
++ *
++ * @see #getMapping()
++ */
++ public void setMapping(Mapping value) {
++ this.mapping = value;
++ }
-- @XmlAttribute(name = "pos2")
-- protected BigInteger pos2;
++ /**
++ * internal jalview id for the dnasq for this
++ * mapping.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDnasq() {
++ return dnasq;
++ }
-- @XmlAttribute(name = "pos3")
-- protected BigInteger pos3;
++ /**
++ * Sets the value of the dnasq property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getDnasq()
++ */
++ public void setDnasq(String value) {
++ this.dnasq = value;
++ }
-- /**
-- * Gets the value of the pos1 property.
-- *
-- * @return possible object is {@link BigInteger }
-- *
-- */
-- public BigInteger getPos1()
-- {
-- return pos1;
}
-- /**
-- * Sets the value of the pos1 property.
-- *
-- * @param value
-- * allowed object is {@link BigInteger }
-- *
-- */
-- public void setPos1(BigInteger value)
-- {
-- this.pos1 = value;
-- }
/**
-- * Gets the value of the pos2 property.
++ * specifies a series of aligned codons from an
++ * associated DNA sequence alignment that when translated
++ * correspond to columns of a peptide alignment.
++ * Element may have
++ * either all pos1,2,3 attributes specified, or none at all
++ * (indicating a gapped column with no translated peptide).
*
-- * @return possible object is {@link BigInteger }
++ * <p>Java class for anonymous complex type</p>.
*
-- */
-- public BigInteger getPos2()
-- {
-- return pos2;
-- }
--
-- /**
-- * Sets the value of the pos2 property.
-- *
-- * @param value
-- * allowed object is {@link BigInteger }
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- */
-- public void setPos2(BigInteger value)
-- {
-- this.pos2 = value;
-- }
--
-- /**
-- * Gets the value of the pos3 property.
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="pos1" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="pos2" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="pos3" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
-- * @return possible object is {@link BigInteger }
*
*/
-- public BigInteger getPos3()
-- {
-- return pos3;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class Alcodon {
-- /**
-- * Sets the value of the pos3 property.
-- *
-- * @param value
-- * allowed object is {@link BigInteger }
-- *
-- */
-- public void setPos3(BigInteger value)
-- {
-- this.pos3 = value;
-- }
++ @XmlAttribute(name = "pos1")
++ protected BigInteger pos1;
++ @XmlAttribute(name = "pos2")
++ protected BigInteger pos2;
++ @XmlAttribute(name = "pos3")
++ protected BigInteger pos3;
++
++ /**
++ * Gets the value of the pos1 property.
++ *
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
++ */
++ public BigInteger getPos1() {
++ return pos1;
++ }
-- }
++ /**
++ * Sets the value of the pos1 property.
++ *
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ */
++ public void setPos1(BigInteger value) {
++ this.pos1 = value;
++ }
++
++ /**
++ * Gets the value of the pos2 property.
++ *
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
++ */
++ public BigInteger getPos2() {
++ return pos2;
++ }
++
++ /**
++ * Sets the value of the pos2 property.
++ *
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ */
++ public void setPos2(BigInteger value) {
++ this.pos2 = value;
++ }
++
++ /**
++ * Gets the value of the pos3 property.
++ *
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
++ */
++ public BigInteger getPos3() {
++ return pos3;
++ }
++
++ /**
++ * Sets the value of the pos3 property.
++ *
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ */
++ public void setPos3(BigInteger value) {
++ this.pos3 = value;
++ }
++
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}annotationElement"
-- * maxOccurs="unbounded" minOccurs="0"/&gt; &lt;element name="label"
-- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt; &lt;element
-- * name="description" type="{http://www.w3.org/2001/XMLSchema}string"
-- * minOccurs="0"/&gt; &lt;element name="thresholdLine"
-- * minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="label" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="value" type="{http://www.w3.org/2001/XMLSchema}float"
-- * /&gt; &lt;attribute name="colour"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="property" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attribute name="graph" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="graphType" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="sequenceRef"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="groupRef" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="graphColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="graphGroup" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="graphHeight"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="scoreOnly"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="score"
- * type="{http://www.w3.org/2001/XMLSchema}double" /&gt; &lt;attribute
- * name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="centreColLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="scaleColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="showAllColLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="autoCalculated" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="belowAlignment"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="calcId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- * name="contactmatrix"
- * type="{www.vamsas.ac.uk/jalview/version2}MapOnAMatrixType"
- * maxOccurs="unbounded" minOccurs="0"/&gt; &lt;element name="property"
- * type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
- * name="graph" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="graphType"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="groupRef"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="graphColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="graphGroup"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="graphHeight" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="scoreOnly"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="score"
- * type="{http://www.w3.org/2001/XMLSchema}double" /&gt; &lt;attribute
- * name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="centreColLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="scaleColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="showAllColLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="autoCalculated" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="belowAlignment"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="calcId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}annotationElement" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="label" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="thresholdLine" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="contactmatrix" type="{www.vamsas.ac.uk/jalview/version2}MapOnAMatrixType" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="property" type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="graph" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="graphType" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="groupRef" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="graphColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="graphGroup" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="graphHeight" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="scoreOnly" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="score" type="{http://www.w3.org/2001/XMLSchema}double" />
++ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="centreColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="scaleColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showAllColLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoCalculated" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="belowAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="calcId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "",
-- propOrder =
-- { "annotationElement", "label", "description", "thresholdLine",
- "property" })
- "contactmatrix", "property" })
++@XmlType(name = "", propOrder = {
++ "annotationElement",
++ "label",
++ "description",
++ "thresholdLine",
++ "contactmatrix",
++ "property"
++})
@XmlRootElement(name = "Annotation")
--public class Annotation
--{
++public class Annotation {
+
- protected List<AnnotationElement> annotationElement;
++ protected List<AnnotationElement> annotationElement;
++ @XmlElement(required = true)
++ protected String label;
++ protected String description;
++ protected Annotation.ThresholdLine thresholdLine;
++ protected List<MapOnAMatrixType> contactmatrix;
++ protected List<Property> property;
++ @XmlAttribute(name = "graph", required = true)
++ protected boolean graph;
++ @XmlAttribute(name = "graphType")
++ protected Integer graphType;
++ @XmlAttribute(name = "sequenceRef")
++ protected String sequenceRef;
++ @XmlAttribute(name = "groupRef")
++ protected String groupRef;
++ @XmlAttribute(name = "graphColour")
++ protected Integer graphColour;
++ @XmlAttribute(name = "graphGroup")
++ protected Integer graphGroup;
++ /**
++ * height in pixels for the graph if this is a
++ * graph-type annotation.
++ *
++ */
++ @XmlAttribute(name = "graphHeight")
++ protected Integer graphHeight;
++ @XmlAttribute(name = "id")
++ protected String id;
++ @XmlAttribute(name = "scoreOnly")
++ protected Boolean scoreOnly;
++ @XmlAttribute(name = "score")
++ protected Double score;
++ @XmlAttribute(name = "visible")
++ protected Boolean visible;
++ @XmlAttribute(name = "centreColLabels")
++ protected Boolean centreColLabels;
++ @XmlAttribute(name = "scaleColLabels")
++ protected Boolean scaleColLabels;
++ @XmlAttribute(name = "showAllColLabels")
++ protected Boolean showAllColLabels;
++ /**
++ * is an autocalculated annotation row
++ *
++ */
++ @XmlAttribute(name = "autoCalculated")
++ protected Boolean autoCalculated;
++ /**
++ * is to be shown below the alignment - introduced
++ * in Jalview 2.8 for visualizing T-COFFEE alignment scores
++ *
++ */
++ @XmlAttribute(name = "belowAlignment")
++ protected Boolean belowAlignment;
++ /**
++ * Optional string identifier used to group sets of
++ * annotation produced by a particular calculation. Values are opaque
++ * strings but have semantic meaning to Jalview's renderer, data
++ * importer and calculation system.
++ *
++ */
++ @XmlAttribute(name = "calcId")
++ protected String calcId;
+
- @XmlElement(required = true)
- protected String label;
++ /**
++ * Gets the value of the annotationElement property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the annotationElement property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAnnotationElement().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link AnnotationElement }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the annotationElement property.
++ */
++ public List<AnnotationElement> getAnnotationElement() {
++ if (annotationElement == null) {
++ annotationElement = new ArrayList<AnnotationElement>();
++ }
++ return this.annotationElement;
++ }
- protected List<AnnotationElement> annotationElement;
- protected String description;
++ /**
++ * Gets the value of the label property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getLabel() {
++ return label;
++ }
- @XmlElement(required = true)
- protected String label;
-
- protected String description;
-
-- protected Annotation.ThresholdLine thresholdLine;
--
- protected List<Annotation.Property> property;
-
- @XmlAttribute(name = "graph", required = true)
- protected boolean graph;
-
- @XmlAttribute(name = "graphType")
- protected Integer graphType;
-
- @XmlAttribute(name = "sequenceRef")
- protected String sequenceRef;
-
- @XmlAttribute(name = "groupRef")
- protected String groupRef;
-
- @XmlAttribute(name = "graphColour")
- protected Integer graphColour;
-
- @XmlAttribute(name = "graphGroup")
- protected Integer graphGroup;
-
- @XmlAttribute(name = "graphHeight")
- protected Integer graphHeight;
-
- @XmlAttribute(name = "id")
- protected String id;
-
- @XmlAttribute(name = "scoreOnly")
- protected Boolean scoreOnly;
-
- @XmlAttribute(name = "score")
- protected Double score;
-
- @XmlAttribute(name = "visible")
- protected Boolean visible;
-
- @XmlAttribute(name = "centreColLabels")
- protected Boolean centreColLabels;
-
- @XmlAttribute(name = "scaleColLabels")
- protected Boolean scaleColLabels;
-
- @XmlAttribute(name = "showAllColLabels")
- protected Boolean showAllColLabels;
-
- @XmlAttribute(name = "autoCalculated")
- protected Boolean autoCalculated;
-
- @XmlAttribute(name = "belowAlignment")
- protected Boolean belowAlignment;
-
- @XmlAttribute(name = "calcId")
- protected String calcId;
-
- /**
- * Gets the value of the annotationElement property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the annotationElement property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getAnnotationElement().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link AnnotationElement }
- *
- *
- */
- public List<AnnotationElement> getAnnotationElement()
- {
- if (annotationElement == null)
- {
- annotationElement = new ArrayList<AnnotationElement>();
- }
- return this.annotationElement;
- }
-
- /**
- * Gets the value of the label property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Sets the value of the label property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setLabel(String value)
- {
- this.label = value;
- }
-
- /**
- * Gets the value of the description property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the description property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setDescription(String value)
- {
- this.description = value;
- }
-
- /**
- * Gets the value of the thresholdLine property.
- *
- * @return possible object is {@link Annotation.ThresholdLine }
- *
- */
- public Annotation.ThresholdLine getThresholdLine()
- {
- return thresholdLine;
- }
-
- /**
- * Sets the value of the thresholdLine property.
- *
- * @param value
- * allowed object is {@link Annotation.ThresholdLine }
- *
- */
- public void setThresholdLine(Annotation.ThresholdLine value)
- {
- this.thresholdLine = value;
- }
-
- /**
- * Gets the value of the property property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the property property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getProperty().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Annotation.Property }
- *
- *
- */
- public List<Annotation.Property> getProperty()
- {
- if (property == null)
- {
- property = new ArrayList<Annotation.Property>();
- }
- return this.property;
- }
-
- /**
- * Gets the value of the graph property.
- *
- */
- public boolean isGraph()
- {
- return graph;
- }
-
- /**
- * Sets the value of the graph property.
- *
- */
- public void setGraph(boolean value)
- {
- this.graph = value;
- }
-
- /**
- * Gets the value of the graphType property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphType()
- {
- return graphType;
- }
-
- /**
- * Sets the value of the graphType property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphType(Integer value)
- {
- this.graphType = value;
- }
-
- /**
- * Gets the value of the sequenceRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getSequenceRef()
- {
- return sequenceRef;
- }
-
- /**
- * Sets the value of the sequenceRef property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setSequenceRef(String value)
- {
- this.sequenceRef = value;
- }
-
- /**
- * Gets the value of the groupRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getGroupRef()
- {
- return groupRef;
- }
-
- /**
- * Sets the value of the groupRef property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setGroupRef(String value)
- {
- this.groupRef = value;
- }
-
- /**
- * Gets the value of the graphColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphColour()
- {
- return graphColour;
- }
-
- /**
- * Sets the value of the graphColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphColour(Integer value)
- {
- this.graphColour = value;
- }
-
- /**
- * Gets the value of the graphGroup property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphGroup()
- {
- return graphGroup;
- }
-
- /**
- * Sets the value of the graphGroup property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphGroup(Integer value)
- {
- this.graphGroup = value;
- }
-
- /**
- * Gets the value of the graphHeight property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphHeight()
- {
- return graphHeight;
- }
-
- /**
- * Sets the value of the graphHeight property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphHeight(Integer value)
- {
- this.graphHeight = value;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
-
- /**
- * Gets the value of the scoreOnly property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isScoreOnly()
- {
- if (scoreOnly == null)
- {
- return false;
- }
- else
- {
- return scoreOnly;
- }
- }
-
- /**
- * Sets the value of the scoreOnly property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setScoreOnly(Boolean value)
- {
- this.scoreOnly = value;
- }
-
- /**
- * Gets the value of the score property.
- *
- * @return possible object is {@link Double }
- *
- */
- public Double getScore()
- {
- return score;
- }
-
- /**
- * Sets the value of the score property.
- *
- * @param value
- * allowed object is {@link Double }
- *
- */
- public void setScore(Double value)
- {
- this.score = value;
- }
-
- /**
- * Gets the value of the visible property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isVisible()
- {
- return visible;
- }
-
- /**
- * Sets the value of the visible property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setVisible(Boolean value)
- {
- this.visible = value;
- }
-
- /**
- * Gets the value of the centreColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isCentreColLabels()
- {
- return centreColLabels;
- }
-
- /**
- * Sets the value of the centreColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setCentreColLabels(Boolean value)
- {
- this.centreColLabels = value;
- }
-
- /**
- * Gets the value of the scaleColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isScaleColLabels()
- {
- return scaleColLabels;
- }
-
- /**
- * Sets the value of the scaleColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setScaleColLabels(Boolean value)
- {
- this.scaleColLabels = value;
- }
-
- /**
- * Gets the value of the showAllColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowAllColLabels()
- {
- return showAllColLabels;
- }
-
- /**
- * Sets the value of the showAllColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowAllColLabels(Boolean value)
- {
- this.showAllColLabels = value;
- }
-
- /**
- * Gets the value of the autoCalculated property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isAutoCalculated()
- {
- if (autoCalculated == null)
- {
- return false;
- }
- else
- {
- return autoCalculated;
- }
- }
-
- /**
- * Sets the value of the autoCalculated property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setAutoCalculated(Boolean value)
- {
- this.autoCalculated = value;
- }
-
- /**
- * Gets the value of the belowAlignment property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isBelowAlignment()
- {
- if (belowAlignment == null)
- {
- return true;
- }
- else
- {
- return belowAlignment;
- }
- }
-
- /**
- * Sets the value of the belowAlignment property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setBelowAlignment(Boolean value)
- {
- this.belowAlignment = value;
- }
-
- /**
- * Gets the value of the calcId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getCalcId()
- {
- return calcId;
- }
-
- /**
- * Sets the value of the calcId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setCalcId(String value)
- {
- this.calcId = value;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class Property
- {
-
- @XmlAttribute(name = "name")
- protected String name;
-
- @XmlAttribute(name = "value")
- protected String value;
-
- /**
- * Gets the value of the name property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the name property.
- protected List<MapOnAMatrixType> contactmatrix;
-
- protected List<Property> property;
-
- @XmlAttribute(name = "graph", required = true)
- protected boolean graph;
-
- @XmlAttribute(name = "graphType")
- protected Integer graphType;
-
- @XmlAttribute(name = "sequenceRef")
- protected String sequenceRef;
-
- @XmlAttribute(name = "groupRef")
- protected String groupRef;
-
- @XmlAttribute(name = "graphColour")
- protected Integer graphColour;
-
- @XmlAttribute(name = "graphGroup")
- protected Integer graphGroup;
-
- @XmlAttribute(name = "graphHeight")
- protected Integer graphHeight;
-
- @XmlAttribute(name = "id")
- protected String id;
-
- @XmlAttribute(name = "scoreOnly")
- protected Boolean scoreOnly;
-
- @XmlAttribute(name = "score")
- protected Double score;
-
- @XmlAttribute(name = "visible")
- protected Boolean visible;
-
- @XmlAttribute(name = "centreColLabels")
- protected Boolean centreColLabels;
-
- @XmlAttribute(name = "scaleColLabels")
- protected Boolean scaleColLabels;
-
- @XmlAttribute(name = "showAllColLabels")
- protected Boolean showAllColLabels;
-
- @XmlAttribute(name = "autoCalculated")
- protected Boolean autoCalculated;
-
- @XmlAttribute(name = "belowAlignment")
- protected Boolean belowAlignment;
-
- @XmlAttribute(name = "calcId")
- protected String calcId;
-
- /**
- * Gets the value of the annotationElement property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the annotationElement property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getAnnotationElement().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link AnnotationElement }
- *
- *
- */
- public List<AnnotationElement> getAnnotationElement()
- {
- if (annotationElement == null)
- {
- annotationElement = new ArrayList<AnnotationElement>();
- }
- return this.annotationElement;
- }
-
- /**
- * Gets the value of the label property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getLabel()
- {
- return label;
- }
-
- /**
- * Sets the value of the label property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setLabel(String value)
- {
- this.label = value;
- }
-
- /**
- * Gets the value of the description property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDescription()
- {
- return description;
- }
-
- /**
- * Sets the value of the description property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setDescription(String value)
- {
- this.description = value;
- }
-
- /**
- * Gets the value of the thresholdLine property.
- *
- * @return possible object is {@link Annotation.ThresholdLine }
- *
- */
- public Annotation.ThresholdLine getThresholdLine()
- {
- return thresholdLine;
- }
-
- /**
- * Sets the value of the thresholdLine property.
- *
- * @param value
- * allowed object is {@link Annotation.ThresholdLine }
- *
- */
- public void setThresholdLine(Annotation.ThresholdLine value)
- {
- this.thresholdLine = value;
- }
-
- /**
- * Gets the value of the contactmatrix property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the contactmatrix property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getContactmatrix().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link MapOnAMatrixType }
- *
- *
- */
- public List<MapOnAMatrixType> getContactmatrix()
- {
- if (contactmatrix == null)
- {
- contactmatrix = new ArrayList<MapOnAMatrixType>();
- }
- return this.contactmatrix;
- }
-
- /**
- * Gets the value of the property property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the property property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getProperty().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Property }
- *
- *
- */
- public List<Property> getProperty()
- {
- if (property == null)
- {
- property = new ArrayList<Property>();
- }
- return this.property;
- }
-
- /**
- * Gets the value of the graph property.
- *
- */
- public boolean isGraph()
- {
- return graph;
- }
-
- /**
- * Sets the value of the graph property.
- *
- */
- public void setGraph(boolean value)
- {
- this.graph = value;
- }
-
- /**
- * Gets the value of the graphType property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphType()
- {
- return graphType;
- }
-
- /**
- * Sets the value of the graphType property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphType(Integer value)
- {
- this.graphType = value;
- }
-
- /**
- * Gets the value of the sequenceRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getSequenceRef()
- {
- return sequenceRef;
- }
-
- /**
- * Sets the value of the sequenceRef property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setSequenceRef(String value)
- {
- this.sequenceRef = value;
- }
-
- /**
- * Gets the value of the groupRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getGroupRef()
- {
- return groupRef;
- }
-
- /**
- * Sets the value of the groupRef property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setGroupRef(String value)
- {
- this.groupRef = value;
- }
-
- /**
- * Gets the value of the graphColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphColour()
- {
- return graphColour;
- }
-
- /**
- * Sets the value of the graphColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphColour(Integer value)
- {
- this.graphColour = value;
- }
-
- /**
- * Gets the value of the graphGroup property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphGroup()
- {
- return graphGroup;
- }
-
- /**
- * Sets the value of the graphGroup property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphGroup(Integer value)
- {
- this.graphGroup = value;
- }
-
- /**
- * Gets the value of the graphHeight property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGraphHeight()
- {
- return graphHeight;
- }
-
- /**
- * Sets the value of the graphHeight property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGraphHeight(Integer value)
- {
- this.graphHeight = value;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
-
- /**
- * Gets the value of the scoreOnly property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isScoreOnly()
- {
- if (scoreOnly == null)
- {
- return false;
- }
- else
- {
- return scoreOnly;
- }
- }
-
- /**
- * Sets the value of the scoreOnly property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setScoreOnly(Boolean value)
- {
- this.scoreOnly = value;
- }
-
- /**
- * Gets the value of the score property.
- *
- * @return possible object is {@link Double }
- *
- */
- public Double getScore()
- {
- return score;
- }
-
- /**
- * Sets the value of the score property.
- *
- * @param value
- * allowed object is {@link Double }
- *
- */
- public void setScore(Double value)
- {
- this.score = value;
- }
-
- /**
- * Gets the value of the visible property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isVisible()
- {
- return visible;
- }
-
- /**
- * Sets the value of the visible property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setVisible(Boolean value)
- {
- this.visible = value;
- }
-
- /**
- * Gets the value of the centreColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isCentreColLabels()
- {
- return centreColLabels;
- }
-
- /**
- * Sets the value of the centreColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setCentreColLabels(Boolean value)
- {
- this.centreColLabels = value;
- }
-
- /**
- * Gets the value of the scaleColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isScaleColLabels()
- {
- return scaleColLabels;
- }
-
- /**
- * Sets the value of the scaleColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setScaleColLabels(Boolean value)
- {
- this.scaleColLabels = value;
- }
-
- /**
- * Gets the value of the showAllColLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowAllColLabels()
- {
- return showAllColLabels;
- }
-
- /**
- * Sets the value of the showAllColLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowAllColLabels(Boolean value)
- {
- this.showAllColLabels = value;
- }
-
- /**
- * Gets the value of the autoCalculated property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isAutoCalculated()
- {
- if (autoCalculated == null)
- {
- return false;
- }
- else
- {
- return autoCalculated;
- }
- }
-
- /**
- * Sets the value of the autoCalculated property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setAutoCalculated(Boolean value)
- {
- this.autoCalculated = value;
- }
-
- /**
- * Gets the value of the belowAlignment property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isBelowAlignment()
- {
- if (belowAlignment == null)
- {
- return true;
- }
- else
- {
- return belowAlignment;
- }
- }
-
- /**
- * Sets the value of the belowAlignment property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setBelowAlignment(Boolean value)
- {
- this.belowAlignment = value;
- }
-
- /**
- * Gets the value of the calcId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getCalcId()
- {
- return calcId;
- }
-
- /**
- * Sets the value of the calcId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setCalcId(String value)
- {
- this.calcId = value;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="label" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
- * name="colour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class ThresholdLine
- {
-
- @XmlAttribute(name = "label")
- protected String label;
++ /**
++ * Sets the value of the label property.
+ *
+ * @param value
- * allowed object is {@link String }
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setLabel(String value) {
++ this.label = value;
++ }
+
- @XmlAttribute(name = "value")
- protected Float value;
++ /**
++ * Gets the value of the description property.
+ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
+ */
- public void setName(String value)
- {
- this.name = value;
++ public String getDescription() {
++ return description;
+ }
- @XmlAttribute(name = "colour")
- protected Integer colour;
+ /**
- * Gets the value of the value property.
++ * Sets the value of the description property.
+ *
- * @return possible object is {@link String }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDescription(String value) {
++ this.description = value;
++ }
+
+ /**
- * Gets the value of the label property.
++ * Gets the value of the thresholdLine property.
*
- * @return possible object is {@link String }
++ * @return
++ * possible object is
++ * {@link Annotation.ThresholdLine }
++ *
+ */
- public String getValue()
- {
- return value;
++ public Annotation.ThresholdLine getThresholdLine() {
++ return thresholdLine;
+ }
+
+ /**
- * Sets the value of the value property.
++ * Sets the value of the thresholdLine property.
*
+ * @param value
- * allowed object is {@link String }
- *
- */
- public void setValue(String value)
- {
- this.value = value;
- }
-
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="label" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
- * name="colour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class ThresholdLine
- {
-
- @XmlAttribute(name = "label")
- protected String label;
++ * allowed object is
++ * {@link Annotation.ThresholdLine }
++ *
+ */
- public String getLabel()
- {
- return label;
++ public void setThresholdLine(Annotation.ThresholdLine value) {
++ this.thresholdLine = value;
+ }
- @XmlAttribute(name = "value")
- protected Float value;
+ /**
- * Sets the value of the label property.
++ * Gets the value of the contactmatrix property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the contactmatrix property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getContactmatrix().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link MapOnAMatrixType }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the contactmatrix property.
++ */
++ public List<MapOnAMatrixType> getContactmatrix() {
++ if (contactmatrix == null) {
++ contactmatrix = new ArrayList<MapOnAMatrixType>();
++ }
++ return this.contactmatrix;
++ }
+
- @XmlAttribute(name = "colour")
- protected Integer colour;
++ /**
++ * Gets the value of the property property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the property property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getProperty().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Property }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the property property.
++ */
++ public List<Property> getProperty() {
++ if (property == null) {
++ property = new ArrayList<Property>();
++ }
++ return this.property;
++ }
+
+ /**
- * Gets the value of the label property.
++ * Gets the value of the graph property.
+ *
- * @return possible object is {@link String }
++ */
++ public boolean isGraph() {
++ return graph;
++ }
++
++ /**
++ * Sets the value of the graph property.
+ *
+ */
- public String getLabel()
- {
- return label;
++ public void setGraph(boolean value) {
++ this.graph = value;
+ }
+
+ /**
- * Sets the value of the label property.
++ * Gets the value of the graphType property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getGraphType() {
++ return graphType;
++ }
++
++ /**
++ * Sets the value of the graphType property.
+ *
+ * @param value
- * allowed object is {@link String }
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setGraphType(Integer value) {
++ this.graphType = value;
++ }
++
++ /**
++ * Gets the value of the sequenceRef property.
+ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
+ */
- public void setLabel(String value)
- {
- this.label = value;
++ public String getSequenceRef() {
++ return sequenceRef;
+ }
+
+ /**
- * Gets the value of the value property.
++ * Sets the value of the sequenceRef property.
+ *
- * @return possible object is {@link Float }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setSequenceRef(String value) {
++ this.sequenceRef = value;
++ }
++
++ /**
++ * Gets the value of the groupRef property.
+ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
+ */
- public Float getValue()
- {
- return value;
++ public String getGroupRef() {
++ return groupRef;
+ }
+
+ /**
- * Sets the value of the value property.
++ * Sets the value of the groupRef property.
+ *
+ * @param value
- * allowed object is {@link Float }
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setGroupRef(String value) {
++ this.groupRef = value;
++ }
++
++ /**
++ * Gets the value of the graphColour property.
+ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
+ */
- public void setValue(Float value)
- {
- this.value = value;
++ public Integer getGraphColour() {
++ return graphColour;
+ }
+
+ /**
- * Gets the value of the colour property.
++ * Sets the value of the graphColour property.
*
- * @return possible object is {@link Integer }
+ * @param value
- * allowed object is {@link String }
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setGraphColour(Integer value) {
++ this.graphColour = value;
++ }
++
++ /**
++ * Gets the value of the graphGroup property.
*
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
*/
- public Integer getColour()
- {
- return colour;
- public void setLabel(String value)
- {
- this.label = value;
++ public Integer getGraphGroup() {
++ return graphGroup;
}
/**
- * Sets the value of the colour property.
- * Gets the value of the value property.
++ * Sets the value of the graphGroup property.
*
- * @return possible object is {@link Float }
+ * @param value
- * allowed object is {@link Integer }
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setGraphGroup(Integer value) {
++ this.graphGroup = value;
++ }
++
++ /**
++ * height in pixels for the graph if this is a
++ * graph-type annotation.
*
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
*/
- public void setColour(Integer value)
- {
- this.colour = value;
- public Float getValue()
- {
- return value;
++ public Integer getGraphHeight() {
++ return graphHeight;
}
- }
+ /**
- * Sets the value of the value property.
++ * Sets the value of the graphHeight property.
+ *
+ * @param value
- * allowed object is {@link Float }
++ * allowed object is
++ * {@link Integer }
++ *
++ * @see #getGraphHeight()
++ */
++ public void setGraphHeight(Integer value) {
++ this.graphHeight = value;
++ }
++
++ /**
++ * Gets the value of the id property.
+ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
+ */
- public void setValue(Float value)
- {
- this.value = value;
++ public String getId() {
++ return id;
+ }
+
+ /**
- * Gets the value of the colour property.
++ * Sets the value of the id property.
+ *
- * @return possible object is {@link Integer }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
++
++ /**
++ * Gets the value of the scoreOnly property.
+ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
+ */
- public Integer getColour()
- {
- return colour;
++ public boolean isScoreOnly() {
++ if (scoreOnly == null) {
++ return false;
++ } else {
++ return scoreOnly;
++ }
+ }
+
+ /**
- * Sets the value of the colour property.
++ * Sets the value of the scoreOnly property.
+ *
+ * @param value
- * allowed object is {@link Integer }
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setScoreOnly(Boolean value) {
++ this.scoreOnly = value;
++ }
++
++ /**
++ * Gets the value of the score property.
+ *
++ * @return
++ * possible object is
++ * {@link Double }
++ *
+ */
- public void setColour(Integer value)
- {
- this.colour = value;
++ public Double getScore() {
++ return score;
+ }
+
- }
++ /**
++ * Sets the value of the score property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Double }
++ *
++ */
++ public void setScore(Double value) {
++ this.score = value;
++ }
++
++ /**
++ * Gets the value of the visible property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isVisible() {
++ return visible;
++ }
++
++ /**
++ * Sets the value of the visible property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setVisible(Boolean value) {
++ this.visible = value;
++ }
++
++ /**
++ * Gets the value of the centreColLabels property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isCentreColLabels() {
++ return centreColLabels;
++ }
++
++ /**
++ * Sets the value of the centreColLabels property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setCentreColLabels(Boolean value) {
++ this.centreColLabels = value;
++ }
++
++ /**
++ * Gets the value of the scaleColLabels property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isScaleColLabels() {
++ return scaleColLabels;
++ }
++
++ /**
++ * Sets the value of the scaleColLabels property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setScaleColLabels(Boolean value) {
++ this.scaleColLabels = value;
++ }
++
++ /**
++ * Gets the value of the showAllColLabels property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isShowAllColLabels() {
++ return showAllColLabels;
++ }
++
++ /**
++ * Sets the value of the showAllColLabels property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setShowAllColLabels(Boolean value) {
++ this.showAllColLabels = value;
++ }
++
++ /**
++ * is an autocalculated annotation row
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public boolean isAutoCalculated() {
++ if (autoCalculated == null) {
++ return false;
++ } else {
++ return autoCalculated;
++ }
++ }
++
++ /**
++ * Sets the value of the autoCalculated property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ * @see #isAutoCalculated()
++ */
++ public void setAutoCalculated(Boolean value) {
++ this.autoCalculated = value;
++ }
++
++ /**
++ * is to be shown below the alignment - introduced
++ * in Jalview 2.8 for visualizing T-COFFEE alignment scores
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public boolean isBelowAlignment() {
++ if (belowAlignment == null) {
++ return true;
++ } else {
++ return belowAlignment;
++ }
++ }
++
++ /**
++ * Sets the value of the belowAlignment property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ * @see #isBelowAlignment()
++ */
++ public void setBelowAlignment(Boolean value) {
++ this.belowAlignment = value;
++ }
++
++ /**
++ * Optional string identifier used to group sets of
++ * annotation produced by a particular calculation. Values are opaque
++ * strings but have semantic meaning to Jalview's renderer, data
++ * importer and calculation system.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getCalcId() {
++ return calcId;
++ }
++
++ /**
++ * Sets the value of the calcId property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getCalcId()
++ */
++ public void setCalcId(String value) {
++ this.calcId = value;
++ }
++
++
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="label" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class ThresholdLine {
++
++ @XmlAttribute(name = "label")
++ protected String label;
++ @XmlAttribute(name = "value")
++ protected Float value;
++ @XmlAttribute(name = "colour")
++ protected Integer colour;
++
++ /**
++ * Gets the value of the label property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getLabel() {
++ return label;
++ }
++
++ /**
++ * Sets the value of the label property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setLabel(String value) {
++ this.label = value;
++ }
++
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getValue() {
++ return value;
++ }
++
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setValue(Float value) {
++ this.value = value;
++ }
++
++ /**
++ * Gets the value of the colour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getColour() {
++ return colour;
++ }
++
++ /**
++ * Sets the value of the colour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setColour(Integer value) {
++ this.colour = value;
++ }
++
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for AnnotationColourScheme complex type.
++ * <p>Java class for AnnotationColourScheme complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="AnnotationColourScheme"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="aboveThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;attribute name="annotation"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="minColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;attribute name="maxColour"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
-- * name="colourScheme" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="threshold"
-- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
-- * name="perSequence" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
-- * &lt;attribute name="predefinedColours"
-- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="AnnotationColourScheme">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="aboveThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="annotation" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="minColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="maxColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="colourScheme" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="perSequence" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="predefinedColours" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType(name = "AnnotationColourScheme", namespace = "www.jalview.org")
--public class AnnotationColourScheme
--{
--
-- @XmlAttribute(name = "aboveThreshold")
-- protected Integer aboveThreshold;
--
-- @XmlAttribute(name = "annotation")
-- protected String annotation;
--
-- @XmlAttribute(name = "minColour")
-- protected Integer minColour;
--
-- @XmlAttribute(name = "maxColour")
-- protected Integer maxColour;
--
-- @XmlAttribute(name = "colourScheme")
-- protected String colourScheme;
--
-- @XmlAttribute(name = "threshold")
-- protected Float threshold;
--
-- @XmlAttribute(name = "perSequence")
-- protected Boolean perSequence;
--
-- @XmlAttribute(name = "predefinedColours")
-- protected Boolean predefinedColours;
--
-- /**
-- * Gets the value of the aboveThreshold property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getAboveThreshold()
-- {
-- return aboveThreshold;
-- }
--
-- /**
-- * Sets the value of the aboveThreshold property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setAboveThreshold(Integer value)
-- {
-- this.aboveThreshold = value;
-- }
--
-- /**
-- * Gets the value of the annotation property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getAnnotation()
-- {
-- return annotation;
-- }
--
-- /**
-- * Sets the value of the annotation property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setAnnotation(String value)
-- {
-- this.annotation = value;
-- }
--
-- /**
-- * Gets the value of the minColour property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getMinColour()
-- {
-- return minColour;
-- }
--
-- /**
-- * Sets the value of the minColour property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setMinColour(Integer value)
-- {
-- this.minColour = value;
-- }
--
-- /**
-- * Gets the value of the maxColour property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getMaxColour()
-- {
-- return maxColour;
-- }
--
-- /**
-- * Sets the value of the maxColour property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setMaxColour(Integer value)
-- {
-- this.maxColour = value;
-- }
--
-- /**
-- * Gets the value of the colourScheme property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getColourScheme()
-- {
-- return colourScheme;
-- }
--
-- /**
-- * Sets the value of the colourScheme property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setColourScheme(String value)
-- {
-- this.colourScheme = value;
-- }
--
-- /**
-- * Gets the value of the threshold property.
-- *
-- * @return possible object is {@link Float }
-- *
-- */
-- public Float getThreshold()
-- {
-- return threshold;
-- }
--
-- /**
-- * Sets the value of the threshold property.
-- *
-- * @param value
-- * allowed object is {@link Float }
-- *
-- */
-- public void setThreshold(Float value)
-- {
-- this.threshold = value;
-- }
--
-- /**
-- * Gets the value of the perSequence property.
-- *
-- * @return possible object is {@link Boolean }
-- *
-- */
-- public Boolean isPerSequence()
-- {
-- return perSequence;
-- }
--
-- /**
-- * Sets the value of the perSequence property.
-- *
-- * @param value
-- * allowed object is {@link Boolean }
-- *
-- */
-- public void setPerSequence(Boolean value)
-- {
-- this.perSequence = value;
-- }
--
-- /**
-- * Gets the value of the predefinedColours property.
-- *
-- * @return possible object is {@link Boolean }
-- *
-- */
-- public Boolean isPredefinedColours()
-- {
-- return predefinedColours;
-- }
--
-- /**
-- * Sets the value of the predefinedColours property.
-- *
-- * @param value
-- * allowed object is {@link Boolean }
-- *
-- */
-- public void setPredefinedColours(Boolean value)
-- {
-- this.predefinedColours = value;
-- }
++public class AnnotationColourScheme {
++
++ @XmlAttribute(name = "aboveThreshold")
++ protected Integer aboveThreshold;
++ @XmlAttribute(name = "annotation")
++ protected String annotation;
++ @XmlAttribute(name = "minColour")
++ protected Integer minColour;
++ @XmlAttribute(name = "maxColour")
++ protected Integer maxColour;
++ @XmlAttribute(name = "colourScheme")
++ protected String colourScheme;
++ @XmlAttribute(name = "threshold")
++ protected Float threshold;
++ @XmlAttribute(name = "perSequence")
++ protected Boolean perSequence;
++ @XmlAttribute(name = "predefinedColours")
++ protected Boolean predefinedColours;
++
++ /**
++ * Gets the value of the aboveThreshold property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getAboveThreshold() {
++ return aboveThreshold;
++ }
++
++ /**
++ * Sets the value of the aboveThreshold property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setAboveThreshold(Integer value) {
++ this.aboveThreshold = value;
++ }
++
++ /**
++ * Gets the value of the annotation property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getAnnotation() {
++ return annotation;
++ }
++
++ /**
++ * Sets the value of the annotation property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setAnnotation(String value) {
++ this.annotation = value;
++ }
++
++ /**
++ * Gets the value of the minColour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getMinColour() {
++ return minColour;
++ }
++
++ /**
++ * Sets the value of the minColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setMinColour(Integer value) {
++ this.minColour = value;
++ }
++
++ /**
++ * Gets the value of the maxColour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getMaxColour() {
++ return maxColour;
++ }
++
++ /**
++ * Sets the value of the maxColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setMaxColour(Integer value) {
++ this.maxColour = value;
++ }
++
++ /**
++ * Gets the value of the colourScheme property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getColourScheme() {
++ return colourScheme;
++ }
++
++ /**
++ * Sets the value of the colourScheme property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setColourScheme(String value) {
++ this.colourScheme = value;
++ }
++
++ /**
++ * Gets the value of the threshold property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getThreshold() {
++ return threshold;
++ }
++
++ /**
++ * Sets the value of the threshold property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setThreshold(Float value) {
++ this.threshold = value;
++ }
++
++ /**
++ * Gets the value of the perSequence property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isPerSequence() {
++ return perSequence;
++ }
++
++ /**
++ * Sets the value of the perSequence property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setPerSequence(Boolean value) {
++ this.perSequence = value;
++ }
++
++ /**
++ * Gets the value of the predefinedColours property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isPredefinedColours() {
++ return predefinedColours;
++ }
++
++ /**
++ * Sets the value of the predefinedColours property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setPredefinedColours(Boolean value) {
++ this.predefinedColours = value;
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="displayCharacter"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="description"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="secondaryStructure" minOccurs="0"&gt;
-- * &lt;simpleType&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}string"&gt; &lt;length
-- * value="1"/&gt; &lt;/restriction&gt; &lt;/simpleType&gt;
-- * &lt;/element&gt; &lt;element name="value"
-- * type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="position" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
-- * name="colour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="displayCharacter" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="secondaryStructure" minOccurs="0">
++ * <simpleType>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
++ * <length value="1"/>
++ * </restriction>
++ * </simpleType>
++ * </element>
++ * <element name="value" type="{http://www.w3.org/2001/XMLSchema}float" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="position" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "",
-- propOrder =
-- { "displayCharacter", "description", "secondaryStructure", "value" })
++@XmlType(name = "", propOrder = {
++ "displayCharacter",
++ "description",
++ "secondaryStructure",
++ "value"
++})
@XmlRootElement(name = "annotationElement")
--public class AnnotationElement
--{
--
-- protected String displayCharacter;
--
-- protected String description;
--
-- protected String secondaryStructure;
--
-- protected Float value;
--
-- @XmlAttribute(name = "position", required = true)
-- protected int position;
--
-- @XmlAttribute(name = "colour")
-- protected Integer colour;
--
-- /**
-- * Gets the value of the displayCharacter property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDisplayCharacter()
-- {
-- return displayCharacter;
-- }
--
-- /**
-- * Sets the value of the displayCharacter property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDisplayCharacter(String value)
-- {
-- this.displayCharacter = value;
-- }
--
-- /**
-- * Gets the value of the description property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDescription()
-- {
-- return description;
-- }
--
-- /**
-- * Sets the value of the description property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDescription(String value)
-- {
-- this.description = value;
-- }
--
-- /**
-- * Gets the value of the secondaryStructure property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getSecondaryStructure()
-- {
-- return secondaryStructure;
-- }
--
-- /**
-- * Sets the value of the secondaryStructure property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setSecondaryStructure(String value)
-- {
-- this.secondaryStructure = value;
-- }
--
-- /**
-- * Gets the value of the value property.
-- *
-- * @return possible object is {@link Float }
-- *
-- */
-- public Float getValue()
-- {
-- return value;
-- }
--
-- /**
-- * Sets the value of the value property.
-- *
-- * @param value
-- * allowed object is {@link Float }
-- *
-- */
-- public void setValue(Float value)
-- {
-- this.value = value;
-- }
--
-- /**
-- * Gets the value of the position property.
-- *
-- */
-- public int getPosition()
-- {
-- return position;
-- }
--
-- /**
-- * Sets the value of the position property.
-- *
-- */
-- public void setPosition(int value)
-- {
-- this.position = value;
-- }
--
-- /**
-- * Gets the value of the colour property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getColour()
-- {
-- return colour;
-- }
--
-- /**
-- * Sets the value of the colour property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setColour(Integer value)
-- {
-- this.colour = value;
-- }
++public class AnnotationElement {
++
++ protected String displayCharacter;
++ protected String description;
++ protected String secondaryStructure;
++ protected Float value;
++ @XmlAttribute(name = "position", required = true)
++ protected int position;
++ @XmlAttribute(name = "colour")
++ protected Integer colour;
++
++ /**
++ * Gets the value of the displayCharacter property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDisplayCharacter() {
++ return displayCharacter;
++ }
++
++ /**
++ * Sets the value of the displayCharacter property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDisplayCharacter(String value) {
++ this.displayCharacter = value;
++ }
++
++ /**
++ * Gets the value of the description property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDescription() {
++ return description;
++ }
++
++ /**
++ * Sets the value of the description property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDescription(String value) {
++ this.description = value;
++ }
++
++ /**
++ * Gets the value of the secondaryStructure property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getSecondaryStructure() {
++ return secondaryStructure;
++ }
++
++ /**
++ * Sets the value of the secondaryStructure property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setSecondaryStructure(String value) {
++ this.secondaryStructure = value;
++ }
++
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getValue() {
++ return value;
++ }
++
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setValue(Float value) {
++ this.value = value;
++ }
++
++ /**
++ * Gets the value of the position property.
++ *
++ */
++ public int getPosition() {
++ return position;
++ }
++
++ /**
++ * Sets the value of the position property.
++ *
++ */
++ public void setPosition(int value) {
++ this.position = value;
++ }
++
++ /**
++ * Gets the value of the colour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getColour() {
++ return colour;
++ }
++
++ /**
++ * Sets the value of the colour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setColour(Integer value) {
++ this.colour = value;
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for DoubleMatrix complex type.
++ * <p>Java class for DoubleMatrix complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="DoubleMatrix"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="row"
-- * type="{www.jalview.org}DoubleVector" maxOccurs="unbounded"
-- * minOccurs="0"/&gt; &lt;element name="D"
-- * type="{www.jalview.org}DoubleVector" minOccurs="0"/&gt; &lt;element
-- * name="E" type="{www.jalview.org}DoubleVector" minOccurs="0"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="rows"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
-- * name="columns" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="DoubleMatrix">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="row" type="{www.jalview.org}DoubleVector" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="D" type="{www.jalview.org}DoubleVector" minOccurs="0"/>
++ * <element name="E" type="{www.jalview.org}DoubleVector" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="rows" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="columns" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "DoubleMatrix",
-- namespace = "www.jalview.org",
-- propOrder =
-- { "row", "d", "e" })
--public class DoubleMatrix
--{
--
-- protected List<DoubleVector> row;
--
-- @XmlElement(name = "D")
-- protected DoubleVector d;
--
-- @XmlElement(name = "E")
-- protected DoubleVector e;
--
-- @XmlAttribute(name = "rows")
-- protected Integer rows;
--
-- @XmlAttribute(name = "columns")
-- protected Integer columns;
--
-- /**
-- * Gets the value of the row property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the row property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getRow().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link DoubleVector }
-- *
-- *
-- */
-- public List<DoubleVector> getRow()
-- {
-- if (row == null)
-- {
-- row = new ArrayList<DoubleVector>();
++@XmlType(name = "DoubleMatrix", namespace = "www.jalview.org", propOrder = {
++ "row",
++ "d",
++ "e"
++})
++public class DoubleMatrix {
++
++ protected List<DoubleVector> row;
++ @XmlElement(name = "D")
++ protected DoubleVector d;
++ @XmlElement(name = "E")
++ protected DoubleVector e;
++ @XmlAttribute(name = "rows")
++ protected Integer rows;
++ @XmlAttribute(name = "columns")
++ protected Integer columns;
++
++ /**
++ * Gets the value of the row property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the row property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getRow().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link DoubleVector }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the row property.
++ */
++ public List<DoubleVector> getRow() {
++ if (row == null) {
++ row = new ArrayList<DoubleVector>();
++ }
++ return this.row;
++ }
++
++ /**
++ * Gets the value of the d property.
++ *
++ * @return
++ * possible object is
++ * {@link DoubleVector }
++ *
++ */
++ public DoubleVector getD() {
++ return d;
++ }
++
++ /**
++ * Sets the value of the d property.
++ *
++ * @param value
++ * allowed object is
++ * {@link DoubleVector }
++ *
++ */
++ public void setD(DoubleVector value) {
++ this.d = value;
++ }
++
++ /**
++ * Gets the value of the e property.
++ *
++ * @return
++ * possible object is
++ * {@link DoubleVector }
++ *
++ */
++ public DoubleVector getE() {
++ return e;
++ }
++
++ /**
++ * Sets the value of the e property.
++ *
++ * @param value
++ * allowed object is
++ * {@link DoubleVector }
++ *
++ */
++ public void setE(DoubleVector value) {
++ this.e = value;
++ }
++
++ /**
++ * Gets the value of the rows property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getRows() {
++ return rows;
++ }
++
++ /**
++ * Sets the value of the rows property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setRows(Integer value) {
++ this.rows = value;
++ }
++
++ /**
++ * Gets the value of the columns property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getColumns() {
++ return columns;
++ }
++
++ /**
++ * Sets the value of the columns property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setColumns(Integer value) {
++ this.columns = value;
}
-- return this.row;
-- }
--
-- /**
-- * Gets the value of the d property.
-- *
-- * @return possible object is {@link DoubleVector }
-- *
-- */
-- public DoubleVector getD()
-- {
-- return d;
-- }
--
-- /**
-- * Sets the value of the d property.
-- *
-- * @param value
-- * allowed object is {@link DoubleVector }
-- *
-- */
-- public void setD(DoubleVector value)
-- {
-- this.d = value;
-- }
--
-- /**
-- * Gets the value of the e property.
-- *
-- * @return possible object is {@link DoubleVector }
-- *
-- */
-- public DoubleVector getE()
-- {
-- return e;
-- }
--
-- /**
-- * Sets the value of the e property.
-- *
-- * @param value
-- * allowed object is {@link DoubleVector }
-- *
-- */
-- public void setE(DoubleVector value)
-- {
-- this.e = value;
-- }
--
-- /**
-- * Gets the value of the rows property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getRows()
-- {
-- return rows;
-- }
--
-- /**
-- * Sets the value of the rows property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setRows(Integer value)
-- {
-- this.rows = value;
-- }
--
-- /**
-- * Gets the value of the columns property.
-- *
-- * @return possible object is {@link Integer }
-- *
-- */
-- public Integer getColumns()
-- {
-- return columns;
-- }
--
-- /**
-- * Sets the value of the columns property.
-- *
-- * @param value
-- * allowed object is {@link Integer }
-- *
-- */
-- public void setColumns(Integer value)
-- {
-- this.columns = value;
-- }
}
//
- // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802
- // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a>
-// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
+ // See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
+
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
+
/**
- * <p>Java class for DoubleVector complex type.
- * <p>Java class for DoubleVector complex type.
++ * <p>Java class for DoubleVector complex type</p>.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
- * <pre> &lt;complexType name="DoubleVector"&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="v"
- * type="{http://www.w3.org/2001/XMLSchema}double" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
+ * <pre>
- * <complexType name="DoubleVector">
- * <complexContent>
- * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
- * <sequence>
- * <element name="v" type="{http://www.w3.org/2001/XMLSchema}double" maxOccurs="unbounded" minOccurs="0"/>
- * </sequence>
- * </restriction>
- * </complexContent>
- * </complexType>
++ * <complexType name="DoubleVector">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="v" type="{http://www.w3.org/2001/XMLSchema}double" maxOccurs="unbounded" minOccurs="0"/>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
+ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(
- name = "DoubleVector",
- namespace = "www.jalview.org",
- propOrder =
- { "v" })
-public class DoubleVector
-{
+@XmlType(name = "DoubleVector", namespace = "www.jalview.org", propOrder = {
+ "v"
+})
+public class DoubleVector {
- @XmlElement(type = Double.class)
- protected List<Double> v;
+ @XmlElement(type = Double.class)
+ protected List<Double> v;
- /**
- * Gets the value of the v property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the v property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getV().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Double }
- *
- *
- */
- public List<Double> getV()
- {
- if (v == null)
- {
- v = new ArrayList<Double>();
+ /**
+ * Gets the value of the v property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the v property.
++ * This is why there is not a <CODE>set</CODE> method for the v property.</p>
+ *
+ * <p>
+ * For example, to add a new item, do as follows:
++ * </p>
+ * <pre>
- * getV().add(newItem);
++ * getV().add(newItem);
+ * </pre>
+ *
+ *
+ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Double }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the v property.
+ */
+ public List<Double> getV() {
+ if (v == null) {
+ v = new ArrayList<Double>();
+ }
+ return this.v;
}
- return this.v;
- }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlAttribute;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for feature complex type.
++ * <p>Java class for feature complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="feature"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="otherData"
-- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;attribute name="key2"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;attribute name="begin" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
-- * name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
-- * /&gt; &lt;attribute name="type" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="description" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="status"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="featureGroup" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="score" type="{http://www.w3.org/2001/XMLSchema}float"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="feature">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="otherData" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="key2" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attribute name="begin" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="status" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="featureGroup" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="score" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "feature",
-- namespace = "www.jalview.org",
-- propOrder =
-- { "otherData" })
--public class Feature
--{
--
-- protected List<Feature.OtherData> otherData;
--
-- @XmlAttribute(name = "begin", required = true)
-- protected int begin;
--
-- @XmlAttribute(name = "end", required = true)
-- protected int end;
--
-- @XmlAttribute(name = "type", required = true)
-- protected String type;
--
-- @XmlAttribute(name = "description")
-- protected String description;
--
-- @XmlAttribute(name = "status")
-- protected String status;
--
-- @XmlAttribute(name = "featureGroup")
-- protected String featureGroup;
--
-- @XmlAttribute(name = "score")
-- protected Float score;
--
-- /**
-- * Gets the value of the otherData property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the otherData property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getOtherData().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link Feature.OtherData }
-- *
-- *
-- */
-- public List<Feature.OtherData> getOtherData()
-- {
-- if (otherData == null)
-- {
-- otherData = new ArrayList<Feature.OtherData>();
++@XmlType(name = "feature", namespace = "www.jalview.org", propOrder = {
++ "otherData"
++})
++public class Feature {
++
++ protected List<Feature.OtherData> otherData;
++ @XmlAttribute(name = "begin", required = true)
++ protected int begin;
++ @XmlAttribute(name = "end", required = true)
++ protected int end;
++ @XmlAttribute(name = "type", required = true)
++ protected String type;
++ @XmlAttribute(name = "description")
++ protected String description;
++ @XmlAttribute(name = "status")
++ protected String status;
++ @XmlAttribute(name = "featureGroup")
++ protected String featureGroup;
++ @XmlAttribute(name = "score")
++ protected Float score;
++
++ /**
++ * Gets the value of the otherData property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the otherData property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getOtherData().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Feature.OtherData }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the otherData property.
++ */
++ public List<Feature.OtherData> getOtherData() {
++ if (otherData == null) {
++ otherData = new ArrayList<Feature.OtherData>();
++ }
++ return this.otherData;
}
-- return this.otherData;
-- }
--
-- /**
-- * Gets the value of the begin property.
-- *
-- */
-- public int getBegin()
-- {
-- return begin;
-- }
--
-- /**
-- * Sets the value of the begin property.
-- *
-- */
-- public void setBegin(int value)
-- {
-- this.begin = value;
-- }
--
-- /**
-- * Gets the value of the end property.
-- *
-- */
-- public int getEnd()
-- {
-- return end;
-- }
--
-- /**
-- * Sets the value of the end property.
-- *
-- */
-- public void setEnd(int value)
-- {
-- this.end = value;
-- }
--
-- /**
-- * Gets the value of the type property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getType()
-- {
-- return type;
-- }
--
-- /**
-- * Sets the value of the type property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setType(String value)
-- {
-- this.type = value;
-- }
--
-- /**
-- * Gets the value of the description property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDescription()
-- {
-- return description;
-- }
--
-- /**
-- * Sets the value of the description property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDescription(String value)
-- {
-- this.description = value;
-- }
--
-- /**
-- * Gets the value of the status property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getStatus()
-- {
-- return status;
-- }
--
-- /**
-- * Sets the value of the status property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setStatus(String value)
-- {
-- this.status = value;
-- }
--
-- /**
-- * Gets the value of the featureGroup property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getFeatureGroup()
-- {
-- return featureGroup;
-- }
--
-- /**
-- * Sets the value of the featureGroup property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setFeatureGroup(String value)
-- {
-- this.featureGroup = value;
-- }
--
-- /**
-- * Gets the value of the score property.
-- *
-- * @return possible object is {@link Float }
-- *
-- */
-- public Float getScore()
-- {
-- return score;
-- }
--
-- /**
-- * Sets the value of the score property.
-- *
-- * @param value
-- * allowed object is {@link Float }
-- *
-- */
-- public void setScore(Float value)
-- {
-- this.score = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;attribute name="key2"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "")
-- public static class OtherData
-- {
--
-- @XmlAttribute(name = "key", required = true)
-- protected String key;
--
-- @XmlAttribute(name = "key2")
-- protected String key2;
--
-- @XmlAttribute(name = "value", required = true)
-- protected String value;
/**
-- * Gets the value of the key property.
++ * Gets the value of the begin property.
*
-- * @return possible object is {@link String }
++ */
++ public int getBegin() {
++ return begin;
++ }
++
++ /**
++ * Sets the value of the begin property.
*
*/
-- public String getKey()
-- {
-- return key;
++ public void setBegin(int value) {
++ this.begin = value;
}
/**
-- * Sets the value of the key property.
++ * Gets the value of the end property.
*
-- * @param value
-- * allowed object is {@link String }
++ */
++ public int getEnd() {
++ return end;
++ }
++
++ /**
++ * Sets the value of the end property.
++ *
++ */
++ public void setEnd(int value) {
++ this.end = value;
++ }
++
++ /**
++ * Gets the value of the type property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public void setKey(String value)
-- {
-- this.key = value;
++ public String getType() {
++ return type;
}
/**
-- * Gets the value of the key2 property.
++ * Sets the value of the type property.
*
-- * @return possible object is {@link String }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setType(String value) {
++ this.type = value;
++ }
++
++ /**
++ * Gets the value of the description property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getKey2()
-- {
-- return key2;
++ public String getDescription() {
++ return description;
}
/**
-- * Sets the value of the key2 property.
++ * Sets the value of the description property.
*
* @param value
-- * allowed object is {@link String }
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDescription(String value) {
++ this.description = value;
++ }
++
++ /**
++ * Gets the value of the status property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public void setKey2(String value)
-- {
-- this.key2 = value;
++ public String getStatus() {
++ return status;
}
/**
-- * Gets the value of the value property.
++ * Sets the value of the status property.
*
-- * @return possible object is {@link String }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setStatus(String value) {
++ this.status = value;
++ }
++
++ /**
++ * Gets the value of the featureGroup property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getValue()
-- {
-- return value;
++ public String getFeatureGroup() {
++ return featureGroup;
}
/**
-- * Sets the value of the value property.
++ * Sets the value of the featureGroup property.
*
* @param value
-- * allowed object is {@link String }
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setFeatureGroup(String value) {
++ this.featureGroup = value;
++ }
++
++ /**
++ * Gets the value of the score property.
*
++ * @return
++ * possible object is
++ * {@link Float }
++ *
*/
-- public void setValue(String value)
-- {
-- this.value = value;
++ public Float getScore() {
++ return score;
}
-- }
++ /**
++ * Sets the value of the score property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setScore(Float value) {
++ this.score = value;
++ }
++
++
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="key" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="key2" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class OtherData {
++
++ @XmlAttribute(name = "key", required = true)
++ protected String key;
++ /**
++ * key2 may be used for a sub-attribute of key
++ *
++ */
++ @XmlAttribute(name = "key2")
++ protected String key2;
++ @XmlAttribute(name = "value", required = true)
++ protected String value;
++
++ /**
++ * Gets the value of the key property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getKey() {
++ return key;
++ }
++
++ /**
++ * Sets the value of the key property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setKey(String value) {
++ this.key = value;
++ }
++
++ /**
++ * key2 may be used for a sub-attribute of key
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getKey2() {
++ return key2;
++ }
++
++ /**
++ * Sets the value of the key2 property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getKey2()
++ */
++ public void setKey2(String value) {
++ this.key2 = value;
++ }
++
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getValue() {
++ return value;
++ }
++
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
++
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for FeatureMatcher complex type.
++ * <p>Java class for FeatureMatcher complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="FeatureMatcher"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="attributeName"
-- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2"
-- * minOccurs="0"/&gt; &lt;element name="condition"
-- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt; &lt;element
-- * name="value" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="by"
-- * type="{www.jalview.org/colours}FilterBy" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="FeatureMatcher">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * <element name="condition" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="value" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * </sequence>
++ * <attribute name="by" type="{www.jalview.org/colours}FilterBy" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "FeatureMatcher",
-- namespace = "www.jalview.org/colours",
-- propOrder =
-- { "attributeName", "condition", "value" })
--public class FeatureMatcher
--{
--
-- @XmlElement(namespace = "")
-- protected List<String> attributeName;
++@XmlType(name = "FeatureMatcher", namespace = "www.jalview.org/colours", propOrder = {
++ "attributeName",
++ "condition",
++ "value"
++})
++public class FeatureMatcher {
-- @XmlElement(namespace = "", required = true)
-- protected String condition;
++ /**
++ * name of feature attribute to filter on, or attribute and sub-attribute
++ *
++ */
++ @XmlElement(namespace = "")
++ protected List<String> attributeName;
++ @XmlElement(namespace = "", required = true)
++ protected String condition;
++ @XmlElement(namespace = "", required = true)
++ protected String value;
++ @XmlAttribute(name = "by")
++ protected FilterBy by;
-- @XmlElement(namespace = "", required = true)
-- protected String value;
--
-- @XmlAttribute(name = "by")
-- protected FilterBy by;
--
-- /**
-- * Gets the value of the attributeName property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the attributeName property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAttributeName().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link String }
-- *
-- *
-- */
-- public List<String> getAttributeName()
-- {
-- if (attributeName == null)
-- {
-- attributeName = new ArrayList<String>();
++ /**
++ * name of feature attribute to filter on, or attribute and sub-attribute
++ *
++ * Gets the value of the attributeName property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the attributeName property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAttributeName().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the attributeName property.
++ */
++ public List<String> getAttributeName() {
++ if (attributeName == null) {
++ attributeName = new ArrayList<String>();
++ }
++ return this.attributeName;
}
-- return this.attributeName;
-- }
-- /**
-- * Gets the value of the condition property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getCondition()
-- {
-- return condition;
-- }
++ /**
++ * Gets the value of the condition property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getCondition() {
++ return condition;
++ }
-- /**
-- * Sets the value of the condition property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setCondition(String value)
-- {
-- this.condition = value;
-- }
++ /**
++ * Sets the value of the condition property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setCondition(String value) {
++ this.condition = value;
++ }
-- /**
-- * Gets the value of the value property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getValue()
-- {
-- return value;
-- }
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getValue() {
++ return value;
++ }
-- /**
-- * Sets the value of the value property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setValue(String value)
-- {
-- this.value = value;
-- }
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
-- /**
-- * Gets the value of the by property.
-- *
-- * @return possible object is {@link FilterBy }
-- *
-- */
-- public FilterBy getBy()
-- {
-- return by;
-- }
++ /**
++ * Gets the value of the by property.
++ *
++ * @return
++ * possible object is
++ * {@link FilterBy }
++ *
++ */
++ public FilterBy getBy() {
++ return by;
++ }
-- /**
-- * Sets the value of the by property.
-- *
-- * @param value
-- * allowed object is {@link FilterBy }
-- *
-- */
-- public void setBy(FilterBy value)
-- {
-- this.by = value;
-- }
++ /**
++ * Sets the value of the by property.
++ *
++ * @param value
++ * allowed object is
++ * {@link FilterBy }
++ *
++ */
++ public void setBy(FilterBy value) {
++ this.by = value;
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
* A feature match condition, which may be simple or compound
*
-- * <p>Java class for FeatureMatcherSet complex type.
++ * <p>Java class for FeatureMatcherSet complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="FeatureMatcherSet"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;choice&gt; &lt;element name="matchCondition"
-- * type="{www.jalview.org/colours}FeatureMatcher"/&gt; &lt;element
-- * name="compoundMatcher"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="matcherSet"
-- * type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2"
-- * minOccurs="2"/&gt; &lt;/sequence&gt; &lt;attribute name="and"
-- * use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;/choice&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="FeatureMatcherSet">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <choice>
++ * <element name="matchCondition" type="{www.jalview.org/colours}FeatureMatcher"/>
++ * <element name="compoundMatcher">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2" minOccurs="2"/>
++ * </sequence>
++ * <attribute name="and" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </choice>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "FeatureMatcherSet",
-- namespace = "www.jalview.org/colours",
-- propOrder =
-- { "matchCondition", "compoundMatcher" })
--public class FeatureMatcherSet
--{
--
-- @XmlElement(namespace = "")
-- protected FeatureMatcher matchCondition;
--
-- @XmlElement(namespace = "")
-- protected FeatureMatcherSet.CompoundMatcher compoundMatcher;
--
-- /**
-- * Gets the value of the matchCondition property.
-- *
-- * @return possible object is {@link FeatureMatcher }
-- *
-- */
-- public FeatureMatcher getMatchCondition()
-- {
-- return matchCondition;
-- }
--
-- /**
-- * Sets the value of the matchCondition property.
-- *
-- * @param value
-- * allowed object is {@link FeatureMatcher }
-- *
-- */
-- public void setMatchCondition(FeatureMatcher value)
-- {
-- this.matchCondition = value;
-- }
--
-- /**
-- * Gets the value of the compoundMatcher property.
-- *
-- * @return possible object is {@link FeatureMatcherSet.CompoundMatcher }
-- *
-- */
-- public FeatureMatcherSet.CompoundMatcher getCompoundMatcher()
-- {
-- return compoundMatcher;
-- }
--
-- /**
-- * Sets the value of the compoundMatcher property.
-- *
-- * @param value
-- * allowed object is {@link FeatureMatcherSet.CompoundMatcher }
-- *
-- */
-- public void setCompoundMatcher(FeatureMatcherSet.CompoundMatcher value)
-- {
-- this.compoundMatcher = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="matcherSet"
-- * type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2"
-- * minOccurs="2"/&gt; &lt;/sequence&gt; &lt;attribute
-- * name="and" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "", propOrder = { "matcherSet" })
-- public static class CompoundMatcher
-- {
--
-- @XmlElement(namespace = "", required = true)
-- protected List<FeatureMatcherSet> matcherSet;
--
-- @XmlAttribute(name = "and", required = true)
-- protected boolean and;
++@XmlType(name = "FeatureMatcherSet", namespace = "www.jalview.org/colours", propOrder = {
++ "matchCondition",
++ "compoundMatcher"
++})
++public class FeatureMatcherSet {
++
++ @XmlElement(namespace = "")
++ protected FeatureMatcher matchCondition;
++ @XmlElement(namespace = "")
++ protected FeatureMatcherSet.CompoundMatcher compoundMatcher;
/**
-- * Gets the value of the matcherSet property.
-- *
-- * <p> This accessor method returns a reference to the live list, not
-- * a snapshot. Therefore any modification you make to the returned list will
-- * be present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the matcherSet property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getMatcherSet().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link FeatureMatcherSet }
++ * Gets the value of the matchCondition property.
*
++ * @return
++ * possible object is
++ * {@link FeatureMatcher }
++ *
++ */
++ public FeatureMatcher getMatchCondition() {
++ return matchCondition;
++ }
++
++ /**
++ * Sets the value of the matchCondition property.
*
++ * @param value
++ * allowed object is
++ * {@link FeatureMatcher }
++ *
*/
-- public List<FeatureMatcherSet> getMatcherSet()
-- {
-- if (matcherSet == null)
-- {
-- matcherSet = new ArrayList<FeatureMatcherSet>();
-- }
-- return this.matcherSet;
++ public void setMatchCondition(FeatureMatcher value) {
++ this.matchCondition = value;
}
/**
-- * Gets the value of the and property.
++ * Gets the value of the compoundMatcher property.
*
++ * @return
++ * possible object is
++ * {@link FeatureMatcherSet.CompoundMatcher }
++ *
*/
-- public boolean isAnd()
-- {
-- return and;
++ public FeatureMatcherSet.CompoundMatcher getCompoundMatcher() {
++ return compoundMatcher;
}
/**
-- * Sets the value of the and property.
++ * Sets the value of the compoundMatcher property.
*
++ * @param value
++ * allowed object is
++ * {@link FeatureMatcherSet.CompoundMatcher }
++ *
*/
-- public void setAnd(boolean value)
-- {
-- this.and = value;
++ public void setCompoundMatcher(FeatureMatcherSet.CompoundMatcher value) {
++ this.compoundMatcher = value;
}
-- }
++
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" maxOccurs="2" minOccurs="2"/>
++ * </sequence>
++ * <attribute name="and" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "", propOrder = {
++ "matcherSet"
++ })
++ public static class CompoundMatcher {
++
++ @XmlElement(namespace = "", required = true)
++ protected List<FeatureMatcherSet> matcherSet;
++ /**
++ * If true, matchers are AND-ed, if false they are OR-ed
++ *
++ */
++ @XmlAttribute(name = "and", required = true)
++ protected boolean and;
++
++ /**
++ * Gets the value of the matcherSet property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the matcherSet property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getMatcherSet().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link FeatureMatcherSet }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the matcherSet property.
++ */
++ public List<FeatureMatcherSet> getMatcherSet() {
++ if (matcherSet == null) {
++ matcherSet = new ArrayList<FeatureMatcherSet>();
++ }
++ return this.matcherSet;
++ }
++
++ /**
++ * If true, matchers are AND-ed, if false they are OR-ed
++ *
++ */
++ public boolean isAnd() {
++ return and;
++ }
++
++ /**
++ * Sets the value of the and property.
++ *
++ */
++ public void setAnd(boolean value) {
++ this.and = value;
++ }
++
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for FilterBy.
++ * Filter may apply to label, score or some feature attribute
++ *
++ * <p>Java class for FilterBy</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class. <pre> &lt;simpleType
-- * name="FilterBy"&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}string"&gt; &lt;enumeration
-- * value="byLabel"/&gt; &lt;enumeration value="byScore"/&gt;
-- * &lt;enumeration value="byAttribute"/&gt; &lt;/restriction&gt;
-- * &lt;/simpleType&gt; </pre>
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ * <pre>
++ * <simpleType name="FilterBy">
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
++ * <enumeration value="byLabel"/>
++ * <enumeration value="byScore"/>
++ * <enumeration value="byAttribute"/>
++ * </restriction>
++ * </simpleType>
++ * </pre>
*
*/
@XmlType(name = "FilterBy", namespace = "www.jalview.org/colours")
@XmlEnum
--public enum FilterBy
--{
--
-- @XmlEnumValue("byLabel")
-- BY_LABEL("byLabel"), @XmlEnumValue("byScore")
-- BY_SCORE("byScore"), @XmlEnumValue("byAttribute")
-- BY_ATTRIBUTE("byAttribute");
--
-- private final String value;
--
-- FilterBy(String v)
-- {
-- value = v;
-- }
--
-- public String value()
-- {
-- return value;
-- }
--
-- public static FilterBy fromValue(String v)
-- {
-- for (FilterBy c : FilterBy.values())
-- {
-- if (c.value.equals(v))
-- {
-- return c;
-- }
++public enum FilterBy {
++
++ @XmlEnumValue("byLabel")
++ BY_LABEL("byLabel"),
++ @XmlEnumValue("byScore")
++ BY_SCORE("byScore"),
++ @XmlEnumValue("byAttribute")
++ BY_ATTRIBUTE("byAttribute");
++ private final String value;
++
++ FilterBy(String v) {
++ value = v;
++ }
++
++ /**
++ * Gets the value associated to the enum constant.
++ *
++ * @return
++ * The value linked to the enum.
++ */
++ public String value() {
++ return value;
++ }
++
++ /**
++ * Gets the enum associated to the value passed as parameter.
++ *
++ * @param v
++ * The value to get the enum from.
++ * @return
++ * The enum which corresponds to the value, if it exists.
++ * @throws IllegalArgumentException
++ * If no value matches in the enum declaration.
++ */
++ public static FilterBy fromValue(String v) {
++ for (FilterBy c: FilterBy.values()) {
++ if (c.value.equals(v)) {
++ return c;
++ }
++ }
++ throw new IllegalArgumentException(v);
}
-- throw new IllegalArgumentException(v);
-- }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
+
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import javax.xml.datatype.XMLGregorianCalendar;
+
/**
-- * <p>Java class for JalviewModel complex type.
++ * <p>Java class for JalviewModel complex type</p>.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
- * <pre>
- * &lt;complexType name="JalviewModel"&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="creationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/&gt;
- * &lt;element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;element name="vamsasModel" type="{www.vamsas.ac.uk/jalview/version2}VAMSAS"/&gt;
- * &lt;sequence&gt;
- * &lt;element name="JSeq" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/&gt;
- * &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org}pdbentry"&gt;
- * &lt;sequence&gt;
- * &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;simpleContent&gt;
- * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt;
- * &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/&gt;
- * &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="secondaryStructure" maxOccurs="unbounded"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="JGroup" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/&gt;
- * &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="Viewport" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showComplementFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showComplementFeaturesOnTop" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="UserColours" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="tree" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence minOccurs="0"&gt;
- * &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="PcaViewer" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="sequencePoint" maxOccurs="unbounded"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="axis" maxOccurs="3" minOccurs="3"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="seqPointMin"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="seqPointMax"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="pcaData" type="{www.jalview.org}PcaDataType"/&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attGroup ref="{www.jalview.org}SimilarityParams"/&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="xDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="FeatureSettings" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="setting" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/&gt;
- * &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" /&gt;
- * &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="group" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/sequence&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- * <pre> &lt;complexType name="JalviewModel"&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="creationDate"
- * type="{http://www.w3.org/2001/XMLSchema}dateTime"/&gt; &lt;element
- * name="version" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;element name="vamsasModel"
- * type="{www.vamsas.ac.uk/jalview/version2}VAMSAS"/&gt;
- * &lt;sequence&gt; &lt;element name="JSeq" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="features"
- * type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/&gt;
- * &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt; &lt;extension
- * base="{www.jalview.org}pdbentry"&gt; &lt;sequence&gt;
- * &lt;element name="structureState" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;simpleContent&gt; &lt;extension
- * base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;/extension&gt; &lt;/simpleContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;/extension&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="hiddenSequences"
- * type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;element name="rnaViewer" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="secondaryStructure"
- * maxOccurs="unbounded"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="dividerLocation"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attribute name="colour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="end" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="hidden"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="JGroup" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="seq"
- * type="{http://www.w3.org/2001/XMLSchema}string"
- * maxOccurs="unbounded"/&gt; &lt;element name="annotationColours"
- * type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;/sequence&gt; &lt;attribute name="start"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="colour"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="displayBoxes"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="colourText"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="showUnconserved"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="true" /&gt; &lt;attribute name="showConsensusHistogram"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="Viewport" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="AnnotationColours"
- * type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;element name="hiddenColumns" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="calcIdParam" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt; &lt;extension
- * base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="autoUpdate" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="overview" minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="residueColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="hiddenColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="pidSelected"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="consThreshold"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="rightAlignIds"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showColourText"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="showBoxes"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="renderGaps"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="showNPfeatureTooltip"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="followHighlight"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="followSelection"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showAnnotation"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="showGroupConservation"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConsensus"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showConsensusHistogram"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="startRes"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="charWidth"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="charHeight" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontName"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="idWidthManuallyAdjusted"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="true" /&gt; &lt;attribute name="viewName"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="gatheredViews"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="id"
- * type="{http://www.w3.org/2001/XMLSchema}ID" /&gt; &lt;attribute
- * name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showComplementFeatures"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showComplementFeaturesOnTop"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="UserColours" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="UserColourScheme"
- * type="{www.jalview.org/colours}JalviewUserColours"/&gt;
- * &lt;/sequence&gt; &lt;attribute name="id"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="tree" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence minOccurs="0"&gt; &lt;element name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt; &lt;element
- * name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute name="fontName"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showBootstrap"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="markUnlinked"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="currentTree"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="columnWise" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="columnReference"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="linkToAllViews"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="PcaViewer" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="sequencePoint"
- * maxOccurs="unbounded"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;attribute name="sequenceRef"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="axis" maxOccurs="3" minOccurs="3"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="seqPointMin"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="seqPointMax"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="pcaData"
- * type="{www.jalview.org}PcaDataType"/&gt; &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}SimilarityParams"/&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="xDim"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="bgColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="FeatureSettings" minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="setting" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="attributeName"
- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2"
- * minOccurs="0"/&gt; &lt;element name="matcherSet"
- * type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/&gt;
- * &lt;/sequence&gt; &lt;attribute name="type" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="display" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt; &lt;attribute
- * name="order" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="mincolour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="noValueColour" type="{www.jalview.org/colours}NoValueColour"
- * default="Min" /&gt; &lt;attribute name="threshold"
- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
- * name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float"
- * /&gt; &lt;attribute name="min"
- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
- * name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="autoScale"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="group" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="name" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="display" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;/sequence&gt; &lt;/sequence&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="JalviewModel">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="creationDate" type="{http://www.w3.org/2001/XMLSchema}dateTime"/>
++ * <element name="version" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="vamsasModel" type="{www.vamsas.ac.uk/jalview/version2}VAMSAS"/>
++ * <sequence>
++ * <element name="JSeq" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="pdbids" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org}pdbentry">
++ * <sequence>
++ * <element name="structureState" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <simpleContent>
++ * <extension base="<http://www.w3.org/2001/XMLSchema>string">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </simpleContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="secondaryStructure" maxOccurs="unbounded">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="hmmerProfile" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="JGroup" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
++ * <element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="Viewport" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
++ * <element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
++ * <attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="overview" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="residueColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="hiddenColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="charWidth" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="charHeight" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="idWidthManuallyAdjusted" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
++ * <attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="showComplementFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showComplementFeaturesOnTop" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="UserColours" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
++ * </sequence>
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="tree" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence minOccurs="0">
++ * <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="columnWise" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="columnReference" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
++ * <attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="PcaViewer" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="sequencePoint" maxOccurs="unbounded">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * <attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="axis" maxOccurs="3" minOccurs="3">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="seqPointMin">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="seqPointMax">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="pcaData" type="{www.jalview.org}PcaDataType"/>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}SimilarityParams"/>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="xDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="showLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="FeatureSettings" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="setting" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="group" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
}
/**
- * Gets the value of the name property.
+ * Gets the value of the jSeq property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @return possible object is {@link String }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the jSeq property.
++ * This is why there is not a <CODE>set</CODE> method for the jSeq property.</p>
*
- * <p>
- */
- public String getName()
- {
- return name;
- }
-
- /**
- * Sets the value of the name property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getJSeq().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getJSeq().add(newItem);
++ * </pre>
*
- * @param value
- * allowed object is {@link String }
*
- * <p>
- */
- public void setName(String value)
- {
- this.name = value;
- }
-
- /**
- * Gets the value of the colour property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JSeq }
++ * </p>
*
- * @return possible object is {@link String }
*
++ * @return
++ * The value of the jSeq property.
*/
- public String getColour()
- {
- return colour;
+ public List<JalviewModel.JSeq> getJSeq() {
+ if (jSeq == null) {
+ jSeq = new ArrayList<JalviewModel.JSeq>();
+ }
+ return this.jSeq;
}
/**
- * Sets the value of the colour property.
+ * Gets the value of the jGroup property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @param value
- * allowed object is {@link String }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the jGroup property.
++ * This is why there is not a <CODE>set</CODE> method for the jGroup property.</p>
*
- * <p>
- */
- public void setColour(String value)
- {
- this.colour = value;
- }
-
- /**
- * Gets the value of the consThreshold property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getJGroup().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getJGroup().add(newItem);
++ * </pre>
*
- * @return possible object is {@link Integer }
*
- * <p>
- */
- public Integer getConsThreshold()
- {
- return consThreshold;
- }
-
- /**
- * Sets the value of the consThreshold property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JGroup }
++ * </p>
*
- * @param value
- * allowed object is {@link Integer }
*
++ * @return
++ * The value of the jGroup property.
*/
- public void setConsThreshold(Integer value)
- {
- this.consThreshold = value;
+ public List<JalviewModel.JGroup> getJGroup() {
+ if (jGroup == null) {
+ jGroup = new ArrayList<JalviewModel.JGroup>();
+ }
+ return this.jGroup;
}
/**
- * Gets the value of the pidThreshold property.
+ * Gets the value of the viewport property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @return possible object is {@link Integer }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the viewport property.
++ * This is why there is not a <CODE>set</CODE> method for the viewport property.</p>
*
- * <p>
- */
- public Integer getPidThreshold()
- {
- return pidThreshold;
- }
-
- /**
- * Sets the value of the pidThreshold property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getViewport().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getViewport().add(newItem);
++ * </pre>
*
- * @param value
- * allowed object is {@link Integer }
*
- * <p>
- */
- public void setPidThreshold(Integer value)
- {
- this.pidThreshold = value;
- }
-
- /**
- * Gets the value of the outlineColour property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.Viewport }
++ * </p>
*
- * @return possible object is {@link Integer }
*
++ * @return
++ * The value of the viewport property.
*/
- public Integer getOutlineColour()
- {
- return outlineColour;
+ public List<JalviewModel.Viewport> getViewport() {
+ if (viewport == null) {
+ viewport = new ArrayList<JalviewModel.Viewport>();
+ }
+ return this.viewport;
}
/**
- * Sets the value of the outlineColour property.
+ * Gets the value of the userColours property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @param value
- * allowed object is {@link Integer }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the userColours property.
++ * This is why there is not a <CODE>set</CODE> method for the userColours property.</p>
*
- * <p>
- */
- public void setOutlineColour(Integer value)
- {
- this.outlineColour = value;
- }
-
- /**
- * Gets the value of the displayBoxes property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getUserColours().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getUserColours().add(newItem);
++ * </pre>
*
- * @return possible object is {@link Boolean }
*
- * <p>
- */
- public Boolean isDisplayBoxes()
- {
- return displayBoxes;
- }
-
- /**
- * Sets the value of the displayBoxes property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.UserColours }
++ * </p>
*
- * @param value
- * allowed object is {@link Boolean }
*
++ * @return
++ * The value of the userColours property.
*/
- public void setDisplayBoxes(Boolean value)
- {
- this.displayBoxes = value;
+ public List<JalviewModel.UserColours> getUserColours() {
+ if (userColours == null) {
+ userColours = new ArrayList<JalviewModel.UserColours>();
+ }
+ return this.userColours;
}
/**
- * Gets the value of the displayText property.
+ * Gets the value of the tree property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @return possible object is {@link Boolean }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the tree property.
++ * This is why there is not a <CODE>set</CODE> method for the tree property.</p>
*
- * <p>
- */
- public Boolean isDisplayText()
- {
- return displayText;
- }
-
- /**
- * Sets the value of the displayText property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getTree().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getTree().add(newItem);
++ * </pre>
*
- * @param value
- * allowed object is {@link Boolean }
*
- * <p>
- */
- public void setDisplayText(Boolean value)
- {
- this.displayText = value;
- }
-
- /**
- * Gets the value of the colourText property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.Tree }
++ * </p>
*
- * @return possible object is {@link Boolean }
*
++ * @return
++ * The value of the tree property.
*/
- public Boolean isColourText()
- {
- return colourText;
+ public List<JalviewModel.Tree> getTree() {
+ if (tree == null) {
+ tree = new ArrayList<JalviewModel.Tree>();
+ }
+ return this.tree;
}
/**
- * Sets the value of the colourText property.
+ * Gets the value of the pcaViewer property.
*
- * <p>
- * This accessor method returns a reference to the live list,
- * @param value
- * allowed object is {@link Boolean }
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the pcaViewer property.
++ * This is why there is not a <CODE>set</CODE> method for the pcaViewer property.</p>
*
- * <p>
- */
- public void setColourText(Boolean value)
- {
- this.colourText = value;
- }
-
- /**
- * Gets the value of the textCol1 property.
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getPcaViewer().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getPcaViewer().add(newItem);
++ * </pre>
*
- * @return possible object is {@link Integer }
*
- * <p>
- */
- public Integer getTextCol1()
- {
- return textCol1;
- }
-
- /**
- * Sets the value of the textCol1 property.
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.PcaViewer }
++ * </p>
*
- * @param value
- * allowed object is {@link Integer }
*
++ * @return
++ * The value of the pcaViewer property.
*/
- public void setTextCol1(Integer value)
- {
- this.textCol1 = value;
+ public List<JalviewModel.PcaViewer> getPcaViewer() {
+ if (pcaViewer == null) {
+ pcaViewer = new ArrayList<JalviewModel.PcaViewer>();
+ }
+ return this.pcaViewer;
}
/**
}
/**
- * Sets the value of the textCol2 property.
+ * Sets the value of the featureSettings property.
*
* @param value
- * allowed object is {@link Integer }
- *
- */
- public void setTextCol2(Integer value)
- {
- this.textCol2 = value;
- }
-
- /**
- * Gets the value of the textColThreshold property.
+ * allowed object is
+ * {@link JalviewModel.FeatureSettings }
+ *
+ */
+ public void setFeatureSettings(JalviewModel.FeatureSettings value) {
+ this.featureSettings = value;
+ }
+
+
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="setting" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/&gt;
- * &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" /&gt;
- * &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="group" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="setting" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="group" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @return possible object is {@link Integer }
*
*/
- public Integer getTextColThreshold()
- {
- return textColThreshold;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "setting",
+ "group"
+ })
+ public static class FeatureSettings {
- /**
- * Sets the value of the textColThreshold property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setTextColThreshold(Integer value)
- {
- this.textColThreshold = value;
- }
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.FeatureSettings.Setting> setting;
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.FeatureSettings.Group> group;
- /**
- * Gets the value of the showUnconserved property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowUnconserved()
- {
- return showUnconserved;
- }
+ /**
+ * Gets the value of the setting property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the setting property.
++ * This is why there is not a <CODE>set</CODE> method for the setting property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getSetting().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getSetting().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.FeatureSettings.Setting }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the setting property.
+ */
+ public List<JalviewModel.FeatureSettings.Setting> getSetting() {
+ if (setting == null) {
+ setting = new ArrayList<JalviewModel.FeatureSettings.Setting>();
+ }
+ return this.setting;
+ }
- /**
- * Sets the value of the showUnconserved property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowUnconserved(Boolean value)
- {
- this.showUnconserved = value;
- }
+ /**
+ * Gets the value of the group property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the group property.
++ * This is why there is not a <CODE>set</CODE> method for the group property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getGroup().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getGroup().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.FeatureSettings.Group }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the group property.
+ */
+ public List<JalviewModel.FeatureSettings.Group> getGroup() {
+ if (group == null) {
+ group = new ArrayList<JalviewModel.FeatureSettings.Group>();
+ }
+ return this.group;
+ }
- /**
- * Gets the value of the ignoreGapsinConsensus property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isIgnoreGapsinConsensus()
- {
- if (ignoreGapsinConsensus == null)
- {
- return true;
- }
- else
- {
- return ignoreGapsinConsensus;
- }
- }
- /**
- * Sets the value of the ignoreGapsinConsensus property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setIgnoreGapsinConsensus(Boolean value)
- {
- this.ignoreGapsinConsensus = value;
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Group {
+
+ @XmlAttribute(name = "name", required = true)
+ protected String name;
+ @XmlAttribute(name = "display", required = true)
+ protected boolean display;
+
+ /**
+ * Gets the value of the name property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getName() {
+ return name;
+ }
+
+ /**
+ * Sets the value of the name property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setName(String value) {
+ this.name = value;
+ }
+
+ /**
+ * Gets the value of the display property.
+ *
+ */
+ public boolean isDisplay() {
+ return display;
+ }
+
+ /**
+ * Sets the value of the display property.
+ *
+ */
+ public void setDisplay(boolean value) {
+ this.display = value;
+ }
- /**
- * Gets the value of the showConsensusHistogram property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowConsensusHistogram()
- {
- if (showConsensusHistogram == null)
- {
- return true;
- }
- else
- {
- return showConsensusHistogram;
- }
- }
+ }
- /**
- * Sets the value of the showConsensusHistogram property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowConsensusHistogram(Boolean value)
- {
- this.showConsensusHistogram = value;
- }
- /**
- * Gets the value of the showSequenceLogo property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowSequenceLogo()
- {
- if (showSequenceLogo == null)
- {
- return false;
- }
- else
- {
- return showSequenceLogo;
- }
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/&gt;
- * &lt;element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" /&gt;
- * &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="colour" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="display" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="order" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="mincolour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="threshstate" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "attributeName",
+ "matcherSet"
+ })
+ public static class Setting {
+
++ /**
++ * name of feature attribute to colour by, or attribute and sub-attribute
++ *
++ */
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<String> attributeName;
++ /**
++ * optional filter(s) applied to the feature type
++ *
++ */
+ @XmlElement(namespace = "www.jalview.org")
+ protected FeatureMatcherSet matcherSet;
+ @XmlAttribute(name = "type", required = true)
+ protected String type;
+ @XmlAttribute(name = "colour", required = true)
+ protected int colour;
+ @XmlAttribute(name = "display", required = true)
+ protected boolean display;
+ @XmlAttribute(name = "order")
+ protected Float order;
++ /**
++ * Optional minimum colour
++ * for graduated
++ * feature
++ * colour
++ *
++ */
+ @XmlAttribute(name = "mincolour")
+ protected Integer mincolour;
+ @XmlAttribute(name = "noValueColour")
+ protected NoValueColour noValueColour;
++ /**
++ * threshold value for
++ * graduated feature colour
++ *
++ */
+ @XmlAttribute(name = "threshold")
+ protected Float threshold;
++ /**
++ * threshold type for
++ * graduated feature colour
++ *
++ */
+ @XmlAttribute(name = "threshstate")
+ protected Integer threshstate;
+ @XmlAttribute(name = "max")
+ protected Float max;
+ @XmlAttribute(name = "min")
+ protected Float min;
+ @XmlAttribute(name = "colourByLabel")
+ protected Boolean colourByLabel;
+ @XmlAttribute(name = "autoScale")
+ protected Boolean autoScale;
+
+ /**
++ * name of feature attribute to colour by, or attribute and sub-attribute
++ *
+ * Gets the value of the attributeName property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the attributeName property.
++ * This is why there is not a <CODE>set</CODE> method for the attributeName property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getAttributeName().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getAttributeName().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the attributeName property.
+ */
+ public List<String> getAttributeName() {
+ if (attributeName == null) {
+ attributeName = new ArrayList<String>();
+ }
+ return this.attributeName;
+ }
+
+ /**
- * Gets the value of the matcherSet property.
++ * optional filter(s) applied to the feature type
+ *
+ * @return
+ * possible object is
+ * {@link FeatureMatcherSet }
+ *
+ */
+ public FeatureMatcherSet getMatcherSet() {
+ return matcherSet;
+ }
+
+ /**
+ * Sets the value of the matcherSet property.
+ *
+ * @param value
+ * allowed object is
+ * {@link FeatureMatcherSet }
+ *
++ * @see #getMatcherSet()
+ */
+ public void setMatcherSet(FeatureMatcherSet value) {
+ this.matcherSet = value;
+ }
+
+ /**
+ * Gets the value of the type property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+ /**
+ * Gets the value of the colour property.
+ *
+ */
+ public int getColour() {
+ return colour;
+ }
+
+ /**
+ * Sets the value of the colour property.
+ *
+ */
+ public void setColour(int value) {
+ this.colour = value;
+ }
+
+ /**
+ * Gets the value of the display property.
+ *
+ */
+ public boolean isDisplay() {
+ return display;
+ }
+
+ /**
+ * Sets the value of the display property.
+ *
+ */
+ public void setDisplay(boolean value) {
+ this.display = value;
+ }
+
+ /**
+ * Gets the value of the order property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getOrder() {
+ return order;
+ }
+
+ /**
+ * Sets the value of the order property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setOrder(Float value) {
+ this.order = value;
+ }
+
+ /**
- * Gets the value of the mincolour property.
++ * Optional minimum colour
++ * for graduated
++ * feature
++ * colour
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getMincolour() {
+ return mincolour;
+ }
+
+ /**
+ * Sets the value of the mincolour property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
++ * @see #getMincolour()
+ */
+ public void setMincolour(Integer value) {
+ this.mincolour = value;
+ }
+
+ /**
+ * Gets the value of the noValueColour property.
+ *
+ * @return
+ * possible object is
+ * {@link NoValueColour }
+ *
+ */
+ public NoValueColour getNoValueColour() {
+ if (noValueColour == null) {
+ return NoValueColour.MIN;
+ } else {
+ return noValueColour;
+ }
+ }
+
+ /**
+ * Sets the value of the noValueColour property.
+ *
+ * @param value
+ * allowed object is
+ * {@link NoValueColour }
+ *
+ */
+ public void setNoValueColour(NoValueColour value) {
+ this.noValueColour = value;
+ }
+
+ /**
- * Gets the value of the threshold property.
++ * threshold value for
++ * graduated feature colour
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getThreshold() {
+ return threshold;
+ }
+
+ /**
+ * Sets the value of the threshold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
++ * @see #getThreshold()
+ */
+ public void setThreshold(Float value) {
+ this.threshold = value;
+ }
+
+ /**
- * Gets the value of the threshstate property.
++ * threshold type for
++ * graduated feature colour
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getThreshstate() {
+ return threshstate;
+ }
+
+ /**
+ * Sets the value of the threshstate property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
++ * @see #getThreshstate()
+ */
+ public void setThreshstate(Integer value) {
+ this.threshstate = value;
+ }
+
+ /**
+ * Gets the value of the max property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getMax() {
+ return max;
+ }
+
+ /**
+ * Sets the value of the max property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setMax(Float value) {
+ this.max = value;
+ }
+
+ /**
+ * Gets the value of the min property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getMin() {
+ return min;
+ }
+
+ /**
+ * Sets the value of the min property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setMin(Float value) {
+ this.min = value;
+ }
+
+ /**
+ * Gets the value of the colourByLabel property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isColourByLabel() {
+ return colourByLabel;
+ }
+
+ /**
+ * Sets the value of the colourByLabel property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setColourByLabel(Boolean value) {
+ this.colourByLabel = value;
+ }
+
+ /**
+ * Gets the value of the autoScale property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isAutoScale() {
+ return autoScale;
+ }
+
+ /**
+ * Sets the value of the autoScale property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setAutoScale(Boolean value) {
+ this.autoScale = value;
+ }
- /**
- * Sets the value of the showSequenceLogo property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowSequenceLogo(Boolean value)
- {
- this.showSequenceLogo = value;
- }
+ }
- /**
- * Gets the value of the normaliseSequenceLogo property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isNormaliseSequenceLogo()
- {
- if (normaliseSequenceLogo == null)
- {
- return false;
- }
- else
- {
- return normaliseSequenceLogo;
- }
}
- /**
- * Sets the value of the normaliseSequenceLogo property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setNormaliseSequenceLogo(Boolean value)
- {
- this.normaliseSequenceLogo = value;
- }
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the id property.
++ * <p>Java class for anonymous complex type</p>.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
- * @return possible object is {@link String }
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/&gt;
- * &lt;element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the id property.
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="seq" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"/>
++ * <element name="annotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="outlineColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="displayBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="displayText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="colourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @param value
- * allowed object is {@link String }
*
*/
- public void setId(String value)
- {
- this.id = value;
- }
-
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="features"
- * type="{www.jalview.org}feature" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;element name="pdbids" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;extension
- * base="{www.jalview.org}pdbentry"&gt; &lt;sequence&gt;
- * &lt;element name="structureState" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;simpleContent&gt; &lt;extension
- * base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="true" /&gt; &lt;attribute name="colourwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt; &lt;/simpleContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;/extension&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="hiddenSequences"
- * type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;element name="rnaViewer"
- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="secondaryStructure"
- * maxOccurs="unbounded"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="dividerLocation"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attribute name="colour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="end" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="hidden"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewreference"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(
- name = "",
- propOrder =
- { "features", "pdbids", "hiddenSequences", "rnaViewer" })
- public static class JSeq
- {
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<Feature> features;
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<JalviewModel.JSeq.Pdbids> pdbids;
-
- @XmlElement(namespace = "www.jalview.org", type = Integer.class)
- protected List<Integer> hiddenSequences;
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<JalviewModel.JSeq.RnaViewer> rnaViewer;
-
- @XmlAttribute(name = "colour")
- protected Integer colour;
-
- @XmlAttribute(name = "start", required = true)
- protected int start;
-
- @XmlAttribute(name = "end", required = true)
- protected int end;
-
- @XmlAttribute(name = "id", required = true)
- protected String id;
-
- @XmlAttribute(name = "hidden")
- protected Boolean hidden;
-
- @XmlAttribute(name = "viewreference")
- protected Boolean viewreference;
-
- /**
- * Gets the value of the features property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the features property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getFeatures().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Feature }
- *
- *
- */
- public List<Feature> getFeatures()
- {
- if (features == null)
- {
- features = new ArrayList<Feature>();
- }
- return this.features;
- }
-
- /**
- * Gets the value of the pdbids property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the pdbids property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getPdbids().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.JSeq.Pdbids }
- *
- *
- */
- public List<JalviewModel.JSeq.Pdbids> getPdbids()
- {
- if (pdbids == null)
- {
- pdbids = new ArrayList<JalviewModel.JSeq.Pdbids>();
- }
- return this.pdbids;
- }
-
- /**
- * Gets the value of the hiddenSequences property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the hiddenSequences property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getHiddenSequences().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Integer }
- *
- *
- */
- public List<Integer> getHiddenSequences()
- {
- if (hiddenSequences == null)
- {
- hiddenSequences = new ArrayList<Integer>();
- }
- return this.hiddenSequences;
- }
-
- /**
- * Gets the value of the rnaViewer property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the rnaViewer property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getRnaViewer().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.JSeq.RnaViewer }
- *
- *
- */
- public List<JalviewModel.JSeq.RnaViewer> getRnaViewer()
- {
- if (rnaViewer == null)
- {
- rnaViewer = new ArrayList<JalviewModel.JSeq.RnaViewer>();
- }
- return this.rnaViewer;
- }
-
- /**
- * Gets the value of the colour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getColour()
- {
- return colour;
- }
-
- /**
- * Sets the value of the colour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setColour(Integer value)
- {
- this.colour = value;
- }
-
- /**
- * Gets the value of the start property.
- *
- */
- public int getStart()
- {
- return start;
- }
-
- /**
- * Sets the value of the start property.
- *
- */
- public void setStart(int value)
- {
- this.start = value;
- }
-
- /**
- * Gets the value of the end property.
- *
- */
- public int getEnd()
- {
- return end;
- }
-
- /**
- * Sets the value of the end property.
- *
- */
- public void setEnd(int value)
- {
- this.end = value;
- }
-
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
-
- /**
- * Gets the value of the hidden property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isHidden()
- {
- return hidden;
- }
-
- /**
- * Sets the value of the hidden property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setHidden(Boolean value)
- {
- this.hidden = value;
- }
-
- /**
- * Gets the value of the viewreference property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isViewreference()
- {
- return viewreference;
- }
-
- /**
- * Sets the value of the viewreference property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setViewreference(Boolean value)
- {
- this.viewreference = value;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org}pdbentry"&gt;
- * &lt;sequence&gt; &lt;element name="structureState"
- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;simpleContent&gt; &lt;extension
- * base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false"
- * /&gt; &lt;attribute name="colourByJmol"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt; &lt;/simpleContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;/extension&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = { "structureState" })
- public static class Pdbids extends Pdbentry
- {
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<JalviewModel.JSeq.Pdbids.StructureState> structureState;
-
- /**
- * Gets the value of the structureState property.
- *
- * <p> This accessor method returns a reference to the live list,
- * not a snapshot. Therefore any modification you make to the returned
- * list will be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the structureState property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getStructureState().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.JSeq.Pdbids.StructureState }
- *
- *
- */
- public List<JalviewModel.JSeq.Pdbids.StructureState> getStructureState()
- {
- if (structureState == null)
- {
- structureState = new ArrayList<JalviewModel.JSeq.Pdbids.StructureState>();
- }
- return this.structureState;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;simpleContent&gt;
- * &lt;extension
- * base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true"
- * /&gt; &lt;attribute name="colourwithAlignPanel"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false"
- * /&gt; &lt;attribute name="colourByJmol"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true"
- * /&gt; &lt;attribute name="type"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt; &lt;/simpleContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = { "value" })
- public static class StructureState
- {
-
- @XmlValue
- protected String value;
-
- @XmlAttribute(name = "visible")
- protected Boolean visible;
-
- @XmlAttribute(name = "viewId")
- protected String viewId;
-
- @XmlAttribute(name = "alignwithAlignPanel")
- protected Boolean alignwithAlignPanel;
-
- @XmlAttribute(name = "colourwithAlignPanel")
- protected Boolean colourwithAlignPanel;
-
- @XmlAttribute(name = "colourByJmol")
- protected Boolean colourByJmol;
-
- @XmlAttribute(name = "type")
- protected String type;
-
- @XmlAttribute(name = "width")
- protected Integer width;
-
- @XmlAttribute(name = "height")
- protected Integer height;
-
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
-
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "seq",
+ "annotationColours"
+ })
+ public static class JGroup {
+
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected List<String> seq;
+ @XmlElement(namespace = "www.jalview.org")
+ protected AnnotationColourScheme annotationColours;
+ @XmlAttribute(name = "start")
+ protected Integer start;
+ @XmlAttribute(name = "end")
+ protected Integer end;
+ @XmlAttribute(name = "name")
+ protected String name;
+ @XmlAttribute(name = "colour")
+ protected String colour;
+ @XmlAttribute(name = "consThreshold")
+ protected Integer consThreshold;
+ @XmlAttribute(name = "pidThreshold")
+ protected Integer pidThreshold;
+ @XmlAttribute(name = "outlineColour")
+ protected Integer outlineColour;
+ @XmlAttribute(name = "displayBoxes")
+ protected Boolean displayBoxes;
+ @XmlAttribute(name = "displayText")
+ protected Boolean displayText;
+ @XmlAttribute(name = "colourText")
+ protected Boolean colourText;
+ @XmlAttribute(name = "textCol1")
+ protected Integer textCol1;
+ @XmlAttribute(name = "textCol2")
+ protected Integer textCol2;
+ @XmlAttribute(name = "textColThreshold")
+ protected Integer textColThreshold;
+ @XmlAttribute(name = "showUnconserved")
+ protected Boolean showUnconserved;
+ @XmlAttribute(name = "ignoreGapsinConsensus")
+ protected Boolean ignoreGapsinConsensus;
+ @XmlAttribute(name = "showConsensusHistogram")
+ protected Boolean showConsensusHistogram;
+ @XmlAttribute(name = "showSequenceLogo")
+ protected Boolean showSequenceLogo;
+ @XmlAttribute(name = "normaliseSequenceLogo")
+ protected Boolean normaliseSequenceLogo;
++ /**
++ * Optional sequence group ID (only
++ * needs to be
++ * unique for this
++ * alignment)
++ *
++ */
+ @XmlAttribute(name = "id")
+ protected String id;
/**
- * Gets the value of the value property.
+ * Gets the value of the seq property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the seq property.
++ * This is why there is not a <CODE>set</CODE> method for the seq property.</p>
*
- * <p>
- * @return possible object is {@link String }
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getSeq().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getSeq().add(newItem);
++ * </pre>
*
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link String }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the seq property.
*/
- public String getValue()
- {
- return value;
+ public List<String> getSeq() {
+ if (seq == null) {
+ seq = new ArrayList<String>();
+ }
+ return this.seq;
}
/**
}
/**
- * Sets the value of the viewerState property.
+ * Sets the value of the normaliseSequenceLogo property.
*
* @param value
- * allowed object is {@link String }
- *
+ * allowed object is
+ * {@link Boolean }
+ *
*/
- public void setViewerState(String value)
- {
- this.viewerState = value;
+ public void setNormaliseSequenceLogo(Boolean value) {
+ this.normaliseSequenceLogo = value;
}
- }
+ /**
- * Gets the value of the id property.
++ * Optional sequence group ID (only
++ * needs to be
++ * unique for this
++ * alignment)
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
- }
-
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="sequencePoint"
- * maxOccurs="unbounded"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;attribute
- * name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="axis" maxOccurs="3" minOccurs="3"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="seqPointMin"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="seqPointMax"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt;
- * &lt;/element&gt; &lt;element name="pcaData"
- * type="{www.jalview.org}PcaDataType"/&gt; &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}SimilarityParams"/&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="xDim"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;attribute name="bgColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="linkToAllViews"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(
- name = "",
- propOrder =
- { "sequencePoint", "axis", "seqPointMin", "seqPointMax", "pcaData" })
- public static class PcaViewer
- {
-
- @XmlElement(namespace = "www.jalview.org", required = true)
- protected List<JalviewModel.PcaViewer.SequencePoint> sequencePoint;
-
- @XmlElement(namespace = "www.jalview.org", required = true)
- protected List<JalviewModel.PcaViewer.Axis> axis;
-
- @XmlElement(namespace = "www.jalview.org", required = true)
- protected JalviewModel.PcaViewer.SeqPointMin seqPointMin;
-
- @XmlElement(namespace = "www.jalview.org", required = true)
- protected JalviewModel.PcaViewer.SeqPointMax seqPointMax;
-
- @XmlElement(namespace = "www.jalview.org", required = true)
- protected PcaDataType pcaData;
-
- @XmlAttribute(name = "title")
- protected String title;
-
- @XmlAttribute(name = "scoreModelName")
- protected String scoreModelName;
-
- @XmlAttribute(name = "xDim")
- protected Integer xDim;
-
- @XmlAttribute(name = "yDim")
- protected Integer yDim;
-
- @XmlAttribute(name = "zDim")
- protected Integer zDim;
-
- @XmlAttribute(name = "bgColour")
- protected Integer bgColour;
-
- @XmlAttribute(name = "scaleFactor")
- protected Float scaleFactor;
-
- @XmlAttribute(name = "showLabels")
- protected Boolean showLabels;
-
- @XmlAttribute(name = "linkToAllViews")
- protected Boolean linkToAllViews;
-
- @XmlAttribute(name = "includeGaps")
- protected Boolean includeGaps;
-
- @XmlAttribute(name = "matchGaps")
- protected Boolean matchGaps;
-
- @XmlAttribute(name = "includeGappedColumns")
- protected Boolean includeGappedColumns;
-
- @XmlAttribute(name = "denominateByShortestLength")
- protected Boolean denominateByShortestLength;
-
- @XmlAttribute(name = "width")
- protected Integer width;
-
- @XmlAttribute(name = "height")
- protected Integer height;
-
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
-
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getId()
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
- /**
- * Gets the value of the sequencePoint property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the sequencePoint property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getSequencePoint().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.PcaViewer.SequencePoint }
- *
- *
- */
- public List<JalviewModel.PcaViewer.SequencePoint> getSequencePoint()
- {
- if (sequencePoint == null)
- {
- sequencePoint = new ArrayList<JalviewModel.PcaViewer.SequencePoint>();
- }
- return this.sequencePoint;
}
- /**
- * Gets the value of the axis property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the axis property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getAxis().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.PcaViewer.Axis }
- *
- *
- */
- public List<JalviewModel.PcaViewer.Axis> getAxis()
- {
- if (axis == null)
- {
- axis = new ArrayList<JalviewModel.PcaViewer.Axis>();
- }
- return this.axis;
- }
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the seqPointMin property.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/&gt;
- * &lt;element name="pdbids" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org}pdbentry"&gt;
- * &lt;sequence&gt;
- * &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;simpleContent&gt;
- * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt;
- * &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/&gt;
- * &lt;element name="rnaViewer" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="secondaryStructure" maxOccurs="unbounded"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="features" type="{www.jalview.org}feature" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="pdbids" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org}pdbentry">
++ * <sequence>
++ * <element name="structureState" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <simpleContent>
++ * <extension base="<http://www.w3.org/2001/XMLSchema>string">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </simpleContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="hiddenSequences" type="{http://www.w3.org/2001/XMLSchema}int" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="rnaViewer" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="secondaryStructure" maxOccurs="unbounded">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="hmmerProfile" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="colour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="hidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewreference" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @return possible object is {@link JalviewModel.PcaViewer.SeqPointMin }
*
*/
- public JalviewModel.PcaViewer.SeqPointMin getSeqPointMin()
- {
- return seqPointMin;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "features",
+ "pdbids",
+ "hiddenSequences",
+ "rnaViewer",
+ "hmmerProfile"
+ })
+ public static class JSeq {
+
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<Feature> features;
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.JSeq.Pdbids> pdbids;
+ @XmlElement(namespace = "www.jalview.org", type = Integer.class)
+ protected List<Integer> hiddenSequences;
++ /**
++ * Reference to a viewer showing
++ * RNA structure for this sequence.
++ * Schema supports one viewer
++ * showing multiple annotations for
++ * multiple sequences, though
++ * currently only one annotation
++ * for one sequence (gapped or
++ * trimmed) is used
++ *
++ */
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.JSeq.RnaViewer> rnaViewer;
++ /**
++ * name of the project jar entry that holds the HMM file with the profile for the sequence
++ *
++ */
+ @XmlElement(namespace = "www.jalview.org")
+ protected String hmmerProfile;
+ @XmlAttribute(name = "colour")
+ protected Integer colour;
+ @XmlAttribute(name = "start", required = true)
+ protected int start;
+ @XmlAttribute(name = "end", required = true)
+ protected int end;
+ @XmlAttribute(name = "id", required = true)
+ protected String id;
+ @XmlAttribute(name = "hidden")
+ protected Boolean hidden;
+ @XmlAttribute(name = "viewreference")
+ protected Boolean viewreference;
- /**
- * Sets the value of the seqPointMin property.
- *
- * @param value
- * allowed object is {@link JalviewModel.PcaViewer.SeqPointMin }
- *
- */
- public void setSeqPointMin(JalviewModel.PcaViewer.SeqPointMin value)
- {
- this.seqPointMin = value;
- }
+ /**
+ * Gets the value of the features property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the features property.
++ * This is why there is not a <CODE>set</CODE> method for the features property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getFeatures().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getFeatures().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Feature }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the features property.
+ */
+ public List<Feature> getFeatures() {
+ if (features == null) {
+ features = new ArrayList<Feature>();
+ }
+ return this.features;
+ }
- /**
- * Gets the value of the seqPointMax property.
- *
- * @return possible object is {@link JalviewModel.PcaViewer.SeqPointMax }
- *
- */
- public JalviewModel.PcaViewer.SeqPointMax getSeqPointMax()
- {
- return seqPointMax;
- }
+ /**
+ * Gets the value of the pdbids property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the pdbids property.
++ * This is why there is not a <CODE>set</CODE> method for the pdbids property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getPdbids().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getPdbids().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JSeq.Pdbids }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the pdbids property.
+ */
+ public List<JalviewModel.JSeq.Pdbids> getPdbids() {
+ if (pdbids == null) {
+ pdbids = new ArrayList<JalviewModel.JSeq.Pdbids>();
+ }
+ return this.pdbids;
+ }
- /**
- * Sets the value of the seqPointMax property.
- *
- * @param value
- * allowed object is {@link JalviewModel.PcaViewer.SeqPointMax }
- *
- */
- public void setSeqPointMax(JalviewModel.PcaViewer.SeqPointMax value)
- {
- this.seqPointMax = value;
- }
+ /**
+ * Gets the value of the hiddenSequences property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the hiddenSequences property.
++ * This is why there is not a <CODE>set</CODE> method for the hiddenSequences property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getHiddenSequences().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getHiddenSequences().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link Integer }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the hiddenSequences property.
+ */
+ public List<Integer> getHiddenSequences() {
+ if (hiddenSequences == null) {
+ hiddenSequences = new ArrayList<Integer>();
+ }
+ return this.hiddenSequences;
+ }
- /**
- * Gets the value of the pcaData property.
- *
- * @return possible object is {@link PcaDataType }
- *
- */
- public PcaDataType getPcaData()
- {
- return pcaData;
- }
+ /**
++ * Reference to a viewer showing
++ * RNA structure for this sequence.
++ * Schema supports one viewer
++ * showing multiple annotations for
++ * multiple sequences, though
++ * currently only one annotation
++ * for one sequence (gapped or
++ * trimmed) is used
++ *
+ * Gets the value of the rnaViewer property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the rnaViewer property.
++ * This is why there is not a <CODE>set</CODE> method for the rnaViewer property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getRnaViewer().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getRnaViewer().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JSeq.RnaViewer }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the rnaViewer property.
+ */
+ public List<JalviewModel.JSeq.RnaViewer> getRnaViewer() {
+ if (rnaViewer == null) {
+ rnaViewer = new ArrayList<JalviewModel.JSeq.RnaViewer>();
+ }
+ return this.rnaViewer;
+ }
- /**
- * Sets the value of the pcaData property.
- *
- * @param value
- * allowed object is {@link PcaDataType }
- *
- */
- public void setPcaData(PcaDataType value)
- {
- this.pcaData = value;
- }
+ /**
- * Gets the value of the hmmerProfile property.
++ * name of the project jar entry that holds the HMM file with the profile for the sequence
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getHmmerProfile() {
+ return hmmerProfile;
+ }
- /**
- * Gets the value of the title property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTitle()
- {
- return title;
- }
+ /**
+ * Sets the value of the hmmerProfile property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getHmmerProfile()
+ */
+ public void setHmmerProfile(String value) {
+ this.hmmerProfile = value;
+ }
- /**
- * Sets the value of the title property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setTitle(String value)
- {
- this.title = value;
- }
+ /**
+ * Gets the value of the colour property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getColour() {
+ return colour;
+ }
- /**
- * Gets the value of the scoreModelName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getScoreModelName()
- {
- return scoreModelName;
- }
+ /**
+ * Sets the value of the colour property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setColour(Integer value) {
+ this.colour = value;
+ }
- /**
- * Sets the value of the scoreModelName property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setScoreModelName(String value)
- {
- this.scoreModelName = value;
- }
+ /**
+ * Gets the value of the start property.
+ *
+ */
+ public int getStart() {
+ return start;
+ }
- /**
- * Gets the value of the xDim property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getXDim()
- {
- return xDim;
- }
+ /**
+ * Sets the value of the start property.
+ *
+ */
+ public void setStart(int value) {
+ this.start = value;
+ }
- /**
- * Sets the value of the xDim property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setXDim(Integer value)
- {
- this.xDim = value;
- }
+ /**
+ * Gets the value of the end property.
+ *
+ */
+ public int getEnd() {
+ return end;
+ }
- /**
- * Gets the value of the yDim property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getYDim()
- {
- return yDim;
- }
+ /**
+ * Sets the value of the end property.
+ *
+ */
+ public void setEnd(int value) {
+ this.end = value;
+ }
- /**
- * Sets the value of the yDim property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setYDim(Integer value)
- {
- this.yDim = value;
- }
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
- /**
- * Gets the value of the zDim property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getZDim()
- {
- return zDim;
- }
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
- /**
- * Sets the value of the zDim property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setZDim(Integer value)
- {
- this.zDim = value;
- }
+ /**
+ * Gets the value of the hidden property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isHidden() {
+ return hidden;
+ }
- /**
- * Gets the value of the bgColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getBgColour()
- {
- return bgColour;
- }
+ /**
+ * Sets the value of the hidden property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setHidden(Boolean value) {
+ this.hidden = value;
+ }
- /**
- * Sets the value of the bgColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setBgColour(Integer value)
- {
- this.bgColour = value;
- }
+ /**
+ * Gets the value of the viewreference property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isViewreference() {
+ return viewreference;
+ }
- /**
- * Gets the value of the scaleFactor property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getScaleFactor()
- {
- return scaleFactor;
- }
+ /**
+ * Sets the value of the viewreference property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setViewreference(Boolean value) {
+ this.viewreference = value;
+ }
+
+
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org}pdbentry"&gt;
- * &lt;sequence&gt;
- * &lt;element name="structureState" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;simpleContent&gt;
- * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt;
- * &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org}pdbentry">
++ * <sequence>
++ * <element name="structureState" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <simpleContent>
++ * <extension base="<http://www.w3.org/2001/XMLSchema>string">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </simpleContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "structureState"
+ })
+ public static class Pdbids
+ extends Pdbentry
+ {
+
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.JSeq.Pdbids.StructureState> structureState;
+
+ /**
+ * Gets the value of the structureState property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the structureState property.
++ * This is why there is not a <CODE>set</CODE> method for the structureState property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getStructureState().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getStructureState().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JSeq.Pdbids.StructureState }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the structureState property.
+ */
+ public List<JalviewModel.JSeq.Pdbids.StructureState> getStructureState() {
+ if (structureState == null) {
+ structureState = new ArrayList<JalviewModel.JSeq.Pdbids.StructureState>();
+ }
+ return this.structureState;
+ }
+
+
+ /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content contained within this class.
- *
- * <pre>
- * &lt;complexType&gt;
- * &lt;simpleContent&gt;
- * &lt;extension base="&lt;http://www.w3.org/2001/XMLSchema&gt;string"&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/extension&gt;
- * &lt;/simpleContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <simpleContent>
++ * <extension base="<http://www.w3.org/2001/XMLSchema>string">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="visible" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="alignwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="colourwithAlignPanel" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="colourByJmol" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </simpleContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "value"
+ })
+ public static class StructureState {
+
+ @XmlValue
+ protected String value;
+ @XmlAttribute(name = "visible")
+ protected Boolean visible;
++ /**
++ * additional
++ * identifier
++ * which
++ * properly
++ * disambiguates
++ * the
++ * structure
++ * view
++ * from
++ * any
++ * other
++ * view
++ * with
++ * the
++ * same
++ * attributes.
++ * This
++ * is
++ * not
++ * an
++ * ID,
++ * because
++ * it
++ * is
++ * possible
++ * to
++ * have
++ * many
++ * references
++ * to
++ * the
++ * same
++ * physical
++ * structure
++ * view
++ * from
++ * different
++ * sequences
++ * in
++ * an
++ * alignment.
++ * A
++ * structureState
++ * element
++ * citing
++ * the
++ * same
++ * viewId
++ * will
++ * appear
++ * for
++ * each
++ * instance.
++ *
++ */
+ @XmlAttribute(name = "viewId")
+ protected String viewId;
++ /**
++ * Flag
++ * set
++ * if
++ * the
++ * alignment
++ * panel
++ * containing
++ * this
++ * JSeq
++ * should
++ * be
++ * included
++ * in
++ * those
++ * used
++ * to
++ * perform
++ * a
++ * structure
++ * superposition
++ * (since
++ * Jalview
++ * 2.7).
++ *
++ */
+ @XmlAttribute(name = "alignwithAlignPanel")
+ protected Boolean alignwithAlignPanel;
++ /**
++ * Flag
++ * set
++ * if
++ * the
++ * alignment
++ * panel
++ * containing
++ * this
++ * JSeq
++ * should
++ * be
++ * included
++ * in
++ * those
++ * used
++ * to
++ * colour
++ * its
++ * associated
++ * sequences
++ * in
++ * this
++ * structureState(since
++ * Jalview
++ * 2.7).
++ *
++ */
+ @XmlAttribute(name = "colourwithAlignPanel")
+ protected Boolean colourwithAlignPanel;
++ /**
++ * Flag
++ * set
++ * if
++ * the
++ * structure
++ * display
++ * is
++ * coloured
++ * by
++ * the
++ * Jmol
++ * state,
++ * rather
++ * than
++ * by
++ * one
++ * or
++ * more
++ * linked
++ * alignment
++ * views.
++ *
++ */
+ @XmlAttribute(name = "colourByJmol")
+ protected Boolean colourByJmol;
++ /**
++ * An
++ * identifier
++ * for
++ * the
++ * viewer
++ * type,
++ * currently
++ * either
++ * JMOL
++ * or
++ * CHIMERA
++ *
++ */
+ @XmlAttribute(name = "type")
+ protected String type;
+ @XmlAttribute(name = "width")
+ protected Integer width;
+ @XmlAttribute(name = "height")
+ protected Integer height;
+ @XmlAttribute(name = "xpos")
+ protected Integer xpos;
+ @XmlAttribute(name = "ypos")
+ protected Integer ypos;
+
+ /**
+ * Gets the value of the value property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getValue() {
+ return value;
+ }
+
+ /**
+ * Sets the value of the value property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setValue(String value) {
+ this.value = value;
+ }
+
+ /**
+ * Gets the value of the visible property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isVisible() {
+ return visible;
+ }
+
+ /**
+ * Sets the value of the visible property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setVisible(Boolean value) {
+ this.visible = value;
+ }
+
+ /**
- * Gets the value of the viewId property.
++ * additional
++ * identifier
++ * which
++ * properly
++ * disambiguates
++ * the
++ * structure
++ * view
++ * from
++ * any
++ * other
++ * view
++ * with
++ * the
++ * same
++ * attributes.
++ * This
++ * is
++ * not
++ * an
++ * ID,
++ * because
++ * it
++ * is
++ * possible
++ * to
++ * have
++ * many
++ * references
++ * to
++ * the
++ * same
++ * physical
++ * structure
++ * view
++ * from
++ * different
++ * sequences
++ * in
++ * an
++ * alignment.
++ * A
++ * structureState
++ * element
++ * citing
++ * the
++ * same
++ * viewId
++ * will
++ * appear
++ * for
++ * each
++ * instance.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+ /**
+ * Sets the value of the viewId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getViewId()
+ */
+ public void setViewId(String value) {
+ this.viewId = value;
+ }
+
+ /**
- * Gets the value of the alignwithAlignPanel property.
++ * Flag
++ * set
++ * if
++ * the
++ * alignment
++ * panel
++ * containing
++ * this
++ * JSeq
++ * should
++ * be
++ * included
++ * in
++ * those
++ * used
++ * to
++ * perform
++ * a
++ * structure
++ * superposition
++ * (since
++ * Jalview
++ * 2.7).
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isAlignwithAlignPanel() {
+ if (alignwithAlignPanel == null) {
+ return true;
+ } else {
+ return alignwithAlignPanel;
+ }
+ }
+
+ /**
+ * Sets the value of the alignwithAlignPanel property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
++ * @see #isAlignwithAlignPanel()
+ */
+ public void setAlignwithAlignPanel(Boolean value) {
+ this.alignwithAlignPanel = value;
+ }
+
+ /**
- * Gets the value of the colourwithAlignPanel property.
++ * Flag
++ * set
++ * if
++ * the
++ * alignment
++ * panel
++ * containing
++ * this
++ * JSeq
++ * should
++ * be
++ * included
++ * in
++ * those
++ * used
++ * to
++ * colour
++ * its
++ * associated
++ * sequences
++ * in
++ * this
++ * structureState(since
++ * Jalview
++ * 2.7).
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isColourwithAlignPanel() {
+ if (colourwithAlignPanel == null) {
+ return false;
+ } else {
+ return colourwithAlignPanel;
+ }
+ }
+
+ /**
+ * Sets the value of the colourwithAlignPanel property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
++ * @see #isColourwithAlignPanel()
+ */
+ public void setColourwithAlignPanel(Boolean value) {
+ this.colourwithAlignPanel = value;
+ }
+
+ /**
- * Gets the value of the colourByJmol property.
++ * Flag
++ * set
++ * if
++ * the
++ * structure
++ * display
++ * is
++ * coloured
++ * by
++ * the
++ * Jmol
++ * state,
++ * rather
++ * than
++ * by
++ * one
++ * or
++ * more
++ * linked
++ * alignment
++ * views.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isColourByJmol() {
+ if (colourByJmol == null) {
+ return true;
+ } else {
+ return colourByJmol;
+ }
+ }
+
+ /**
+ * Sets the value of the colourByJmol property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
++ * @see #isColourByJmol()
+ */
+ public void setColourByJmol(Boolean value) {
+ this.colourByJmol = value;
+ }
+
+ /**
- * Gets the value of the type property.
++ * An
++ * identifier
++ * for
++ * the
++ * viewer
++ * type,
++ * currently
++ * either
++ * JMOL
++ * or
++ * CHIMERA
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getType() {
+ return type;
+ }
+
+ /**
+ * Sets the value of the type property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getType()
+ */
+ public void setType(String value) {
+ this.type = value;
+ }
+
+ /**
+ * Gets the value of the width property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getWidth() {
+ return width;
+ }
+
+ /**
+ * Sets the value of the width property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setWidth(Integer value) {
+ this.width = value;
+ }
+
+ /**
+ * Gets the value of the height property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getHeight() {
+ return height;
+ }
+
+ /**
+ * Sets the value of the height property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setHeight(Integer value) {
+ this.height = value;
+ }
+
+ /**
+ * Gets the value of the xpos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getXpos() {
+ return xpos;
+ }
+
+ /**
+ * Sets the value of the xpos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setXpos(Integer value) {
+ this.xpos = value;
+ }
+
+ /**
+ * Gets the value of the ypos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getYpos() {
+ return ypos;
+ }
+
+ /**
+ * Sets the value of the ypos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setYpos(Integer value) {
+ this.ypos = value;
+ }
+
+ }
+
+ }
+
+
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="secondaryStructure" maxOccurs="unbounded"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="secondaryStructure" maxOccurs="unbounded">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="viewId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="dividerLocation" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="selectedRna" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "secondaryStructure"
+ })
+ public static class RnaViewer {
+
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected List<JalviewModel.JSeq.RnaViewer.SecondaryStructure> secondaryStructure;
+ @XmlAttribute(name = "title")
+ protected String title;
++ /**
++ * An id unique to the RNA
++ * viewer panel
++ *
++ */
+ @XmlAttribute(name = "viewId")
+ protected String viewId;
++ /**
++ * horizontal position of
++ * split pane divider
++ *
++ */
+ @XmlAttribute(name = "dividerLocation")
+ protected Integer dividerLocation;
++ /**
++ * Index of the selected
++ * structure in the viewer
++ * panel
++ *
++ */
+ @XmlAttribute(name = "selectedRna")
+ protected Integer selectedRna;
+ @XmlAttribute(name = "width")
+ protected Integer width;
+ @XmlAttribute(name = "height")
+ protected Integer height;
+ @XmlAttribute(name = "xpos")
+ protected Integer xpos;
+ @XmlAttribute(name = "ypos")
+ protected Integer ypos;
+
+ /**
+ * Gets the value of the secondaryStructure property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the secondaryStructure property.
++ * This is why there is not a <CODE>set</CODE> method for the secondaryStructure property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getSecondaryStructure().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getSecondaryStructure().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the secondaryStructure property.
+ */
+ public List<JalviewModel.JSeq.RnaViewer.SecondaryStructure> getSecondaryStructure() {
+ if (secondaryStructure == null) {
+ secondaryStructure = new ArrayList<JalviewModel.JSeq.RnaViewer.SecondaryStructure>();
+ }
+ return this.secondaryStructure;
+ }
+
+ /**
+ * Gets the value of the title property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets the value of the title property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitle(String value) {
+ this.title = value;
+ }
+
+ /**
- * Gets the value of the viewId property.
++ * An id unique to the RNA
++ * viewer panel
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getViewId() {
+ return viewId;
+ }
+
+ /**
+ * Sets the value of the viewId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getViewId()
+ */
+ public void setViewId(String value) {
+ this.viewId = value;
+ }
+
+ /**
- * Gets the value of the dividerLocation property.
++ * horizontal position of
++ * split pane divider
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getDividerLocation() {
+ return dividerLocation;
+ }
+
+ /**
+ * Sets the value of the dividerLocation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
++ * @see #getDividerLocation()
+ */
+ public void setDividerLocation(Integer value) {
+ this.dividerLocation = value;
+ }
+
+ /**
- * Gets the value of the selectedRna property.
++ * Index of the selected
++ * structure in the viewer
++ * panel
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getSelectedRna() {
+ return selectedRna;
+ }
+
+ /**
+ * Sets the value of the selectedRna property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
++ * @see #getSelectedRna()
+ */
+ public void setSelectedRna(Integer value) {
+ this.selectedRna = value;
+ }
+
+ /**
+ * Gets the value of the width property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getWidth() {
+ return width;
+ }
+
+ /**
+ * Sets the value of the width property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setWidth(Integer value) {
+ this.width = value;
+ }
+
+ /**
+ * Gets the value of the height property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getHeight() {
+ return height;
+ }
+
+ /**
+ * Sets the value of the height property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setHeight(Integer value) {
+ this.height = value;
+ }
+
+ /**
+ * Gets the value of the xpos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getXpos() {
+ return xpos;
+ }
+
+ /**
+ * Sets the value of the xpos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setXpos(Integer value) {
+ this.xpos = value;
+ }
+
+ /**
+ * Gets the value of the ypos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getYpos() {
+ return ypos;
+ }
+
+ /**
+ * Sets the value of the ypos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setYpos(Integer value) {
+ this.ypos = value;
+ }
+
+
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="annotationId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gapped" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="viewerState" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class SecondaryStructure {
+
+ @XmlAttribute(name = "title")
+ protected String title;
++ /**
++ * id attribute
++ * of
++ * Annotation
++ * in
++ * vamsasModel
++ * for the
++ * secondary
++ * structure
++ * annotation
++ * shown in the
++ * viewer
++ *
++ */
+ @XmlAttribute(name = "annotationId", required = true)
+ protected String annotationId;
++ /**
++ * if true the
++ * RNA
++ * structure is
++ * shown with
++ * gaps, if
++ * false
++ * without
++ *
++ */
+ @XmlAttribute(name = "gapped")
+ protected Boolean gapped;
++ /**
++ * name of the
++ * project jar
++ * entry that
++ * holds the
++ * VARNA viewer
++ * state for
++ * the
++ * structure
++ *
++ */
+ @XmlAttribute(name = "viewerState")
+ protected String viewerState;
+
+ /**
+ * Gets the value of the title property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
+
+ /**
+ * Sets the value of the title property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitle(String value) {
+ this.title = value;
+ }
+
+ /**
- * Gets the value of the annotationId property.
++ * id attribute
++ * of
++ * Annotation
++ * in
++ * vamsasModel
++ * for the
++ * secondary
++ * structure
++ * annotation
++ * shown in the
++ * viewer
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getAnnotationId() {
+ return annotationId;
+ }
+
+ /**
+ * Sets the value of the annotationId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getAnnotationId()
+ */
+ public void setAnnotationId(String value) {
+ this.annotationId = value;
+ }
+
+ /**
- * Gets the value of the gapped property.
++ * if true the
++ * RNA
++ * structure is
++ * shown with
++ * gaps, if
++ * false
++ * without
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isGapped() {
+ return gapped;
+ }
+
+ /**
+ * Sets the value of the gapped property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
++ * @see #isGapped()
+ */
+ public void setGapped(Boolean value) {
+ this.gapped = value;
+ }
+
+ /**
- * Gets the value of the viewerState property.
++ * name of the
++ * project jar
++ * entry that
++ * holds the
++ * VARNA viewer
++ * state for
++ * the
++ * structure
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getViewerState() {
+ return viewerState;
+ }
+
+ /**
+ * Sets the value of the viewerState property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getViewerState()
+ */
+ public void setViewerState(String value) {
+ this.viewerState = value;
+ }
+
+ }
+
+ }
- /**
- * Sets the value of the scaleFactor property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setScaleFactor(Float value)
- {
- this.scaleFactor = value;
}
+
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the showLabels property.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="sequencePoint" maxOccurs="unbounded"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="axis" maxOccurs="3" minOccurs="3"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="seqPointMin"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="seqPointMax"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="pcaData" type="{www.jalview.org}PcaDataType"/&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attGroup ref="{www.jalview.org}SimilarityParams"/&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="xDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="sequencePoint" maxOccurs="unbounded">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * <attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="axis" maxOccurs="3" minOccurs="3">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="seqPointMin">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="seqPointMax">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="pcaData" type="{www.jalview.org}PcaDataType"/>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}SimilarityParams"/>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="scoreModelName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="xDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="yDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="zDim" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="scaleFactor" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="showLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @return possible object is {@link Boolean }
*
*/
- public Boolean isShowLabels()
- {
- return showLabels;
- }
-
- /**
- * Sets the value of the showLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowLabels(Boolean value)
- {
- this.showLabels = value;
- }
-
- /**
- * Gets the value of the linkToAllViews property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isLinkToAllViews()
- {
- return linkToAllViews;
- }
-
- /**
- * Sets the value of the linkToAllViews property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setLinkToAllViews(Boolean value)
- {
- this.linkToAllViews = value;
- }
-
- /**
- * Gets the value of the includeGaps property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isIncludeGaps()
- {
- return includeGaps;
- }
-
- /**
- * Sets the value of the includeGaps property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setIncludeGaps(Boolean value)
- {
- this.includeGaps = value;
- }
-
- /**
- * Gets the value of the matchGaps property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isMatchGaps()
- {
- return matchGaps;
- }
-
- /**
- * Sets the value of the matchGaps property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setMatchGaps(Boolean value)
- {
- this.matchGaps = value;
- }
-
- /**
- * Gets the value of the includeGappedColumns property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isIncludeGappedColumns()
- {
- return includeGappedColumns;
- }
-
- /**
- * Sets the value of the includeGappedColumns property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setIncludeGappedColumns(Boolean value)
- {
- this.includeGappedColumns = value;
- }
-
- /**
- * Gets the value of the denominateByShortestLength property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isDenominateByShortestLength()
- {
- return denominateByShortestLength;
- }
-
- /**
- * Sets the value of the denominateByShortestLength property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setDenominateByShortestLength(Boolean value)
- {
- this.denominateByShortestLength = value;
- }
-
- /**
- * Gets the value of the width property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getWidth()
- {
- return width;
- }
-
- /**
- * Sets the value of the width property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setWidth(Integer value)
- {
- this.width = value;
- }
-
- /**
- * Gets the value of the height property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getHeight()
- {
- return height;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "sequencePoint",
+ "axis",
+ "seqPointMin",
+ "seqPointMax",
+ "pcaData"
+ })
+ public static class PcaViewer {
+
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected List<JalviewModel.PcaViewer.SequencePoint> sequencePoint;
++ /**
++ * endpoints of X, Y and Z axes in that order
++ *
++ */
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected List<JalviewModel.PcaViewer.Axis> axis;
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected JalviewModel.PcaViewer.SeqPointMin seqPointMin;
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected JalviewModel.PcaViewer.SeqPointMax seqPointMax;
+ @XmlElement(namespace = "www.jalview.org", required = true)
+ protected PcaDataType pcaData;
+ @XmlAttribute(name = "title")
+ protected String title;
+ @XmlAttribute(name = "scoreModelName")
+ protected String scoreModelName;
+ @XmlAttribute(name = "xDim")
+ protected Integer xDim;
+ @XmlAttribute(name = "yDim")
+ protected Integer yDim;
+ @XmlAttribute(name = "zDim")
+ protected Integer zDim;
+ @XmlAttribute(name = "bgColour")
+ protected Integer bgColour;
+ @XmlAttribute(name = "scaleFactor")
+ protected Float scaleFactor;
+ @XmlAttribute(name = "showLabels")
+ protected Boolean showLabels;
+ @XmlAttribute(name = "linkToAllViews")
+ protected Boolean linkToAllViews;
- @XmlAttribute(name = "width")
- protected Integer width;
- @XmlAttribute(name = "height")
- protected Integer height;
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
+ @XmlAttribute(name = "includeGaps")
+ protected Boolean includeGaps;
+ @XmlAttribute(name = "matchGaps")
+ protected Boolean matchGaps;
+ @XmlAttribute(name = "includeGappedColumns")
+ protected Boolean includeGappedColumns;
+ @XmlAttribute(name = "denominateByShortestLength")
+ protected Boolean denominateByShortestLength;
++ @XmlAttribute(name = "width")
++ protected Integer width;
++ @XmlAttribute(name = "height")
++ protected Integer height;
++ @XmlAttribute(name = "xpos")
++ protected Integer xpos;
++ @XmlAttribute(name = "ypos")
++ protected Integer ypos;
- /**
- * Sets the value of the height property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setHeight(Integer value)
- {
- this.height = value;
- }
+ /**
+ * Gets the value of the sequencePoint property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the sequencePoint property.
++ * This is why there is not a <CODE>set</CODE> method for the sequencePoint property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getSequencePoint().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getSequencePoint().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.PcaViewer.SequencePoint }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the sequencePoint property.
+ */
+ public List<JalviewModel.PcaViewer.SequencePoint> getSequencePoint() {
+ if (sequencePoint == null) {
+ sequencePoint = new ArrayList<JalviewModel.PcaViewer.SequencePoint>();
+ }
+ return this.sequencePoint;
+ }
- /**
- * Gets the value of the xpos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getXpos()
- {
- return xpos;
- }
+ /**
++ * endpoints of X, Y and Z axes in that order
++ *
+ * Gets the value of the axis property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the axis property.
++ * This is why there is not a <CODE>set</CODE> method for the axis property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getAxis().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getAxis().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.PcaViewer.Axis }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the axis property.
+ */
+ public List<JalviewModel.PcaViewer.Axis> getAxis() {
+ if (axis == null) {
+ axis = new ArrayList<JalviewModel.PcaViewer.Axis>();
+ }
+ return this.axis;
+ }
- /**
- * Sets the value of the xpos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setXpos(Integer value)
- {
- this.xpos = value;
- }
+ /**
+ * Gets the value of the seqPointMin property.
+ *
+ * @return
+ * possible object is
+ * {@link JalviewModel.PcaViewer.SeqPointMin }
+ *
+ */
+ public JalviewModel.PcaViewer.SeqPointMin getSeqPointMin() {
+ return seqPointMin;
+ }
- /**
- * Gets the value of the ypos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getYpos()
- {
- return ypos;
- }
+ /**
+ * Sets the value of the seqPointMin property.
+ *
+ * @param value
+ * allowed object is
+ * {@link JalviewModel.PcaViewer.SeqPointMin }
+ *
+ */
+ public void setSeqPointMin(JalviewModel.PcaViewer.SeqPointMin value) {
+ this.seqPointMin = value;
+ }
- /**
- * Sets the value of the ypos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setYpos(Integer value)
- {
- this.ypos = value;
- }
+ /**
+ * Gets the value of the seqPointMax property.
+ *
+ * @return
+ * possible object is
+ * {@link JalviewModel.PcaViewer.SeqPointMax }
+ *
+ */
+ public JalviewModel.PcaViewer.SeqPointMax getSeqPointMax() {
+ return seqPointMax;
+ }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class Axis
- {
-
- @XmlAttribute(name = "xPos")
- protected Float xPos;
-
- @XmlAttribute(name = "yPos")
- protected Float yPos;
-
- @XmlAttribute(name = "zPos")
- protected Float zPos;
-
- /**
- * Gets the value of the xPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getXPos()
- {
- return xPos;
- }
-
- /**
- * Sets the value of the xPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setXPos(Float value)
- {
- this.xPos = value;
- }
-
- /**
- * Gets the value of the yPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getYPos()
- {
- return yPos;
- }
-
- /**
- * Sets the value of the yPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setYPos(Float value)
- {
- this.yPos = value;
- }
-
- /**
- * Gets the value of the zPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getZPos()
- {
- return zPos;
- }
-
- /**
- * Sets the value of the zPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setZPos(Float value)
- {
- this.zPos = value;
- }
+ /**
+ * Sets the value of the seqPointMax property.
+ *
+ * @param value
+ * allowed object is
+ * {@link JalviewModel.PcaViewer.SeqPointMax }
+ *
+ */
+ public void setSeqPointMax(JalviewModel.PcaViewer.SeqPointMax value) {
+ this.seqPointMax = value;
+ }
- }
+ /**
+ * Gets the value of the pcaData property.
+ *
+ * @return
+ * possible object is
+ * {@link PcaDataType }
+ *
+ */
+ public PcaDataType getPcaData() {
+ return pcaData;
+ }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class SeqPointMax
- {
-
- @XmlAttribute(name = "xPos")
- protected Float xPos;
-
- @XmlAttribute(name = "yPos")
- protected Float yPos;
-
- @XmlAttribute(name = "zPos")
- protected Float zPos;
-
- /**
- * Gets the value of the xPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getXPos()
- {
- return xPos;
- }
-
- /**
- * Sets the value of the xPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setXPos(Float value)
- {
- this.xPos = value;
- }
-
- /**
- * Gets the value of the yPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getYPos()
- {
- return yPos;
- }
-
- /**
- * Sets the value of the yPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setYPos(Float value)
- {
- this.yPos = value;
- }
-
- /**
- * Gets the value of the zPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getZPos()
- {
- return zPos;
- }
-
- /**
- * Sets the value of the zPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setZPos(Float value)
- {
- this.zPos = value;
- }
+ /**
+ * Sets the value of the pcaData property.
+ *
+ * @param value
+ * allowed object is
+ * {@link PcaDataType }
+ *
+ */
+ public void setPcaData(PcaDataType value) {
+ this.pcaData = value;
+ }
- }
+ /**
+ * Gets the value of the title property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;/restriction&gt;
- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class SeqPointMin
- {
-
- @XmlAttribute(name = "xPos")
- protected Float xPos;
-
- @XmlAttribute(name = "yPos")
- protected Float yPos;
-
- @XmlAttribute(name = "zPos")
- protected Float zPos;
-
- /**
- * Gets the value of the xPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getXPos()
- {
- return xPos;
- }
-
- /**
- * Sets the value of the xPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setXPos(Float value)
- {
- this.xPos = value;
- }
-
- /**
- * Gets the value of the yPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getYPos()
- {
- return yPos;
- }
-
- /**
- * Sets the value of the yPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setYPos(Float value)
- {
- this.yPos = value;
- }
-
- /**
- * Gets the value of the zPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getZPos()
- {
- return zPos;
- }
-
- /**
- * Sets the value of the zPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setZPos(Float value)
- {
- this.zPos = value;
- }
+ /**
+ * Sets the value of the title property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitle(String value) {
+ this.title = value;
+ }
- }
+ /**
+ * Gets the value of the scoreModelName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getScoreModelName() {
+ return scoreModelName;
+ }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}position"/&gt; &lt;attribute
- * name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class SequencePoint
- {
-
- @XmlAttribute(name = "sequenceRef")
- protected String sequenceRef;
-
- @XmlAttribute(name = "xPos")
- protected Float xPos;
-
- @XmlAttribute(name = "yPos")
- protected Float yPos;
-
- @XmlAttribute(name = "zPos")
- protected Float zPos;
-
- /**
- * Gets the value of the sequenceRef property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getSequenceRef()
- {
- return sequenceRef;
- }
-
- /**
- * Sets the value of the sequenceRef property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setSequenceRef(String value)
- {
- this.sequenceRef = value;
- }
-
- /**
- * Gets the value of the xPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getXPos()
- {
- return xPos;
- }
-
- /**
- * Sets the value of the xPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setXPos(Float value)
- {
- this.xPos = value;
- }
-
- /**
- * Gets the value of the yPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getYPos()
- {
- return yPos;
- }
-
- /**
- * Sets the value of the yPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setYPos(Float value)
- {
- this.yPos = value;
- }
-
- /**
- * Gets the value of the zPos property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getZPos()
- {
- return zPos;
- }
-
- /**
- * Sets the value of the zPos property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setZPos(Float value)
- {
- this.zPos = value;
- }
+ /**
+ * Sets the value of the scoreModelName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setScoreModelName(String value) {
+ this.scoreModelName = value;
+ }
- }
+ /**
+ * Gets the value of the xDim property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getXDim() {
+ return xDim;
+ }
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;sequence
- * minOccurs="0"&gt; &lt;element name="title"
- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt; &lt;element
- * name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="fontSize"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="threshold"
- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
- * name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="showDistances"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="markUnlinked"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="fitToWindow"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="currentTree"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="columnWise"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="columnReference"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="linkToAllViews"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = { "title", "newick" })
- public static class Tree
- {
-
- @XmlElement(namespace = "www.jalview.org")
- protected String title;
-
- @XmlElement(namespace = "www.jalview.org")
- protected String newick;
-
- @XmlAttribute(name = "fontName")
- protected String fontName;
-
- @XmlAttribute(name = "fontSize")
- protected Integer fontSize;
-
- @XmlAttribute(name = "fontStyle")
- protected Integer fontStyle;
-
- @XmlAttribute(name = "threshold")
- protected Float threshold;
-
- @XmlAttribute(name = "showBootstrap")
- protected Boolean showBootstrap;
-
- @XmlAttribute(name = "showDistances")
- protected Boolean showDistances;
-
- @XmlAttribute(name = "markUnlinked")
- protected Boolean markUnlinked;
-
- @XmlAttribute(name = "fitToWindow")
- protected Boolean fitToWindow;
-
- @XmlAttribute(name = "currentTree")
- protected Boolean currentTree;
-
- @XmlAttribute(name = "columnWise")
- protected Boolean columnWise;
-
- @XmlAttribute(name = "columnReference")
- protected String columnReference;
-
- @XmlAttribute(name = "id")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
-
- @XmlAttribute(name = "linkToAllViews")
- protected Boolean linkToAllViews;
-
- @XmlAttribute(name = "width")
- protected Integer width;
-
- @XmlAttribute(name = "height")
- protected Integer height;
-
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
-
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
+ /**
+ * Sets the value of the xDim property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setXDim(Integer value) {
+ this.xDim = value;
+ }
- /**
- * Gets the value of the title property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTitle()
- {
- return title;
- }
+ /**
+ * Gets the value of the yDim property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getYDim() {
+ return yDim;
+ }
- /**
- * Sets the value of the title property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setTitle(String value)
- {
- this.title = value;
- }
+ /**
+ * Sets the value of the yDim property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setYDim(Integer value) {
+ this.yDim = value;
+ }
- /**
- * Gets the value of the newick property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getNewick()
- {
- return newick;
- }
+ /**
+ * Gets the value of the zDim property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getZDim() {
+ return zDim;
+ }
- /**
- * Sets the value of the newick property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setNewick(String value)
- {
- this.newick = value;
- }
+ /**
+ * Sets the value of the zDim property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setZDim(Integer value) {
+ this.zDim = value;
+ }
- /**
- * Gets the value of the fontName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getFontName()
- {
- return fontName;
- }
+ /**
+ * Gets the value of the bgColour property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getBgColour() {
+ return bgColour;
+ }
- /**
- * Sets the value of the fontName property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setFontName(String value)
- {
- this.fontName = value;
- }
+ /**
+ * Sets the value of the bgColour property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setBgColour(Integer value) {
+ this.bgColour = value;
+ }
- /**
- * Gets the value of the fontSize property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getFontSize()
- {
- return fontSize;
- }
+ /**
+ * Gets the value of the scaleFactor property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getScaleFactor() {
+ return scaleFactor;
+ }
- /**
- * Sets the value of the fontSize property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setFontSize(Integer value)
- {
- this.fontSize = value;
- }
+ /**
+ * Sets the value of the scaleFactor property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setScaleFactor(Float value) {
+ this.scaleFactor = value;
+ }
- /**
- * Gets the value of the fontStyle property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getFontStyle()
- {
- return fontStyle;
- }
+ /**
+ * Gets the value of the showLabels property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowLabels() {
+ return showLabels;
+ }
- /**
- * Sets the value of the fontStyle property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setFontStyle(Integer value)
- {
- this.fontStyle = value;
- }
+ /**
+ * Sets the value of the showLabels property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowLabels(Boolean value) {
+ this.showLabels = value;
+ }
- /**
- * Gets the value of the threshold property.
- *
- * @return possible object is {@link Float }
- *
- */
- public Float getThreshold()
- {
- return threshold;
- }
+ /**
+ * Gets the value of the linkToAllViews property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isLinkToAllViews() {
+ return linkToAllViews;
+ }
- /**
- * Sets the value of the threshold property.
- *
- * @param value
- * allowed object is {@link Float }
- *
- */
- public void setThreshold(Float value)
- {
- this.threshold = value;
- }
+ /**
+ * Sets the value of the linkToAllViews property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setLinkToAllViews(Boolean value) {
+ this.linkToAllViews = value;
+ }
- /**
- * Gets the value of the showBootstrap property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowBootstrap()
- {
- return showBootstrap;
- }
+ /**
- * Gets the value of the width property.
++ * Gets the value of the includeGaps property.
+ *
+ * @return
+ * possible object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public Integer getWidth() {
- return width;
++ public Boolean isIncludeGaps() {
++ return includeGaps;
+ }
- /**
- * Sets the value of the showBootstrap property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowBootstrap(Boolean value)
- {
- this.showBootstrap = value;
- }
+ /**
- * Sets the value of the width property.
++ * Sets the value of the includeGaps property.
+ *
+ * @param value
+ * allowed object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public void setWidth(Integer value) {
- this.width = value;
++ public void setIncludeGaps(Boolean value) {
++ this.includeGaps = value;
+ }
- /**
- * Gets the value of the showDistances property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowDistances()
- {
- return showDistances;
- }
+ /**
- * Gets the value of the height property.
++ * Gets the value of the matchGaps property.
+ *
+ * @return
+ * possible object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public Integer getHeight() {
- return height;
++ public Boolean isMatchGaps() {
++ return matchGaps;
+ }
- /**
- * Sets the value of the showDistances property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowDistances(Boolean value)
- {
- this.showDistances = value;
- }
+ /**
- * Sets the value of the height property.
++ * Sets the value of the matchGaps property.
+ *
+ * @param value
+ * allowed object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public void setHeight(Integer value) {
- this.height = value;
++ public void setMatchGaps(Boolean value) {
++ this.matchGaps = value;
+ }
- /**
- * Gets the value of the markUnlinked property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isMarkUnlinked()
- {
- return markUnlinked;
- }
+ /**
- * Gets the value of the xpos property.
++ * Gets the value of the includeGappedColumns property.
+ *
+ * @return
+ * possible object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public Integer getXpos() {
- return xpos;
++ public Boolean isIncludeGappedColumns() {
++ return includeGappedColumns;
+ }
- /**
- * Sets the value of the markUnlinked property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setMarkUnlinked(Boolean value)
- {
- this.markUnlinked = value;
- }
+ /**
- * Sets the value of the xpos property.
++ * Sets the value of the includeGappedColumns property.
+ *
+ * @param value
+ * allowed object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public void setXpos(Integer value) {
- this.xpos = value;
++ public void setIncludeGappedColumns(Boolean value) {
++ this.includeGappedColumns = value;
+ }
- /**
- * Gets the value of the fitToWindow property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isFitToWindow()
- {
- return fitToWindow;
- }
+ /**
- * Gets the value of the ypos property.
++ * Gets the value of the denominateByShortestLength property.
+ *
+ * @return
+ * possible object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public Integer getYpos() {
- return ypos;
++ public Boolean isDenominateByShortestLength() {
++ return denominateByShortestLength;
+ }
- /**
- * Sets the value of the fitToWindow property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setFitToWindow(Boolean value)
- {
- this.fitToWindow = value;
- }
+ /**
- * Sets the value of the ypos property.
++ * Sets the value of the denominateByShortestLength property.
+ *
+ * @param value
+ * allowed object is
- * {@link Integer }
++ * {@link Boolean }
+ *
+ */
- public void setYpos(Integer value) {
- this.ypos = value;
++ public void setDenominateByShortestLength(Boolean value) {
++ this.denominateByShortestLength = value;
+ }
- /**
- * Gets the value of the currentTree property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isCurrentTree()
- {
- return currentTree;
- }
+ /**
- * Gets the value of the includeGaps property.
++ * Gets the value of the width property.
+ *
+ * @return
+ * possible object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public Boolean isIncludeGaps() {
- return includeGaps;
++ public Integer getWidth() {
++ return width;
+ }
- /**
- * Sets the value of the currentTree property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setCurrentTree(Boolean value)
- {
- this.currentTree = value;
- }
+ /**
- * Sets the value of the includeGaps property.
++ * Sets the value of the width property.
+ *
+ * @param value
+ * allowed object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public void setIncludeGaps(Boolean value) {
- this.includeGaps = value;
++ public void setWidth(Integer value) {
++ this.width = value;
+ }
- /**
- * Gets the value of the columnWise property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isColumnWise()
- {
- if (columnWise == null)
- {
- return false;
- }
- else
- {
- return columnWise;
- }
- }
+ /**
- * Gets the value of the matchGaps property.
++ * Gets the value of the height property.
+ *
+ * @return
+ * possible object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public Boolean isMatchGaps() {
- return matchGaps;
++ public Integer getHeight() {
++ return height;
+ }
- /**
- * Sets the value of the columnWise property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setColumnWise(Boolean value)
- {
- this.columnWise = value;
- }
+ /**
- * Sets the value of the matchGaps property.
++ * Sets the value of the height property.
+ *
+ * @param value
+ * allowed object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public void setMatchGaps(Boolean value) {
- this.matchGaps = value;
++ public void setHeight(Integer value) {
++ this.height = value;
+ }
- /**
- * Gets the value of the columnReference property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getColumnReference()
- {
- return columnReference;
- }
+ /**
- * Gets the value of the includeGappedColumns property.
++ * Gets the value of the xpos property.
+ *
+ * @return
+ * possible object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public Boolean isIncludeGappedColumns() {
- return includeGappedColumns;
++ public Integer getXpos() {
++ return xpos;
+ }
- /**
- * Sets the value of the columnReference property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setColumnReference(String value)
- {
- this.columnReference = value;
- }
+ /**
- * Sets the value of the includeGappedColumns property.
++ * Sets the value of the xpos property.
+ *
+ * @param value
+ * allowed object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public void setIncludeGappedColumns(Boolean value) {
- this.includeGappedColumns = value;
++ public void setXpos(Integer value) {
++ this.xpos = value;
+ }
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
+ /**
- * Gets the value of the denominateByShortestLength property.
++ * Gets the value of the ypos property.
+ *
+ * @return
+ * possible object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public Boolean isDenominateByShortestLength() {
- return denominateByShortestLength;
++ public Integer getYpos() {
++ return ypos;
+ }
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
+ /**
- * Sets the value of the denominateByShortestLength property.
++ * Sets the value of the ypos property.
+ *
+ * @param value
+ * allowed object is
- * {@link Boolean }
++ * {@link Integer }
+ *
+ */
- public void setDenominateByShortestLength(Boolean value) {
- this.denominateByShortestLength = value;
++ public void setYpos(Integer value) {
++ this.ypos = value;
+ }
- /**
- * Gets the value of the linkToAllViews property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isLinkToAllViews()
- {
- if (linkToAllViews == null)
- {
- return false;
- }
- else
- {
- return linkToAllViews;
- }
- }
- /**
- * Sets the value of the linkToAllViews property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setLinkToAllViews(Boolean value)
- {
- this.linkToAllViews = value;
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class Axis {
+
+ @XmlAttribute(name = "xPos")
+ protected Float xPos;
+ @XmlAttribute(name = "yPos")
+ protected Float yPos;
+ @XmlAttribute(name = "zPos")
+ protected Float zPos;
+
+ /**
+ * Gets the value of the xPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getXPos() {
+ return xPos;
+ }
+
+ /**
+ * Sets the value of the xPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setXPos(Float value) {
+ this.xPos = value;
+ }
+
+ /**
+ * Gets the value of the yPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getYPos() {
+ return yPos;
+ }
+
+ /**
+ * Sets the value of the yPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setYPos(Float value) {
+ this.yPos = value;
+ }
+
+ /**
+ * Gets the value of the zPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getZPos() {
+ return zPos;
+ }
+
+ /**
+ * Sets the value of the zPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setZPos(Float value) {
+ this.zPos = value;
+ }
- /**
- * Gets the value of the width property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getWidth()
- {
- return width;
- }
+ }
- /**
- * Sets the value of the width property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setWidth(Integer value)
- {
- this.width = value;
- }
- /**
- * Gets the value of the height property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getHeight()
- {
- return height;
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class SeqPointMax {
+
+ @XmlAttribute(name = "xPos")
+ protected Float xPos;
+ @XmlAttribute(name = "yPos")
+ protected Float yPos;
+ @XmlAttribute(name = "zPos")
+ protected Float zPos;
+
+ /**
+ * Gets the value of the xPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getXPos() {
+ return xPos;
+ }
+
+ /**
+ * Sets the value of the xPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setXPos(Float value) {
+ this.xPos = value;
+ }
+
+ /**
+ * Gets the value of the yPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getYPos() {
+ return yPos;
+ }
+
+ /**
+ * Sets the value of the yPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setYPos(Float value) {
+ this.yPos = value;
+ }
+
+ /**
+ * Gets the value of the zPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getZPos() {
+ return zPos;
+ }
+
+ /**
+ * Sets the value of the zPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setZPos(Float value) {
+ this.zPos = value;
+ }
- /**
- * Sets the value of the height property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setHeight(Integer value)
- {
- this.height = value;
- }
+ }
- /**
- * Gets the value of the xpos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getXpos()
- {
- return xpos;
- }
- /**
- * Sets the value of the xpos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setXpos(Integer value)
- {
- this.xpos = value;
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class SeqPointMin {
+
+ @XmlAttribute(name = "xPos")
+ protected Float xPos;
+ @XmlAttribute(name = "yPos")
+ protected Float yPos;
+ @XmlAttribute(name = "zPos")
+ protected Float zPos;
+
+ /**
+ * Gets the value of the xPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getXPos() {
+ return xPos;
+ }
+
+ /**
+ * Sets the value of the xPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setXPos(Float value) {
+ this.xPos = value;
+ }
+
+ /**
+ * Gets the value of the yPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getYPos() {
+ return yPos;
+ }
+
+ /**
+ * Sets the value of the yPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setYPos(Float value) {
+ this.yPos = value;
+ }
+
+ /**
+ * Gets the value of the zPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getZPos() {
+ return zPos;
+ }
+
+ /**
+ * Sets the value of the zPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setZPos(Float value) {
+ this.zPos = value;
+ }
- /**
- * Gets the value of the ypos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getYpos()
- {
- return ypos;
- }
+ }
- /**
- * Sets the value of the ypos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setYpos(Integer value)
- {
- this.ypos = value;
- }
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="UserColourScheme"
- * type="{www.jalview.org/colours}JalviewUserColours"/&gt;
- * &lt;/sequence&gt; &lt;attribute name="id"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "", propOrder = { "userColourScheme" })
- public static class UserColours
- {
-
- @XmlElement(
- name = "UserColourScheme",
- namespace = "www.jalview.org",
- required = true)
- protected JalviewUserColours userColourScheme;
-
- @XmlAttribute(name = "id")
- protected String id;
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attGroup ref="{www.jalview.org}position"/&gt;
- * &lt;attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}position"/>
++ * <attribute name="sequenceRef" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class SequencePoint {
+
+ @XmlAttribute(name = "sequenceRef")
+ protected String sequenceRef;
+ @XmlAttribute(name = "xPos")
+ protected Float xPos;
+ @XmlAttribute(name = "yPos")
+ protected Float yPos;
+ @XmlAttribute(name = "zPos")
+ protected Float zPos;
+
+ /**
+ * Gets the value of the sequenceRef property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSequenceRef() {
+ return sequenceRef;
+ }
+
+ /**
+ * Sets the value of the sequenceRef property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSequenceRef(String value) {
+ this.sequenceRef = value;
+ }
+
+ /**
+ * Gets the value of the xPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getXPos() {
+ return xPos;
+ }
+
+ /**
+ * Sets the value of the xPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setXPos(Float value) {
+ this.xPos = value;
+ }
+
+ /**
+ * Gets the value of the yPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getYPos() {
+ return yPos;
+ }
+
+ /**
+ * Sets the value of the yPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setYPos(Float value) {
+ this.yPos = value;
+ }
+
+ /**
+ * Gets the value of the zPos property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getZPos() {
+ return zPos;
+ }
+
+ /**
+ * Sets the value of the zPos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setZPos(Float value) {
+ this.zPos = value;
+ }
- /**
- * Gets the value of the userColourScheme property.
- *
- * @return possible object is {@link JalviewUserColours }
- *
- */
- public JalviewUserColours getUserColourScheme()
- {
- return userColourScheme;
- }
+ }
- /**
- * Sets the value of the userColourScheme property.
- *
- * @param value
- * allowed object is {@link JalviewUserColours }
- *
- */
- public void setUserColourScheme(JalviewUserColours value)
- {
- this.userColourScheme = value;
}
+
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the id property.
++ * <p>Java class for anonymous complex type</p>.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
- * @return possible object is {@link String }
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence minOccurs="0"&gt;
- * &lt;element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
- * &lt;attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- */
- public String getId()
- {
- return id;
- }
-
- /**
- * Sets the value of the id property.
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence minOccurs="0">
++ * <element name="title" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="newick" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="showBootstrap" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showDistances" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="markUnlinked" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="fitToWindow" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="currentTree" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="columnWise" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="columnReference" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
++ * <attribute name="linkToAllViews" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @param value
- * allowed object is {@link String }
*
*/
- public void setId(String value)
- {
- this.id = value;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "title",
+ "newick"
+ })
+ public static class Tree {
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="AnnotationColours"
- * type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;element name="hiddenColumns" maxOccurs="unbounded"
- * minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int"
- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="calcIdParam" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;extension
- * base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * default="false" /&gt; &lt;attribute name="autoUpdate"
- * use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
- * name="overview" minOccurs="0"&gt; &lt;complexType&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="residueColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="hiddenColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; &lt;/element&gt;
- * &lt;/sequence&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="conservationSelected"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="pidSelected"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="bgColour"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showFullId"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="rightAlignIds"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showText"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showColourText"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showUnconserved"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showBoxes"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="wrapAlignment"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="renderGaps"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showSequenceFeatures"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showNPfeatureTooltip"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showDbRefTooltip"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="followHighlight"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="followSelection"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showAnnotation"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="centreColumnLabels"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConservation"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConsensus"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showConsensusHistogram"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="startRes"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="charWidth"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="charHeight" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontName"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="idWidthManuallyAdjusted"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="scaleProteinAsCdna"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="viewName"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="gatheredViews"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="textCol1"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textColThreshold"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="complementId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="showComplementFeatures"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showComplementFeaturesOnTop"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(
- name = "",
- propOrder =
- { "annotationColours", "hiddenColumns", "calcIdParam", "overview" })
- public static class Viewport
- {
-
- @XmlElement(name = "AnnotationColours", namespace = "www.jalview.org")
- protected AnnotationColourScheme annotationColours;
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<JalviewModel.Viewport.HiddenColumns> hiddenColumns;
-
- @XmlElement(namespace = "www.jalview.org")
- protected List<JalviewModel.Viewport.CalcIdParam> calcIdParam;
-
- @XmlElement(namespace = "www.jalview.org")
- protected JalviewModel.Viewport.Overview overview;
-
- @XmlAttribute(name = "conservationSelected")
- protected Boolean conservationSelected;
-
- @XmlAttribute(name = "pidSelected")
- protected Boolean pidSelected;
-
- @XmlAttribute(name = "bgColour")
- protected String bgColour;
-
- @XmlAttribute(name = "consThreshold")
- protected Integer consThreshold;
-
- @XmlAttribute(name = "pidThreshold")
- protected Integer pidThreshold;
-
- @XmlAttribute(name = "title")
- protected String title;
-
- @XmlAttribute(name = "showFullId")
- protected Boolean showFullId;
-
- @XmlAttribute(name = "rightAlignIds")
- protected Boolean rightAlignIds;
-
- @XmlAttribute(name = "showText")
- protected Boolean showText;
-
- @XmlAttribute(name = "showColourText")
- protected Boolean showColourText;
-
- @XmlAttribute(name = "showUnconserved")
- protected Boolean showUnconserved;
-
- @XmlAttribute(name = "showBoxes")
- protected Boolean showBoxes;
-
- @XmlAttribute(name = "wrapAlignment")
- protected Boolean wrapAlignment;
+ @XmlElement(namespace = "www.jalview.org")
+ protected String title;
+ @XmlElement(namespace = "www.jalview.org")
+ protected String newick;
+ @XmlAttribute(name = "fontName")
+ protected String fontName;
+ @XmlAttribute(name = "fontSize")
+ protected Integer fontSize;
+ @XmlAttribute(name = "fontStyle")
+ protected Integer fontStyle;
+ @XmlAttribute(name = "threshold")
+ protected Float threshold;
+ @XmlAttribute(name = "showBootstrap")
+ protected Boolean showBootstrap;
+ @XmlAttribute(name = "showDistances")
+ protected Boolean showDistances;
+ @XmlAttribute(name = "markUnlinked")
+ protected Boolean markUnlinked;
+ @XmlAttribute(name = "fitToWindow")
+ protected Boolean fitToWindow;
+ @XmlAttribute(name = "currentTree")
+ protected Boolean currentTree;
++ /**
++ * Set for trees associated with columns of an alignment, sequence or annotation row
++ *
++ */
++ @XmlAttribute(name = "columnWise")
++ protected Boolean columnWise;
++ /**
++ * Refers to annotation row the tree is provided by
++ *
++ */
++ @XmlAttribute(name = "columnReference")
++ protected String columnReference;
++ /**
++ * Tree ID added for binding tree
++ * visualization
++ * settings to vamsas
++ * document trees in jalview 2.4.1
++ *
++ */
+ @XmlAttribute(name = "id")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlID
+ @XmlSchemaType(name = "ID")
+ protected String id;
+ @XmlAttribute(name = "linkToAllViews")
+ protected Boolean linkToAllViews;
+ @XmlAttribute(name = "width")
+ protected Integer width;
+ @XmlAttribute(name = "height")
+ protected Integer height;
+ @XmlAttribute(name = "xpos")
+ protected Integer xpos;
+ @XmlAttribute(name = "ypos")
+ protected Integer ypos;
- @XmlAttribute(name = "renderGaps")
- protected Boolean renderGaps;
+ /**
+ * Gets the value of the title property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
- @XmlAttribute(name = "showSequenceFeatures")
- protected Boolean showSequenceFeatures;
+ /**
+ * Sets the value of the title property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitle(String value) {
+ this.title = value;
+ }
- @XmlAttribute(name = "showNPfeatureTooltip")
- protected Boolean showNPfeatureTooltip;
+ /**
+ * Gets the value of the newick property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getNewick() {
+ return newick;
+ }
- @XmlAttribute(name = "showDbRefTooltip")
- protected Boolean showDbRefTooltip;
+ /**
+ * Sets the value of the newick property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setNewick(String value) {
+ this.newick = value;
+ }
- @XmlAttribute(name = "followHighlight")
- protected Boolean followHighlight;
+ /**
+ * Gets the value of the fontName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFontName() {
+ return fontName;
+ }
- @XmlAttribute(name = "followSelection")
- protected Boolean followSelection;
+ /**
+ * Sets the value of the fontName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFontName(String value) {
+ this.fontName = value;
+ }
- @XmlAttribute(name = "showAnnotation")
- protected Boolean showAnnotation;
+ /**
+ * Gets the value of the fontSize property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getFontSize() {
+ return fontSize;
+ }
- @XmlAttribute(name = "centreColumnLabels")
- protected Boolean centreColumnLabels;
+ /**
+ * Sets the value of the fontSize property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setFontSize(Integer value) {
+ this.fontSize = value;
+ }
- @XmlAttribute(name = "showGroupConservation")
- protected Boolean showGroupConservation;
+ /**
+ * Gets the value of the fontStyle property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getFontStyle() {
+ return fontStyle;
+ }
- @XmlAttribute(name = "showGroupConsensus")
- protected Boolean showGroupConsensus;
+ /**
+ * Sets the value of the fontStyle property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setFontStyle(Integer value) {
+ this.fontStyle = value;
+ }
- @XmlAttribute(name = "showConsensusHistogram")
- protected Boolean showConsensusHistogram;
+ /**
+ * Gets the value of the threshold property.
+ *
+ * @return
+ * possible object is
+ * {@link Float }
+ *
+ */
+ public Float getThreshold() {
+ return threshold;
+ }
- @XmlAttribute(name = "showSequenceLogo")
- protected Boolean showSequenceLogo;
+ /**
+ * Sets the value of the threshold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Float }
+ *
+ */
+ public void setThreshold(Float value) {
+ this.threshold = value;
+ }
- @XmlAttribute(name = "normaliseSequenceLogo")
- protected Boolean normaliseSequenceLogo;
+ /**
+ * Gets the value of the showBootstrap property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowBootstrap() {
+ return showBootstrap;
+ }
- @XmlAttribute(name = "ignoreGapsinConsensus")
- protected Boolean ignoreGapsinConsensus;
+ /**
+ * Sets the value of the showBootstrap property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowBootstrap(Boolean value) {
+ this.showBootstrap = value;
+ }
- @XmlAttribute(name = "startRes")
- protected Integer startRes;
+ /**
+ * Gets the value of the showDistances property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowDistances() {
+ return showDistances;
+ }
- @XmlAttribute(name = "startSeq")
- protected Integer startSeq;
+ /**
+ * Sets the value of the showDistances property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowDistances(Boolean value) {
+ this.showDistances = value;
+ }
- @XmlAttribute(name = "charWidth")
- protected Integer charWidth;
+ /**
+ * Gets the value of the markUnlinked property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isMarkUnlinked() {
+ return markUnlinked;
+ }
- @XmlAttribute(name = "charHeight")
- protected Integer charHeight;
+ /**
+ * Sets the value of the markUnlinked property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setMarkUnlinked(Boolean value) {
+ this.markUnlinked = value;
+ }
- @XmlAttribute(name = "fontName")
- protected String fontName;
+ /**
+ * Gets the value of the fitToWindow property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isFitToWindow() {
+ return fitToWindow;
+ }
- @XmlAttribute(name = "fontSize")
- protected Integer fontSize;
+ /**
+ * Sets the value of the fitToWindow property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setFitToWindow(Boolean value) {
+ this.fitToWindow = value;
+ }
- @XmlAttribute(name = "fontStyle")
- protected Integer fontStyle;
+ /**
+ * Gets the value of the currentTree property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isCurrentTree() {
+ return currentTree;
+ }
- @XmlAttribute(name = "idWidth")
- protected Integer idWidth;
+ /**
+ * Sets the value of the currentTree property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setCurrentTree(Boolean value) {
+ this.currentTree = value;
+ }
- @XmlAttribute(name = "idWidthManuallyAdjusted")
- protected Boolean idWidthManuallyAdjusted;
+ /**
- * Gets the value of the id property.
++ * Set for trees associated with columns of an alignment, sequence or annotation row
+ *
+ * @return
+ * possible object is
- * {@link String }
++ * {@link Boolean }
+ *
+ */
- public String getId() {
- return id;
++ public boolean isColumnWise() {
++ if (columnWise == null) {
++ return false;
++ } else {
++ return columnWise;
++ }
+ }
- @XmlAttribute(name = "scaleProteinAsCdna")
- protected Boolean scaleProteinAsCdna;
+ /**
- * Sets the value of the id property.
++ * Sets the value of the columnWise property.
+ *
+ * @param value
+ * allowed object is
- * {@link String }
++ * {@link Boolean }
+ *
++ * @see #isColumnWise()
+ */
- public void setId(String value) {
- this.id = value;
++ public void setColumnWise(Boolean value) {
++ this.columnWise = value;
+ }
- @XmlAttribute(name = "viewName")
- protected String viewName;
+ /**
- * Gets the value of the linkToAllViews property.
++ * Refers to annotation row the tree is provided by
+ *
+ * @return
+ * possible object is
- * {@link Boolean }
++ * {@link String }
+ *
+ */
- public boolean isLinkToAllViews() {
- if (linkToAllViews == null) {
- return false;
++ public String getColumnReference() {
++ return columnReference;
++ }
+
- @XmlAttribute(name = "sequenceSetId")
- protected String sequenceSetId;
++ /**
++ * Sets the value of the columnReference property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getColumnReference()
++ */
++ public void setColumnReference(String value) {
++ this.columnReference = value;
++ }
+
- @XmlAttribute(name = "gatheredViews")
- protected Boolean gatheredViews;
++ /**
++ * Tree ID added for binding tree
++ * visualization
++ * settings to vamsas
++ * document trees in jalview 2.4.1
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getId() {
++ return id;
++ }
+
- @XmlAttribute(name = "textCol1")
- protected Integer textCol1;
++ /**
++ * Sets the value of the id property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getId()
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
+
- @XmlAttribute(name = "textCol2")
- protected Integer textCol2;
++ /**
++ * Gets the value of the linkToAllViews property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public boolean isLinkToAllViews() {
++ if (linkToAllViews == null) {
++ return false;
+ } else {
+ return linkToAllViews;
+ }
+ }
- @XmlAttribute(name = "textColThreshold")
- protected Integer textColThreshold;
+ /**
+ * Sets the value of the linkToAllViews property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setLinkToAllViews(Boolean value) {
+ this.linkToAllViews = value;
+ }
- @XmlAttribute(name = "id")
- @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
- @XmlID
- @XmlSchemaType(name = "ID")
- protected String id;
+ /**
+ * Gets the value of the width property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getWidth() {
+ return width;
+ }
- @XmlAttribute(name = "complementId")
- protected String complementId;
+ /**
+ * Sets the value of the width property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setWidth(Integer value) {
+ this.width = value;
+ }
- @XmlAttribute(name = "showComplementFeatures")
- protected Boolean showComplementFeatures;
+ /**
+ * Gets the value of the height property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getHeight() {
+ return height;
+ }
- @XmlAttribute(name = "showComplementFeaturesOnTop")
- protected Boolean showComplementFeaturesOnTop;
+ /**
+ * Sets the value of the height property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setHeight(Integer value) {
+ this.height = value;
+ }
- @XmlAttribute(name = "width")
- protected Integer width;
+ /**
+ * Gets the value of the xpos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getXpos() {
+ return xpos;
+ }
- @XmlAttribute(name = "height")
- protected Integer height;
+ /**
+ * Sets the value of the xpos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setXpos(Integer value) {
+ this.xpos = value;
+ }
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
+ /**
+ * Gets the value of the ypos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getYpos() {
+ return ypos;
+ }
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
+ /**
+ * Sets the value of the ypos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setYpos(Integer value) {
+ this.ypos = value;
+ }
- /**
- * Gets the value of the annotationColours property.
- *
- * @return possible object is {@link AnnotationColourScheme }
- *
- */
- public AnnotationColourScheme getAnnotationColours()
- {
- return annotationColours;
}
- /**
- * Sets the value of the annotationColours property.
- *
- * @param value
- * allowed object is {@link AnnotationColourScheme }
- *
- */
- public void setAnnotationColours(AnnotationColourScheme value)
- {
- this.annotationColours = value;
- }
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the hiddenColumns property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the hiddenColumns property.
++ * <p>Java class for anonymous complex type</p>.
*
- * <p>The following schema fragment specifies the expected content contained within this class.
- * <p> For example, to add a new item, do as follows: <pre>
- * getHiddenColumns().add(newItem); </pre>
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/&gt;
- * &lt;/sequence&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.Viewport.HiddenColumns }
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="UserColourScheme" type="{www.jalview.org/colours}JalviewUserColours"/>
++ * </sequence>
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
- public List<JalviewModel.Viewport.HiddenColumns> getHiddenColumns()
- {
- if (hiddenColumns == null)
- {
- hiddenColumns = new ArrayList<JalviewModel.Viewport.HiddenColumns>();
- }
- return this.hiddenColumns;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "userColourScheme"
+ })
+ public static class UserColours {
- /**
- * Gets the value of the calcIdParam property.
- *
- * <p> This accessor method returns a reference to the live list, not
- * a snapshot. Therefore any modification you make to the returned list will
- * be present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the calcIdParam property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getCalcIdParam().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link JalviewModel.Viewport.CalcIdParam }
- *
- *
- */
- public List<JalviewModel.Viewport.CalcIdParam> getCalcIdParam()
- {
- if (calcIdParam == null)
- {
- calcIdParam = new ArrayList<JalviewModel.Viewport.CalcIdParam>();
- }
- return this.calcIdParam;
- }
+ @XmlElement(name = "UserColourScheme", namespace = "www.jalview.org", required = true)
+ protected JalviewUserColours userColourScheme;
+ @XmlAttribute(name = "id")
+ protected String id;
- /**
- * Gets the value of the overview property.
- *
- * @return possible object is {@link JalviewModel.Viewport.Overview }
- *
- */
- public JalviewModel.Viewport.Overview getOverview()
- {
- return overview;
- }
+ /**
+ * Gets the value of the userColourScheme property.
+ *
+ * @return
+ * possible object is
+ * {@link JalviewUserColours }
+ *
+ */
+ public JalviewUserColours getUserColourScheme() {
+ return userColourScheme;
+ }
- /**
- * Sets the value of the overview property.
- *
- * @param value
- * allowed object is {@link JalviewModel.Viewport.Overview }
- *
- */
- public void setOverview(JalviewModel.Viewport.Overview value)
- {
- this.overview = value;
- }
+ /**
+ * Sets the value of the userColourScheme property.
+ *
+ * @param value
+ * allowed object is
+ * {@link JalviewUserColours }
+ *
+ */
+ public void setUserColourScheme(JalviewUserColours value) {
+ this.userColourScheme = value;
+ }
- /**
- * Gets the value of the conservationSelected property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isConservationSelected()
- {
- return conservationSelected;
- }
+ /**
+ * Gets the value of the id property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
- /**
- * Sets the value of the conservationSelected property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setConservationSelected(Boolean value)
- {
- this.conservationSelected = value;
- }
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
- /**
- * Gets the value of the pidSelected property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isPidSelected()
- {
- return pidSelected;
}
- /**
- * Sets the value of the pidSelected property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setPidSelected(Boolean value)
- {
- this.pidSelected = value;
- }
/**
- * <p>Java class for anonymous complex type.
- * Gets the value of the bgColour property.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt;
- * &lt;element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/&gt;
- * &lt;element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;element name="calcIdParam" maxOccurs="unbounded" minOccurs="0"&gt;
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * &lt;/element&gt;
- * &lt;/sequence&gt;
- * &lt;attGroup ref="{www.jalview.org}swingwindow"/&gt;
- * &lt;attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" /&gt;
- * &lt;attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" /&gt;
- * &lt;attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="showComplementFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="showComplementFeaturesOnTop" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="AnnotationColours" type="{www.jalview.org}AnnotationColourScheme" minOccurs="0"/>
++ * <element name="hiddenColumns" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="calcIdParam" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
++ * <attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="overview" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="residueColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="hiddenColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="conservationSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="pidSelected" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="bgColour" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="consThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="pidThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="showFullId" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="rightAlignIds" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showColourText" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showUnconserved" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showBoxes" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="wrapAlignment" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="renderGaps" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showSequenceFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showNPfeatureTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="showDbRefTooltip" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="followHighlight" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="followSelection" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showAnnotation" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="centreColumnLabels" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showGroupConservation" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showGroupConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showConsensusHistogram" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="showSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="normaliseSequenceLogo" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="ignoreGapsinConsensus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="startRes" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="startSeq" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="charWidth" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="charHeight" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="fontSize" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="fontStyle" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="idWidth" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="idWidthManuallyAdjusted" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="scaleProteinAsCdna" type="{http://www.w3.org/2001/XMLSchema}boolean" default="true" />
++ * <attribute name="viewName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="sequenceSetId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="gatheredViews" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="textCol1" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textCol2" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="textColThreshold" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}ID" />
++ * <attribute name="complementId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="showComplementFeatures" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="showComplementFeaturesOnTop" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
- * @return possible object is {@link String }
*
*/
- public String getBgColour()
- {
- return bgColour;
- }
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "", propOrder = {
+ "annotationColours",
+ "hiddenColumns",
- "calcIdParam"
++ "calcIdParam",
++ "overview"
+ })
+ public static class Viewport {
+
+ @XmlElement(name = "AnnotationColours", namespace = "www.jalview.org")
+ protected AnnotationColourScheme annotationColours;
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.Viewport.HiddenColumns> hiddenColumns;
+ @XmlElement(namespace = "www.jalview.org")
+ protected List<JalviewModel.Viewport.CalcIdParam> calcIdParam;
++ @XmlElement(namespace = "www.jalview.org")
++ protected JalviewModel.Viewport.Overview overview;
+ @XmlAttribute(name = "conservationSelected")
+ protected Boolean conservationSelected;
+ @XmlAttribute(name = "pidSelected")
+ protected Boolean pidSelected;
+ @XmlAttribute(name = "bgColour")
+ protected String bgColour;
+ @XmlAttribute(name = "consThreshold")
+ protected Integer consThreshold;
+ @XmlAttribute(name = "pidThreshold")
+ protected Integer pidThreshold;
+ @XmlAttribute(name = "title")
+ protected String title;
+ @XmlAttribute(name = "showFullId")
+ protected Boolean showFullId;
+ @XmlAttribute(name = "rightAlignIds")
+ protected Boolean rightAlignIds;
+ @XmlAttribute(name = "showText")
+ protected Boolean showText;
+ @XmlAttribute(name = "showColourText")
+ protected Boolean showColourText;
+ @XmlAttribute(name = "showUnconserved")
+ protected Boolean showUnconserved;
+ @XmlAttribute(name = "showBoxes")
+ protected Boolean showBoxes;
+ @XmlAttribute(name = "wrapAlignment")
+ protected Boolean wrapAlignment;
+ @XmlAttribute(name = "renderGaps")
+ protected Boolean renderGaps;
+ @XmlAttribute(name = "showSequenceFeatures")
+ protected Boolean showSequenceFeatures;
+ @XmlAttribute(name = "showNPfeatureTooltip")
+ protected Boolean showNPfeatureTooltip;
+ @XmlAttribute(name = "showDbRefTooltip")
+ protected Boolean showDbRefTooltip;
+ @XmlAttribute(name = "followHighlight")
+ protected Boolean followHighlight;
+ @XmlAttribute(name = "followSelection")
+ protected Boolean followSelection;
+ @XmlAttribute(name = "showAnnotation")
+ protected Boolean showAnnotation;
+ @XmlAttribute(name = "centreColumnLabels")
+ protected Boolean centreColumnLabels;
+ @XmlAttribute(name = "showGroupConservation")
+ protected Boolean showGroupConservation;
+ @XmlAttribute(name = "showGroupConsensus")
+ protected Boolean showGroupConsensus;
+ @XmlAttribute(name = "showConsensusHistogram")
+ protected Boolean showConsensusHistogram;
+ @XmlAttribute(name = "showSequenceLogo")
+ protected Boolean showSequenceLogo;
+ @XmlAttribute(name = "normaliseSequenceLogo")
+ protected Boolean normaliseSequenceLogo;
+ @XmlAttribute(name = "ignoreGapsinConsensus")
+ protected Boolean ignoreGapsinConsensus;
+ @XmlAttribute(name = "startRes")
+ protected Integer startRes;
+ @XmlAttribute(name = "startSeq")
+ protected Integer startSeq;
++ @XmlAttribute(name = "charWidth")
++ protected Integer charWidth;
++ @XmlAttribute(name = "charHeight")
++ protected Integer charHeight;
+ @XmlAttribute(name = "fontName")
+ protected String fontName;
+ @XmlAttribute(name = "fontSize")
+ protected Integer fontSize;
+ @XmlAttribute(name = "fontStyle")
+ protected Integer fontStyle;
++ @XmlAttribute(name = "idWidth")
++ protected Integer idWidth;
++ @XmlAttribute(name = "idWidthManuallyAdjusted")
++ protected Boolean idWidthManuallyAdjusted;
+ @XmlAttribute(name = "scaleProteinAsCdna")
+ protected Boolean scaleProteinAsCdna;
+ @XmlAttribute(name = "viewName")
+ protected String viewName;
+ @XmlAttribute(name = "sequenceSetId")
+ protected String sequenceSetId;
+ @XmlAttribute(name = "gatheredViews")
+ protected Boolean gatheredViews;
+ @XmlAttribute(name = "textCol1")
+ protected Integer textCol1;
+ @XmlAttribute(name = "textCol2")
+ protected Integer textCol2;
+ @XmlAttribute(name = "textColThreshold")
+ protected Integer textColThreshold;
++ /**
++ * unique id used by jalview to
++ * synchronize
++ * between stored and
++ * instantiated views
++ *
++ */
+ @XmlAttribute(name = "id")
+ @XmlJavaTypeAdapter(CollapsedStringAdapter.class)
+ @XmlID
+ @XmlSchemaType(name = "ID")
+ protected String id;
++ /**
++ * The viewport id of this viewport's
++ * (cdna/protein) coding complement, if any
++ *
++ */
+ @XmlAttribute(name = "complementId")
+ protected String complementId;
+ @XmlAttribute(name = "showComplementFeatures")
+ protected Boolean showComplementFeatures;
+ @XmlAttribute(name = "showComplementFeaturesOnTop")
+ protected Boolean showComplementFeaturesOnTop;
+ @XmlAttribute(name = "width")
+ protected Integer width;
+ @XmlAttribute(name = "height")
+ protected Integer height;
+ @XmlAttribute(name = "xpos")
+ protected Integer xpos;
+ @XmlAttribute(name = "ypos")
+ protected Integer ypos;
- /**
- * Sets the value of the bgColour property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setBgColour(String value)
- {
- this.bgColour = value;
- }
+ /**
+ * Gets the value of the annotationColours property.
+ *
+ * @return
+ * possible object is
+ * {@link AnnotationColourScheme }
+ *
+ */
+ public AnnotationColourScheme getAnnotationColours() {
+ return annotationColours;
+ }
- /**
- * Gets the value of the consThreshold property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getConsThreshold()
- {
- return consThreshold;
- }
+ /**
+ * Sets the value of the annotationColours property.
+ *
+ * @param value
+ * allowed object is
+ * {@link AnnotationColourScheme }
+ *
+ */
+ public void setAnnotationColours(AnnotationColourScheme value) {
+ this.annotationColours = value;
+ }
+
+ /**
+ * Gets the value of the hiddenColumns property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the hiddenColumns property.
++ * This is why there is not a <CODE>set</CODE> method for the hiddenColumns property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getHiddenColumns().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getHiddenColumns().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.Viewport.HiddenColumns }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the hiddenColumns property.
+ */
+ public List<JalviewModel.Viewport.HiddenColumns> getHiddenColumns() {
+ if (hiddenColumns == null) {
+ hiddenColumns = new ArrayList<JalviewModel.Viewport.HiddenColumns>();
+ }
+ return this.hiddenColumns;
+ }
+
+ /**
+ * Gets the value of the calcIdParam property.
+ *
- * <p>
- * This accessor method returns a reference to the live list,
++ * <p>This accessor method returns a reference to the live list,
+ * not a snapshot. Therefore any modification you make to the
+ * returned list will be present inside the JAXB object.
- * This is why there is not a <CODE>set</CODE> method for the calcIdParam property.
++ * This is why there is not a <CODE>set</CODE> method for the calcIdParam property.</p>
+ *
- * <p>
++ * <p>
+ * For example, to add a new item, do as follows:
- * <pre>
- * getCalcIdParam().add(newItem);
- * </pre>
++ * </p>
++ * <pre>
++ * getCalcIdParam().add(newItem);
++ * </pre>
+ *
+ *
- * <p>
++ * <p>
+ * Objects of the following type(s) are allowed in the list
+ * {@link JalviewModel.Viewport.CalcIdParam }
++ * </p>
+ *
+ *
++ * @return
++ * The value of the calcIdParam property.
+ */
+ public List<JalviewModel.Viewport.CalcIdParam> getCalcIdParam() {
+ if (calcIdParam == null) {
+ calcIdParam = new ArrayList<JalviewModel.Viewport.CalcIdParam>();
+ }
+ return this.calcIdParam;
+ }
+
+ /**
++ * Gets the value of the overview property.
++ *
++ * @return
++ * possible object is
++ * {@link JalviewModel.Viewport.Overview }
++ *
++ */
++ public JalviewModel.Viewport.Overview getOverview() {
++ return overview;
++ }
++
++ /**
++ * Sets the value of the overview property.
++ *
++ * @param value
++ * allowed object is
++ * {@link JalviewModel.Viewport.Overview }
++ *
++ */
++ public void setOverview(JalviewModel.Viewport.Overview value) {
++ this.overview = value;
++ }
++
++ /**
+ * Gets the value of the conservationSelected property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isConservationSelected() {
+ return conservationSelected;
+ }
+
+ /**
+ * Sets the value of the conservationSelected property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setConservationSelected(Boolean value) {
+ this.conservationSelected = value;
+ }
+
+ /**
+ * Gets the value of the pidSelected property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isPidSelected() {
+ return pidSelected;
+ }
+
+ /**
+ * Sets the value of the pidSelected property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setPidSelected(Boolean value) {
+ this.pidSelected = value;
+ }
+
+ /**
+ * Gets the value of the bgColour property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getBgColour() {
+ return bgColour;
+ }
- /**
- * Sets the value of the consThreshold property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setConsThreshold(Integer value)
- {
- this.consThreshold = value;
- }
+ /**
+ * Sets the value of the bgColour property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setBgColour(String value) {
+ this.bgColour = value;
+ }
- /**
- * Gets the value of the pidThreshold property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getPidThreshold()
- {
- return pidThreshold;
- }
+ /**
+ * Gets the value of the consThreshold property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getConsThreshold() {
+ return consThreshold;
+ }
- /**
- * Sets the value of the pidThreshold property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setPidThreshold(Integer value)
- {
- this.pidThreshold = value;
- }
+ /**
+ * Sets the value of the consThreshold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setConsThreshold(Integer value) {
+ this.consThreshold = value;
+ }
- /**
- * Gets the value of the title property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTitle()
- {
- return title;
- }
+ /**
+ * Gets the value of the pidThreshold property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getPidThreshold() {
+ return pidThreshold;
+ }
- /**
- * Sets the value of the title property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setTitle(String value)
- {
- this.title = value;
- }
+ /**
+ * Sets the value of the pidThreshold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setPidThreshold(Integer value) {
+ this.pidThreshold = value;
+ }
- /**
- * Gets the value of the showFullId property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowFullId()
- {
- return showFullId;
- }
+ /**
+ * Gets the value of the title property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getTitle() {
+ return title;
+ }
- /**
- * Sets the value of the showFullId property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowFullId(Boolean value)
- {
- this.showFullId = value;
- }
+ /**
+ * Sets the value of the title property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setTitle(String value) {
+ this.title = value;
+ }
- /**
- * Gets the value of the rightAlignIds property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isRightAlignIds()
- {
- return rightAlignIds;
- }
+ /**
+ * Gets the value of the showFullId property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowFullId() {
+ return showFullId;
+ }
- /**
- * Sets the value of the rightAlignIds property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setRightAlignIds(Boolean value)
- {
- this.rightAlignIds = value;
- }
+ /**
+ * Sets the value of the showFullId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowFullId(Boolean value) {
+ this.showFullId = value;
+ }
- /**
- * Gets the value of the showText property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowText()
- {
- return showText;
- }
+ /**
+ * Gets the value of the rightAlignIds property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isRightAlignIds() {
+ return rightAlignIds;
+ }
- /**
- * Sets the value of the showText property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowText(Boolean value)
- {
- this.showText = value;
- }
+ /**
+ * Sets the value of the rightAlignIds property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setRightAlignIds(Boolean value) {
+ this.rightAlignIds = value;
+ }
- /**
- * Gets the value of the showColourText property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowColourText()
- {
- return showColourText;
- }
+ /**
+ * Gets the value of the showText property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowText() {
+ return showText;
+ }
- /**
- * Sets the value of the showColourText property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowColourText(Boolean value)
- {
- this.showColourText = value;
- }
+ /**
+ * Sets the value of the showText property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowText(Boolean value) {
+ this.showText = value;
+ }
- /**
- * Gets the value of the showUnconserved property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowUnconserved()
- {
- if (showUnconserved == null)
- {
- return false;
- }
- else
- {
- return showUnconserved;
- }
- }
+ /**
+ * Gets the value of the showColourText property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowColourText() {
+ return showColourText;
+ }
- /**
- * Sets the value of the showUnconserved property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowUnconserved(Boolean value)
- {
- this.showUnconserved = value;
- }
+ /**
+ * Sets the value of the showColourText property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowColourText(Boolean value) {
+ this.showColourText = value;
+ }
- /**
- * Gets the value of the showBoxes property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowBoxes()
- {
- return showBoxes;
- }
+ /**
+ * Gets the value of the showUnconserved property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowUnconserved() {
+ if (showUnconserved == null) {
+ return false;
+ } else {
+ return showUnconserved;
+ }
+ }
- /**
- * Sets the value of the showBoxes property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowBoxes(Boolean value)
- {
- this.showBoxes = value;
- }
+ /**
+ * Sets the value of the showUnconserved property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowUnconserved(Boolean value) {
+ this.showUnconserved = value;
+ }
- /**
- * Gets the value of the wrapAlignment property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isWrapAlignment()
- {
- return wrapAlignment;
- }
+ /**
+ * Gets the value of the showBoxes property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowBoxes() {
+ return showBoxes;
+ }
- /**
- * Sets the value of the wrapAlignment property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setWrapAlignment(Boolean value)
- {
- this.wrapAlignment = value;
- }
+ /**
+ * Sets the value of the showBoxes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowBoxes(Boolean value) {
+ this.showBoxes = value;
+ }
- /**
- * Gets the value of the renderGaps property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isRenderGaps()
- {
- return renderGaps;
- }
+ /**
+ * Gets the value of the wrapAlignment property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isWrapAlignment() {
+ return wrapAlignment;
+ }
- /**
- * Sets the value of the renderGaps property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setRenderGaps(Boolean value)
- {
- this.renderGaps = value;
- }
+ /**
+ * Sets the value of the wrapAlignment property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setWrapAlignment(Boolean value) {
+ this.wrapAlignment = value;
+ }
- /**
- * Gets the value of the showSequenceFeatures property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowSequenceFeatures()
- {
- return showSequenceFeatures;
- }
+ /**
+ * Gets the value of the renderGaps property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isRenderGaps() {
+ return renderGaps;
+ }
- /**
- * Sets the value of the showSequenceFeatures property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowSequenceFeatures(Boolean value)
- {
- this.showSequenceFeatures = value;
- }
+ /**
+ * Sets the value of the renderGaps property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setRenderGaps(Boolean value) {
+ this.renderGaps = value;
+ }
- /**
- * Gets the value of the showNPfeatureTooltip property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowNPfeatureTooltip()
- {
- return showNPfeatureTooltip;
- }
+ /**
+ * Gets the value of the showSequenceFeatures property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowSequenceFeatures() {
+ return showSequenceFeatures;
+ }
- /**
- * Sets the value of the showNPfeatureTooltip property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowNPfeatureTooltip(Boolean value)
- {
- this.showNPfeatureTooltip = value;
- }
+ /**
+ * Sets the value of the showSequenceFeatures property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowSequenceFeatures(Boolean value) {
+ this.showSequenceFeatures = value;
+ }
+
+ /**
+ * Gets the value of the showNPfeatureTooltip property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowNPfeatureTooltip() {
+ return showNPfeatureTooltip;
+ }
- /**
- * Gets the value of the showDbRefTooltip property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowDbRefTooltip()
- {
- return showDbRefTooltip;
- }
+ /**
+ * Sets the value of the showNPfeatureTooltip property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowNPfeatureTooltip(Boolean value) {
+ this.showNPfeatureTooltip = value;
+ }
- /**
- * Sets the value of the showDbRefTooltip property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowDbRefTooltip(Boolean value)
- {
- this.showDbRefTooltip = value;
- }
+ /**
+ * Gets the value of the showDbRefTooltip property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowDbRefTooltip() {
+ return showDbRefTooltip;
+ }
- /**
- * Gets the value of the followHighlight property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isFollowHighlight()
- {
- if (followHighlight == null)
- {
- return true;
- }
- else
- {
- return followHighlight;
- }
- }
+ /**
+ * Sets the value of the showDbRefTooltip property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowDbRefTooltip(Boolean value) {
+ this.showDbRefTooltip = value;
+ }
- /**
- * Sets the value of the followHighlight property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setFollowHighlight(Boolean value)
- {
- this.followHighlight = value;
- }
+ /**
+ * Gets the value of the followHighlight property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isFollowHighlight() {
+ if (followHighlight == null) {
+ return true;
+ } else {
+ return followHighlight;
+ }
+ }
- /**
- * Gets the value of the followSelection property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isFollowSelection()
- {
- if (followSelection == null)
- {
- return true;
- }
- else
- {
- return followSelection;
- }
- }
+ /**
+ * Sets the value of the followHighlight property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setFollowHighlight(Boolean value) {
+ this.followHighlight = value;
+ }
- /**
- * Sets the value of the followSelection property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setFollowSelection(Boolean value)
- {
- this.followSelection = value;
- }
+ /**
+ * Gets the value of the followSelection property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isFollowSelection() {
+ if (followSelection == null) {
+ return true;
+ } else {
+ return followSelection;
+ }
+ }
- /**
- * Gets the value of the showAnnotation property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowAnnotation()
- {
- return showAnnotation;
- }
+ /**
+ * Sets the value of the followSelection property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setFollowSelection(Boolean value) {
+ this.followSelection = value;
+ }
- /**
- * Sets the value of the showAnnotation property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowAnnotation(Boolean value)
- {
- this.showAnnotation = value;
- }
+ /**
+ * Gets the value of the showAnnotation property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isShowAnnotation() {
+ return showAnnotation;
+ }
- /**
- * Gets the value of the centreColumnLabels property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isCentreColumnLabels()
- {
- if (centreColumnLabels == null)
- {
- return false;
- }
- else
- {
- return centreColumnLabels;
- }
- }
+ /**
+ * Sets the value of the showAnnotation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowAnnotation(Boolean value) {
+ this.showAnnotation = value;
+ }
- /**
- * Sets the value of the centreColumnLabels property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setCentreColumnLabels(Boolean value)
- {
- this.centreColumnLabels = value;
- }
+ /**
+ * Gets the value of the centreColumnLabels property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isCentreColumnLabels() {
+ if (centreColumnLabels == null) {
+ return false;
+ } else {
+ return centreColumnLabels;
+ }
+ }
- /**
- * Gets the value of the showGroupConservation property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowGroupConservation()
- {
- if (showGroupConservation == null)
- {
- return false;
- }
- else
- {
- return showGroupConservation;
- }
- }
+ /**
+ * Sets the value of the centreColumnLabels property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setCentreColumnLabels(Boolean value) {
+ this.centreColumnLabels = value;
+ }
- /**
- * Sets the value of the showGroupConservation property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowGroupConservation(Boolean value)
- {
- this.showGroupConservation = value;
- }
+ /**
+ * Gets the value of the showGroupConservation property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowGroupConservation() {
+ if (showGroupConservation == null) {
+ return false;
+ } else {
+ return showGroupConservation;
+ }
+ }
- /**
- * Gets the value of the showGroupConsensus property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowGroupConsensus()
- {
- if (showGroupConsensus == null)
- {
- return false;
- }
- else
- {
- return showGroupConsensus;
- }
- }
+ /**
+ * Sets the value of the showGroupConservation property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowGroupConservation(Boolean value) {
+ this.showGroupConservation = value;
+ }
- /**
- * Sets the value of the showGroupConsensus property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowGroupConsensus(Boolean value)
- {
- this.showGroupConsensus = value;
- }
+ /**
+ * Gets the value of the showGroupConsensus property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowGroupConsensus() {
+ if (showGroupConsensus == null) {
+ return false;
+ } else {
+ return showGroupConsensus;
+ }
+ }
- /**
- * Gets the value of the showConsensusHistogram property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowConsensusHistogram()
- {
- if (showConsensusHistogram == null)
- {
- return true;
- }
- else
- {
- return showConsensusHistogram;
- }
- }
+ /**
+ * Sets the value of the showGroupConsensus property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowGroupConsensus(Boolean value) {
+ this.showGroupConsensus = value;
+ }
- /**
- * Sets the value of the showConsensusHistogram property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowConsensusHistogram(Boolean value)
- {
- this.showConsensusHistogram = value;
- }
+ /**
+ * Gets the value of the showConsensusHistogram property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowConsensusHistogram() {
+ if (showConsensusHistogram == null) {
+ return true;
+ } else {
+ return showConsensusHistogram;
+ }
+ }
- /**
- * Gets the value of the showSequenceLogo property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowSequenceLogo()
- {
- if (showSequenceLogo == null)
- {
- return false;
- }
- else
- {
- return showSequenceLogo;
- }
- }
+ /**
+ * Sets the value of the showConsensusHistogram property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowConsensusHistogram(Boolean value) {
+ this.showConsensusHistogram = value;
+ }
- /**
- * Sets the value of the showSequenceLogo property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowSequenceLogo(Boolean value)
- {
- this.showSequenceLogo = value;
- }
+ /**
+ * Gets the value of the showSequenceLogo property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowSequenceLogo() {
+ if (showSequenceLogo == null) {
+ return false;
+ } else {
+ return showSequenceLogo;
+ }
+ }
- /**
- * Gets the value of the normaliseSequenceLogo property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isNormaliseSequenceLogo()
- {
- if (normaliseSequenceLogo == null)
- {
- return false;
- }
- else
- {
- return normaliseSequenceLogo;
- }
- }
+ /**
+ * Sets the value of the showSequenceLogo property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowSequenceLogo(Boolean value) {
+ this.showSequenceLogo = value;
+ }
- /**
- * Sets the value of the normaliseSequenceLogo property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setNormaliseSequenceLogo(Boolean value)
- {
- this.normaliseSequenceLogo = value;
- }
+ /**
+ * Gets the value of the normaliseSequenceLogo property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isNormaliseSequenceLogo() {
+ if (normaliseSequenceLogo == null) {
+ return false;
+ } else {
+ return normaliseSequenceLogo;
+ }
+ }
- /**
- * Gets the value of the ignoreGapsinConsensus property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isIgnoreGapsinConsensus()
- {
- if (ignoreGapsinConsensus == null)
- {
- return true;
- }
- else
- {
- return ignoreGapsinConsensus;
- }
- }
+ /**
+ * Sets the value of the normaliseSequenceLogo property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setNormaliseSequenceLogo(Boolean value) {
+ this.normaliseSequenceLogo = value;
+ }
- /**
- * Sets the value of the ignoreGapsinConsensus property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setIgnoreGapsinConsensus(Boolean value)
- {
- this.ignoreGapsinConsensus = value;
- }
+ /**
+ * Gets the value of the ignoreGapsinConsensus property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isIgnoreGapsinConsensus() {
+ if (ignoreGapsinConsensus == null) {
+ return true;
+ } else {
+ return ignoreGapsinConsensus;
+ }
+ }
- /**
- * Gets the value of the startRes property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getStartRes()
- {
- return startRes;
- }
+ /**
+ * Sets the value of the ignoreGapsinConsensus property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setIgnoreGapsinConsensus(Boolean value) {
+ this.ignoreGapsinConsensus = value;
+ }
- /**
- * Sets the value of the startRes property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setStartRes(Integer value)
- {
- this.startRes = value;
- }
+ /**
+ * Gets the value of the startRes property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getStartRes() {
+ return startRes;
+ }
- /**
- * Gets the value of the startSeq property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getStartSeq()
- {
- return startSeq;
- }
+ /**
+ * Sets the value of the startRes property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setStartRes(Integer value) {
+ this.startRes = value;
+ }
+
+ /**
+ * Gets the value of the startSeq property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getStartSeq() {
+ return startSeq;
+ }
- /**
- * Sets the value of the startSeq property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setStartSeq(Integer value)
- {
- this.startSeq = value;
- }
+ /**
+ * Sets the value of the startSeq property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setStartSeq(Integer value) {
+ this.startSeq = value;
+ }
- /**
- * Gets the value of the charWidth property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getCharWidth()
- {
- return charWidth;
- }
+ /**
++ * Gets the value of the charWidth property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getCharWidth() {
++ return charWidth;
++ }
+
- /**
- * Sets the value of the charWidth property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setCharWidth(Integer value)
- {
- this.charWidth = value;
- }
++ /**
++ * Sets the value of the charWidth property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setCharWidth(Integer value) {
++ this.charWidth = value;
++ }
+
- /**
- * Gets the value of the charHeight property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getCharHeight()
- {
- return charHeight;
- }
++ /**
++ * Gets the value of the charHeight property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getCharHeight() {
++ return charHeight;
++ }
+
- /**
- * Sets the value of the charHeight property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setCharHeight(Integer value)
- {
- this.charHeight = value;
- }
++ /**
++ * Sets the value of the charHeight property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setCharHeight(Integer value) {
++ this.charHeight = value;
++ }
+
- /**
- * Gets the value of the fontName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getFontName()
- {
- return fontName;
- }
++ /**
+ * Gets the value of the fontName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getFontName() {
+ return fontName;
+ }
- /**
- * Sets the value of the fontName property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setFontName(String value)
- {
- this.fontName = value;
- }
+ /**
+ * Sets the value of the fontName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setFontName(String value) {
+ this.fontName = value;
+ }
- /**
- * Gets the value of the fontSize property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getFontSize()
- {
- return fontSize;
- }
+ /**
+ * Gets the value of the fontSize property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getFontSize() {
+ return fontSize;
+ }
- /**
- * Sets the value of the fontSize property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setFontSize(Integer value)
- {
- this.fontSize = value;
- }
+ /**
+ * Sets the value of the fontSize property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setFontSize(Integer value) {
+ this.fontSize = value;
+ }
- /**
- * Gets the value of the fontStyle property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getFontStyle()
- {
- return fontStyle;
- }
+ /**
+ * Gets the value of the fontStyle property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getFontStyle() {
+ return fontStyle;
+ }
- /**
- * Sets the value of the fontStyle property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setFontStyle(Integer value)
- {
- this.fontStyle = value;
- }
+ /**
+ * Sets the value of the fontStyle property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setFontStyle(Integer value) {
+ this.fontStyle = value;
+ }
- /**
- * Gets the value of the idWidth property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getIdWidth()
- {
- return idWidth;
- }
+ /**
++ * Gets the value of the idWidth property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getIdWidth() {
++ return idWidth;
++ }
+
- /**
- * Sets the value of the idWidth property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setIdWidth(Integer value)
- {
- this.idWidth = value;
- }
++ /**
++ * Sets the value of the idWidth property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setIdWidth(Integer value) {
++ this.idWidth = value;
++ }
+
- /**
- * Gets the value of the idWidthManuallyAdjusted property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isIdWidthManuallyAdjusted()
- {
- return idWidthManuallyAdjusted;
- }
++ /**
++ * Gets the value of the idWidthManuallyAdjusted property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isIdWidthManuallyAdjusted() {
++ return idWidthManuallyAdjusted;
++ }
+
- /**
- * Sets the value of the idWidthManuallyAdjusted property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setIdWidthManuallyAdjusted(Boolean value)
- {
- this.idWidthManuallyAdjusted = value;
- }
++ /**
++ * Sets the value of the idWidthManuallyAdjusted property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setIdWidthManuallyAdjusted(Boolean value) {
++ this.idWidthManuallyAdjusted = value;
++ }
+
- /**
- * Gets the value of the scaleProteinAsCdna property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isScaleProteinAsCdna()
- {
- if (scaleProteinAsCdna == null)
- {
- return true;
- }
- else
- {
- return scaleProteinAsCdna;
- }
- }
++ /**
+ * Gets the value of the scaleProteinAsCdna property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isScaleProteinAsCdna() {
+ if (scaleProteinAsCdna == null) {
+ return true;
+ } else {
+ return scaleProteinAsCdna;
+ }
+ }
- /**
- * Sets the value of the scaleProteinAsCdna property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setScaleProteinAsCdna(Boolean value)
- {
- this.scaleProteinAsCdna = value;
- }
+ /**
+ * Sets the value of the scaleProteinAsCdna property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setScaleProteinAsCdna(Boolean value) {
+ this.scaleProteinAsCdna = value;
+ }
- /**
- * Gets the value of the viewName property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getViewName()
- {
- return viewName;
- }
+ /**
+ * Gets the value of the viewName property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getViewName() {
+ return viewName;
+ }
- /**
- * Sets the value of the viewName property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setViewName(String value)
- {
- this.viewName = value;
- }
+ /**
+ * Sets the value of the viewName property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setViewName(String value) {
+ this.viewName = value;
+ }
- /**
- * Gets the value of the sequenceSetId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getSequenceSetId()
- {
- return sequenceSetId;
- }
+ /**
+ * Gets the value of the sequenceSetId property.
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getSequenceSetId() {
+ return sequenceSetId;
+ }
- /**
- * Sets the value of the sequenceSetId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setSequenceSetId(String value)
- {
- this.sequenceSetId = value;
- }
+ /**
+ * Sets the value of the sequenceSetId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
+ */
+ public void setSequenceSetId(String value) {
+ this.sequenceSetId = value;
+ }
- /**
- * Gets the value of the gatheredViews property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isGatheredViews()
- {
- return gatheredViews;
- }
+ /**
+ * Gets the value of the gatheredViews property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public Boolean isGatheredViews() {
+ return gatheredViews;
+ }
- /**
- * Sets the value of the gatheredViews property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setGatheredViews(Boolean value)
- {
- this.gatheredViews = value;
- }
+ /**
+ * Sets the value of the gatheredViews property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setGatheredViews(Boolean value) {
+ this.gatheredViews = value;
+ }
- /**
- * Gets the value of the textCol1 property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getTextCol1()
- {
- return textCol1;
- }
+ /**
+ * Gets the value of the textCol1 property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getTextCol1() {
+ return textCol1;
+ }
- /**
- * Sets the value of the textCol1 property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setTextCol1(Integer value)
- {
- this.textCol1 = value;
- }
+ /**
+ * Sets the value of the textCol1 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setTextCol1(Integer value) {
+ this.textCol1 = value;
+ }
+
+ /**
+ * Gets the value of the textCol2 property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getTextCol2() {
+ return textCol2;
+ }
- /**
- * Gets the value of the textCol2 property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getTextCol2()
- {
- return textCol2;
- }
+ /**
+ * Sets the value of the textCol2 property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setTextCol2(Integer value) {
+ this.textCol2 = value;
+ }
- /**
- * Sets the value of the textCol2 property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setTextCol2(Integer value)
- {
- this.textCol2 = value;
- }
+ /**
+ * Gets the value of the textColThreshold property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getTextColThreshold() {
+ return textColThreshold;
+ }
- /**
- * Gets the value of the textColThreshold property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getTextColThreshold()
- {
- return textColThreshold;
- }
+ /**
+ * Sets the value of the textColThreshold property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setTextColThreshold(Integer value) {
+ this.textColThreshold = value;
+ }
- /**
- * Sets the value of the textColThreshold property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setTextColThreshold(Integer value)
- {
- this.textColThreshold = value;
- }
+ /**
- * Gets the value of the id property.
++ * unique id used by jalview to
++ * synchronize
++ * between stored and
++ * instantiated views
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getId() {
+ return id;
+ }
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
+ /**
+ * Sets the value of the id property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getId()
+ */
+ public void setId(String value) {
+ this.id = value;
+ }
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
+ /**
- * Gets the value of the complementId property.
++ * The viewport id of this viewport's
++ * (cdna/protein) coding complement, if any
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getComplementId() {
+ return complementId;
+ }
- /**
- * Gets the value of the complementId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getComplementId()
- {
- return complementId;
- }
+ /**
+ * Sets the value of the complementId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getComplementId()
+ */
+ public void setComplementId(String value) {
+ this.complementId = value;
+ }
- /**
- * Sets the value of the complementId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setComplementId(String value)
- {
- this.complementId = value;
- }
+ /**
+ * Gets the value of the showComplementFeatures property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowComplementFeatures() {
+ if (showComplementFeatures == null) {
+ return false;
+ } else {
+ return showComplementFeatures;
+ }
+ }
- /**
- * Gets the value of the showComplementFeatures property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowComplementFeatures()
- {
- if (showComplementFeatures == null)
- {
- return false;
- }
- else
- {
- return showComplementFeatures;
- }
- }
+ /**
+ * Sets the value of the showComplementFeatures property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowComplementFeatures(Boolean value) {
+ this.showComplementFeatures = value;
+ }
- /**
- * Sets the value of the showComplementFeatures property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowComplementFeatures(Boolean value)
- {
- this.showComplementFeatures = value;
- }
+ /**
+ * Gets the value of the showComplementFeaturesOnTop property.
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isShowComplementFeaturesOnTop() {
+ if (showComplementFeaturesOnTop == null) {
+ return false;
+ } else {
+ return showComplementFeaturesOnTop;
+ }
+ }
- /**
- * Gets the value of the showComplementFeaturesOnTop property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isShowComplementFeaturesOnTop()
- {
- if (showComplementFeaturesOnTop == null)
- {
- return false;
- }
- else
- {
- return showComplementFeaturesOnTop;
- }
- }
+ /**
+ * Sets the value of the showComplementFeaturesOnTop property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
+ */
+ public void setShowComplementFeaturesOnTop(Boolean value) {
+ this.showComplementFeaturesOnTop = value;
+ }
- /**
- * Sets the value of the showComplementFeaturesOnTop property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowComplementFeaturesOnTop(Boolean value)
- {
- this.showComplementFeaturesOnTop = value;
- }
+ /**
+ * Gets the value of the width property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getWidth() {
+ return width;
+ }
- /**
- * Gets the value of the width property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getWidth()
- {
- return width;
- }
+ /**
+ * Sets the value of the width property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setWidth(Integer value) {
+ this.width = value;
+ }
- /**
- * Sets the value of the width property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setWidth(Integer value)
- {
- this.width = value;
- }
+ /**
+ * Gets the value of the height property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getHeight() {
+ return height;
+ }
- /**
- * Gets the value of the height property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getHeight()
- {
- return height;
- }
+ /**
+ * Sets the value of the height property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setHeight(Integer value) {
+ this.height = value;
+ }
- /**
- * Sets the value of the height property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setHeight(Integer value)
- {
- this.height = value;
- }
+ /**
+ * Gets the value of the xpos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getXpos() {
+ return xpos;
+ }
- /**
- * Gets the value of the xpos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getXpos()
- {
- return xpos;
- }
+ /**
+ * Sets the value of the xpos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setXpos(Integer value) {
+ this.xpos = value;
+ }
- /**
- * Sets the value of the xpos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setXpos(Integer value)
- {
- this.xpos = value;
- }
+ /**
+ * Gets the value of the ypos property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getYpos() {
+ return ypos;
+ }
- /**
- * Gets the value of the ypos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getYpos()
- {
- return ypos;
- }
+ /**
+ * Sets the value of the ypos property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setYpos(Integer value) {
+ this.ypos = value;
+ }
- /**
- * Sets the value of the ypos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setYpos(Integer value)
- {
- this.ypos = value;
- }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;extension
- * base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="needsUpdate"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false"
- * /&gt; &lt;attribute name="autoUpdate" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class CalcIdParam extends WebServiceParameterSet
- {
-
- @XmlAttribute(name = "calcId", required = true)
- protected String calcId;
-
- @XmlAttribute(name = "needsUpdate")
- protected Boolean needsUpdate;
-
- @XmlAttribute(name = "autoUpdate", required = true)
- protected boolean autoUpdate;
-
- /**
- * Gets the value of the calcId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getCalcId()
- {
- return calcId;
- }
-
- /**
- * Sets the value of the calcId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setCalcId(String value)
- {
- this.calcId = value;
- }
-
- /**
- * Gets the value of the needsUpdate property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public boolean isNeedsUpdate()
- {
- if (needsUpdate == null)
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet"&gt;
- * &lt;attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
- * &lt;attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
- * &lt;/extension&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.jalview.org/xml/wsparamset}WebServiceParameterSet">
++ * <attribute name="calcId" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="needsUpdate" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="autoUpdate" use="required" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class CalcIdParam
+ extends WebServiceParameterSet
{
- return false;
+
++ /**
++ * handle for the calculation which uses
++ * this parameter set
++ *
++ */
+ @XmlAttribute(name = "calcId", required = true)
+ protected String calcId;
++ /**
++ * should the calculation be performed
++ * immediately after loading in order to refresh results
++ *
++ */
+ @XmlAttribute(name = "needsUpdate")
+ protected Boolean needsUpdate;
++ /**
++ * should the calculation be automatically
++ * performed on edits
++ *
++ */
+ @XmlAttribute(name = "autoUpdate", required = true)
+ protected boolean autoUpdate;
+
+ /**
- * Gets the value of the calcId property.
++ * handle for the calculation which uses
++ * this parameter set
+ *
+ * @return
+ * possible object is
+ * {@link String }
+ *
+ */
+ public String getCalcId() {
+ return calcId;
+ }
+
+ /**
+ * Sets the value of the calcId property.
+ *
+ * @param value
+ * allowed object is
+ * {@link String }
+ *
++ * @see #getCalcId()
+ */
+ public void setCalcId(String value) {
+ this.calcId = value;
+ }
+
+ /**
- * Gets the value of the needsUpdate property.
++ * should the calculation be performed
++ * immediately after loading in order to refresh results
+ *
+ * @return
+ * possible object is
+ * {@link Boolean }
+ *
+ */
+ public boolean isNeedsUpdate() {
+ if (needsUpdate == null) {
+ return false;
+ } else {
+ return needsUpdate;
+ }
+ }
+
+ /**
+ * Sets the value of the needsUpdate property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Boolean }
+ *
++ * @see #isNeedsUpdate()
+ */
+ public void setNeedsUpdate(Boolean value) {
+ this.needsUpdate = value;
+ }
+
+ /**
- * Gets the value of the autoUpdate property.
++ * should the calculation be automatically
++ * performed on edits
+ *
+ */
+ public boolean isAutoUpdate() {
+ return autoUpdate;
+ }
+
+ /**
+ * Sets the value of the autoUpdate property.
+ *
+ */
+ public void setAutoUpdate(boolean value) {
+ this.autoUpdate = value;
+ }
+
}
- else
- {
- return needsUpdate;
- }
- }
-
- /**
- * Sets the value of the needsUpdate property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setNeedsUpdate(Boolean value)
- {
- this.needsUpdate = value;
- }
-
- /**
- * Gets the value of the autoUpdate property.
- *
- */
- public boolean isAutoUpdate()
- {
- return autoUpdate;
- }
-
- /**
- * Sets the value of the autoUpdate property.
- *
- */
- public void setAutoUpdate(boolean value)
- {
- this.autoUpdate = value;
- }
- }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="start"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class HiddenColumns
- {
-
- @XmlAttribute(name = "start")
- protected Integer start;
-
- @XmlAttribute(name = "end")
- protected Integer end;
-
- /**
- * Gets the value of the start property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getStart()
- {
- return start;
- }
-
- /**
- * Sets the value of the start property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setStart(Integer value)
- {
- this.start = value;
- }
-
- /**
- * Gets the value of the end property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getEnd()
- {
- return end;
- }
-
- /**
- * Sets the value of the end property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setEnd(Integer value)
- {
- this.end = value;
- }
+ /**
- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre>
- * &lt;complexType&gt;
- * &lt;complexContent&gt;
- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;/restriction&gt;
- * &lt;/complexContent&gt;
- * &lt;/complexType&gt;
- * </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "")
+ public static class HiddenColumns {
+
+ @XmlAttribute(name = "start")
+ protected Integer start;
+ @XmlAttribute(name = "end")
+ protected Integer end;
+
+ /**
+ * Gets the value of the start property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getStart() {
+ return start;
+ }
+
+ /**
+ * Sets the value of the start property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setStart(Integer value) {
+ this.start = value;
+ }
+
+ /**
+ * Gets the value of the end property.
+ *
+ * @return
+ * possible object is
+ * {@link Integer }
+ *
+ */
+ public Integer getEnd() {
+ return end;
+ }
+
+ /**
+ * Sets the value of the end property.
+ *
+ * @param value
+ * allowed object is
+ * {@link Integer }
+ *
+ */
+ public void setEnd(Integer value) {
+ this.end = value;
+ }
- }
+ }
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attGroup
- * ref="{www.jalview.org}swingwindow"/&gt; &lt;attribute
- * name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean"
- * /&gt; &lt;attribute name="residueColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
- * &lt;attribute name="hiddenColour"
- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
- * name="title" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class Overview
- {
-
- @XmlAttribute(name = "showHidden")
- protected Boolean showHidden;
-
- @XmlAttribute(name = "residueColour")
- protected Integer residueColour;
-
- @XmlAttribute(name = "gapColour")
- protected Integer gapColour;
-
- @XmlAttribute(name = "hiddenColour")
- protected Integer hiddenColour;
-
- @XmlAttribute(name = "title")
- protected String title;
-
- @XmlAttribute(name = "width")
- protected Integer width;
-
- @XmlAttribute(name = "height")
- protected Integer height;
-
- @XmlAttribute(name = "xpos")
- protected Integer xpos;
-
- @XmlAttribute(name = "ypos")
- protected Integer ypos;
-
- /**
- * Gets the value of the showHidden property.
- *
- * @return possible object is {@link Boolean }
- *
- */
- public Boolean isShowHidden()
- {
- return showHidden;
- }
-
- /**
- * Sets the value of the showHidden property.
- *
- * @param value
- * allowed object is {@link Boolean }
- *
- */
- public void setShowHidden(Boolean value)
- {
- this.showHidden = value;
- }
-
- /**
- * Gets the value of the residueColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getResidueColour()
- {
- return residueColour;
- }
-
- /**
- * Sets the value of the residueColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setResidueColour(Integer value)
- {
- this.residueColour = value;
- }
-
- /**
- * Gets the value of the gapColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getGapColour()
- {
- return gapColour;
- }
-
- /**
- * Sets the value of the gapColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setGapColour(Integer value)
- {
- this.gapColour = value;
- }
-
- /**
- * Gets the value of the hiddenColour property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getHiddenColour()
- {
- return hiddenColour;
- }
-
- /**
- * Sets the value of the hiddenColour property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setHiddenColour(Integer value)
- {
- this.hiddenColour = value;
- }
-
- /**
- * Gets the value of the title property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTitle()
- {
- return title;
- }
-
- /**
- * Sets the value of the title property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setTitle(String value)
- {
- this.title = value;
- }
-
- /**
- * Gets the value of the width property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getWidth()
- {
- return width;
- }
-
- /**
- * Sets the value of the width property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setWidth(Integer value)
- {
- this.width = value;
- }
-
- /**
- * Gets the value of the height property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getHeight()
- {
- return height;
- }
-
- /**
- * Sets the value of the height property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setHeight(Integer value)
- {
- this.height = value;
- }
-
- /**
- * Gets the value of the xpos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getXpos()
- {
- return xpos;
- }
-
- /**
- * Sets the value of the xpos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setXpos(Integer value)
- {
- this.xpos = value;
- }
-
- /**
- * Gets the value of the ypos property.
- *
- * @return possible object is {@link Integer }
- *
- */
- public Integer getYpos()
- {
- return ypos;
- }
-
- /**
- * Sets the value of the ypos property.
- *
- * @param value
- * allowed object is {@link Integer }
- *
- */
- public void setYpos(Integer value)
- {
- this.ypos = value;
- }
+
- }
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attGroup ref="{www.jalview.org}swingwindow"/>
++ * <attribute name="showHidden" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="residueColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="gapColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="hiddenColour" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="title" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class Overview {
++
++ @XmlAttribute(name = "showHidden")
++ protected Boolean showHidden;
++ @XmlAttribute(name = "residueColour")
++ protected Integer residueColour;
++ @XmlAttribute(name = "gapColour")
++ protected Integer gapColour;
++ @XmlAttribute(name = "hiddenColour")
++ protected Integer hiddenColour;
++ @XmlAttribute(name = "title")
++ protected String title;
++ @XmlAttribute(name = "width")
++ protected Integer width;
++ @XmlAttribute(name = "height")
++ protected Integer height;
++ @XmlAttribute(name = "xpos")
++ protected Integer xpos;
++ @XmlAttribute(name = "ypos")
++ protected Integer ypos;
++
++ /**
++ * Gets the value of the showHidden property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isShowHidden() {
++ return showHidden;
++ }
++
++ /**
++ * Sets the value of the showHidden property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setShowHidden(Boolean value) {
++ this.showHidden = value;
++ }
++
++ /**
++ * Gets the value of the residueColour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getResidueColour() {
++ return residueColour;
++ }
++
++ /**
++ * Sets the value of the residueColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setResidueColour(Integer value) {
++ this.residueColour = value;
++ }
++
++ /**
++ * Gets the value of the gapColour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getGapColour() {
++ return gapColour;
++ }
++
++ /**
++ * Sets the value of the gapColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setGapColour(Integer value) {
++ this.gapColour = value;
++ }
++
++ /**
++ * Gets the value of the hiddenColour property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getHiddenColour() {
++ return hiddenColour;
++ }
++
++ /**
++ * Sets the value of the hiddenColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setHiddenColour(Integer value) {
++ this.hiddenColour = value;
++ }
++
++ /**
++ * Gets the value of the title property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getTitle() {
++ return title;
++ }
++
++ /**
++ * Sets the value of the title property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setTitle(String value) {
++ this.title = value;
++ }
++
++ /**
++ * Gets the value of the width property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getWidth() {
++ return width;
++ }
++
++ /**
++ * Sets the value of the width property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setWidth(Integer value) {
++ this.width = value;
++ }
++
++ /**
++ * Gets the value of the height property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getHeight() {
++ return height;
++ }
++
++ /**
++ * Sets the value of the height property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setHeight(Integer value) {
++ this.height = value;
++ }
++
++ /**
++ * Gets the value of the xpos property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getXpos() {
++ return xpos;
++ }
++
++ /**
++ * Sets the value of the xpos property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setXpos(Integer value) {
++ this.xpos = value;
++ }
++
++ /**
++ * Gets the value of the ypos property.
++ *
++ * @return
++ * possible object is
++ * {@link Integer }
++ *
++ */
++ public Integer getYpos() {
++ return ypos;
++ }
++
++ /**
++ * Sets the value of the ypos property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Integer }
++ *
++ */
++ public void setYpos(Integer value) {
++ this.ypos = value;
++ }
++
++ }
+
- }
+ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for JalviewUserColours complex type.
++ * <p>Java class for JalviewUserColours complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="JalviewUserColours"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="Version"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="colour" maxOccurs="unbounded" minOccurs="0"&gt;
-- * &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="attributeName"
-- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2"
-- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
-- * name="Name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="RGB" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="noValueColour"
-- * type="{www.jalview.org/colours}NoValueColour" default="Min" /&gt;
-- * &lt;attribute name="threshType"
-- * type="{www.jalview.org/colours}ThresholdType" /&gt; &lt;attribute
-- * name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
-- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float"
-- * /&gt; &lt;attribute name="min"
-- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
-- * name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean"
-- * /&gt; &lt;attribute name="autoScale"
-- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
-- * name="filter" maxOccurs="unbounded" minOccurs="0"&gt;
-- * &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="matcherSet"
-- * type="{www.jalview.org/colours}FeatureMatcherSet"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="featureType" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;attribute name="schemeName"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="JalviewUserColours">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="Version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="colour" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="RGB" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
++ * <attribute name="threshType" type="{www.jalview.org/colours}ThresholdType" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="filter" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet"/>
++ * </sequence>
++ * <attribute name="featureType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attribute name="schemeName" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "JalviewUserColours",
-- namespace = "www.jalview.org/colours",
-- propOrder =
-- { "version", "colour", "filter" })
--public class JalviewUserColours
--{
--
-- @XmlElement(name = "Version", namespace = "")
-- protected String version;
--
-- @XmlElement(namespace = "")
-- protected List<JalviewUserColours.Colour> colour;
--
-- @XmlElement(namespace = "")
-- protected List<JalviewUserColours.Filter> filter;
--
-- @XmlAttribute(name = "schemeName")
-- protected String schemeName;
--
-- /**
-- * Gets the value of the version property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getVersion()
-- {
-- return version;
-- }
--
-- /**
-- * Sets the value of the version property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setVersion(String value)
-- {
-- this.version = value;
-- }
--
-- /**
-- * Gets the value of the colour property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the colour property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getColour().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link JalviewUserColours.Colour }
-- *
-- *
-- */
-- public List<JalviewUserColours.Colour> getColour()
-- {
-- if (colour == null)
-- {
-- colour = new ArrayList<JalviewUserColours.Colour>();
-- }
-- return this.colour;
-- }
--
-- /**
-- * Gets the value of the filter property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the filter property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getFilter().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link JalviewUserColours.Filter }
-- *
-- *
-- */
-- public List<JalviewUserColours.Filter> getFilter()
-- {
-- if (filter == null)
-- {
-- filter = new ArrayList<JalviewUserColours.Filter>();
-- }
-- return this.filter;
-- }
--
-- /**
-- * Gets the value of the schemeName property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getSchemeName()
-- {
-- return schemeName;
-- }
--
-- /**
-- * Sets the value of the schemeName property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setSchemeName(String value)
-- {
-- this.schemeName = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="attributeName"
-- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2"
-- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
-- * name="Name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="RGB" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="noValueColour"
-- * type="{www.jalview.org/colours}NoValueColour" default="Min" /&gt;
-- * &lt;attribute name="threshType"
-- * type="{www.jalview.org/colours}ThresholdType" /&gt; &lt;attribute
-- * name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" /&gt;
-- * &lt;attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float"
-- * /&gt; &lt;attribute name="min"
-- * type="{http://www.w3.org/2001/XMLSchema}float" /&gt; &lt;attribute
-- * name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean"
-- * /&gt; &lt;attribute name="autoScale"
-- * type="{http://www.w3.org/2001/XMLSchema}boolean" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "", propOrder = { "attributeName" })
-- public static class Colour
-- {
--
-- @XmlElement(namespace = "")
-- protected List<String> attributeName;
--
-- @XmlAttribute(name = "Name")
-- protected String name;
--
-- @XmlAttribute(name = "RGB", required = true)
-- protected String rgb;
--
-- @XmlAttribute(name = "minRGB")
-- protected String minRGB;
--
-- @XmlAttribute(name = "noValueColour")
-- protected NoValueColour noValueColour;
--
-- @XmlAttribute(name = "threshType")
-- protected ThresholdType threshType;
--
-- @XmlAttribute(name = "threshold")
-- protected Float threshold;
--
-- @XmlAttribute(name = "max")
-- protected Float max;
--
-- @XmlAttribute(name = "min")
-- protected Float min;
--
-- @XmlAttribute(name = "colourByLabel")
-- protected Boolean colourByLabel;
--
-- @XmlAttribute(name = "autoScale")
-- protected Boolean autoScale;
++@XmlType(name = "JalviewUserColours", namespace = "www.jalview.org/colours", propOrder = {
++ "version",
++ "colour",
++ "filter"
++})
++public class JalviewUserColours {
/**
-- * Gets the value of the attributeName property.
-- *
-- * <p> This accessor method returns a reference to the live list, not
-- * a snapshot. Therefore any modification you make to the returned list will
-- * be present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the attributeName property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAttributeName().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link String }
-- *
++ * Jalview colour scheme document version.
*
*/
-- public List<String> getAttributeName()
-- {
-- if (attributeName == null)
-- {
-- attributeName = new ArrayList<String>();
-- }
-- return this.attributeName;
-- }
--
-- /**
-- * Gets the value of the name property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getName()
-- {
-- return name;
-- }
--
-- /**
-- * Sets the value of the name property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setName(String value)
-- {
-- this.name = value;
-- }
--
-- /**
-- * Gets the value of the rgb property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getRGB()
-- {
-- return rgb;
-- }
--
-- /**
-- * Sets the value of the rgb property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setRGB(String value)
-- {
-- this.rgb = value;
-- }
--
-- /**
-- * Gets the value of the minRGB property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getMinRGB()
-- {
-- return minRGB;
-- }
--
-- /**
-- * Sets the value of the minRGB property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setMinRGB(String value)
-- {
-- this.minRGB = value;
-- }
++ @XmlElement(name = "Version", namespace = "")
++ protected String version;
++ @XmlElement(namespace = "")
++ protected List<JalviewUserColours.Colour> colour;
++ @XmlElement(namespace = "")
++ protected List<JalviewUserColours.Filter> filter;
++ @XmlAttribute(name = "schemeName")
++ protected String schemeName;
/**
-- * Gets the value of the noValueColour property.
-- *
-- * @return possible object is {@link NoValueColour }
++ * Jalview colour scheme document version.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public NoValueColour getNoValueColour()
-- {
-- if (noValueColour == null)
-- {
-- return NoValueColour.MIN;
-- }
-- else
-- {
-- return noValueColour;
-- }
++ public String getVersion() {
++ return version;
}
/**
-- * Sets the value of the noValueColour property.
++ * Sets the value of the version property.
*
* @param value
-- * allowed object is {@link NoValueColour }
-- *
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getVersion()
*/
-- public void setNoValueColour(NoValueColour value)
-- {
-- this.noValueColour = value;
++ public void setVersion(String value) {
++ this.version = value;
}
/**
-- * Gets the value of the threshType property.
++ * Gets the value of the colour property.
*
-- * @return possible object is {@link ThresholdType }
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the colour property.</p>
*
-- */
-- public ThresholdType getThreshType()
-- {
-- return threshType;
-- }
--
-- /**
-- * Sets the value of the threshType property.
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getColour().add(newItem);
++ * </pre>
*
-- * @param value
-- * allowed object is {@link ThresholdType }
*
-- */
-- public void setThreshType(ThresholdType value)
-- {
-- this.threshType = value;
-- }
--
-- /**
-- * Gets the value of the threshold property.
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link JalviewUserColours.Colour }
++ * </p>
*
-- * @return possible object is {@link Float }
*
++ * @return
++ * The value of the colour property.
*/
-- public Float getThreshold()
-- {
-- return threshold;
++ public List<JalviewUserColours.Colour> getColour() {
++ if (colour == null) {
++ colour = new ArrayList<JalviewUserColours.Colour>();
++ }
++ return this.colour;
}
/**
-- * Sets the value of the threshold property.
++ * Gets the value of the filter property.
*
-- * @param value
-- * allowed object is {@link Float }
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the filter property.</p>
*
-- */
-- public void setThreshold(Float value)
-- {
-- this.threshold = value;
-- }
--
-- /**
-- * Gets the value of the max property.
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getFilter().add(newItem);
++ * </pre>
*
-- * @return possible object is {@link Float }
*
-- */
-- public Float getMax()
-- {
-- return max;
-- }
--
-- /**
-- * Sets the value of the max property.
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link JalviewUserColours.Filter }
++ * </p>
*
-- * @param value
-- * allowed object is {@link Float }
*
++ * @return
++ * The value of the filter property.
*/
-- public void setMax(Float value)
-- {
-- this.max = value;
++ public List<JalviewUserColours.Filter> getFilter() {
++ if (filter == null) {
++ filter = new ArrayList<JalviewUserColours.Filter>();
++ }
++ return this.filter;
}
/**
-- * Gets the value of the min property.
-- *
-- * @return possible object is {@link Float }
++ * Gets the value of the schemeName property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public Float getMin()
-- {
-- return min;
++ public String getSchemeName() {
++ return schemeName;
}
/**
-- * Sets the value of the min property.
++ * Sets the value of the schemeName property.
*
* @param value
-- * allowed object is {@link Float }
-- *
++ * allowed object is
++ * {@link String }
++ *
*/
-- public void setMin(Float value)
-- {
-- this.min = value;
++ public void setSchemeName(String value) {
++ this.schemeName = value;
}
-- /**
-- * Gets the value of the colourByLabel property.
-- *
-- * @return possible object is {@link Boolean }
-- *
-- */
-- public Boolean isColourByLabel()
-- {
-- return colourByLabel;
-- }
/**
-- * Sets the value of the colourByLabel property.
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="attributeName" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="2" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="Name" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="RGB" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="minRGB" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="noValueColour" type="{www.jalview.org/colours}NoValueColour" default="Min" />
++ * <attribute name="threshType" type="{www.jalview.org/colours}ThresholdType" />
++ * <attribute name="threshold" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="max" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="min" type="{http://www.w3.org/2001/XMLSchema}float" />
++ * <attribute name="colourByLabel" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * <attribute name="autoScale" type="{http://www.w3.org/2001/XMLSchema}boolean" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
-- * @param value
-- * allowed object is {@link Boolean }
*
*/
-- public void setColourByLabel(Boolean value)
-- {
-- this.colourByLabel = value;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "", propOrder = {
++ "attributeName"
++ })
++ public static class Colour {
++
++ /**
++ * name of feature attribute to colour by, or attribute and sub-attribute
++ *
++ */
++ @XmlElement(namespace = "")
++ protected List<String> attributeName;
++ /**
++ * Single letter residue code for an alignment colour scheme, or feature type for a feature colour scheme
++ *
++ */
++ @XmlAttribute(name = "Name")
++ protected String name;
++ @XmlAttribute(name = "RGB", required = true)
++ protected String rgb;
++ @XmlAttribute(name = "minRGB")
++ protected String minRGB;
++ @XmlAttribute(name = "noValueColour")
++ protected NoValueColour noValueColour;
++ @XmlAttribute(name = "threshType")
++ protected ThresholdType threshType;
++ @XmlAttribute(name = "threshold")
++ protected Float threshold;
++ @XmlAttribute(name = "max")
++ protected Float max;
++ @XmlAttribute(name = "min")
++ protected Float min;
++ @XmlAttribute(name = "colourByLabel")
++ protected Boolean colourByLabel;
++ @XmlAttribute(name = "autoScale")
++ protected Boolean autoScale;
++
++ /**
++ * name of feature attribute to colour by, or attribute and sub-attribute
++ *
++ * Gets the value of the attributeName property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the attributeName property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAttributeName().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the attributeName property.
++ */
++ public List<String> getAttributeName() {
++ if (attributeName == null) {
++ attributeName = new ArrayList<String>();
++ }
++ return this.attributeName;
++ }
++
++ /**
++ * Single letter residue code for an alignment colour scheme, or feature type for a feature colour scheme
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Sets the value of the name property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getName()
++ */
++ public void setName(String value) {
++ this.name = value;
++ }
++
++ /**
++ * Gets the value of the rgb property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getRGB() {
++ return rgb;
++ }
++
++ /**
++ * Sets the value of the rgb property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setRGB(String value) {
++ this.rgb = value;
++ }
++
++ /**
++ * Gets the value of the minRGB property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getMinRGB() {
++ return minRGB;
++ }
++
++ /**
++ * Sets the value of the minRGB property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setMinRGB(String value) {
++ this.minRGB = value;
++ }
++
++ /**
++ * Gets the value of the noValueColour property.
++ *
++ * @return
++ * possible object is
++ * {@link NoValueColour }
++ *
++ */
++ public NoValueColour getNoValueColour() {
++ if (noValueColour == null) {
++ return NoValueColour.MIN;
++ } else {
++ return noValueColour;
++ }
++ }
++
++ /**
++ * Sets the value of the noValueColour property.
++ *
++ * @param value
++ * allowed object is
++ * {@link NoValueColour }
++ *
++ */
++ public void setNoValueColour(NoValueColour value) {
++ this.noValueColour = value;
++ }
++
++ /**
++ * Gets the value of the threshType property.
++ *
++ * @return
++ * possible object is
++ * {@link ThresholdType }
++ *
++ */
++ public ThresholdType getThreshType() {
++ return threshType;
++ }
++
++ /**
++ * Sets the value of the threshType property.
++ *
++ * @param value
++ * allowed object is
++ * {@link ThresholdType }
++ *
++ */
++ public void setThreshType(ThresholdType value) {
++ this.threshType = value;
++ }
++
++ /**
++ * Gets the value of the threshold property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getThreshold() {
++ return threshold;
++ }
++
++ /**
++ * Sets the value of the threshold property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setThreshold(Float value) {
++ this.threshold = value;
++ }
++
++ /**
++ * Gets the value of the max property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getMax() {
++ return max;
++ }
++
++ /**
++ * Sets the value of the max property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setMax(Float value) {
++ this.max = value;
++ }
++
++ /**
++ * Gets the value of the min property.
++ *
++ * @return
++ * possible object is
++ * {@link Float }
++ *
++ */
++ public Float getMin() {
++ return min;
++ }
++
++ /**
++ * Sets the value of the min property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Float }
++ *
++ */
++ public void setMin(Float value) {
++ this.min = value;
++ }
++
++ /**
++ * Gets the value of the colourByLabel property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isColourByLabel() {
++ return colourByLabel;
++ }
++
++ /**
++ * Sets the value of the colourByLabel property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setColourByLabel(Boolean value) {
++ this.colourByLabel = value;
++ }
++
++ /**
++ * Gets the value of the autoScale property.
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public Boolean isAutoScale() {
++ return autoScale;
++ }
++
++ /**
++ * Sets the value of the autoScale property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ */
++ public void setAutoScale(Boolean value) {
++ this.autoScale = value;
++ }
-- /**
-- * Gets the value of the autoScale property.
-- *
-- * @return possible object is {@link Boolean }
-- *
-- */
-- public Boolean isAutoScale()
-- {
-- return autoScale;
}
-- /**
-- * Sets the value of the autoScale property.
-- *
-- * @param value
-- * allowed object is {@link Boolean }
-- *
-- */
-- public void setAutoScale(Boolean value)
-- {
-- this.autoScale = value;
-- }
--
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="matcherSet"
-- * type="{www.jalview.org/colours}FeatureMatcherSet"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="featureType"
-- * use="required" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "", propOrder = { "matcherSet" })
-- public static class Filter
-- {
--
-- @XmlElement(namespace = "", required = true)
-- protected FeatureMatcherSet matcherSet;
--
-- @XmlAttribute(name = "featureType", required = true)
-- protected String featureType;
--
-- /**
-- * Gets the value of the matcherSet property.
-- *
-- * @return possible object is {@link FeatureMatcherSet }
-- *
-- */
-- public FeatureMatcherSet getMatcherSet()
-- {
-- return matcherSet;
-- }
/**
-- * Sets the value of the matcherSet property.
++ * <p>Java class for anonymous complex type</p>.
*
-- * @param value
-- * allowed object is {@link FeatureMatcherSet }
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- */
-- public void setMatcherSet(FeatureMatcherSet value)
-- {
-- this.matcherSet = value;
-- }
--
-- /**
-- * Gets the value of the featureType property.
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="matcherSet" type="{www.jalview.org/colours}FeatureMatcherSet"/>
++ * </sequence>
++ * <attribute name="featureType" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
-- * @return possible object is {@link String }
*
*/
-- public String getFeatureType()
-- {
-- return featureType;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "", propOrder = {
++ "matcherSet"
++ })
++ public static class Filter {
++
++ @XmlElement(namespace = "", required = true)
++ protected FeatureMatcherSet matcherSet;
++ @XmlAttribute(name = "featureType", required = true)
++ protected String featureType;
++
++ /**
++ * Gets the value of the matcherSet property.
++ *
++ * @return
++ * possible object is
++ * {@link FeatureMatcherSet }
++ *
++ */
++ public FeatureMatcherSet getMatcherSet() {
++ return matcherSet;
++ }
++
++ /**
++ * Sets the value of the matcherSet property.
++ *
++ * @param value
++ * allowed object is
++ * {@link FeatureMatcherSet }
++ *
++ */
++ public void setMatcherSet(FeatureMatcherSet value) {
++ this.matcherSet = value;
++ }
++
++ /**
++ * Gets the value of the featureType property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getFeatureType() {
++ return featureType;
++ }
++
++ /**
++ * Sets the value of the featureType property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setFeatureType(String value) {
++ this.featureType = value;
++ }
-- /**
-- * Sets the value of the featureType property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setFeatureType(String value)
-- {
-- this.featureType = value;
}
-- }
--
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.math.BigInteger;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
++
/**
++ * This effectively represents a java.util.MapList
++ * object
*
-- * This effectively represents a java.util.MapList object
-- *
++ * <p>Java class for mapListType complex type</p>.
*
-- * <p>Java class for mapListType complex type.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType name="mapListType"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="mapListFrom"
-- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
-- * /&gt; &lt;attribute name="end" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
-- * name="mapListTo" maxOccurs="unbounded" minOccurs="0"&gt;
-- * &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;attribute name="start" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt; &lt;attribute
-- * name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;attribute name="mapFromUnit" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
-- * &lt;attribute name="mapToUnit" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}positiveInteger" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="mapListType">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="mapListFrom" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element name="mapListTo" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attribute name="mapFromUnit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
++ * <attribute name="mapToUnit" use="required" type="{http://www.w3.org/2001/XMLSchema}positiveInteger" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "mapListType", propOrder = { "mapListFrom", "mapListTo" })
--@XmlSeeAlso({ Mapping.class })
--public class MapListType
--{
--
-- protected List<MapListType.MapListFrom> mapListFrom;
--
-- protected List<MapListType.MapListTo> mapListTo;
--
-- @XmlAttribute(name = "mapFromUnit", required = true)
-- @XmlSchemaType(name = "positiveInteger")
-- protected BigInteger mapFromUnit;
--
-- @XmlAttribute(name = "mapToUnit", required = true)
-- @XmlSchemaType(name = "positiveInteger")
-- protected BigInteger mapToUnit;
--
-- /**
-- * Gets the value of the mapListFrom property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the mapListFrom property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getMapListFrom().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link MapListType.MapListFrom }
-- *
-- *
-- */
-- public List<MapListType.MapListFrom> getMapListFrom()
-- {
-- if (mapListFrom == null)
-- {
-- mapListFrom = new ArrayList<MapListType.MapListFrom>();
-- }
-- return this.mapListFrom;
-- }
--
-- /**
-- * Gets the value of the mapListTo property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the mapListTo property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getMapListTo().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link MapListType.MapListTo }
-- *
-- *
-- */
-- public List<MapListType.MapListTo> getMapListTo()
-- {
-- if (mapListTo == null)
-- {
-- mapListTo = new ArrayList<MapListType.MapListTo>();
-- }
-- return this.mapListTo;
-- }
--
-- /**
-- * Gets the value of the mapFromUnit property.
-- *
-- * @return possible object is {@link BigInteger }
-- *
-- */
-- public BigInteger getMapFromUnit()
-- {
-- return mapFromUnit;
-- }
--
-- /**
-- * Sets the value of the mapFromUnit property.
-- *
-- * @param value
-- * allowed object is {@link BigInteger }
-- *
-- */
-- public void setMapFromUnit(BigInteger value)
-- {
-- this.mapFromUnit = value;
-- }
--
-- /**
-- * Gets the value of the mapToUnit property.
-- *
-- * @return possible object is {@link BigInteger }
-- *
-- */
-- public BigInteger getMapToUnit()
-- {
-- return mapToUnit;
-- }
--
-- /**
-- * Sets the value of the mapToUnit property.
-- *
-- * @param value
-- * allowed object is {@link BigInteger }
-- *
-- */
-- public void setMapToUnit(BigInteger value)
-- {
-- this.mapToUnit = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
-- * /&gt; &lt;attribute name="end" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "")
-- public static class MapListFrom
-- {
++@XmlType(name = "mapListType", propOrder = {
++ "mapListFrom",
++ "mapListTo"
++})
++@XmlSeeAlso({
++ Mapping.class
++})
++public class MapListType {
-- @XmlAttribute(name = "start", required = true)
-- protected int start;
--
-- @XmlAttribute(name = "end", required = true)
-- protected int end;
++ /**
++ * a region from start to end inclusive
++ *
++ */
++ protected List<MapListType.MapListFrom> mapListFrom;
++ /**
++ * a region from start to end inclusive
++ *
++ */
++ protected List<MapListType.MapListTo> mapListTo;
++ /**
++ * number of dictionary symbol widths involved in
++ * each
++ * mapped position on this sequence (for example, 3 for a dna
++ * sequence exon
++ * region that is being mapped to a protein sequence).
++ * This is optional,
++ * since the unit can be usually be inferred from the
++ * dictionary type of
++ * each sequence involved in the mapping.
++ *
++ */
++ @XmlAttribute(name = "mapFromUnit", required = true)
++ @XmlSchemaType(name = "positiveInteger")
++ protected BigInteger mapFromUnit;
++ /**
++ * number of dictionary symbol widths involved in
++ * each
++ * mapped position on this sequence (for example, 3 for a dna
++ * sequence exon
++ * region that is being mapped to a protein sequence).
++ * This is optional,
++ * since the unit can be usually be inferred from the
++ * dictionary type of
++ * each sequence involved in the mapping.
++ *
++ */
++ @XmlAttribute(name = "mapToUnit", required = true)
++ @XmlSchemaType(name = "positiveInteger")
++ protected BigInteger mapToUnit;
/**
-- * Gets the value of the start property.
++ * a region from start to end inclusive
++ *
++ * Gets the value of the mapListFrom property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the mapListFrom property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getMapListFrom().add(newItem);
++ * </pre>
++ *
*
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link MapListType.MapListFrom }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the mapListFrom property.
*/
-- public int getStart()
-- {
-- return start;
++ public List<MapListType.MapListFrom> getMapListFrom() {
++ if (mapListFrom == null) {
++ mapListFrom = new ArrayList<MapListType.MapListFrom>();
++ }
++ return this.mapListFrom;
}
/**
-- * Sets the value of the start property.
++ * a region from start to end inclusive
++ *
++ * Gets the value of the mapListTo property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the mapListTo property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getMapListTo().add(newItem);
++ * </pre>
*
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link MapListType.MapListTo }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the mapListTo property.
*/
-- public void setStart(int value)
-- {
-- this.start = value;
++ public List<MapListType.MapListTo> getMapListTo() {
++ if (mapListTo == null) {
++ mapListTo = new ArrayList<MapListType.MapListTo>();
++ }
++ return this.mapListTo;
}
/**
-- * Gets the value of the end property.
++ * number of dictionary symbol widths involved in
++ * each
++ * mapped position on this sequence (for example, 3 for a dna
++ * sequence exon
++ * region that is being mapped to a protein sequence).
++ * This is optional,
++ * since the unit can be usually be inferred from the
++ * dictionary type of
++ * each sequence involved in the mapping.
*
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
*/
-- public int getEnd()
-- {
-- return end;
++ public BigInteger getMapFromUnit() {
++ return mapFromUnit;
}
/**
-- * Sets the value of the end property.
++ * Sets the value of the mapFromUnit property.
*
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ * @see #getMapFromUnit()
*/
-- public void setEnd(int value)
-- {
-- this.end = value;
++ public void setMapFromUnit(BigInteger value) {
++ this.mapFromUnit = value;
}
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int"
-- * /&gt; &lt;attribute name="end" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}int" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "")
-- public static class MapListTo
-- {
--
-- @XmlAttribute(name = "start", required = true)
-- protected int start;
--
-- @XmlAttribute(name = "end", required = true)
-- protected int end;
--
/**
-- * Gets the value of the start property.
++ * number of dictionary symbol widths involved in
++ * each
++ * mapped position on this sequence (for example, 3 for a dna
++ * sequence exon
++ * region that is being mapped to a protein sequence).
++ * This is optional,
++ * since the unit can be usually be inferred from the
++ * dictionary type of
++ * each sequence involved in the mapping.
*
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
*/
-- public int getStart()
-- {
-- return start;
++ public BigInteger getMapToUnit() {
++ return mapToUnit;
}
/**
-- * Sets the value of the start property.
++ * Sets the value of the mapToUnit property.
*
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ * @see #getMapToUnit()
*/
-- public void setStart(int value)
-- {
-- this.start = value;
++ public void setMapToUnit(BigInteger value) {
++ this.mapToUnit = value;
}
++
/**
-- * Gets the value of the end property.
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
*
*/
-- public int getEnd()
-- {
-- return end;
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class MapListFrom {
++
++ @XmlAttribute(name = "start", required = true)
++ protected int start;
++ @XmlAttribute(name = "end", required = true)
++ protected int end;
++
++ /**
++ * Gets the value of the start property.
++ *
++ */
++ public int getStart() {
++ return start;
++ }
++
++ /**
++ * Sets the value of the start property.
++ *
++ */
++ public void setStart(int value) {
++ this.start = value;
++ }
++
++ /**
++ * Gets the value of the end property.
++ *
++ */
++ public int getEnd() {
++ return end;
++ }
++
++ /**
++ * Sets the value of the end property.
++ *
++ */
++ public void setEnd(int value) {
++ this.end = value;
++ }
++
}
++
/**
-- * Sets the value of the end property.
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="start" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * <attribute name="end" use="required" type="{http://www.w3.org/2001/XMLSchema}int" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
*
*/
-- public void setEnd(int value)
-- {
-- this.end = value;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class MapListTo {
++
++ @XmlAttribute(name = "start", required = true)
++ protected int start;
++ @XmlAttribute(name = "end", required = true)
++ protected int end;
++
++ /**
++ * Gets the value of the start property.
++ *
++ */
++ public int getStart() {
++ return start;
++ }
-- }
++ /**
++ * Sets the value of the start property.
++ *
++ */
++ public void setStart(int value) {
++ this.start = value;
++ }
++
++ /**
++ * Gets the value of the end property.
++ *
++ */
++ public int getEnd() {
++ return end;
++ }
++
++ /**
++ * Sets the value of the end property.
++ *
++ */
++ public void setEnd(int value) {
++ this.end = value;
++ }
++
++ }
}
--- /dev/null
+ //
-// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
+ // See https://eclipse-ee4j.github.io/jaxb-ri
+ // Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
+ //
+
++
+ package jalview.xml.binding.jalview;
+
+ import java.util.ArrayList;
+ import java.util.List;
+ import javax.xml.bind.annotation.XmlAccessType;
+ import javax.xml.bind.annotation.XmlAccessorType;
+ import javax.xml.bind.annotation.XmlAttribute;
+ import javax.xml.bind.annotation.XmlType;
+
++
+ /**
- * Defines a mapping from the local frame to a matrix and its associated data
- * specified by MatrixType
- *
++ * Defines a mapping from the local frame to a matrix
++ * and its associated data specified by MatrixType
+ *
- * <p>Java class for MapOnAMatrixType complex type.
++ * <p>Java class for MapOnAMatrixType complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre> &lt;complexType name="MapOnAMatrixType"&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="property"
- * type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;element name="mapping"
- * type="{www.vamsas.ac.uk/jalview/version2}mapListType" minOccurs="0"/&gt;
- * &lt;/sequence&gt; &lt;attribute name="matrix" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="id" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="MapOnAMatrixType">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="property" type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="mapping" type="{www.vamsas.ac.uk/jalview/version2}mapListType" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="matrix" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(name = "MapOnAMatrixType", propOrder = { "property", "mapping" })
-public class MapOnAMatrixType
-{
-
- protected List<Property> property;
-
- protected MapListType mapping;
-
- @XmlAttribute(name = "matrix", required = true)
- protected String matrix;
++@XmlType(name = "MapOnAMatrixType", propOrder = {
++ "property",
++ "mapping"
++})
++public class MapOnAMatrixType {
+
- @XmlAttribute(name = "id")
- protected String id;
++ protected List<Property> property;
++ /**
++ * mapping from the matrix row and column positions
++ * to
++ * associated reference frame
++ *
++ */
++ protected MapListType mapping;
++ /**
++ * reference to the matrix type this Map refers to
++ *
++ */
++ @XmlAttribute(name = "matrix", required = true)
++ protected String matrix;
++ @XmlAttribute(name = "id")
++ protected String id;
+
- /**
- * Gets the value of the property property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the property property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getProperty().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Property }
- *
- *
- */
- public List<Property> getProperty()
- {
- if (property == null)
- {
- property = new ArrayList<Property>();
++ /**
++ * Gets the value of the property property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the property property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getProperty().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Property }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the property property.
++ */
++ public List<Property> getProperty() {
++ if (property == null) {
++ property = new ArrayList<Property>();
++ }
++ return this.property;
+ }
- return this.property;
- }
+
- /**
- * Gets the value of the mapping property.
- *
- * @return possible object is {@link MapListType }
- *
- */
- public MapListType getMapping()
- {
- return mapping;
- }
++ /**
++ * mapping from the matrix row and column positions
++ * to
++ * associated reference frame
++ *
++ * @return
++ * possible object is
++ * {@link MapListType }
++ *
++ */
++ public MapListType getMapping() {
++ return mapping;
++ }
+
- /**
- * Sets the value of the mapping property.
- *
- * @param value
- * allowed object is {@link MapListType }
- *
- */
- public void setMapping(MapListType value)
- {
- this.mapping = value;
- }
++ /**
++ * Sets the value of the mapping property.
++ *
++ * @param value
++ * allowed object is
++ * {@link MapListType }
++ *
++ * @see #getMapping()
++ */
++ public void setMapping(MapListType value) {
++ this.mapping = value;
++ }
+
- /**
- * Gets the value of the matrix property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getMatrix()
- {
- return matrix;
- }
++ /**
++ * reference to the matrix type this Map refers to
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getMatrix() {
++ return matrix;
++ }
+
- /**
- * Sets the value of the matrix property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setMatrix(String value)
- {
- this.matrix = value;
- }
++ /**
++ * Sets the value of the matrix property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getMatrix()
++ */
++ public void setMatrix(String value) {
++ this.matrix = value;
++ }
+
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
++ /**
++ * Gets the value of the id property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getId() {
++ return id;
++ }
+
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
++ /**
++ * Sets the value of the id property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
+
+ }
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
++ * Represent the jalview.datamodel.Mapping object -
++ * it also provides
++ * a way of storing sequences that are mapped 'to'
++ * without adding them
++ * to the sequence set (which will mean they are
++ * then added to the alignment too).
*
-- * Represent the jalview.datamodel.Mapping object - it also provides a way of
-- * storing sequences that are mapped 'to' without adding them to the sequence
-- * set (which will mean they are then added to the alignment too).
-- *
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>Java class for anonymous complex type.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;extension
-- * base="{www.vamsas.ac.uk/jalview/version2}mapListType"&gt;
-- * &lt;sequence&gt; &lt;choice minOccurs="0"&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Sequence"/&gt; &lt;element
-- * name="dseqFor"&gt; &lt;simpleType&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}string"&gt;
-- * &lt;/restriction&gt; &lt;/simpleType&gt;
-- * &lt;/element&gt; &lt;/choice&gt; &lt;/sequence&gt;
-- * &lt;attribute name="mappingType"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/extension&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.vamsas.ac.uk/jalview/version2}mapListType">
++ * <sequence>
++ * <choice minOccurs="0">
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Sequence"/>
++ * <element name="dseqFor">
++ * <simpleType>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
++ * </restriction>
++ * </simpleType>
++ * </element>
++ * </choice>
++ * </sequence>
++ * <attribute name="mappingType" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "", propOrder = { "sequence", "dseqFor" })
++@XmlType(name = "", propOrder = {
++ "sequence",
++ "dseqFor"
++})
@XmlRootElement(name = "Mapping")
--public class Mapping extends MapListType
++public class Mapping
++ extends MapListType
{
-- @XmlElement(name = "Sequence")
-- protected Sequence sequence;
--
-- protected String dseqFor;
--
-- @XmlAttribute(name = "mappingType")
-- protected String mappingType;
++ @XmlElement(name = "Sequence")
++ protected Sequence sequence;
++ protected String dseqFor;
++ /**
++ * Biotype of the mapping e.g. CdsToPeptide
++ *
++ */
++ @XmlAttribute(name = "mappingType")
++ protected String mappingType;
-- /**
-- * Gets the value of the sequence property.
-- *
-- * @return possible object is {@link Sequence }
-- *
-- */
-- public Sequence getSequence()
-- {
-- return sequence;
-- }
++ /**
++ * Gets the value of the sequence property.
++ *
++ * @return
++ * possible object is
++ * {@link Sequence }
++ *
++ */
++ public Sequence getSequence() {
++ return sequence;
++ }
-- /**
-- * Sets the value of the sequence property.
-- *
-- * @param value
-- * allowed object is {@link Sequence }
-- *
-- */
-- public void setSequence(Sequence value)
-- {
-- this.sequence = value;
-- }
++ /**
++ * Sets the value of the sequence property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Sequence }
++ *
++ */
++ public void setSequence(Sequence value) {
++ this.sequence = value;
++ }
-- /**
-- * Gets the value of the dseqFor property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDseqFor()
-- {
-- return dseqFor;
-- }
++ /**
++ * Gets the value of the dseqFor property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDseqFor() {
++ return dseqFor;
++ }
-- /**
-- * Sets the value of the dseqFor property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDseqFor(String value)
-- {
-- this.dseqFor = value;
-- }
++ /**
++ * Sets the value of the dseqFor property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDseqFor(String value) {
++ this.dseqFor = value;
++ }
-- /**
-- * Gets the value of the mappingType property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getMappingType()
-- {
-- return mappingType;
-- }
++ /**
++ * Biotype of the mapping e.g. CdsToPeptide
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getMappingType() {
++ return mappingType;
++ }
-- /**
-- * Sets the value of the mappingType property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setMappingType(String value)
-- {
-- this.mappingType = value;
-- }
++ /**
++ * Sets the value of the mappingType property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getMappingType()
++ */
++ public void setMappingType(String value) {
++ this.mappingType = value;
++ }
}
--- /dev/null
+ //
-// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
+ // See https://eclipse-ee4j.github.io/jaxb-ri
+ // Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
+ //
+
++
+ package jalview.xml.binding.jalview;
+
+ import java.math.BigInteger;
+ import java.util.ArrayList;
+ import java.util.List;
+ import javax.xml.bind.annotation.XmlAccessType;
+ import javax.xml.bind.annotation.XmlAccessorType;
+ import javax.xml.bind.annotation.XmlAttribute;
+ import javax.xml.bind.annotation.XmlElement;
+ import javax.xml.bind.annotation.XmlType;
+
++
+ /**
- * Represents matrix data imported to Jalview, and the results of any derived
- * calculations (independent of a particular view on the matrix).
++ * Represents matrix data imported to Jalview, and the
++ * results of any derived calculations (independent of a particular
++ * view
++ * on the matrix).
+ *
++ * <p>Java class for MatrixType complex type</p>.
+ *
- * <p>Java class for MatrixType complex type.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType name="MatrixType"&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
- * &lt;sequence&gt; &lt;element name="elements"
- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt; &lt;element
- * name="groups" type="{http://www.w3.org/2001/XMLSchema}string"
- * maxOccurs="unbounded" minOccurs="0"/&gt; &lt;element name="newick"
- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;element name="property"
- * type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
- * name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="rows" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}integer" /&gt; &lt;attribute
- * name="cols" use="required" type="{http://www.w3.org/2001/XMLSchema}integer"
- * /&gt; &lt;attribute name="treeMethod"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
- * name="cutHeight" type="{http://www.w3.org/2001/XMLSchema}double" /&gt;
- * &lt;attribute name="id" use="required"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="MatrixType">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="elements" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * <element name="groups" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="newick" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="property" type="{www.vamsas.ac.uk/jalview/version2}property" maxOccurs="unbounded" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="type" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="rows" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="cols" use="required" type="{http://www.w3.org/2001/XMLSchema}integer" />
++ * <attribute name="treeMethod" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="cutHeight" type="{http://www.w3.org/2001/XMLSchema}double" />
++ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
-@XmlType(
- name = "MatrixType",
- propOrder =
- { "elements", "groups", "newick", "property" })
-public class MatrixType
-{
-
- @XmlElement(required = true)
- protected String elements;
-
- protected List<String> groups;
-
- protected List<String> newick;
-
- protected List<Property> property;
++@XmlType(name = "MatrixType", propOrder = {
++ "elements",
++ "groups",
++ "newick",
++ "property"
++})
++public class MatrixType {
+
- @XmlAttribute(name = "type", required = true)
- protected String type;
++ /**
++ * serialised representation of matrix as one or
++ * more sets of comma separated values
++ *
++ */
++ @XmlElement(required = true)
++ protected String elements;
++ /**
++ * Comma separated series of longs formed from
++ * bitsets defining partitions on the rows/columns of the matrix
++ *
++ */
++ protected List<String> groups;
++ /**
++ * tree computed for this
++ *
++ */
++ protected List<String> newick;
++ protected List<Property> property;
++ @XmlAttribute(name = "type", required = true)
++ protected String type;
++ @XmlAttribute(name = "rows", required = true)
++ protected BigInteger rows;
++ @XmlAttribute(name = "cols", required = true)
++ protected BigInteger cols;
++ @XmlAttribute(name = "treeMethod")
++ protected String treeMethod;
++ @XmlAttribute(name = "cutHeight")
++ protected Double cutHeight;
++ @XmlAttribute(name = "id", required = true)
++ protected String id;
+
- @XmlAttribute(name = "rows", required = true)
- protected BigInteger rows;
-
- @XmlAttribute(name = "cols", required = true)
- protected BigInteger cols;
-
- @XmlAttribute(name = "treeMethod")
- protected String treeMethod;
-
- @XmlAttribute(name = "cutHeight")
- protected Double cutHeight;
-
- @XmlAttribute(name = "id", required = true)
- protected String id;
-
- /**
- * Gets the value of the elements property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getElements()
- {
- return elements;
- }
++ /**
++ * serialised representation of matrix as one or
++ * more sets of comma separated values
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getElements() {
++ return elements;
++ }
+
- /**
- * Sets the value of the elements property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setElements(String value)
- {
- this.elements = value;
- }
++ /**
++ * Sets the value of the elements property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getElements()
++ */
++ public void setElements(String value) {
++ this.elements = value;
++ }
+
- /**
- * Gets the value of the groups property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the groups property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getGroups().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link String }
- *
- *
- */
- public List<String> getGroups()
- {
- if (groups == null)
- {
- groups = new ArrayList<String>();
++ /**
++ * Comma separated series of longs formed from
++ * bitsets defining partitions on the rows/columns of the matrix
++ *
++ * Gets the value of the groups property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the groups property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getGroups().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the groups property.
++ */
++ public List<String> getGroups() {
++ if (groups == null) {
++ groups = new ArrayList<String>();
++ }
++ return this.groups;
+ }
- return this.groups;
- }
+
- /**
- * Gets the value of the newick property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the newick property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getNewick().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link String }
- *
- *
- */
- public List<String> getNewick()
- {
- if (newick == null)
- {
- newick = new ArrayList<String>();
++ /**
++ * tree computed for this
++ *
++ * Gets the value of the newick property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the newick property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getNewick().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the newick property.
++ */
++ public List<String> getNewick() {
++ if (newick == null) {
++ newick = new ArrayList<String>();
++ }
++ return this.newick;
+ }
- return this.newick;
- }
+
- /**
- * Gets the value of the property property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the property property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getProperty().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link Property }
- *
- *
- */
- public List<Property> getProperty()
- {
- if (property == null)
- {
- property = new ArrayList<Property>();
++ /**
++ * Gets the value of the property property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the property property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getProperty().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Property }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the property property.
++ */
++ public List<Property> getProperty() {
++ if (property == null) {
++ property = new ArrayList<Property>();
++ }
++ return this.property;
+ }
- return this.property;
- }
+
- /**
- * Gets the value of the type property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getType()
- {
- return type;
- }
++ /**
++ * Gets the value of the type property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getType() {
++ return type;
++ }
+
- /**
- * Sets the value of the type property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setType(String value)
- {
- this.type = value;
- }
++ /**
++ * Sets the value of the type property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setType(String value) {
++ this.type = value;
++ }
+
- /**
- * Gets the value of the rows property.
- *
- * @return possible object is {@link BigInteger }
- *
- */
- public BigInteger getRows()
- {
- return rows;
- }
++ /**
++ * Gets the value of the rows property.
++ *
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
++ */
++ public BigInteger getRows() {
++ return rows;
++ }
+
- /**
- * Sets the value of the rows property.
- *
- * @param value
- * allowed object is {@link BigInteger }
- *
- */
- public void setRows(BigInteger value)
- {
- this.rows = value;
- }
++ /**
++ * Sets the value of the rows property.
++ *
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ */
++ public void setRows(BigInteger value) {
++ this.rows = value;
++ }
+
- /**
- * Gets the value of the cols property.
- *
- * @return possible object is {@link BigInteger }
- *
- */
- public BigInteger getCols()
- {
- return cols;
- }
++ /**
++ * Gets the value of the cols property.
++ *
++ * @return
++ * possible object is
++ * {@link BigInteger }
++ *
++ */
++ public BigInteger getCols() {
++ return cols;
++ }
+
- /**
- * Sets the value of the cols property.
- *
- * @param value
- * allowed object is {@link BigInteger }
- *
- */
- public void setCols(BigInteger value)
- {
- this.cols = value;
- }
++ /**
++ * Sets the value of the cols property.
++ *
++ * @param value
++ * allowed object is
++ * {@link BigInteger }
++ *
++ */
++ public void setCols(BigInteger value) {
++ this.cols = value;
++ }
+
- /**
- * Gets the value of the treeMethod property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getTreeMethod()
- {
- return treeMethod;
- }
++ /**
++ * Gets the value of the treeMethod property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getTreeMethod() {
++ return treeMethod;
++ }
+
- /**
- * Sets the value of the treeMethod property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setTreeMethod(String value)
- {
- this.treeMethod = value;
- }
++ /**
++ * Sets the value of the treeMethod property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setTreeMethod(String value) {
++ this.treeMethod = value;
++ }
+
- /**
- * Gets the value of the cutHeight property.
- *
- * @return possible object is {@link Double }
- *
- */
- public Double getCutHeight()
- {
- return cutHeight;
- }
++ /**
++ * Gets the value of the cutHeight property.
++ *
++ * @return
++ * possible object is
++ * {@link Double }
++ *
++ */
++ public Double getCutHeight() {
++ return cutHeight;
++ }
+
- /**
- * Sets the value of the cutHeight property.
- *
- * @param value
- * allowed object is {@link Double }
- *
- */
- public void setCutHeight(Double value)
- {
- this.cutHeight = value;
- }
++ /**
++ * Sets the value of the cutHeight property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Double }
++ *
++ */
++ public void setCutHeight(Double value) {
++ this.cutHeight = value;
++ }
+
- /**
- * Gets the value of the id property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getId()
- {
- return id;
- }
++ /**
++ * Gets the value of the id property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getId() {
++ return id;
++ }
+
- /**
- * Sets the value of the id property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setId(String value)
- {
- this.id = value;
- }
++ /**
++ * Sets the value of the id property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
+
+ }
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlEnumValue;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for NoValueColour.
++ * Graduated feature colour if no score (or attribute) value
++ *
++ * <p>Java class for NoValueColour</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class. <pre> &lt;simpleType
-- * name="NoValueColour"&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}string"&gt; &lt;enumeration
-- * value="None"/&gt; &lt;enumeration value="Min"/&gt;
-- * &lt;enumeration value="Max"/&gt; &lt;/restriction&gt;
-- * &lt;/simpleType&gt; </pre>
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ * <pre>
++ * <simpleType name="NoValueColour">
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
++ * <enumeration value="None"/>
++ * <enumeration value="Min"/>
++ * <enumeration value="Max"/>
++ * </restriction>
++ * </simpleType>
++ * </pre>
*
*/
@XmlType(name = "NoValueColour", namespace = "www.jalview.org/colours")
@XmlEnum
--public enum NoValueColour
--{
--
-- @XmlEnumValue("None")
-- NONE("None"), @XmlEnumValue("Min")
-- MIN("Min"), @XmlEnumValue("Max")
-- MAX("Max");
--
-- private final String value;
--
-- NoValueColour(String v)
-- {
-- value = v;
-- }
--
-- public String value()
-- {
-- return value;
-- }
--
-- public static NoValueColour fromValue(String v)
-- {
-- for (NoValueColour c : NoValueColour.values())
-- {
-- if (c.value.equals(v))
-- {
-- return c;
-- }
++public enum NoValueColour {
++
++ @XmlEnumValue("None")
++ NONE("None"),
++ @XmlEnumValue("Min")
++ MIN("Min"),
++ @XmlEnumValue("Max")
++ MAX("Max");
++ private final String value;
++
++ NoValueColour(String v) {
++ value = v;
++ }
++
++ /**
++ * Gets the value associated to the enum constant.
++ *
++ * @return
++ * The value linked to the enum.
++ */
++ public String value() {
++ return value;
++ }
++
++ /**
++ * Gets the enum associated to the value passed as parameter.
++ *
++ * @param v
++ * The value to get the enum from.
++ * @return
++ * The enum which corresponds to the value, if it exists.
++ * @throws IllegalArgumentException
++ * If no value matches in the enum declaration.
++ */
++ public static NoValueColour fromValue(String v) {
++ for (NoValueColour c: NoValueColour.values()) {
++ if (c.value.equals(v)) {
++ return c;
++ }
++ }
++ throw new IllegalArgumentException(v);
}
-- throw new IllegalArgumentException(v);
-- }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.JAXBElement;
import javax.xml.bind.annotation.XmlRegistry;
import javax.xml.namespace.QName;
++
/**
-- * This object contains factory methods for each Java content interface and Java
-- * element interface generated in the jalview.xml.binding.jalview package.
-- * <p>An ObjectFactory allows you to programatically construct new
-- * instances of the Java representation for XML content. The Java representation
-- * of XML content can consist of schema derived interfaces and classes
-- * representing the binding of schema type definitions, element declarations and
-- * model groups. Factory methods for each of these are provided in this class.
++ * This object contains factory methods for each
++ * Java content interface and Java element interface
++ * generated in the jalview.xml.binding.jalview package.
++ * <p>An ObjectFactory allows you to programatically
++ * construct new instances of the Java representation
++ * for XML content. The Java representation of XML
++ * content can consist of schema derived interfaces
++ * and classes representing the binding of schema
++ * type definitions, element declarations and model
++ * groups. Factory methods for each of these are
++ * provided in this class.
*
*/
@XmlRegistry
--public class ObjectFactory
--{
--
-- private final static QName _JalviewModel_QNAME = new QName(
-- "www.jalview.org", "JalviewModel");
--
-- private final static QName _JalviewUserColours_QNAME = new QName(
-- "www.jalview.org/colours", "JalviewUserColours");
--
-- private final static QName _WebServiceParameterSet_QNAME = new QName(
-- "www.jalview.org/xml/wsparamset", "WebServiceParameterSet");
--
-- /**
-- * Create a new ObjectFactory that can be used to create new instances of
-- * schema derived classes for package: jalview.xml.binding.jalview
-- *
-- */
-- public ObjectFactory()
-- {
-- }
--
-- /**
-- * Create an instance of {@link MapListType }
-- *
-- */
-- public MapListType createMapListType()
-- {
-- return new MapListType();
-- }
--
-- /**
-- * Create an instance of {@link Sequence }
-- *
-- */
-- public Sequence createSequence()
-- {
-- return new Sequence();
-- }
--
-- /**
-- * Create an instance of {@link AlcodonFrame }
-- *
-- */
-- public AlcodonFrame createAlcodonFrame()
-- {
-- return new AlcodonFrame();
-- }
--
-- /**
-- * Create an instance of {@link Annotation }
-- *
-- */
-- public Annotation createAnnotation()
-- {
-- return new Annotation();
-- }
--
-- /**
-- * Create an instance of {@link SequenceSet }
-- *
-- */
-- public SequenceSet createSequenceSet()
-- {
-- return new SequenceSet();
-- }
--
-- /**
-- * Create an instance of {@link FeatureMatcherSet }
-- *
-- */
-- public FeatureMatcherSet createFeatureMatcherSet()
-- {
-- return new FeatureMatcherSet();
-- }
--
-- /**
-- * Create an instance of {@link JalviewUserColours }
-- *
-- */
-- public JalviewUserColours createJalviewUserColours()
-- {
-- return new JalviewUserColours();
-- }
--
-- /**
-- * Create an instance of {@link Pdbentry }
-- *
-- */
-- public Pdbentry createPdbentry()
-- {
-- return new Pdbentry();
-- }
--
-- /**
-- * Create an instance of {@link Feature }
-- *
-- */
-- public Feature createFeature()
-- {
-- return new Feature();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel }
-- *
-- */
-- public JalviewModel createJalviewModel()
-- {
-- return new JalviewModel();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.FeatureSettings }
-- *
-- */
-- public JalviewModel.FeatureSettings createJalviewModelFeatureSettings()
-- {
-- return new JalviewModel.FeatureSettings();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.PcaViewer }
-- *
-- */
-- public JalviewModel.PcaViewer createJalviewModelPcaViewer()
-- {
-- return new JalviewModel.PcaViewer();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.Viewport }
-- *
-- */
-- public JalviewModel.Viewport createJalviewModelViewport()
-- {
-- return new JalviewModel.Viewport();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.JSeq }
-- *
-- */
-- public JalviewModel.JSeq createJalviewModelJSeq()
-- {
-- return new JalviewModel.JSeq();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.JSeq.RnaViewer }
-- *
-- */
-- public JalviewModel.JSeq.RnaViewer createJalviewModelJSeqRnaViewer()
-- {
-- return new JalviewModel.JSeq.RnaViewer();
-- }
--
-- /**
-- * Create an instance of {@link JalviewModel.JSeq.Pdbids }
-- *
-- */
-- public JalviewModel.JSeq.Pdbids createJalviewModelJSeqPdbids()
-- {
-- return new JalviewModel.JSeq.Pdbids();
-- }
--
-- /**
-- * Create an instance of {@link AnnotationColourScheme }
-- *
-- */
-- public AnnotationColourScheme createAnnotationColourScheme()
-- {
-- return new AnnotationColourScheme();
-- }
--
-- /**
-- * Create an instance of {@link PcaDataType }
-- *
-- */
-- public PcaDataType createPcaDataType()
-- {
-- return new PcaDataType();
-- }
--
-- /**
-- * Create an instance of {@link DoubleVector }
-- *
-- */
-- public DoubleVector createDoubleVector()
-- {
-- return new DoubleVector();
-- }
--
-- /**
-- * Create an instance of {@link DoubleMatrix }
-- *
-- */
-- public DoubleMatrix createDoubleMatrix()
-- {
-- return new DoubleMatrix();
-- }
--
-- /**
-- * Create an instance of {@link Mapping }
-- *
-- */
-- public Mapping createMapping()
-- {
-- return new Mapping();
-- }
--
-- /**
-- * Create an instance of {@link MapListType.MapListFrom }
-- *
-- */
-- public MapListType.MapListFrom createMapListTypeMapListFrom()
-- {
-- return new MapListType.MapListFrom();
-- }
--
-- /**
-- * Create an instance of {@link MapListType.MapListTo }
-- *
-- */
-- public MapListType.MapListTo createMapListTypeMapListTo()
-- {
-- return new MapListType.MapListTo();
-- }
--
-- /**
-- * Create an instance of {@link SequenceType }
-- *
-- */
-- public SequenceType createSequenceType()
-- {
-- return new SequenceType();
-- }
--
-- /**
-- * Create an instance of {@link Sequence.DBRef }
-- *
-- */
-- public Sequence.DBRef createSequenceDBRef()
-- {
-- return new Sequence.DBRef();
-- }
--
-- /**
-- * Create an instance of {@link AlcodonFrame.Alcodon }
-- *
-- */
-- public AlcodonFrame.Alcodon createAlcodonFrameAlcodon()
-- {
-- return new AlcodonFrame.Alcodon();
-- }
--
-- /**
-- * Create an instance of {@link AlcodonFrame.AlcodMap }
-- *
-- */
-- public AlcodonFrame.AlcodMap createAlcodonFrameAlcodMap()
-- {
-- return new AlcodonFrame.AlcodMap();
-- }
--
-- /**
-- * Create an instance of {@link AnnotationElement }
-- *
-- */
-- public AnnotationElement createAnnotationElement()
-- {
-- return new AnnotationElement();
-- }
--
-- /**
-- * Create an instance of {@link Annotation.ThresholdLine }
-- *
-- */
-- public Annotation.ThresholdLine createAnnotationThresholdLine()
-- {
-- return new Annotation.ThresholdLine();
-- }
--
-- /**
- * Create an instance of {@link Annotation.Property }
- *
- */
- public Annotation.Property createAnnotationProperty()
- {
- return new Annotation.Property();
- }
-
- /**
- * Create an instance of {@link SequenceSet.SequenceSetProperties }
- *
- */
- public SequenceSet.SequenceSetProperties createSequenceSetSequenceSetProperties()
- {
- return new SequenceSet.SequenceSetProperties();
- }
-
- /**
- * Create an instance of {@link VAMSAS }
- *
- */
- public VAMSAS createVAMSAS()
- {
- return new VAMSAS();
- }
-
- /**
- * Create an instance of {@link FeatureMatcher }
- *
- */
- public FeatureMatcher createFeatureMatcher()
- {
- return new FeatureMatcher();
- }
-
- /**
- * Create an instance of {@link WebServiceParameterSet }
- *
- */
- public WebServiceParameterSet createWebServiceParameterSet()
- {
- return new WebServiceParameterSet();
- }
-
- /**
- * Create an instance of {@link FeatureMatcherSet.CompoundMatcher }
- *
- */
- public FeatureMatcherSet.CompoundMatcher createFeatureMatcherSetCompoundMatcher()
- {
- return new FeatureMatcherSet.CompoundMatcher();
- }
-
- /**
- * Create an instance of {@link JalviewUserColours.Colour }
- *
- */
- public JalviewUserColours.Colour createJalviewUserColoursColour()
- {
- return new JalviewUserColours.Colour();
- }
-
- /**
- * Create an instance of {@link JalviewUserColours.Filter }
- *
- */
- public JalviewUserColours.Filter createJalviewUserColoursFilter()
- {
- return new JalviewUserColours.Filter();
- }
-
- /**
- * Create an instance of {@link Pdbentry.Property }
- *
- */
- public Pdbentry.Property createPdbentryProperty()
- {
- return new Pdbentry.Property();
- }
-
- /**
- * Create an instance of {@link Feature.OtherData }
- *
- */
- public Feature.OtherData createFeatureOtherData()
- {
- return new Feature.OtherData();
- }
-
- /**
- * Create an instance of {@link JalviewModel.JGroup }
- *
- */
- public JalviewModel.JGroup createJalviewModelJGroup()
- {
- return new JalviewModel.JGroup();
- }
-
- /**
- * Create an instance of {@link JalviewModel.UserColours }
- *
- */
- public JalviewModel.UserColours createJalviewModelUserColours()
- {
- return new JalviewModel.UserColours();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Tree }
- *
- */
- public JalviewModel.Tree createJalviewModelTree()
- {
- return new JalviewModel.Tree();
- }
-
- /**
- * Create an instance of {@link JalviewModel.FeatureSettings.Setting }
- *
- */
- public JalviewModel.FeatureSettings.Setting createJalviewModelFeatureSettingsSetting()
- {
- return new JalviewModel.FeatureSettings.Setting();
- }
-
- /**
- * Create an instance of {@link JalviewModel.FeatureSettings.Group }
- *
- */
- public JalviewModel.FeatureSettings.Group createJalviewModelFeatureSettingsGroup()
- {
- return new JalviewModel.FeatureSettings.Group();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SequencePoint }
- *
- */
- public JalviewModel.PcaViewer.SequencePoint createJalviewModelPcaViewerSequencePoint()
- {
- return new JalviewModel.PcaViewer.SequencePoint();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.Axis }
- *
- */
- public JalviewModel.PcaViewer.Axis createJalviewModelPcaViewerAxis()
- {
- return new JalviewModel.PcaViewer.Axis();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMin }
- *
- */
- public JalviewModel.PcaViewer.SeqPointMin createJalviewModelPcaViewerSeqPointMin()
- {
- return new JalviewModel.PcaViewer.SeqPointMin();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMax }
- *
- */
- public JalviewModel.PcaViewer.SeqPointMax createJalviewModelPcaViewerSeqPointMax()
- {
- return new JalviewModel.PcaViewer.SeqPointMax();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Viewport.HiddenColumns }
- *
- */
- public JalviewModel.Viewport.HiddenColumns createJalviewModelViewportHiddenColumns()
- {
- return new JalviewModel.Viewport.HiddenColumns();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Viewport.CalcIdParam }
- *
- */
- public JalviewModel.Viewport.CalcIdParam createJalviewModelViewportCalcIdParam()
- {
- return new JalviewModel.Viewport.CalcIdParam();
- }
-
- /**
- * Create an instance of
- * {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
- *
- */
- public JalviewModel.JSeq.RnaViewer.SecondaryStructure createJalviewModelJSeqRnaViewerSecondaryStructure()
- {
- return new JalviewModel.JSeq.RnaViewer.SecondaryStructure();
- }
-
- /**
- * Create an instance of {@link JalviewModel.JSeq.Pdbids.StructureState }
- *
- */
- public JalviewModel.JSeq.Pdbids.StructureState createJalviewModelJSeqPdbidsStructureState()
- {
- return new JalviewModel.JSeq.Pdbids.StructureState();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link JalviewModel
- * }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link JalviewModel }{@code >}
- */
- @XmlElementDecl(namespace = "www.jalview.org", name = "JalviewModel")
- public JAXBElement<JalviewModel> createJalviewModel(JalviewModel value)
- {
- return new JAXBElement<JalviewModel>(_JalviewModel_QNAME,
- JalviewModel.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement
- * }{@code <}{@link JalviewUserColours }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link JalviewUserColours }{@code >}
- */
- @XmlElementDecl(
- namespace = "www.jalview.org/colours",
- name = "JalviewUserColours")
- public JAXBElement<JalviewUserColours> createJalviewUserColours(
- JalviewUserColours value)
- {
- return new JAXBElement<JalviewUserColours>(_JalviewUserColours_QNAME,
- JalviewUserColours.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement
- * }{@code <}{@link WebServiceParameterSet }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link WebServiceParameterSet }{@code >}
- */
- @XmlElementDecl(
- namespace = "www.jalview.org/xml/wsparamset",
- name = "WebServiceParameterSet")
- public JAXBElement<WebServiceParameterSet> createWebServiceParameterSet(
- WebServiceParameterSet value)
- {
- return new JAXBElement<WebServiceParameterSet>(
- _WebServiceParameterSet_QNAME, WebServiceParameterSet.class,
- null, value);
- }
- * Create an instance of {@link MapOnAMatrixType }
- *
- */
- public MapOnAMatrixType createMapOnAMatrixType()
- {
- return new MapOnAMatrixType();
- }
-
- /**
- * Create an instance of {@link jalview.xml.binding.jalview.Property }
- *
- */
- public jalview.xml.binding.jalview.Property createProperty()
- {
- return new jalview.xml.binding.jalview.Property();
- }
-
- /**
- * Create an instance of {@link SequenceSet.SequenceSetProperties }
- *
- */
- public SequenceSet.SequenceSetProperties createSequenceSetSequenceSetProperties()
- {
- return new SequenceSet.SequenceSetProperties();
- }
-
- /**
- * Create an instance of {@link MatrixType }
- *
- */
- public MatrixType createMatrixType()
- {
- return new MatrixType();
- }
-
- /**
- * Create an instance of {@link VAMSAS }
- *
- */
- public VAMSAS createVAMSAS()
- {
- return new VAMSAS();
- }
-
- /**
- * Create an instance of {@link FeatureMatcher }
- *
- */
- public FeatureMatcher createFeatureMatcher()
- {
- return new FeatureMatcher();
- }
-
- /**
- * Create an instance of {@link WebServiceParameterSet }
- *
- */
- public WebServiceParameterSet createWebServiceParameterSet()
- {
- return new WebServiceParameterSet();
- }
-
- /**
- * Create an instance of {@link FeatureMatcherSet.CompoundMatcher }
- *
- */
- public FeatureMatcherSet.CompoundMatcher createFeatureMatcherSetCompoundMatcher()
- {
- return new FeatureMatcherSet.CompoundMatcher();
- }
-
- /**
- * Create an instance of {@link JalviewUserColours.Colour }
- *
- */
- public JalviewUserColours.Colour createJalviewUserColoursColour()
- {
- return new JalviewUserColours.Colour();
- }
-
- /**
- * Create an instance of {@link JalviewUserColours.Filter }
- *
- */
- public JalviewUserColours.Filter createJalviewUserColoursFilter()
- {
- return new JalviewUserColours.Filter();
- }
-
- /**
- * Create an instance of {@link Pdbentry.Property }
- *
- */
- public Pdbentry.Property createPdbentryProperty()
- {
- return new Pdbentry.Property();
- }
-
- /**
- * Create an instance of {@link Feature.OtherData }
- *
- */
- public Feature.OtherData createFeatureOtherData()
- {
- return new Feature.OtherData();
- }
-
- /**
- * Create an instance of {@link JalviewModel.JGroup }
- *
- */
- public JalviewModel.JGroup createJalviewModelJGroup()
- {
- return new JalviewModel.JGroup();
- }
-
- /**
- * Create an instance of {@link JalviewModel.UserColours }
- *
- */
- public JalviewModel.UserColours createJalviewModelUserColours()
- {
- return new JalviewModel.UserColours();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Tree }
- *
- */
- public JalviewModel.Tree createJalviewModelTree()
- {
- return new JalviewModel.Tree();
- }
-
- /**
- * Create an instance of {@link JalviewModel.FeatureSettings.Setting }
- *
- */
- public JalviewModel.FeatureSettings.Setting createJalviewModelFeatureSettingsSetting()
- {
- return new JalviewModel.FeatureSettings.Setting();
- }
-
- /**
- * Create an instance of {@link JalviewModel.FeatureSettings.Group }
- *
- */
- public JalviewModel.FeatureSettings.Group createJalviewModelFeatureSettingsGroup()
- {
- return new JalviewModel.FeatureSettings.Group();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SequencePoint }
- *
- */
- public JalviewModel.PcaViewer.SequencePoint createJalviewModelPcaViewerSequencePoint()
- {
- return new JalviewModel.PcaViewer.SequencePoint();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.Axis }
- *
- */
- public JalviewModel.PcaViewer.Axis createJalviewModelPcaViewerAxis()
- {
- return new JalviewModel.PcaViewer.Axis();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMin }
- *
- */
- public JalviewModel.PcaViewer.SeqPointMin createJalviewModelPcaViewerSeqPointMin()
- {
- return new JalviewModel.PcaViewer.SeqPointMin();
- }
-
- /**
- * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMax }
- *
- */
- public JalviewModel.PcaViewer.SeqPointMax createJalviewModelPcaViewerSeqPointMax()
- {
- return new JalviewModel.PcaViewer.SeqPointMax();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Viewport.HiddenColumns }
- *
- */
- public JalviewModel.Viewport.HiddenColumns createJalviewModelViewportHiddenColumns()
- {
- return new JalviewModel.Viewport.HiddenColumns();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Viewport.CalcIdParam }
- *
- */
- public JalviewModel.Viewport.CalcIdParam createJalviewModelViewportCalcIdParam()
- {
- return new JalviewModel.Viewport.CalcIdParam();
- }
-
- /**
- * Create an instance of {@link JalviewModel.Viewport.Overview }
- *
- */
- public JalviewModel.Viewport.Overview createJalviewModelViewportOverview()
- {
- return new JalviewModel.Viewport.Overview();
- }
-
- /**
- * Create an instance of
- * {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
- *
- */
- public JalviewModel.JSeq.RnaViewer.SecondaryStructure createJalviewModelJSeqRnaViewerSecondaryStructure()
- {
- return new JalviewModel.JSeq.RnaViewer.SecondaryStructure();
- }
-
- /**
- * Create an instance of {@link JalviewModel.JSeq.Pdbids.StructureState }
- *
- */
- public JalviewModel.JSeq.Pdbids.StructureState createJalviewModelJSeqPdbidsStructureState()
- {
- return new JalviewModel.JSeq.Pdbids.StructureState();
- }
-
- /**
- * Create an instance of {@link JAXBElement }{@code <}{@link JalviewModel
- * }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link JalviewModel }{@code >}
- */
- @XmlElementDecl(namespace = "www.jalview.org", name = "JalviewModel")
- public JAXBElement<JalviewModel> createJalviewModel(JalviewModel value)
- {
- return new JAXBElement<JalviewModel>(_JalviewModel_QNAME,
- JalviewModel.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement
- * }{@code <}{@link JalviewUserColours }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link JalviewUserColours }{@code >}
- */
- @XmlElementDecl(
- namespace = "www.jalview.org/colours",
- name = "JalviewUserColours")
- public JAXBElement<JalviewUserColours> createJalviewUserColours(
- JalviewUserColours value)
- {
- return new JAXBElement<JalviewUserColours>(_JalviewUserColours_QNAME,
- JalviewUserColours.class, null, value);
- }
-
- /**
- * Create an instance of {@link JAXBElement
- * }{@code <}{@link WebServiceParameterSet }{@code >}
- *
- * @param value
- * Java instance representing xml element's value.
- * @return the new instance of {@link JAXBElement
- * }{@code <}{@link WebServiceParameterSet }{@code >}
- */
- @XmlElementDecl(
- namespace = "www.jalview.org/xml/wsparamset",
- name = "WebServiceParameterSet")
- public JAXBElement<WebServiceParameterSet> createWebServiceParameterSet(
- WebServiceParameterSet value)
- {
- return new JAXBElement<WebServiceParameterSet>(
- _WebServiceParameterSet_QNAME, WebServiceParameterSet.class,
- null, value);
- }
++public class ObjectFactory {
++
++ private static final QName _JalviewModel_QNAME = new QName("www.jalview.org", "JalviewModel");
++ private static final QName _JalviewUserColours_QNAME = new QName("www.jalview.org/colours", "JalviewUserColours");
++ private static final QName _WebServiceParameterSet_QNAME = new QName("www.jalview.org/xml/wsparamset", "WebServiceParameterSet");
++
++ /**
++ * Create a new ObjectFactory that can be used to create new instances of schema derived classes for package: jalview.xml.binding.jalview
++ *
++ */
++ public ObjectFactory() {
++ }
++
++ /**
++ * Create an instance of {@link MapListType }
++ *
++ */
++ public MapListType createMapListType() {
++ return new MapListType();
++ }
++
++ /**
++ * Create an instance of {@link Sequence }
++ *
++ */
++ public Sequence createSequence() {
++ return new Sequence();
++ }
++
++ /**
++ * Create an instance of {@link AlcodonFrame }
++ *
++ */
++ public AlcodonFrame createAlcodonFrame() {
++ return new AlcodonFrame();
++ }
++
++ /**
++ * Create an instance of {@link Annotation }
++ *
++ */
++ public Annotation createAnnotation() {
++ return new Annotation();
++ }
++
++ /**
++ * Create an instance of {@link SequenceSet }
++ *
++ */
++ public SequenceSet createSequenceSet() {
++ return new SequenceSet();
++ }
++
++ /**
++ * Create an instance of {@link FeatureMatcherSet }
++ *
++ */
++ public FeatureMatcherSet createFeatureMatcherSet() {
++ return new FeatureMatcherSet();
++ }
++
++ /**
++ * Create an instance of {@link JalviewUserColours }
++ *
++ */
++ public JalviewUserColours createJalviewUserColours() {
++ return new JalviewUserColours();
++ }
++
++ /**
++ * Create an instance of {@link Pdbentry }
++ *
++ */
++ public Pdbentry createPdbentry() {
++ return new Pdbentry();
++ }
++
++ /**
++ * Create an instance of {@link Feature }
++ *
++ */
++ public Feature createFeature() {
++ return new Feature();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel }
++ *
++ */
++ public JalviewModel createJalviewModel() {
++ return new JalviewModel();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.FeatureSettings }
++ *
++ */
++ public JalviewModel.FeatureSettings createJalviewModelFeatureSettings() {
++ return new JalviewModel.FeatureSettings();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.PcaViewer }
++ *
++ */
++ public JalviewModel.PcaViewer createJalviewModelPcaViewer() {
++ return new JalviewModel.PcaViewer();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.Viewport }
++ *
++ */
++ public JalviewModel.Viewport createJalviewModelViewport() {
++ return new JalviewModel.Viewport();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JSeq }
++ *
++ */
++ public JalviewModel.JSeq createJalviewModelJSeq() {
++ return new JalviewModel.JSeq();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JSeq.RnaViewer }
++ *
++ */
++ public JalviewModel.JSeq.RnaViewer createJalviewModelJSeqRnaViewer() {
++ return new JalviewModel.JSeq.RnaViewer();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JSeq.Pdbids }
++ *
++ */
++ public JalviewModel.JSeq.Pdbids createJalviewModelJSeqPdbids() {
++ return new JalviewModel.JSeq.Pdbids();
++ }
++
++ /**
++ * Create an instance of {@link AnnotationColourScheme }
++ *
++ */
++ public AnnotationColourScheme createAnnotationColourScheme() {
++ return new AnnotationColourScheme();
++ }
++
++ /**
++ * Create an instance of {@link PcaDataType }
++ *
++ */
++ public PcaDataType createPcaDataType() {
++ return new PcaDataType();
++ }
++
++ /**
++ * Create an instance of {@link DoubleVector }
++ *
++ */
++ public DoubleVector createDoubleVector() {
++ return new DoubleVector();
++ }
++
++ /**
++ * Create an instance of {@link DoubleMatrix }
++ *
++ */
++ public DoubleMatrix createDoubleMatrix() {
++ return new DoubleMatrix();
++ }
++
++ /**
++ * Create an instance of {@link Mapping }
++ *
++ */
++ public Mapping createMapping() {
++ return new Mapping();
++ }
++
++ /**
++ * Create an instance of {@link MapListType.MapListFrom }
++ *
++ */
++ public MapListType.MapListFrom createMapListTypeMapListFrom() {
++ return new MapListType.MapListFrom();
++ }
++
++ /**
++ * Create an instance of {@link MapListType.MapListTo }
++ *
++ */
++ public MapListType.MapListTo createMapListTypeMapListTo() {
++ return new MapListType.MapListTo();
++ }
++
++ /**
++ * Create an instance of {@link SequenceType }
++ *
++ */
++ public SequenceType createSequenceType() {
++ return new SequenceType();
++ }
++
++ /**
++ * Create an instance of {@link Sequence.DBRef }
++ *
++ */
++ public Sequence.DBRef createSequenceDBRef() {
++ return new Sequence.DBRef();
++ }
++
++ /**
++ * Create an instance of {@link AlcodonFrame.Alcodon }
++ *
++ */
++ public AlcodonFrame.Alcodon createAlcodonFrameAlcodon() {
++ return new AlcodonFrame.Alcodon();
++ }
++
++ /**
++ * Create an instance of {@link AlcodonFrame.AlcodMap }
++ *
++ */
++ public AlcodonFrame.AlcodMap createAlcodonFrameAlcodMap() {
++ return new AlcodonFrame.AlcodMap();
++ }
++
++ /**
++ * Create an instance of {@link AnnotationElement }
++ *
++ */
++ public AnnotationElement createAnnotationElement() {
++ return new AnnotationElement();
++ }
++
++ /**
++ * Create an instance of {@link Annotation.ThresholdLine }
++ *
++ */
++ public Annotation.ThresholdLine createAnnotationThresholdLine() {
++ return new Annotation.ThresholdLine();
++ }
++
++ /**
++ * Create an instance of {@link MapOnAMatrixType }
++ *
++ */
++ public MapOnAMatrixType createMapOnAMatrixType() {
++ return new MapOnAMatrixType();
++ }
++
++ /**
++ * Create an instance of {@link jalview.xml.binding.jalview.Property }
++ *
++ */
++ public jalview.xml.binding.jalview.Property createProperty() {
++ return new jalview.xml.binding.jalview.Property();
++ }
++
++ /**
++ * Create an instance of {@link SequenceSet.SequenceSetProperties }
++ *
++ */
++ public SequenceSet.SequenceSetProperties createSequenceSetSequenceSetProperties() {
++ return new SequenceSet.SequenceSetProperties();
++ }
++
++ /**
++ * Create an instance of {@link MatrixType }
++ *
++ */
++ public MatrixType createMatrixType() {
++ return new MatrixType();
++ }
++
++ /**
++ * Create an instance of {@link VAMSAS }
++ *
++ */
++ public VAMSAS createVAMSAS() {
++ return new VAMSAS();
++ }
++
++ /**
++ * Create an instance of {@link FeatureMatcher }
++ *
++ */
++ public FeatureMatcher createFeatureMatcher() {
++ return new FeatureMatcher();
++ }
++
++ /**
++ * Create an instance of {@link WebServiceParameterSet }
++ *
++ */
++ public WebServiceParameterSet createWebServiceParameterSet() {
++ return new WebServiceParameterSet();
++ }
++
++ /**
++ * Create an instance of {@link FeatureMatcherSet.CompoundMatcher }
++ *
++ */
++ public FeatureMatcherSet.CompoundMatcher createFeatureMatcherSetCompoundMatcher() {
++ return new FeatureMatcherSet.CompoundMatcher();
++ }
++
++ /**
++ * Create an instance of {@link JalviewUserColours.Colour }
++ *
++ */
++ public JalviewUserColours.Colour createJalviewUserColoursColour() {
++ return new JalviewUserColours.Colour();
++ }
++
++ /**
++ * Create an instance of {@link JalviewUserColours.Filter }
++ *
++ */
++ public JalviewUserColours.Filter createJalviewUserColoursFilter() {
++ return new JalviewUserColours.Filter();
++ }
++
++ /**
++ * Create an instance of {@link Pdbentry.Property }
++ *
++ */
++ public Pdbentry.Property createPdbentryProperty() {
++ return new Pdbentry.Property();
++ }
++
++ /**
++ * Create an instance of {@link Feature.OtherData }
++ *
++ */
++ public Feature.OtherData createFeatureOtherData() {
++ return new Feature.OtherData();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JGroup }
++ *
++ */
++ public JalviewModel.JGroup createJalviewModelJGroup() {
++ return new JalviewModel.JGroup();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.UserColours }
++ *
++ */
++ public JalviewModel.UserColours createJalviewModelUserColours() {
++ return new JalviewModel.UserColours();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.Tree }
++ *
++ */
++ public JalviewModel.Tree createJalviewModelTree() {
++ return new JalviewModel.Tree();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.FeatureSettings.Setting }
++ *
++ */
++ public JalviewModel.FeatureSettings.Setting createJalviewModelFeatureSettingsSetting() {
++ return new JalviewModel.FeatureSettings.Setting();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.FeatureSettings.Group }
++ *
++ */
++ public JalviewModel.FeatureSettings.Group createJalviewModelFeatureSettingsGroup() {
++ return new JalviewModel.FeatureSettings.Group();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.PcaViewer.SequencePoint }
++ *
++ */
++ public JalviewModel.PcaViewer.SequencePoint createJalviewModelPcaViewerSequencePoint() {
++ return new JalviewModel.PcaViewer.SequencePoint();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.PcaViewer.Axis }
++ *
++ */
++ public JalviewModel.PcaViewer.Axis createJalviewModelPcaViewerAxis() {
++ return new JalviewModel.PcaViewer.Axis();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMin }
++ *
++ */
++ public JalviewModel.PcaViewer.SeqPointMin createJalviewModelPcaViewerSeqPointMin() {
++ return new JalviewModel.PcaViewer.SeqPointMin();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.PcaViewer.SeqPointMax }
++ *
++ */
++ public JalviewModel.PcaViewer.SeqPointMax createJalviewModelPcaViewerSeqPointMax() {
++ return new JalviewModel.PcaViewer.SeqPointMax();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.Viewport.HiddenColumns }
++ *
++ */
++ public JalviewModel.Viewport.HiddenColumns createJalviewModelViewportHiddenColumns() {
++ return new JalviewModel.Viewport.HiddenColumns();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.Viewport.CalcIdParam }
++ *
++ */
++ public JalviewModel.Viewport.CalcIdParam createJalviewModelViewportCalcIdParam() {
++ return new JalviewModel.Viewport.CalcIdParam();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.Viewport.Overview }
++ *
++ */
++ public JalviewModel.Viewport.Overview createJalviewModelViewportOverview() {
++ return new JalviewModel.Viewport.Overview();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JSeq.RnaViewer.SecondaryStructure }
++ *
++ */
++ public JalviewModel.JSeq.RnaViewer.SecondaryStructure createJalviewModelJSeqRnaViewerSecondaryStructure() {
++ return new JalviewModel.JSeq.RnaViewer.SecondaryStructure();
++ }
++
++ /**
++ * Create an instance of {@link JalviewModel.JSeq.Pdbids.StructureState }
++ *
++ */
++ public JalviewModel.JSeq.Pdbids.StructureState createJalviewModelJSeqPdbidsStructureState() {
++ return new JalviewModel.JSeq.Pdbids.StructureState();
++ }
++
++ /**
++ * Create an instance of {@link JAXBElement }{@code <}{@link JalviewModel }{@code >}
++ *
++ * @param value
++ * Java instance representing xml element's value.
++ * @return
++ * the new instance of {@link JAXBElement }{@code <}{@link JalviewModel }{@code >}
++ */
++ @XmlElementDecl(namespace = "www.jalview.org", name = "JalviewModel")
++ public JAXBElement<JalviewModel> createJalviewModel(JalviewModel value) {
++ return new JAXBElement<JalviewModel>(_JalviewModel_QNAME, JalviewModel.class, null, value);
++ }
++
++ /**
++ * Create an instance of {@link JAXBElement }{@code <}{@link JalviewUserColours }{@code >}
++ *
++ * @param value
++ * Java instance representing xml element's value.
++ * @return
++ * the new instance of {@link JAXBElement }{@code <}{@link JalviewUserColours }{@code >}
++ */
++ @XmlElementDecl(namespace = "www.jalview.org/colours", name = "JalviewUserColours")
++ public JAXBElement<JalviewUserColours> createJalviewUserColours(JalviewUserColours value) {
++ return new JAXBElement<JalviewUserColours>(_JalviewUserColours_QNAME, JalviewUserColours.class, null, value);
++ }
++
++ /**
++ * Create an instance of {@link JAXBElement }{@code <}{@link WebServiceParameterSet }{@code >}
++ *
++ * @param value
++ * Java instance representing xml element's value.
++ * @return
++ * the new instance of {@link JAXBElement }{@code <}{@link WebServiceParameterSet }{@code >}
++ */
++ @XmlElementDecl(namespace = "www.jalview.org/xml/wsparamset", name = "WebServiceParameterSet")
++ public JAXBElement<WebServiceParameterSet> createWebServiceParameterSet(WebServiceParameterSet value) {
++ return new JAXBElement<WebServiceParameterSet>(_WebServiceParameterSet_QNAME, WebServiceParameterSet.class, null, value);
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- *
* The results of a PCA calculation
*
++ * <p>Java class for PcaDataType complex type</p>.
*
-- * <p>Java class for PcaDataType complex type.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType name="PcaDataType"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="pairwiseMatrix"
-- * type="{www.jalview.org}DoubleMatrix"/&gt; &lt;element
-- * name="tridiagonalMatrix" type="{www.jalview.org}DoubleMatrix"/&gt;
-- * &lt;element name="eigenMatrix"
-- * type="{www.jalview.org}DoubleMatrix"/&gt; &lt;/sequence&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="PcaDataType">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="pairwiseMatrix" type="{www.jalview.org}DoubleMatrix"/>
++ * <element name="tridiagonalMatrix" type="{www.jalview.org}DoubleMatrix"/>
++ * <element name="eigenMatrix" type="{www.jalview.org}DoubleMatrix"/>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "PcaDataType",
-- namespace = "www.jalview.org",
-- propOrder =
-- { "pairwiseMatrix", "tridiagonalMatrix", "eigenMatrix" })
--public class PcaDataType
--{
--
-- @XmlElement(required = true)
-- protected DoubleMatrix pairwiseMatrix;
--
-- @XmlElement(required = true)
-- protected DoubleMatrix tridiagonalMatrix;
++@XmlType(name = "PcaDataType", namespace = "www.jalview.org", propOrder = {
++ "pairwiseMatrix",
++ "tridiagonalMatrix",
++ "eigenMatrix"
++})
++public class PcaDataType {
-- @XmlElement(required = true)
-- protected DoubleMatrix eigenMatrix;
++ @XmlElement(required = true)
++ protected DoubleMatrix pairwiseMatrix;
++ @XmlElement(required = true)
++ protected DoubleMatrix tridiagonalMatrix;
++ @XmlElement(required = true)
++ protected DoubleMatrix eigenMatrix;
-- /**
-- * Gets the value of the pairwiseMatrix property.
-- *
-- * @return possible object is {@link DoubleMatrix }
-- *
-- */
-- public DoubleMatrix getPairwiseMatrix()
-- {
-- return pairwiseMatrix;
-- }
++ /**
++ * Gets the value of the pairwiseMatrix property.
++ *
++ * @return
++ * possible object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public DoubleMatrix getPairwiseMatrix() {
++ return pairwiseMatrix;
++ }
-- /**
-- * Sets the value of the pairwiseMatrix property.
-- *
-- * @param value
-- * allowed object is {@link DoubleMatrix }
-- *
-- */
-- public void setPairwiseMatrix(DoubleMatrix value)
-- {
-- this.pairwiseMatrix = value;
-- }
++ /**
++ * Sets the value of the pairwiseMatrix property.
++ *
++ * @param value
++ * allowed object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public void setPairwiseMatrix(DoubleMatrix value) {
++ this.pairwiseMatrix = value;
++ }
-- /**
-- * Gets the value of the tridiagonalMatrix property.
-- *
-- * @return possible object is {@link DoubleMatrix }
-- *
-- */
-- public DoubleMatrix getTridiagonalMatrix()
-- {
-- return tridiagonalMatrix;
-- }
++ /**
++ * Gets the value of the tridiagonalMatrix property.
++ *
++ * @return
++ * possible object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public DoubleMatrix getTridiagonalMatrix() {
++ return tridiagonalMatrix;
++ }
-- /**
-- * Sets the value of the tridiagonalMatrix property.
-- *
-- * @param value
-- * allowed object is {@link DoubleMatrix }
-- *
-- */
-- public void setTridiagonalMatrix(DoubleMatrix value)
-- {
-- this.tridiagonalMatrix = value;
-- }
++ /**
++ * Sets the value of the tridiagonalMatrix property.
++ *
++ * @param value
++ * allowed object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public void setTridiagonalMatrix(DoubleMatrix value) {
++ this.tridiagonalMatrix = value;
++ }
-- /**
-- * Gets the value of the eigenMatrix property.
-- *
-- * @return possible object is {@link DoubleMatrix }
-- *
-- */
-- public DoubleMatrix getEigenMatrix()
-- {
-- return eigenMatrix;
-- }
++ /**
++ * Gets the value of the eigenMatrix property.
++ *
++ * @return
++ * possible object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public DoubleMatrix getEigenMatrix() {
++ return eigenMatrix;
++ }
-- /**
-- * Sets the value of the eigenMatrix property.
-- *
-- * @param value
-- * allowed object is {@link DoubleMatrix }
-- *
-- */
-- public void setEigenMatrix(DoubleMatrix value)
-- {
-- this.eigenMatrix = value;
-- }
++ /**
++ * Sets the value of the eigenMatrix property.
++ *
++ * @param value
++ * allowed object is
++ * {@link DoubleMatrix }
++ *
++ */
++ public void setEigenMatrix(DoubleMatrix value) {
++ this.eigenMatrix = value;
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for pdbentry complex type.
++ * <p>Java class for pdbentry complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="pdbentry"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;sequence
-- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;element name="property"
-- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;attribute name="value" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;attribute name="id" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="type" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="file" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="pdbentry">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence maxOccurs="unbounded" minOccurs="0">
++ * <element name="property" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attribute name="id" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="type" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="file" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "pdbentry",
-- namespace = "www.jalview.org",
-- propOrder =
-- { "property" })
--@XmlSeeAlso({ jalview.xml.binding.jalview.JalviewModel.JSeq.Pdbids.class })
--public class Pdbentry
--{
--
-- protected List<Pdbentry.Property> property;
--
-- @XmlAttribute(name = "id", required = true)
-- protected String id;
--
-- @XmlAttribute(name = "type")
-- protected String type;
--
-- @XmlAttribute(name = "file")
-- protected String file;
--
-- /**
-- * Gets the value of the property property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the property property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getProperty().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link Pdbentry.Property }
-- *
-- *
-- */
-- public List<Pdbentry.Property> getProperty()
-- {
-- if (property == null)
-- {
-- property = new ArrayList<Pdbentry.Property>();
-- }
-- return this.property;
-- }
--
-- /**
-- * Gets the value of the id property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getId()
-- {
-- return id;
-- }
--
-- /**
-- * Sets the value of the id property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setId(String value)
-- {
-- this.id = value;
-- }
--
-- /**
-- * Gets the value of the type property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getType()
-- {
-- return type;
-- }
--
-- /**
-- * Sets the value of the type property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setType(String value)
-- {
-- this.type = value;
-- }
--
-- /**
-- * Gets the value of the file property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getFile()
-- {
-- return file;
-- }
--
-- /**
-- * Sets the value of the file property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setFile(String value)
-- {
-- this.file = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
-- * /&gt; &lt;attribute name="value" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "")
-- public static class Property
-- {
--
-- @XmlAttribute(name = "name", required = true)
-- protected String name;
--
-- @XmlAttribute(name = "value", required = true)
-- protected String value;
++@XmlType(name = "pdbentry", namespace = "www.jalview.org", propOrder = {
++ "property"
++})
++@XmlSeeAlso({
++ jalview.xml.binding.jalview.JalviewModel.JSeq.Pdbids.class
++})
++public class Pdbentry {
++
++ protected List<Pdbentry.Property> property;
++ @XmlAttribute(name = "id", required = true)
++ protected String id;
++ @XmlAttribute(name = "type")
++ protected String type;
++ @XmlAttribute(name = "file")
++ protected String file;
/**
-- * Gets the value of the name property.
++ * Gets the value of the property property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the property property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getProperty().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Pdbentry.Property }
++ * </p>
++ *
*
-- * @return possible object is {@link String }
++ * @return
++ * The value of the property property.
++ */
++ public List<Pdbentry.Property> getProperty() {
++ if (property == null) {
++ property = new ArrayList<Pdbentry.Property>();
++ }
++ return this.property;
++ }
++
++ /**
++ * Gets the value of the id property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getName()
-- {
-- return name;
++ public String getId() {
++ return id;
}
/**
-- * Sets the value of the name property.
++ * Sets the value of the id property.
*
* @param value
-- * allowed object is {@link String }
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
++
++ /**
++ * Gets the value of the type property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public void setName(String value)
-- {
-- this.name = value;
++ public String getType() {
++ return type;
}
/**
-- * Gets the value of the value property.
++ * Sets the value of the type property.
*
-- * @return possible object is {@link String }
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setType(String value) {
++ this.type = value;
++ }
++
++ /**
++ * Gets the value of the file property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getValue()
-- {
-- return value;
++ public String getFile() {
++ return file;
}
/**
-- * Sets the value of the value property.
++ * Sets the value of the file property.
*
* @param value
-- * allowed object is {@link String }
-- *
++ * allowed object is
++ * {@link String }
++ *
*/
-- public void setValue(String value)
-- {
-- this.value = value;
++ public void setFile(String value) {
++ this.file = value;
}
-- }
++
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class Property {
++
++ @XmlAttribute(name = "name", required = true)
++ protected String name;
++ @XmlAttribute(name = "value", required = true)
++ protected String value;
++
++ /**
++ * Gets the value of the name property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Sets the value of the name property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setName(String value) {
++ this.name = value;
++ }
++
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getValue() {
++ return value;
++ }
++
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
++
++ }
}
--- /dev/null
+ //
-// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
+ // See https://eclipse-ee4j.github.io/jaxb-ri
+ // Any modifications to this file will be lost upon recompilation of the source schema.
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
+ //
+
++
+ package jalview.xml.binding.jalview;
+
+ import javax.xml.bind.annotation.XmlAccessType;
+ import javax.xml.bind.annotation.XmlAccessorType;
+ import javax.xml.bind.annotation.XmlAttribute;
+ import javax.xml.bind.annotation.XmlType;
+
++
+ /**
- * <p>Java class for property complex type.
++ * <p>Java class for property complex type</p>.
+ *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
+ *
- * <pre> &lt;complexType name="property"&gt;
- * &lt;complexContent&gt; &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="name" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="property">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="name" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
+ *
+ *
+ */
+ @XmlAccessorType(XmlAccessType.FIELD)
+ @XmlType(name = "property")
-public class Property
-{
-
- @XmlAttribute(name = "name")
- protected String name;
++public class Property {
+
- @XmlAttribute(name = "value")
- protected String value;
++ @XmlAttribute(name = "name")
++ protected String name;
++ @XmlAttribute(name = "value")
++ protected String value;
+
- /**
- * Gets the value of the name property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getName()
- {
- return name;
- }
++ /**
++ * Gets the value of the name property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getName() {
++ return name;
++ }
+
- /**
- * Sets the value of the name property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setName(String value)
- {
- this.name = value;
- }
++ /**
++ * Sets the value of the name property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setName(String value) {
++ this.name = value;
++ }
+
- /**
- * Gets the value of the value property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getValue()
- {
- return value;
- }
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getValue() {
++ return value;
++ }
+
- /**
- * Sets the value of the value property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setValue(String value)
- {
- this.value = value;
- }
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
+
+ }
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;extension
-- * base="{www.vamsas.ac.uk/jalview/version2}SequenceType"&gt;
-- * &lt;sequence&gt; &lt;element name="DBRef" maxOccurs="unbounded"
-- * minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="source"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="version" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="accessionId"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="locus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false"
-- * /&gt; &lt;attribute name="canonical"
-- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt;
-- * &lt;/sequence&gt; &lt;attribute name="dsseqid"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="biotype" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/extension&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <extension base="{www.vamsas.ac.uk/jalview/version2}SequenceType">
++ * <sequence>
++ * <element name="DBRef" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="accessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="locus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="canonical" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * </sequence>
++ * <attribute name="dsseqid" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="biotype" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </extension>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "", propOrder = { "dbRef" })
++@XmlType(name = "", propOrder = {
++ "dbRef"
++})
@XmlRootElement(name = "Sequence")
--public class Sequence extends SequenceType
++public class Sequence
++ extends SequenceType
{
-- @XmlElement(name = "DBRef")
-- protected List<Sequence.DBRef> dbRef;
--
-- @XmlAttribute(name = "dsseqid")
-- protected String dsseqid;
--
-- @XmlAttribute(name = "biotype")
-- protected String biotype;
--
-- /**
-- * Gets the value of the dbRef property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the dbRef property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getDBRef().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link Sequence.DBRef }
-- *
-- *
-- */
-- public List<Sequence.DBRef> getDBRef()
-- {
-- if (dbRef == null)
-- {
-- dbRef = new ArrayList<Sequence.DBRef>();
-- }
-- return this.dbRef;
-- }
--
-- /**
-- * Gets the value of the dsseqid property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDsseqid()
-- {
-- return dsseqid;
-- }
--
-- /**
-- * Sets the value of the dsseqid property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDsseqid(String value)
-- {
-- this.dsseqid = value;
-- }
--
-- /**
-- * Gets the value of the biotype property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getBiotype()
-- {
-- return biotype;
-- }
--
-- /**
-- * Sets the value of the biotype property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setBiotype(String value)
-- {
-- this.biotype = value;
-- }
--
-- /**
-- * <p>Java class for anonymous complex type.
-- *
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
-- *
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="source"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="version" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="accessionId"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="locus" type="{http://www.w3.org/2001/XMLSchema}boolean"
-- * default="false" /&gt; &lt;attribute name="canonical"
-- * type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
-- *
-- *
-- */
-- @XmlAccessorType(XmlAccessType.FIELD)
-- @XmlType(name = "", propOrder = { "mapping" })
-- public static class DBRef
-- {
--
-- @XmlElement(name = "Mapping")
-- protected Mapping mapping;
--
-- @XmlAttribute(name = "source")
-- protected String source;
--
-- @XmlAttribute(name = "version")
-- protected String version;
--
-- @XmlAttribute(name = "accessionId")
-- protected String accessionId;
--
-- @XmlAttribute(name = "locus")
-- protected Boolean locus;
--
-- @XmlAttribute(name = "canonical")
-- protected Boolean canonical;
--
++ @XmlElement(name = "DBRef")
++ protected List<Sequence.DBRef> dbRef;
/**
-- * Gets the value of the mapping property.
-- *
-- * @return possible object is {@link Mapping }
-- *
-- */
-- public Mapping getMapping()
-- {
-- return mapping;
-- }
--
-- /**
-- * Sets the value of the mapping property.
-- *
-- * @param value
-- * allowed object is {@link Mapping }
++ * dataset sequence id for this sequence. Will be
++ * created as union of sequences.
*
*/
-- public void setMapping(Mapping value)
-- {
-- this.mapping = value;
-- }
--
++ @XmlAttribute(name = "dsseqid")
++ protected String dsseqid;
/**
-- * Gets the value of the source property.
-- *
-- * @return possible object is {@link String }
++ * Biotype of the sequence (if known)
*
*/
-- public String getSource()
-- {
-- return source;
-- }
++ @XmlAttribute(name = "biotype")
++ protected String biotype;
/**
-- * Sets the value of the source property.
++ * Gets the value of the dbRef property.
*
-- * @param value
-- * allowed object is {@link String }
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the dbRef property.</p>
*
-- */
-- public void setSource(String value)
-- {
-- this.source = value;
-- }
--
-- /**
-- * Gets the value of the version property.
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getDBRef().add(newItem);
++ * </pre>
*
-- * @return possible object is {@link String }
*
-- */
-- public String getVersion()
-- {
-- return version;
-- }
--
-- /**
-- * Sets the value of the version property.
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Sequence.DBRef }
++ * </p>
*
-- * @param value
-- * allowed object is {@link String }
*
++ * @return
++ * The value of the dbRef property.
*/
-- public void setVersion(String value)
-- {
-- this.version = value;
++ public List<Sequence.DBRef> getDBRef() {
++ if (dbRef == null) {
++ dbRef = new ArrayList<Sequence.DBRef>();
++ }
++ return this.dbRef;
}
/**
-- * Gets the value of the accessionId property.
-- *
-- * @return possible object is {@link String }
++ * dataset sequence id for this sequence. Will be
++ * created as union of sequences.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getAccessionId()
-- {
-- return accessionId;
++ public String getDsseqid() {
++ return dsseqid;
}
/**
-- * Sets the value of the accessionId property.
++ * Sets the value of the dsseqid property.
*
* @param value
-- * allowed object is {@link String }
-- *
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getDsseqid()
*/
-- public void setAccessionId(String value)
-- {
-- this.accessionId = value;
++ public void setDsseqid(String value) {
++ this.dsseqid = value;
}
/**
-- * Gets the value of the locus property.
-- *
-- * @return possible object is {@link Boolean }
++ * Biotype of the sequence (if known)
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public boolean isLocus()
-- {
-- if (locus == null)
-- {
-- return false;
-- }
-- else
-- {
-- return locus;
-- }
++ public String getBiotype() {
++ return biotype;
}
/**
-- * Sets the value of the locus property.
++ * Sets the value of the biotype property.
*
* @param value
-- * allowed object is {@link Boolean }
-- *
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getBiotype()
*/
-- public void setLocus(Boolean value)
-- {
-- this.locus = value;
++ public void setBiotype(String value) {
++ this.biotype = value;
}
++
/**
-- * Gets the value of the canonical property.
++ * <p>Java class for anonymous complex type</p>.
*
-- * @return possible object is {@link Boolean }
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- */
-- public boolean isCanonical()
-- {
-- if (canonical == null)
-- {
-- return false;
-- }
-- else
-- {
-- return canonical;
-- }
-- }
--
-- /**
-- * Sets the value of the canonical property.
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Mapping" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="source" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="version" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="accessionId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="locus" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * <attribute name="canonical" type="{http://www.w3.org/2001/XMLSchema}boolean" default="false" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
-- * @param value
-- * allowed object is {@link Boolean }
*
*/
-- public void setCanonical(Boolean value)
-- {
-- this.canonical = value;
-- }
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "", propOrder = {
++ "mapping"
++ })
++ public static class DBRef {
++
++ @XmlElement(name = "Mapping")
++ protected Mapping mapping;
++ @XmlAttribute(name = "source")
++ protected String source;
++ @XmlAttribute(name = "version")
++ protected String version;
++ @XmlAttribute(name = "accessionId")
++ protected String accessionId;
++ /**
++ * true for gene locus mapping, source=species,
++ * version=assembly, accession=chromosome
++ *
++ */
++ @XmlAttribute(name = "locus")
++ protected Boolean locus;
++ /**
++ * true for the representative accession for
++ * databases where multiple accessions map to the same entry
++ * (eg. Uniprot)
++ *
++ */
++ @XmlAttribute(name = "canonical")
++ protected Boolean canonical;
++
++ /**
++ * Gets the value of the mapping property.
++ *
++ * @return
++ * possible object is
++ * {@link Mapping }
++ *
++ */
++ public Mapping getMapping() {
++ return mapping;
++ }
++
++ /**
++ * Sets the value of the mapping property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Mapping }
++ *
++ */
++ public void setMapping(Mapping value) {
++ this.mapping = value;
++ }
++
++ /**
++ * Gets the value of the source property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getSource() {
++ return source;
++ }
++
++ /**
++ * Sets the value of the source property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setSource(String value) {
++ this.source = value;
++ }
++
++ /**
++ * Gets the value of the version property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getVersion() {
++ return version;
++ }
++
++ /**
++ * Sets the value of the version property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setVersion(String value) {
++ this.version = value;
++ }
++
++ /**
++ * Gets the value of the accessionId property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getAccessionId() {
++ return accessionId;
++ }
++
++ /**
++ * Sets the value of the accessionId property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setAccessionId(String value) {
++ this.accessionId = value;
++ }
++
++ /**
++ * true for gene locus mapping, source=species,
++ * version=assembly, accession=chromosome
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public boolean isLocus() {
++ if (locus == null) {
++ return false;
++ } else {
++ return locus;
++ }
++ }
++
++ /**
++ * Sets the value of the locus property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ * @see #isLocus()
++ */
++ public void setLocus(Boolean value) {
++ this.locus = value;
++ }
++
++ /**
++ * true for the representative accession for
++ * databases where multiple accessions map to the same entry
++ * (eg. Uniprot)
++ *
++ * @return
++ * possible object is
++ * {@link Boolean }
++ *
++ */
++ public boolean isCanonical() {
++ if (canonical == null) {
++ return false;
++ } else {
++ return canonical;
++ }
++ }
++
++ /**
++ * Sets the value of the canonical property.
++ *
++ * @param value
++ * allowed object is
++ * {@link Boolean }
++ *
++ * @see #isCanonical()
++ */
++ public void setCanonical(Boolean value) {
++ this.canonical = value;
++ }
-- }
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for anonymous complex type.
++ * <p>Java class for anonymous complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
-- * &lt;restriction base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Sequence" maxOccurs="unbounded"
-- * minOccurs="0"/&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}Annotation" maxOccurs="unbounded"
-- * minOccurs="0"/&gt; &lt;element name="sequenceSetProperties"
-- * maxOccurs="unbounded" minOccurs="0"&gt; &lt;complexType&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
-- * name="key" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;attribute name="value"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; &lt;/element&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}AlcodonFrame" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
- * name="gapChar" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="datasetId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- * minOccurs="0"/&gt; &lt;element name="Matrix"
- * type="{www.vamsas.ac.uk/jalview/version2}MatrixType" maxOccurs="unbounded"
- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute
- * name="gapChar" use="required" type="{http://www.w3.org/2001/XMLSchema}string"
- * /&gt; &lt;attribute name="datasetId"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Sequence" maxOccurs="unbounded" minOccurs="0"/>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}Annotation" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="sequenceSetProperties" maxOccurs="unbounded" minOccurs="0">
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="key" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </element>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}AlcodonFrame" maxOccurs="unbounded" minOccurs="0"/>
++ * <element name="Matrix" type="{www.vamsas.ac.uk/jalview/version2}MatrixType" maxOccurs="unbounded" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="gapChar" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="datasetId" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "",
-- propOrder =
- { "sequence", "annotation", "sequenceSetProperties", "alcodonFrame" })
- { "sequence", "annotation", "sequenceSetProperties", "alcodonFrame",
- "matrix" })
++@XmlType(name = "", propOrder = {
++ "sequence",
++ "annotation",
++ "sequenceSetProperties",
++ "alcodonFrame",
++ "matrix"
++})
@XmlRootElement(name = "SequenceSet")
--public class SequenceSet
--{
--
-- @XmlElement(name = "Sequence")
-- protected List<Sequence> sequence;
--
-- @XmlElement(name = "Annotation")
-- protected List<Annotation> annotation;
--
-- protected List<SequenceSet.SequenceSetProperties> sequenceSetProperties;
++public class SequenceSet {
-- @XmlElement(name = "AlcodonFrame")
-- protected List<AlcodonFrame> alcodonFrame;
--
- @XmlAttribute(name = "gapChar", required = true)
- protected String gapChar;
-
- @XmlAttribute(name = "datasetId")
- protected String datasetId;
- @XmlElement(name = "Matrix")
- protected List<MatrixType> matrix;
-
- @XmlAttribute(name = "gapChar", required = true)
- protected String gapChar;
-
- @XmlAttribute(name = "datasetId")
- protected String datasetId;
++ @XmlElement(name = "Sequence")
++ protected List<Sequence> sequence;
++ @XmlElement(name = "Annotation")
++ protected List<Annotation> annotation;
++ protected List<SequenceSet.SequenceSetProperties> sequenceSetProperties;
++ @XmlElement(name = "AlcodonFrame")
++ protected List<AlcodonFrame> alcodonFrame;
++ /**
++ * Matrices referred to by this set of sequences.
++ *
++ */
++ @XmlElement(name = "Matrix")
++ protected List<MatrixType> matrix;
++ @XmlAttribute(name = "gapChar", required = true)
++ protected String gapChar;
++ /**
++ * reference to set where jalview will gather the
++ * dataset sequences for all sequences in the set.
++ *
++ */
++ @XmlAttribute(name = "datasetId")
++ protected String datasetId;
-- /**
-- * Gets the value of the sequence property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the sequence property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getSequence().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link Sequence }
-- *
-- *
-- */
-- public List<Sequence> getSequence()
-- {
-- if (sequence == null)
-- {
-- sequence = new ArrayList<Sequence>();
++ /**
++ * Gets the value of the sequence property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the sequence property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getSequence().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Sequence }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the sequence property.
++ */
++ public List<Sequence> getSequence() {
++ if (sequence == null) {
++ sequence = new ArrayList<Sequence>();
++ }
++ return this.sequence;
}
-- return this.sequence;
-- }
-- /**
-- * Gets the value of the annotation property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the annotation property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAnnotation().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link Annotation }
-- *
-- *
-- */
-- public List<Annotation> getAnnotation()
-- {
-- if (annotation == null)
-- {
-- annotation = new ArrayList<Annotation>();
++ /**
++ * Gets the value of the annotation property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the annotation property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAnnotation().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link Annotation }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the annotation property.
++ */
++ public List<Annotation> getAnnotation() {
++ if (annotation == null) {
++ annotation = new ArrayList<Annotation>();
++ }
++ return this.annotation;
}
-- return this.annotation;
-- }
-- /**
-- * Gets the value of the sequenceSetProperties property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the sequenceSetProperties property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getSequenceSetProperties().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link SequenceSet.SequenceSetProperties }
-- *
-- *
-- */
-- public List<SequenceSet.SequenceSetProperties> getSequenceSetProperties()
-- {
-- if (sequenceSetProperties == null)
-- {
-- sequenceSetProperties = new ArrayList<SequenceSet.SequenceSetProperties>();
++ /**
++ * Gets the value of the sequenceSetProperties property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the sequenceSetProperties property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getSequenceSetProperties().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link SequenceSet.SequenceSetProperties }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the sequenceSetProperties property.
++ */
++ public List<SequenceSet.SequenceSetProperties> getSequenceSetProperties() {
++ if (sequenceSetProperties == null) {
++ sequenceSetProperties = new ArrayList<SequenceSet.SequenceSetProperties>();
++ }
++ return this.sequenceSetProperties;
}
-- return this.sequenceSetProperties;
-- }
-- /**
-- * Gets the value of the alcodonFrame property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the alcodonFrame property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getAlcodonFrame().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link AlcodonFrame }
-- *
-- *
-- */
-- public List<AlcodonFrame> getAlcodonFrame()
-- {
-- if (alcodonFrame == null)
-- {
-- alcodonFrame = new ArrayList<AlcodonFrame>();
++ /**
++ * Gets the value of the alcodonFrame property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the alcodonFrame property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getAlcodonFrame().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link AlcodonFrame }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the alcodonFrame property.
++ */
++ public List<AlcodonFrame> getAlcodonFrame() {
++ if (alcodonFrame == null) {
++ alcodonFrame = new ArrayList<AlcodonFrame>();
++ }
++ return this.alcodonFrame;
}
-- return this.alcodonFrame;
-- }
-
- /**
- * Gets the value of the gapChar property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getGapChar()
- {
- return gapChar;
- }
-
- /**
- * Sets the value of the gapChar property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setGapChar(String value)
- {
- this.gapChar = value;
- }
-
- /**
- * Gets the value of the datasetId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDatasetId()
- {
- return datasetId;
- }
-
- /**
- * Sets the value of the datasetId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setDatasetId(String value)
- {
- this.datasetId = value;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="key" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class SequenceSetProperties
- {
-
- @XmlAttribute(name = "key")
- protected String key;
-
- @XmlAttribute(name = "value")
- protected String value;
- /**
- * Gets the value of the matrix property.
- *
- * <p> This accessor method returns a reference to the live list, not a
- * snapshot. Therefore any modification you make to the returned list will be
- * present inside the JAXB object. This is why there is not a
- * <CODE>set</CODE> method for the matrix property.
- *
- * <p> For example, to add a new item, do as follows: <pre>
- * getMatrix().add(newItem); </pre>
- *
- *
- * <p> Objects of the following type(s) are allowed in the list
- * {@link MatrixType }
- *
- *
- */
- public List<MatrixType> getMatrix()
- {
- if (matrix == null)
- {
- matrix = new ArrayList<MatrixType>();
+ /**
- * Gets the value of the key property.
++ * Matrices referred to by this set of sequences.
++ *
++ * Gets the value of the matrix property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the matrix property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getMatrix().add(newItem);
++ * </pre>
+ *
- * @return possible object is {@link String }
+ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link MatrixType }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the matrix property.
+ */
- public String getKey()
- {
- return key;
++ public List<MatrixType> getMatrix() {
++ if (matrix == null) {
++ matrix = new ArrayList<MatrixType>();
++ }
++ return this.matrix;
}
- return this.matrix;
- }
-
- /**
- * Gets the value of the gapChar property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getGapChar()
- {
- return gapChar;
- }
-
- /**
- * Sets the value of the gapChar property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setGapChar(String value)
- {
- this.gapChar = value;
- }
-
- /**
- * Gets the value of the datasetId property.
- *
- * @return possible object is {@link String }
- *
- */
- public String getDatasetId()
- {
- return datasetId;
- }
-
- /**
- * Sets the value of the datasetId property.
- *
- * @param value
- * allowed object is {@link String }
- *
- */
- public void setDatasetId(String value)
- {
- this.datasetId = value;
- }
-
- /**
- * <p>Java class for anonymous complex type.
- *
- * <p>The following schema fragment specifies the expected content
- * contained within this class.
- *
- * <pre> &lt;complexType&gt; &lt;complexContent&gt;
- * &lt;restriction
- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt; &lt;attribute
- * name="key" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;attribute name="value"
- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
- * &lt;/restriction&gt; &lt;/complexContent&gt;
- * &lt;/complexType&gt; </pre>
- *
- *
- */
- @XmlAccessorType(XmlAccessType.FIELD)
- @XmlType(name = "")
- public static class SequenceSetProperties
- {
-
- @XmlAttribute(name = "key")
- protected String key;
-
- @XmlAttribute(name = "value")
- protected String value;
/**
- * Sets the value of the key property.
- *
- * @param value
- * allowed object is {@link String }
- * Gets the value of the key property.
- *
- * @return possible object is {@link String }
++ * Gets the value of the gapChar property.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
- public void setKey(String value)
- {
- this.key = value;
- public String getKey()
- {
- return key;
++ public String getGapChar() {
++ return gapChar;
}
/**
- * Gets the value of the value property.
- * Sets the value of the key property.
++ * Sets the value of the gapChar property.
*
- * @return possible object is {@link String }
+ * @param value
- * allowed object is {@link String }
- *
++ * allowed object is
++ * {@link String }
++ *
+ */
- public void setKey(String value)
- {
- this.key = value;
++ public void setGapChar(String value) {
++ this.gapChar = value;
+ }
+
+ /**
- * Gets the value of the value property.
- *
- * @return possible object is {@link String }
++ * reference to set where jalview will gather the
++ * dataset sequences for all sequences in the set.
*
++ * @return
++ * possible object is
++ * {@link String }
++ *
*/
-- public String getValue()
-- {
-- return value;
++ public String getDatasetId() {
++ return datasetId;
}
/**
-- * Sets the value of the value property.
++ * Sets the value of the datasetId property.
*
* @param value
-- * allowed object is {@link String }
-- *
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getDatasetId()
*/
-- public void setValue(String value)
-- {
-- this.value = value;
++ public void setDatasetId(String value) {
++ this.datasetId = value;
}
-- }
++
++ /**
++ * <p>Java class for anonymous complex type</p>.
++ *
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ *
++ * <pre>
++ * <complexType>
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <attribute name="key" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="value" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
++ *
++ *
++ */
++ @XmlAccessorType(XmlAccessType.FIELD)
++ @XmlType(name = "")
++ public static class SequenceSetProperties {
++
++ @XmlAttribute(name = "key")
++ protected String key;
++ @XmlAttribute(name = "value")
++ protected String value;
++
++ /**
++ * Gets the value of the key property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getKey() {
++ return key;
++ }
++
++ /**
++ * Sets the value of the key property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setKey(String value) {
++ this.key = value;
++ }
++
++ /**
++ * Gets the value of the value property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getValue() {
++ return value;
++ }
++
++ /**
++ * Sets the value of the value property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setValue(String value) {
++ this.value = value;
++ }
++
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for SequenceType complex type.
++ * <p>Java class for SequenceType complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="SequenceType"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="sequence"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="name" type="{http://www.w3.org/2001/XMLSchema}string"
-- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;attribute name="id"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt; &lt;attribute
-- * name="description" type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="SequenceType">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="sequence" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="name" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * </sequence>
++ * <attribute name="id" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * <attribute name="description" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "SequenceType", propOrder = { "sequence", "name" })
--@XmlSeeAlso({ Sequence.class })
--public class SequenceType
--{
--
-- protected String sequence;
--
-- protected String name;
--
-- @XmlAttribute(name = "id")
-- protected String id;
--
-- @XmlAttribute(name = "description")
-- protected String description;
--
-- /**
-- * Gets the value of the sequence property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getSequence()
-- {
-- return sequence;
-- }
--
-- /**
-- * Sets the value of the sequence property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setSequence(String value)
-- {
-- this.sequence = value;
-- }
--
-- /**
-- * Gets the value of the name property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getName()
-- {
-- return name;
-- }
--
-- /**
-- * Sets the value of the name property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setName(String value)
-- {
-- this.name = value;
-- }
--
-- /**
-- * Gets the value of the id property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getId()
-- {
-- return id;
-- }
--
-- /**
-- * Sets the value of the id property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setId(String value)
-- {
-- this.id = value;
-- }
--
-- /**
-- * Gets the value of the description property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDescription()
-- {
-- return description;
-- }
--
-- /**
-- * Sets the value of the description property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDescription(String value)
-- {
-- this.description = value;
-- }
++@XmlType(name = "SequenceType", propOrder = {
++ "sequence",
++ "name"
++})
++@XmlSeeAlso({
++ Sequence.class
++})
++public class SequenceType {
++
++ protected String sequence;
++ protected String name;
++ @XmlAttribute(name = "id")
++ protected String id;
++ @XmlAttribute(name = "description")
++ protected String description;
++
++ /**
++ * Gets the value of the sequence property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getSequence() {
++ return sequence;
++ }
++
++ /**
++ * Sets the value of the sequence property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setSequence(String value) {
++ this.sequence = value;
++ }
++
++ /**
++ * Gets the value of the name property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Sets the value of the name property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setName(String value) {
++ this.name = value;
++ }
++
++ /**
++ * Gets the value of the id property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getId() {
++ return id;
++ }
++
++ /**
++ * Sets the value of the id property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setId(String value) {
++ this.id = value;
++ }
++
++ /**
++ * Gets the value of the description property.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDescription() {
++ return description;
++ }
++
++ /**
++ * Sets the value of the description property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ */
++ public void setDescription(String value) {
++ this.description = value;
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for ThresholdType.
++ * Whether filter has a threshold, and if so is it
++ * above or below
++ *
++ * <p>Java class for ThresholdType</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class. <pre> &lt;simpleType
-- * name="ThresholdType"&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}string"&gt; &lt;enumeration
-- * value="NONE"/&gt; &lt;enumeration value="ABOVE"/&gt;
-- * &lt;enumeration value="BELOW"/&gt; &lt;/restriction&gt;
-- * &lt;/simpleType&gt; </pre>
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
++ * <pre>
++ * <simpleType name="ThresholdType">
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}string">
++ * <enumeration value="NONE"/>
++ * <enumeration value="ABOVE"/>
++ * <enumeration value="BELOW"/>
++ * </restriction>
++ * </simpleType>
++ * </pre>
*
*/
@XmlType(name = "ThresholdType", namespace = "www.jalview.org/colours")
@XmlEnum
--public enum ThresholdType
--{
++public enum ThresholdType {
-- NONE, ABOVE, BELOW;
++ NONE,
++ ABOVE,
++ BELOW;
-- public String value()
-- {
-- return name();
-- }
++ public String value() {
++ return name();
++ }
-- public static ThresholdType fromValue(String v)
-- {
-- return valueOf(v);
-- }
++ public static ThresholdType fromValue(String v) {
++ return valueOf(v);
++ }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for VAMSAS complex type.
++ * <p>Java class for VAMSAS complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="VAMSAS"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="Tree"
-- * type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded"
-- * minOccurs="0"/&gt; &lt;element
-- * ref="{www.vamsas.ac.uk/jalview/version2}SequenceSet" maxOccurs="unbounded"
-- * minOccurs="0"/&gt; &lt;/sequence&gt; &lt;/restriction&gt;
-- * &lt;/complexContent&gt; &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="VAMSAS">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="Tree" type="{http://www.w3.org/2001/XMLSchema}string" maxOccurs="unbounded" minOccurs="0"/>
++ * <element ref="{www.vamsas.ac.uk/jalview/version2}SequenceSet" maxOccurs="unbounded" minOccurs="0"/>
++ * </sequence>
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(name = "VAMSAS", propOrder = { "tree", "sequenceSet" })
--public class VAMSAS
--{
--
-- @XmlElement(name = "Tree")
-- protected List<String> tree;
++@XmlType(name = "VAMSAS", propOrder = {
++ "tree",
++ "sequenceSet"
++})
++public class VAMSAS {
-- @XmlElement(name = "SequenceSet")
-- protected List<SequenceSet> sequenceSet;
++ @XmlElement(name = "Tree")
++ protected List<String> tree;
++ @XmlElement(name = "SequenceSet")
++ protected List<SequenceSet> sequenceSet;
-- /**
-- * Gets the value of the tree property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the tree property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getTree().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link String }
-- *
-- *
-- */
-- public List<String> getTree()
-- {
-- if (tree == null)
-- {
-- tree = new ArrayList<String>();
++ /**
++ * Gets the value of the tree property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the tree property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getTree().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the tree property.
++ */
++ public List<String> getTree() {
++ if (tree == null) {
++ tree = new ArrayList<String>();
++ }
++ return this.tree;
}
-- return this.tree;
-- }
-- /**
-- * Gets the value of the sequenceSet property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the sequenceSet property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getSequenceSet().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link SequenceSet }
-- *
-- *
-- */
-- public List<SequenceSet> getSequenceSet()
-- {
-- if (sequenceSet == null)
-- {
-- sequenceSet = new ArrayList<SequenceSet>();
++ /**
++ * Gets the value of the sequenceSet property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the sequenceSet property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getSequenceSet().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link SequenceSet }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the sequenceSet property.
++ */
++ public List<SequenceSet> getSequenceSet() {
++ if (sequenceSet == null) {
++ sequenceSet = new ArrayList<SequenceSet>();
++ }
++ return this.sequenceSet;
}
-- return this.sequenceSet;
-- }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
++
package jalview.xml.binding.jalview;
import java.util.ArrayList;
import javax.xml.bind.annotation.XmlSeeAlso;
import javax.xml.bind.annotation.XmlType;
++
/**
-- * <p>Java class for WebServiceParameterSet complex type.
++ * <p>Java class for WebServiceParameterSet complex type</p>.
*
-- * <p>The following schema fragment specifies the expected content
-- * contained within this class.
++ * <p>The following schema fragment specifies the expected content contained within this class.</p>
*
-- * <pre> &lt;complexType name="WebServiceParameterSet"&gt;
-- * &lt;complexContent&gt; &lt;restriction
-- * base="{http://www.w3.org/2001/XMLSchema}anyType"&gt;
-- * &lt;sequence&gt; &lt;element name="Version"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="description"
-- * type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/&gt;
-- * &lt;element name="serviceURL"
-- * type="{http://www.w3.org/2001/XMLSchema}anyURI"
-- * maxOccurs="unbounded"/&gt; &lt;element name="parameters"
-- * type="{http://www.w3.org/2001/XMLSchema}string"/&gt;
-- * &lt;/sequence&gt; &lt;attribute name="name" use="required"
-- * type="{http://www.w3.org/2001/XMLSchema}string" /&gt;
-- * &lt;/restriction&gt; &lt;/complexContent&gt;
-- * &lt;/complexType&gt; </pre>
++ * <pre>
++ * <complexType name="WebServiceParameterSet">
++ * <complexContent>
++ * <restriction base="{http://www.w3.org/2001/XMLSchema}anyType">
++ * <sequence>
++ * <element name="Version" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="description" type="{http://www.w3.org/2001/XMLSchema}string" minOccurs="0"/>
++ * <element name="serviceURL" type="{http://www.w3.org/2001/XMLSchema}anyURI" maxOccurs="unbounded"/>
++ * <element name="parameters" type="{http://www.w3.org/2001/XMLSchema}string"/>
++ * </sequence>
++ * <attribute name="name" use="required" type="{http://www.w3.org/2001/XMLSchema}string" />
++ * </restriction>
++ * </complexContent>
++ * </complexType>
++ * </pre>
*
*
*/
@XmlAccessorType(XmlAccessType.FIELD)
--@XmlType(
-- name = "WebServiceParameterSet",
-- namespace = "www.jalview.org/xml/wsparamset",
-- propOrder =
-- { "version", "description", "serviceURL", "parameters" })
++@XmlType(name = "WebServiceParameterSet", namespace = "www.jalview.org/xml/wsparamset", propOrder = {
++ "version",
++ "description",
++ "serviceURL",
++ "parameters"
++})
@XmlSeeAlso({
-- jalview.xml.binding.jalview.JalviewModel.Viewport.CalcIdParam.class })
--public class WebServiceParameterSet
--{
--
-- @XmlElement(name = "Version", namespace = "")
-- protected String version;
--
-- @XmlElement(namespace = "")
-- protected String description;
--
-- @XmlElement(namespace = "", required = true)
-- @XmlSchemaType(name = "anyURI")
-- protected List<String> serviceURL;
--
-- @XmlElement(namespace = "", required = true)
-- protected String parameters;
--
-- @XmlAttribute(name = "name", required = true)
-- protected String name;
--
-- /**
-- * Gets the value of the version property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getVersion()
-- {
-- return version;
-- }
--
-- /**
-- * Sets the value of the version property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setVersion(String value)
-- {
-- this.version = value;
-- }
--
-- /**
-- * Gets the value of the description property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getDescription()
-- {
-- return description;
-- }
--
-- /**
-- * Sets the value of the description property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setDescription(String value)
-- {
-- this.description = value;
-- }
--
-- /**
-- * Gets the value of the serviceURL property.
-- *
-- * <p> This accessor method returns a reference to the live list, not a
-- * snapshot. Therefore any modification you make to the returned list will be
-- * present inside the JAXB object. This is why there is not a
-- * <CODE>set</CODE> method for the serviceURL property.
-- *
-- * <p> For example, to add a new item, do as follows: <pre>
-- * getServiceURL().add(newItem); </pre>
-- *
-- *
-- * <p> Objects of the following type(s) are allowed in the list
-- * {@link String }
-- *
-- *
-- */
-- public List<String> getServiceURL()
-- {
-- if (serviceURL == null)
-- {
-- serviceURL = new ArrayList<String>();
++ jalview.xml.binding.jalview.JalviewModel.Viewport.CalcIdParam.class
++})
++public class WebServiceParameterSet {
++
++ /**
++ * A Jalview Web Service Parameter Set container
++ * version number.
++ * Version 1 created for storing Jaba user presets.
++ *
++ */
++ @XmlElement(name = "Version", namespace = "")
++ protected String version;
++ /**
++ * Short description - as utf8 encoded text. This is
++ * usually displayed
++ * in the body of an HTML capable tooltip, so HTML tags may be embedded
++ * using standard UTF8 encoding.
++ *
++ */
++ @XmlElement(namespace = "")
++ protected String description;
++ /**
++ * URL for which the parameter set is valid. Jalview will use it to
++ * match up parameter sets to service instances that can parse the
++ * parameter set payload.
++ *
++ */
++ @XmlElement(namespace = "", required = true)
++ @XmlSchemaType(name = "anyURI")
++ protected List<String> serviceURL;
++ /**
++ * UTF8 encoded string to be processed into a specific web services'
++ * parameter set. Note - newlines may be important to the structure
++ * of this file.
++ *
++ */
++ @XmlElement(namespace = "", required = true)
++ protected String parameters;
++ /**
++ * The short name for the parameter set. This will be shown amongst the
++ * other presets for the web service.
++ *
++ */
++ @XmlAttribute(name = "name", required = true)
++ protected String name;
++
++ /**
++ * A Jalview Web Service Parameter Set container
++ * version number.
++ * Version 1 created for storing Jaba user presets.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getVersion() {
++ return version;
++ }
++
++ /**
++ * Sets the value of the version property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getVersion()
++ */
++ public void setVersion(String value) {
++ this.version = value;
++ }
++
++ /**
++ * Short description - as utf8 encoded text. This is
++ * usually displayed
++ * in the body of an HTML capable tooltip, so HTML tags may be embedded
++ * using standard UTF8 encoding.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getDescription() {
++ return description;
++ }
++
++ /**
++ * Sets the value of the description property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getDescription()
++ */
++ public void setDescription(String value) {
++ this.description = value;
++ }
++
++ /**
++ * URL for which the parameter set is valid. Jalview will use it to
++ * match up parameter sets to service instances that can parse the
++ * parameter set payload.
++ *
++ * Gets the value of the serviceURL property.
++ *
++ * <p>This accessor method returns a reference to the live list,
++ * not a snapshot. Therefore any modification you make to the
++ * returned list will be present inside the JAXB object.
++ * This is why there is not a <CODE>set</CODE> method for the serviceURL property.</p>
++ *
++ * <p>
++ * For example, to add a new item, do as follows:
++ * </p>
++ * <pre>
++ * getServiceURL().add(newItem);
++ * </pre>
++ *
++ *
++ * <p>
++ * Objects of the following type(s) are allowed in the list
++ * {@link String }
++ * </p>
++ *
++ *
++ * @return
++ * The value of the serviceURL property.
++ */
++ public List<String> getServiceURL() {
++ if (serviceURL == null) {
++ serviceURL = new ArrayList<String>();
++ }
++ return this.serviceURL;
++ }
++
++ /**
++ * UTF8 encoded string to be processed into a specific web services'
++ * parameter set. Note - newlines may be important to the structure
++ * of this file.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getParameters() {
++ return parameters;
++ }
++
++ /**
++ * Sets the value of the parameters property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getParameters()
++ */
++ public void setParameters(String value) {
++ this.parameters = value;
++ }
++
++ /**
++ * The short name for the parameter set. This will be shown amongst the
++ * other presets for the web service.
++ *
++ * @return
++ * possible object is
++ * {@link String }
++ *
++ */
++ public String getName() {
++ return name;
++ }
++
++ /**
++ * Sets the value of the name property.
++ *
++ * @param value
++ * allowed object is
++ * {@link String }
++ *
++ * @see #getName()
++ */
++ public void setName(String value) {
++ this.name = value;
}
-- return this.serviceURL;
-- }
--
-- /**
-- * Gets the value of the parameters property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getParameters()
-- {
-- return parameters;
-- }
--
-- /**
-- * Sets the value of the parameters property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setParameters(String value)
-- {
-- this.parameters = value;
-- }
--
-- /**
-- * Gets the value of the name property.
-- *
-- * @return possible object is {@link String }
-- *
-- */
-- public String getName()
-- {
-- return name;
-- }
--
-- /**
-- * Sets the value of the name property.
-- *
-- * @param value
-- * allowed object is {@link String }
-- *
-- */
-- public void setName(String value)
-- {
-- this.name = value;
-- }
}
//
--// This file was generated by the Eclipse Implementation of JAXB, v2.3.3
++// This file was generated by the Eclipse Implementation of JAXB, v2.3.9
// See https://eclipse-ee4j.github.io/jaxb-ri
// Any modifications to this file will be lost upon recompilation of the source schema.
- // Generated on: 2021.08.30 at 11:05:22 AM BST
-// Generated on: 2023.11.01 at 07:03:09 PM GMT
++// Generated on: 2024.12.16 at 06:28:12 PM GMT
//
--@javax.xml.bind.annotation.XmlSchema(
-- namespace = "www.vamsas.ac.uk/jalview/version2",
-- elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
++@javax.xml.bind.annotation.XmlSchema(namespace = "www.vamsas.ac.uk/jalview/version2", elementFormDefault = javax.xml.bind.annotation.XmlNsForm.QUALIFIED)
package jalview.xml.binding.jalview;
import jalview.gui.JvOptionPane;
import java.io.PrintStream;
-import java.nio.charset.Charset;
+ import java.util.Locale;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.BeforeMethod;
// since it works.
// https://issues.jalview.org/browse/JAL-1889?focusedCommentId=21609&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-21609
String workingDir = "test/jalview/bin/";
- return new Object[][] { { "nodisplay -open examples/uniref50.fa",
- " -eps", workingDir + "test_uniref50_out.eps", true,
- MINFILESIZE_BIG, TEST_TIMEOUT, null },
+ return new Object[][] {
+ //
+ { "nodisplay -open examples/uniref50.fa", " -eps",
+ workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG,
- TEST_TIMEOUT },
++ TEST_TIMEOUT, null },
{ "nodisplay -open examples/uniref50.fa", " -eps",
- workingDir + "test_uniref50_out.eps", false, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ workingDir + "test_uniref50_out.eps", false,
+ MINFILESIZE_BIG, TEST_TIMEOUT, null },
{ "nogui -open examples/uniref50.fa", " -eps",
workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, null },
{ "nogui -open examples/uniref50.fa", " -eps",
- workingDir + "test_uniref50_out.eps", false, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ workingDir + "test_uniref50_out.eps", false,
+ MINFILESIZE_BIG, TEST_TIMEOUT, null },
{ "headless -open examples/uniref50.fa", " -eps",
workingDir + "test_uniref50_out.eps", true, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, null },
{ "headless -open examples/uniref50.fa", " -svg",
- workingDir + "test_uniref50_out.svg", false, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ workingDir + "test_uniref50_out.svg", false,
+ MINFILESIZE_BIG, TEST_TIMEOUT, null },
{ "headless -open examples/uniref50.fa", " -png",
workingDir + "test_uniref50_out.png", true, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, null },
{ "headless -open examples/uniref50.fa", " -html",
- workingDir + "test_uniref50_out.html", true, MINFILESIZE_BIG,
- TEST_TIMEOUT },
+ workingDir + "test_uniref50_out.html", true,
+ MINFILESIZE_BIG, TEST_TIMEOUT, null },
{ "headless -open examples/uniref50.fa", " -fasta",
workingDir + "test_uniref50_out.mfa", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.Fasta.toString() },
{ "headless -open examples/uniref50.fa", " -clustal",
workingDir + "test_uniref50_out.aln", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.Clustal.toString() },
{ "headless -open examples/uniref50.fa", " -msf",
workingDir + "test_uniref50_out.msf", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.MSF.toString() },
{ "headless -open examples/uniref50.fa", " -pileup",
workingDir + "test_uniref50_out.aln", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.Pileup.toString() },
{ "headless -open examples/uniref50.fa", " -pir",
workingDir + "test_uniref50_out.pir", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.PIR.toString() },
{ "headless -open examples/uniref50.fa", " -pfam",
workingDir + "test_uniref50_out.pfam", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.Pfam.toString() },
{ "headless -open examples/uniref50.fa", " -blc",
workingDir + "test_uniref50_out.blc", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT },
+ TEST_TIMEOUT, FileFormat.BLC.toString() },
{ "headless -open examples/uniref50.fa", " -jalview",
workingDir + "test_uniref50_out.jvp", true, MINFILESIZE_SMALL,
- TEST_TIMEOUT, FileFormat.Jalview.toString() }, };
- TEST_TIMEOUT },
++ TEST_TIMEOUT, FileFormat.Jalview.toString() },
+ //
+ };
}
}
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.bin;
+
+ import java.util.Date;
+ import java.util.List;
+
+ import org.testng.Assert;
+ import org.testng.annotations.AfterClass;
+ import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+
+ import jalview.api.AlignViewportI;
+ import jalview.datamodel.AlignmentAnnotation;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.SequenceI;
+ import jalview.gui.AlignFrame;
+ import jalview.gui.AlignmentPanel;
+ import jalview.gui.Desktop;
+ import jalview.gui.JvOptionPane;
+ import jalview.gui.StructureViewerBase;
+
+ @Test
+ public class CommandsTest2
+ {
+ @BeforeClass(alwaysRun = true)
+ public static void setUpBeforeClass() throws Exception
+ {
+ Cache.loadProperties("test/jalview/bin/commandsTest.jvprops");
+ Date oneHourFromNow = new Date(
+ System.currentTimeMillis() + 3600 * 1000);
+ Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ }
+
+ @AfterClass(alwaysRun = true)
+ public static void resetProps()
+ {
+ Cache.loadProperties("test/jalview/testProps.jvprops");
+ }
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
+ Desktop.closeDesktop();
+ }
+
+ @Test(
+ groups =
+ { "Functional", "testTask1" },
+ dataProvider = "structureOpeningArgsParams",
+ singleThreaded = true)
+ public void structureOpeningArgsTest(String cmdLine, int seqNum,
+ int annNum, int viewerNum)
+ {
+ String[] args = cmdLine.split("\\s+");
+
+ CommandsTest.callJalviewMain(args);
- while (Desktop.instance != null
- && Desktop.instance.operationsAreInProgress())
++ while (Desktop.getInstance() != null
++ && Desktop.getInstance().operationsAreInProgress())
+ {
+ try
+ {
+ // sleep for slow build server to open annotations and viewer windows
+ Thread.sleep(viewerNum * 50);
+ } catch (InterruptedException e)
+ {
+ e.printStackTrace();
+ }
+ }
+ ;
+
+ AlignFrame[] afs = Desktop.getDesktopAlignFrames();
+ Assert.assertNotNull(afs);
+ Assert.assertTrue(afs.length > 0);
+
+ AlignFrame af = afs[0];
+ Assert.assertNotNull(af);
+
+ AlignmentPanel ap = af.alignPanel;
+ Assert.assertNotNull(ap);
+
+ AlignmentI al = ap.getAlignment();
+ Assert.assertNotNull(al);
+
+ List<SequenceI> seqs = al.getSequences();
+ Assert.assertNotNull(seqs);
+
+ Assert.assertEquals(seqs.size(), seqNum, "Wrong number of sequences");
+
+ AlignViewportI av = ap.getAlignViewport();
+ Assert.assertNotNull(av);
+
+ AlignmentAnnotation[] aas = al.getAlignmentAnnotation();
+ int visibleAnn = 0;
+ int dcount = 0;
+ for (AlignmentAnnotation aa : aas)
+ {
+ if (aa.visible)
+ visibleAnn++;
+ }
+
+ Assert.assertEquals(visibleAnn, annNum,
+ "Wrong number of visible annotations");
+
+ if (viewerNum > -1)
+ {
- List<StructureViewerBase> openViewers = Desktop.instance
++ List<StructureViewerBase> openViewers = Desktop.getInstance()
+ .getStructureViewers(ap, null);
+ Assert.assertNotNull(openViewers);
+ int count = 0;
+ for (StructureViewerBase svb : openViewers)
+ {
+ if (svb.isVisible())
+ count++;
+ }
+ Assert.assertEquals(count, viewerNum,
+ "Wrong number of structure viewers opened");
+ }
+ }
+
+ @DataProvider(name = "structureOpeningArgsParams")
+ public Object[][] structureOpeningArgsParams()
+ {
+ /*
+ String cmdLine,
+ int seqNum,
+ int annNum,
+ int structureViewerNum,
+ */
+ return new Object[][] {
+ //
+ /*
+ */
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
+ 15, 7, 1 },
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--props=test/jalview/bin/commandsTest2.jvprops2 ",
+ 15, 4, 1 },
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--noshowssannotations "
+ + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
+ 15, 4, 1 },
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--noshowannotations "
+ + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
+ 15, 3, 1 },
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--noshowannotations " + "--noshowssannotations "
+ + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
+ 15, 0, 1 },
+ { "--gui --nonews --nosplash --debug "
+ + "--append=examples/uniref50.fa "
+ + "--colour=gecos-flower "
+ + "--structure=[seqid=FER1_SPIOL]examples/AlphaFold/AF-P00221-F1-model_v4.cif "
+ + "--paematrix=examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json "
+ + "--noshowannotations " + "--noshowssannotations "
+ + "--props=test/jalview/bin/commandsTest2.jvprops1 ",
+ 15, 0, 1 },
+ { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile1 ",
+ 16, 19, 3 },
+ { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --argfile=test/jalview/bin/commandsTest2.argfile2 ",
+ 16, 0, 2 },
+ { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+ + "--allstructures "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+ + "--structureviewer=none "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_2_model_4.pdb "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_3_model_2.pdb",
+ 16, 10, 0 },
+ { "--gui --nonews --nosplash --debug --nowebservicediscovery --props=test/jalview/bin/commandsTest.jvprops --open=./examples/test_fab41.result/sample.a2m "
+ + "--allstructures "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb "
+ + "--noallstructures " + "--structureviewer=none "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_2_model_4.pdb "
+ + "--structure=./examples/test_fab41.result/test_fab41_unrelaxed_rank_3_model_2.pdb",
+ 16, 10, 2 },
+ /*
+ */
+ //
+ };
+ }
+ }
@AfterClass(alwaysRun = true)
public void tearDown()
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" })
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.bin.argparser;
+
+ import java.io.File;
+ import java.io.IOException;
+ import java.util.ArrayList;
+ import java.util.Arrays;
+ import java.util.HashSet;
+ import java.util.List;
+ import java.util.Properties;
+
+ import org.apache.logging.log4j.util.Strings;
+ import org.testng.Assert;
+ import org.testng.annotations.AfterClass;
+ import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+
+ import jalview.bin.Cache;
+ import jalview.bin.Console;
+ import jalview.gui.Desktop;
+
+ @Test(singleThreaded = true)
+ public class ArgParserTest
+ {
+ @AfterClass(alwaysRun = true)
+ public static void resetProps()
+ {
+ Cache.loadProperties("test/jalview/testProps.jvprops");
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
+
+ @Test(groups = "Functional", dataProvider = "argLines")
+ public void parseArgsTest(String commandLineArgs, Arg a, String other)
+ {
+ String[] args = commandLineArgs.split("\\s+");
+ ArgParser argparser = new ArgParser(args);
+ }
+
+ @Test(groups = "Functional", dataProvider = "argSubValsAndLinkedIds")
+ public void parseSubValsAndLinkedIdsTest(String commandLineArgs,
+ String linkedId, Arg a, String subvalKey, String value,
+ boolean trueOrFalse)
+ {
+ String[] args = commandLineArgs.split("\\s+");
+ ArgParser argparser = new ArgParser(args);
+ ArgValuesMap avm = argparser.getLinkedArgs(linkedId);
+ ArgValue av = avm.getArgValue(a);
+ SubVals sv = av.getSubVals();
+ String testString = null;
+ if (subvalKey.equals("GETINDEX"))
+ {
+ testString = String.valueOf(sv.getIndex());
+ }
+ else
+ {
+ testString = sv.get(subvalKey);
+ }
+ if (trueOrFalse)
+ {
+ Assert.assertEquals(testString, value);
+ }
+ else
+ {
+ Assert.assertNotEquals(testString, value);
+ }
+ }
+
+ @Test(
+ groups = "Functional",
+ dataProvider = "argAutoIndexAndSubstitutions")
+ public void parseAutoIndexAndSubstitutionsTest(String commandLineArgs,
+ String linkedId, Arg a, String filename)
+ {
+ // { "--append=filename0 --new --append=filename1", "JALVIEW:1",
+ // Arg.OPEN, "filename1" },
+ String[] args = commandLineArgs.split("\\s+");
+ ArgParser argparser = new ArgParser(args);
+ ArgValuesMap avm = argparser.getLinkedArgs(linkedId);
+ ArgValue av = avm.getArgValue(a);
+ Assert.assertEquals(av.getValue(), filename);
+ }
+
+ @Test(groups = "Functional", dataProvider = "argLines")
+ public void bootstrapArgsTest(String commandLineArgs, Arg a, String other)
+ {
+ String[] args = commandLineArgs.split("\\s+");
+ BootstrapArgs b = BootstrapArgs.getBootstrapArgs(args);
+
+ Assert.assertTrue(b.contains(a));
+ if (a == Arg.PROPS)
+ {
+ Properties bP = Cache.bootstrapProperties(b.getValue(Arg.PROPS));
+ Assert.assertNotNull(bP);
+ Assert.assertTrue(other.equals(bP.get(Cache.BOOTSTRAP_TEST)));
+ Assert.assertFalse(bP.contains("NOT" + Cache.BOOTSTRAP_TEST));
+ }
+ else if (a == Arg.ARGFILE)
+ {
+ List<String> filenames = b.getValueList(a);
+ boolean found = false;
+ for (String s : filenames)
+ {
+ File f = new File(s);
+ File fo = new File(other);
+ try
+ {
+ if (fo.getCanonicalPath().equals(f.getCanonicalPath()))
+ {
+ found = true;
+ break;
+ }
+ } catch (IOException e)
+ {
+ }
+ }
+ Assert.assertTrue(found,
+ "File '" + other + "' not found in shell expanded glob '"
+ + commandLineArgs + "'");
+ }
+ }
+
+ @Test(groups = "Functional", dataProvider = "argFiles")
+ public void argFilesTest(String commandLineArgs, Arg a, String other)
+ {
+ String[] args = commandLineArgs.split("\\s+");
+ BootstrapArgs b = BootstrapArgs.getBootstrapArgs(args);
+
+ Assert.assertTrue(b.contains(a));
+ Assert.assertFalse(b.contains(Arg.APPEND));
+ if (a == Arg.PROPS)
+ {
+ Properties bP = Cache.bootstrapProperties(b.getValue(Arg.PROPS));
+ Assert.assertTrue("true".equals(bP.get(Cache.BOOTSTRAP_TEST)));
+ }
+ }
+
+ @DataProvider(name = "argLinesNotworking")
+ public Object[][] argLinesTest()
+ {
+ return new Object[][] {
+ // can't use this one yet as it doesn't get shell glob expanded by the
+ // test
+ { "--argfile test/jalview/bin/argparser/testfiles/argfile*.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile0.txt" }, };
+ }
+
+ @DataProvider(name = "argLines")
+ public Object[][] argLines()
+ {
+ return new Object[][] { {
+ "--append=test/jalview/bin/argparser/testfiles/test1.fa --props=test/jalview/bin/argparser/testfiles/testProps.jvprops",
+ Arg.PROPS, "true" },
+ { "--debug --append=test/jalview/bin/argparser/testfiles/test1.fa",
+ Arg.DEBUG, null },
+ { "--append=test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ Arg.HEADLESS, null },
+
+ { "--argfile test/jalview/bin/argparser/testfiles/argfile0.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile0.txt" },
+ // these next three are what a shell glob expansion would look like
+ { "--argfile test/jalview/bin/argparser/testfiles/argfile0.txt test/jalview/bin/argparser/testfiles/argfile1.txt test/jalview/bin/argparser/testfiles/argfile2.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile0.txt" },
+ { "--argfile test/jalview/bin/argparser/testfiles/argfile0.txt test/jalview/bin/argparser/testfiles/argfile1.txt test/jalview/bin/argparser/testfiles/argfile2.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile1.txt" },
+ { "--argfile test/jalview/bin/argparser/testfiles/argfile0.txt test/jalview/bin/argparser/testfiles/argfile1.txt test/jalview/bin/argparser/testfiles/argfile2.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile2.txt" },
+ { "--argfile=test/jalview/bin/argparser/testfiles/argfile*.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile0.txt" },
+ { "--argfile=test/jalview/bin/argparser/testfiles/argfile*.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile1.txt" },
+ { "--argfile=test/jalview/bin/argparser/testfiles/argfile*.txt",
+ Arg.ARGFILE,
+ "test/jalview/bin/argparser/testfiles/argfile2.txt" } };
+ }
+
+ @DataProvider(name = "argSubValsAndLinkedIds")
+ public Object[][] argSubValsAndLinkedIds()
+ {
+ return new Object[][] {
+ //
+ /*
+ */
+ { "--debug --append=[hi]test/jalview/bin/argparser/testfiles/test1.fa",
+ "JALVIEW:0", Arg.APPEND, "hi", "true", true },
+ { "--append[linkedId1]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId1", Arg.APPEND, "new", "true", true },
+ { "--append[linkedId2]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId2", Arg.APPEND, "hello", "world", true },
+ { "--append[linkedId3]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId3", Arg.APPEND, "GETINDEX", "1", true },
+ { "--append[linkedId4]=[new,hello=world,1]test/jalview/bin/argparser/testfiles/test1.fa --append[linkedId5]=[notnew;hello=world;1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId5", Arg.APPEND, "new", "true", false },
+ { "--append[linkedId5]=[new,hello=worlddomination,1]test/jalview/bin/argparser/testfiles/test1.fa --append[linkedId2]=[new;hello=world;1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId5", Arg.APPEND, "hello", "world", false },
+ { "--append[linkedId6]=[new,hello=world,0]test/jalview/bin/argparser/testfiles/test1.fa --append[linkedId7]=[new;hello=world;1]test/jalview/bin/argparser/testfiles/test1.fa --headless",
+ "linkedId7", Arg.APPEND, "GETINDEX", "0", false },
+ /*
+ */
+ //
+ };
+ }
+
+ @DataProvider(name = "argAutoIndexAndSubstitutions")
+ public Object[][] argAutoIndexAndSubstitutions()
+ {
+ return new Object[][] {
+ //
+ /*
+ */
+ { "--append=filename0 --append=filename1", "JALVIEW:0", Arg.APPEND,
+ "filename0" },
+ { "--append=filename0 --new --append=filename1", "JALVIEW:1",
+ Arg.APPEND, "filename1" },
+ { "--append=filename0 --new --new --append=filename2", "JALVIEW:0",
+ Arg.APPEND, "filename0" },
+ { "--append=filename0 --new --new --append=filename2", "JALVIEW:2",
+ Arg.APPEND, "filename2" },
+ { "--append[linkA-{n}]=filenameA0 --append[linkA-{++n}]=filenameA1",
+ "linkA-0", Arg.APPEND, "filenameA0" },
+ { "--append[linkB-{n}]=filenameB0 --append[linkB-{++n}]=filenameB1",
+ "linkB-1", Arg.APPEND, "filenameB1" },
+ { "--append[linkC-{n}]=filenameC0 --image[linkC-{n}]=outputC{n}.txt",
+ "linkC-0", Arg.IMAGE, "outputC{n}.txt" },
+ { "--append[linkD-{n}]=filenameD0 --substitutions --image[linkD-{n}]=outputD{n}.txt",
+ "linkD-0", Arg.IMAGE, "outputD0.txt" },
+ { "--append[linkE-{n}]=filenameE0 --substitutions --image[linkE-{n}]=output-E{n}.txt --nil[{++n}] --image[linkE-{n}]=outputE{n}.txt",
+ "linkE-0", Arg.IMAGE, "output-E0.txt" },
+ { "--append[linkF-{n}]=filenameF0 --substitutions --image[linkF-{n}]=output-F{n}.txt --nil[{++n}] --image[linkF-{n}]=outputF{n}.txt",
+ "linkF-1", Arg.IMAGE, "outputF1.txt" },
+ { "--append[linkG-{n}]=filenameG0 --substitutions --image[linkG-{n}]=output-G{n}.txt --nil[{++n}] --nosubstitutions --image[linkG-{n}]=outputG{n}.txt",
+ "linkG-1", Arg.IMAGE, "outputG{n}.txt" },
+ { "--append[linkH-{n}]=filenameH0 --substitutions --image[linkH-{n}]=output-H{n}.txt --nil[{++n}] --nosubstitutions --image[linkH-{n}]=outputH{n}.txt",
+ "linkH-0", Arg.IMAGE, "output-H0.txt" },
+ { "--open=filename0 --append=filename1", "JALVIEW:0", Arg.OPEN,
+ "filename0" },
+ { "--open=filename0 --new --append=filename1", "JALVIEW:1",
+ Arg.APPEND, "filename1" },
+ { "--open=filename0 --new --new --append=filename2", "JALVIEW:0",
+ Arg.OPEN, "filename0" },
+ { "--open=filename0 --new --new --append=filename2", "JALVIEW:2",
+ Arg.APPEND, "filename2" },
+ { "--open[linkA-{n}]=filenameA0 --append[linkA-{++n}]=filenameA1",
+ "linkA-0", Arg.OPEN, "filenameA0" },
+ { "--open[linkB-{n}]=filenameB0 --append[linkB-{++n}]=filenameB1",
+ "linkB-1", Arg.APPEND, "filenameB1" },
+ { "--open[linkC-{n}]=filenameC0 --image[linkC-{n}]=outputC{n}.txt",
+ "linkC-0", Arg.IMAGE, "outputC{n}.txt" },
+ { "--open[linkD-{n}]=filenameD0 --substitutions --image[linkD-{n}]=outputD{n}.txt",
+ "linkD-0", Arg.IMAGE, "outputD0.txt" },
+ { "--open[linkE-{n}]=filenameE0 --substitutions --image[linkE-{n}]=output-E{n}.txt --nil[{++n}] --image[linkE-{n}]=outputE{n}.txt",
+ "linkE-0", Arg.IMAGE, "output-E0.txt" },
+ { "--open[linkF-{n}]=filenameF0 --substitutions --image[linkF-{n}]=output-F{n}.txt --nil[{++n}] --image[linkF-{n}]=outputF{n}.txt",
+ "linkF-1", Arg.IMAGE, "outputF1.txt" },
+ { "--open[linkG-{n}]=filenameG0 --substitutions --image[linkG-{n}]=output-G{n}.txt --nil[{++n}] --nosubstitutions --image[linkG-{n}]=outputG{n}.txt",
+ "linkG-1", Arg.IMAGE, "outputG{n}.txt" },
+ { "--open[linkH-{n}]=filenameH0 --substitutions --image[linkH-{n}]=output-H{n}.txt --nil[{++n}] --nosubstitutions --image[linkH-{n}]=outputH{n}.txt",
+ "linkH-0", Arg.IMAGE, "output-H0.txt" },
+ /*
+ */
+
+ //
+ };
+ }
+
+ @DataProvider(name = "argFiles")
+ public Object[][] argFiles()
+ {
+ return new Object[][] { {
+ "--argfile=test/jalview/bin/argparser/testfiles/argfile0.txt --open=shouldntbeabootstrap",
+ Arg.ARGFILE, "test/jalview/bin/argfiles/testfiles/test1.fa" } };
+ }
+
+ @Test(groups = "Functional", dataProvider = "allLinkedIdsData")
+ public void allLinkedIdsTest(String pwd, String commandLineArgs, Arg a,
+ String[] values, String[] nonvalues)
+ {
+ String userDir = System.getProperty("user.dir");
+ if (pwd != null)
+ {
+ File pwdFile = new File(pwd);
+ System.setProperty("user.dir", pwdFile.getAbsolutePath());
+ }
+ String[] args = commandLineArgs.split("\\s+");
+ ArgParser argparser = new ArgParser(args);
+
+ int num = values.length;
+ List<String> linkedIds = argparser.getLinkedIds();
+ Assert.assertEquals(linkedIds.size(), num,
+ "Wrong number of linkedIds: " + linkedIds.toString());
+ for (int i = 0; i < num; i++)
+ {
+ String value = values[i];
+ String linkedId = linkedIds.get(i);
+ ArgValuesMap avm = argparser.getLinkedArgs(linkedId);
+ if (value == null)
+ {
+ Assert.assertTrue(avm.containsArg(a),
+ "Arg value for " + a.argString()
+ + " not applied correctly to linkedId '" + linkedId
+ + "'");
+ }
+ else
+ {
+ ArgValues avs = avm.getArgValues(a);
+ ArgValue av = avs.getArgValue();
+ String v = av.getValue();
+ value = new File(value).getPath();
+ Assert.assertEquals(v, value, "Arg value for " + a.argString()
+ + " not applied correctly to linkedId '" + linkedId + "'");
+ }
+ }
+
+ System.setProperty("user.dir", userDir);
+ }
+
+ @DataProvider(name = "allLinkedIdsData")
+ public Object[][] allLinkedIdsData()
+ {
+ return new Object[][] {
+ //
+ /*
+ */
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
+ Arg.CLOSE, new String[]
+ { null, null, null },
+ null },
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --output={dirname}/{basename}.stk --close",
+ Arg.OUTPUT, new String[]
+ { "test/jalview/bin/argparser/testfiles/test1.stk",
+ "test/jalview/bin/argparser/testfiles/test2.stk",
+ "test/jalview/bin/argparser/testfiles/test3.stk", },
+ null },
+ { null,
+ "--open=test/jalview/bin/argparser/testfiles/*.fa --substitutions --all --image={dirname}/{basename}.png --close",
+ Arg.IMAGE, new String[]
+ { "test/jalview/bin/argparser/testfiles/test1.png",
+ "test/jalview/bin/argparser/testfiles/test2.png",
+ "test/jalview/bin/argparser/testfiles/test3.png", },
+ null },
+ /*
+ * Find a way to change pwd reliably -- need to match "*.fa" against some files!
+ { "test/jalview/bin/argparser/testfiles",
+
+ "--open=*.fa --image={dirname}/{basename}.png --close",
+ Arg.IMAGE, new String[]
+ { "./test1.png", "./test2.png", "./test3.png", }, null },
+ */
+ //
+ };
+ }
+
+ @Test(groups = "Functional", dataProvider = "bootstrapArgsData")
+ public void bootstrapArgsValuesAndHeadlessModeTest(String commandLineArgs,
+ Arg a, String valS, boolean valB, boolean headlessValue)
+ {
+ String[] args = commandLineArgs.split("\\s+");
+ BootstrapArgs bsa = BootstrapArgs.getBootstrapArgs(args);
+ if (a != null)
+ {
+ if (valS != null)
+ {
+ Assert.assertEquals(bsa.getValue(a), valS,
+ "BootstrapArg " + a.argString()
+ + " value does not match expected '" + valS + "'");
+ }
+ else
+ {
+ Assert.assertEquals(bsa.getBoolean(a), valB,
+ "Boolean/Unary value of BootstrapArg " + a.argString()
+ + "' is not the expected '" + valB + "'");
+ }
+ }
+
+ boolean isHeadless = bsa.isHeadless();
+ Assert.assertEquals(isHeadless, headlessValue,
+ "Assumed headless setting '" + isHeadless + "' is wrong.");
+ }
+
+ @DataProvider(name = "bootstrapArgsData")
+ public Object[][] bootstrapArgsData()
+ {
+ return new Object[][] {
+ /*
+ * cmdline args
+ * Arg (null if only testing headless)
+ * String value if there is one (null otherwise)
+ * boolean value if String value is null
+ * expected value of isHeadless()
+ */
+ /*
+ */
+ { "--open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.JABAWS, "https://forwardsandbackwards.com/", false, true },
+ { "--help-all --open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.HELP, null, true, true },
+ { "--help-all --nonews --open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.NEWS, null, false, true },
+ { "--help --nonews --open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.NEWS, null, false, true },
+ { "--help-opening --nonews --open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.NEWS, null, false, true },
+ { "--nonews --open thisway.fa --output thatway.fa --jabaws https://forwardsandbackwards.com/",
+ Arg.NEWS, null, false, true },
+ { "--open thisway.fa --image thatway.png", null, null, false,
+ true },
+ { "--open thisway.fa --output thatway.png", null, null, false,
+ true },
+ { "--open thisway.fa --image thatway.png --noheadless", null, null,
+ false, false },
+ { "--open thisway.fa --output thatway.png --noheadless", null, null,
+ false, false },
+ { "--open thisway.fa --image thatway.png --gui", null, null, false,
+ false },
+ { "--open thisway.fa --output thatway.png --gui", null, null, false,
+ false },
+ // --gui takes precedence
+ { "--open thisway.fa --image thatway.png --gui --headless", null,
+ null, false, false },
+ { "--open thisway.fa --output thatway.png --gui --headless", null,
+ null, false, false },
+ //
+ };
+ }
+
+ @Test(groups = "Functional", dataProvider = "argsWithinTypesData")
+ public void checkArgsWithinTypesTest(String commandLineArgs,
+ Object[] stuff)
+ {
+ String linkedId = "JALVIEW:0";
+ String[] args = commandLineArgs.split("\\s+");
+ ArgParser argparser = new ArgParser(args);
+ ArgValuesMap avm = argparser.getLinkedArgs(linkedId);
+
+ ArgAndValues avals = (ArgAndValues) stuff[0];
+
+ Object[] moreStuff = (Object[]) stuff[1];
+
+ ArgAndValues[] subAv = (ArgAndValues[]) moreStuff[0];
+
+ Object[] secondaryArgAndAuxStuff = (Object[]) stuff[2];
+
+ // Now look at the argparser
+
+ Arg primaryArg = avals.arg;
+
+ List<ArgValue> parsed_ArgValues = avm.getArgValueList(primaryArg);
+
+ Assert.assertTrue(
+ areEqualSets(avals.values,
+ ArgValuesMap.toValues(parsed_ArgValues)),
+ "Primary arg (" + primaryArg.toString()
+ + ") does not have the expected values. Expected "
+ + avals.values + " and got "
+ + ArgValuesMap.toValues(parsed_ArgValues));
+
+ for (int i = 0; i < parsed_ArgValues.size(); i++)
+ {
+ ArgValue parsed_ArgValue = parsed_ArgValues.get(i);
+ String value = avals.values.get(i);
+
+ Console.debug("- primary arg '" + primaryArg + "' = '" + value + "'");
+
+ Assert.assertEquals(parsed_ArgValue.getValue(), value,
+ "Primary arg value not as expected");
+
+ ArgAndValues[] aux_avals = (ArgAndValues[]) moreStuff[i];
+
+ for (ArgAndValues aux_aval : aux_avals)
+ {
+ Arg auxArg = aux_aval.arg;
+ List<String> auxValues = aux_aval.values;
+
+ String parsed_auxValue = avm.getFromSubValArgOrPref(auxArg,
+ ArgValuesMap.Position.AFTER, parsed_ArgValue, null, null,
+ null, null);
+
+ if (auxValues.isEmpty())
+ {
+ Assert.assertTrue(parsed_auxValue == null,
+ "Not expecting to parse a value for '" + auxArg
+ + "' but found '" + parsed_auxValue + "'");
+ }
+
+ for (String auxValue : auxValues)
+ {
+
+ Console.debug("- + primary aux arg '" + auxArg + "' = '"
+ + auxValue + "'");
+
+ Assert.assertEquals(parsed_auxValue, auxValue,
+ "Primary auxiliary arg (" + auxArg.toString()
+ + ") values do not match");
+
+ }
+ }
+
+ // Now for the secondary args
+ Object[] secondaryStuff = (Object[]) secondaryArgAndAuxStuff[i];
+ ArgAndValues secondaryArgAndValues = (ArgAndValues) secondaryStuff[0];
+ Arg secondaryArg = secondaryArgAndValues.arg;
+ List<String> secondaryValues = secondaryArgAndValues.values;
+
+ List<ArgValue> parsed_secondaryArgValues = avm
+ .getArgValueListFromSubValOrArg(parsed_ArgValue, secondaryArg,
+ null);
+
+ Assert.assertTrue(
+ areEqualSets(secondaryValues,
+ ArgValuesMap.toValues(parsed_secondaryArgValues)),
+ "Secondary arg (" + secondaryArg.toString()
+ + ") does not have the expected values");
+
+ Object[] secondaryMoreStuff = (Object[]) secondaryStuff[1];
+
+ for (int j = 0; j < parsed_secondaryArgValues.size(); j++)
+ {
+ ArgValue parsed_secondaryArgValue = parsed_secondaryArgValues
+ .get(j);
+ String secondary_value = secondaryValues.get(j);
+
+ Console.debug("-- secondary arg '" + secondaryArg + "' = '"
+ + secondary_value + "'");
+
+ Assert.assertEquals(parsed_secondaryArgValue.getValue(),
+ secondary_value, "Secondary arg value not as expected");
+
+ ArgAndValues[] secondary_aux_avals = (ArgAndValues[]) secondaryMoreStuff[j];
+
+ for (ArgAndValues secondary_aux_aval : secondary_aux_avals)
+ {
+ Arg secondary_auxArg = secondary_aux_aval.arg;
+ List<String> secondary_auxValues = secondary_aux_aval.values;
+
+ String parsed_secondary_auxValue = avm.getValueFromSubValOrArg(
+ parsed_secondaryArgValue, secondary_auxArg, null);
+
+ if (secondary_auxValues.isEmpty())
+ {
+ Assert.assertTrue(parsed_secondary_auxValue == null,
+ "Not expecting to parse a value for '"
+ + secondary_auxArg + "' but found '"
+ + parsed_secondary_auxValue + "'");
+ }
+
+ for (String secondary_auxValue : secondary_auxValues)
+ {
+ Console.debug("-- + secondary aux arg '" + secondary_auxArg
+ + "' for value '" + secondary_auxValue + "'");
+
+ Assert.assertEquals(parsed_secondary_auxValue,
+ secondary_auxValue,
+ "Secondary auxiliary arg ("
+ + secondary_auxArg.toString()
+ + ") values do not match");
+ }
+ }
+ }
+ }
+ }
+
+ @DataProvider(name = "argsWithinTypesData")
+ public Object[][] argsWithinTypesData()
+ {
+ return new Object[][] {
+ /*
+ * { cmdline args },
+ * {
+ * { Primary Arg, Secondary Args },
+ * { { Secondary Arg => { Values } } }
+ * },
+ */
+ /*
+ */
+ { //
+ // commandLineArgs
+ "--open=alignment.fa --structure=structure0.pdb"
+ // structureimage0a and structureimage args
+ + " --structureimage=image0a.png --bgcolour=bg0a --imagecolour=col0a"
+ // structureimage0b and structureimage args
+ + " --structureimage=image0b.png --bgcolour=bg0b --imagecolour=col0b"
+ // more structure args
+ + " --structureviewer=sv0 --paematrix=pae0" //
+ // structure1
+ + " --structure=structure1.pdb"
+ // structure args
+ + " --structureviewer=sv1 --paematrix=pae1"
+ // structureimage1a with NO structureimage args
+ // (see `--all --bgcolour=pineapple` later)
+ + " --structureimage=image1a.png"
+ // structureimage1b and structureimage args
+ + " --structureimage=image1b.png --bgcolour=bg1b --imagecolour=col1b"
+ // --all args, should apply to structureimage1a only
+ + " --all --bgcolour=pineapple" //
+ ,
+ // stuff
+ new Object[]
+ {
+ // avals (0) and (1)
+ av(Arg.STRUCTURE, "structure0.pdb", "structure1.pdb"),
+ // moreStuff (0) and (1)
+ new ArgAndValues[][]
+ { //
+ { av(Arg.STRUCTUREVIEWER, "sv0"),
+ av(Arg.PAEMATRIX, "pae0") },
+ { av(Arg.STRUCTUREVIEWER, "sv1"),
+ av(Arg.PAEMATRIX, "pae1") } //
+ },
+ // secondaryArgAndAuxStuff
+ // (same size as values of avals)
+ new Object[][]
+ {
+ // secondaryStuff (0)
+ {
+ // secondaryArgAndValues (a) and (b)
+ av(Arg.STRUCTUREIMAGE, "image0a.png",
+ "image0b.png"),
+ // secondaryMoreStuff
+ // (same size as values of secondaryArgAndValues)
+ new ArgAndValues[][]
+ {
+ // secondary_aux_avals (a)
+ { av(Arg.BGCOLOUR, "bg0a"),
+ av(Arg.IMAGECOLOUR, "col0a") },
+ // secondary_aux_avals (b)
+ { av(Arg.BGCOLOUR, "bg0b"),
+ av(Arg.IMAGECOLOUR, "col0b") }, //
+ }, //
+ },
+ // secondaryStuff (1)
+ {
+ // secondaryArgAndValues (a) and (b)
+ av(Arg.STRUCTUREIMAGE, "image1a.png",
+ "image1b.png"),
+ // secondaryMoreStuff
+ new ArgAndValues[][]
+ {
+ // secondary_aux_avals (a)
+ { av(Arg.BGCOLOUR, "pineapple"),
+ av(Arg.IMAGECOLOUR) },
+ // secondary_aux_avals (b)
+ { av(Arg.BGCOLOUR, "bg1b"),
+ av(Arg.IMAGECOLOUR, "col1b") }, //
+ }, //
+ }, //
+ } //
+ } //
+ }, //
+ { //
+ "--open=alignment.fa --wrap --colour=gecose-flower"
+ // structure0
+ + " --structure=structure0.pdb"
+ + " --structureimage=image0a.png --bgcolour=bg0a --scale=3"
+ + " --structureimage=image0b.png --imagecolour=col0b --scale=4"
+ + " --structureviewer=sv0 --paematrix=pae0" //
+ + " --structureimage=image0c.png"
+ // structure1
+ + " --structure=structure1.pdb"
+ + " --structureviewer=sv1 --paematrix=pae1"
+ + " --structureimage=image1a.png"
+ + " --structureimage=image1b.png --bgcolour=bg1b --imagecolour=col1b"
+ + " --structureimage=image1c.png --bgcolour=bg1c --imagecolour=col1c --scale=5"
+ + " --structureimage=image1d.png --imagecolour=col1d --scale=6"
+ + " --structureimage=image1e.png --bgcolour=bg1e"
+ // structure2
+ + " --structure=structure2.pdb"
+ + " --structureimage=image2a.png --bgcolour=bg2a --scale=23"
+ + " --all --bgcolour=pineapple --imagecolour=banana --scale=2" //
+ ,
+ // stuff
+ new Object[]
+ { av(Arg.STRUCTURE, "structure0.pdb", "structure1.pdb",
+ "structure2.pdb"),
+ new ArgAndValues[][]
+ { //
+ { av(Arg.STRUCTUREVIEWER, "sv0"),
+ av(Arg.PAEMATRIX, "pae0") },
+ { av(Arg.STRUCTUREVIEWER, "sv1"),
+ av(Arg.PAEMATRIX, "pae1") },
+ { av(Arg.STRUCTUREVIEWER), av(Arg.PAEMATRIX) } //
+ }, //
+ new Object[][]
+ { //
+ { //
+ av(Arg.STRUCTUREIMAGE, "image0a.png", "image0b.png",
+ "image0c.png"), //
+ new ArgAndValues[][]
+ { //
+ { av(Arg.BGCOLOUR, "bg0a"),
+ av(Arg.IMAGECOLOUR, "banana"),
+ av(Arg.SCALE, "3") },
+ { av(Arg.BGCOLOUR, "pineapple"),
+ av(Arg.IMAGECOLOUR, "col0b"),
+ av(Arg.SCALE, "4") },
+ { av(Arg.BGCOLOUR, "pineapple"),
+ av(Arg.IMAGECOLOUR, "banana"),
+ av(Arg.SCALE, "2") }, //
+ }, //
+ }, //
+ { //
+ av(Arg.STRUCTUREIMAGE, "image1a.png", "image1b.png",
+ "image1c.png", "image1d.png",
+ "image1e.png"),
+ new ArgAndValues[][]
+ { //
+ { av(Arg.BGCOLOUR, "pineapple"),
+ av(Arg.IMAGECOLOUR, "banana"),
+ av(Arg.SCALE, "2") },
+ { av(Arg.BGCOLOUR, "bg1b"),
+ av(Arg.IMAGECOLOUR, "col1b"),
+ av(Arg.SCALE, "2") },
+ { av(Arg.BGCOLOUR, "bg1c"),
+ av(Arg.IMAGECOLOUR, "col1c"),
+ av(Arg.SCALE, "5") },
+ { av(Arg.BGCOLOUR, "pineapple"),
+ av(Arg.IMAGECOLOUR, "col1d"),
+ av(Arg.SCALE, "6") },
+ { av(Arg.BGCOLOUR, "bg1e"),
+ av(Arg.IMAGECOLOUR, "banana"),
+ av(Arg.SCALE, "2") } //
+ }, //
+ }, //
+ { //
+ av(Arg.STRUCTUREIMAGE, "image2a.png"),
+ new ArgAndValues[][]
+ { //
+ { av(Arg.BGCOLOUR, "bg2a"),
+ av(Arg.IMAGECOLOUR, "banana"),
+ av(Arg.SCALE, "23") }, //
+ }, //
+ }, //
+ } //
+ } //
+ } //
+ };
+ }
+
+ protected ArgAndValues av(Arg a, String... vals)
+ {
+ return new ArgAndValues(a, vals);
+ }
+
+ protected class ArgAndValues
+ {
+ protected Arg arg;
+
+ protected List<String> values;
+
+ ArgAndValues(Arg a, String... vals)
+ {
+ arg = a;
+ values = vals == null ? new ArrayList<String>() : Arrays.asList(vals);
+ }
+
+ @Override
+ public String toString()
+ {
+ StringBuilder sb = new StringBuilder();
+ sb.append(arg.argString());
+ sb.append("\n");
+ sb.append(Strings.join(values, ','));
+ sb.append("\n");
+ return sb.toString();
+ }
+ }
+
+ private static boolean areEqualSets(String[] strArray,
+ List<String> strList)
+ {
+ return areEqualSets(Arrays.asList(strArray), strList);
+ }
+
+ private static boolean areEqualSets(List<String> l1, List<String> l2)
+ {
+ if (l1 == null && l2 == null)
+ {
+ Console.info(
+ "Comparing null lists, should be okay but you might want to know");
+ return true;
+ }
+ if (l1 == null || l2 == null)
+ {
+ return false;
+ }
+ return new HashSet<String>(l1).equals(new HashSet<String>(l2));
+ }
+
+ }
assertNull(ann.annotations[4]);
}
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_NullAnnotationsAndNoColsHidden()
+ {
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", null);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(hc);
+ assertThat(ann.annotations, is(nullValue()));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_NullAnnotationsAndTrim()
+ {
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", null);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(3, 5, hc);
+ assertThat(ann.annotations, is(nullValue()));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_NoColsHidden()
+ {
+ Annotation[] annots = new Annotation[] {
+ EMPTY_ANNOTATION, EMPTY_ANNOTATION, new Annotation(1),
+ new Annotation(2), new Annotation(3), EMPTY_ANNOTATION,
+ EMPTY_ANNOTATION, new Annotation(4), new Annotation(5),
+ EMPTY_ANNOTATION, new Annotation(6), new Annotation(7),
+ new Annotation(8) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(hc);
+ assertThat(ann.annotations, matchesAnnotations(annots));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HideCols()
+ {
+ Annotation[] annots = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(4), new Annotation(5),
+ new Annotation(6), new Annotation(7), new Annotation(8) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(2, 6);
+ ann.makeVisibleAnnotation(hc);
+ var expected = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(7),
+ new Annotation(8) };
+ assertThat(ann.annotations, matchesAnnotations(expected));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_ExplicitFullWidthAndHideCols()
+ {
+ Annotation[] annots = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(4), new Annotation(5),
+ new Annotation(6), new Annotation(7), new Annotation(8),
+ new Annotation(9), new Annotation(10), new Annotation(11) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(4, 7);
+ ann.makeVisibleAnnotation(0, 11, hc);
+ assertThat(ann.annotations,
+ matchesAnnotations(new Annotation(0), new Annotation(1),
+ new Annotation(2), new Annotation(3), new Annotation(8),
+ new Annotation(9), new Annotation(10), new Annotation(11)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_ExplicitFullWidthAndHideCols2()
+ {
+ Annotation[] annots = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(4), new Annotation(5),
+ new Annotation(6), new Annotation(7), new Annotation(8), };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(4, 7);
+ ann.makeVisibleAnnotation(0, 8, hc);
+ assertThat(ann.annotations,
+ matchesAnnotations(new Annotation(0), new Annotation(1),
+ new Annotation(2), new Annotation(3), new Annotation(8)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HideColsWithEmptyAnnots()
+ {
+ Annotation[] annots = new Annotation[] {
+ EMPTY_ANNOTATION, EMPTY_ANNOTATION, new Annotation(1),
+ new Annotation(2), new Annotation(3), EMPTY_ANNOTATION,
+ EMPTY_ANNOTATION, new Annotation(4), new Annotation(5),
+ EMPTY_ANNOTATION, new Annotation(6), new Annotation(7),
+ new Annotation(8) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(1, 3);
+ hc.hideColumns(8, 9);
+ ann.makeVisibleAnnotation(hc);
+ var expected = new Annotation[] {
+ EMPTY_ANNOTATION, new Annotation(3), EMPTY_ANNOTATION, EMPTY_ANNOTATION,
+ new Annotation(4), new Annotation(6), new Annotation(7),
+ new Annotation(8) };
+ assertThat(ann.annotations, matchesAnnotations(expected));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HideColsWithNullAnnots()
+ {
+ Annotation[] annots = new Annotation[] {
+ null, null, new Annotation(2), null, new Annotation(4),
+ new Annotation(5), null, null };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(2, 4);
+ ann.makeVisibleAnnotation(hc);
+ var expected = new Annotation[] {
+ null, null, new Annotation(5), null, null };
+ assertThat(ann.annotations, matchesAnnotations(expected));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_Truncate()
+ {
+ Annotation[] annots = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(4), new Annotation(5),
+ new Annotation(6), new Annotation(7) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ ann.makeVisibleAnnotation(3, 6, new HiddenColumns());
+ assertThat(ann.annotations, matchesAnnotations(new Annotation(3),
+ new Annotation(4), new Annotation(5), new Annotation(6)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_TruncateAndHideColumns()
+ {
+ Annotation[] annots = new Annotation[] {
+ new Annotation(0), new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(4), new Annotation(5),
+ new Annotation(6), new Annotation(7), new Annotation(8),
+ new Annotation(9), new Annotation(10), new Annotation(11) };
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(4, 7);
+ ann.makeVisibleAnnotation(1, 9, hc);
+ assertThat(ann.annotations,
+ matchesAnnotations(new Annotation(1), new Annotation(2),
+ new Annotation(3), new Annotation(8), new Annotation(9)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_TruncateNegativeStart()
+ {
+ Annotation[] annots = annotsRange(8);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(-5, 1, hc);
+ assertThat(ann.annotations,
+ matchesAnnotations(new Annotation(0), new Annotation(1)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_TruncateNegativeStartAndEnd()
+ {
+ Annotation[] annots = annotsRange(8);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(-5, -2, hc);
+ assertThat(ann.annotations, is(emptyArray()));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_TruncateEndBeyondSize()
+ {
+ Annotation[] annots = annotsRange(8);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(6, 10, hc);
+ assertThat(ann.annotations, matchesAnnotations(new Annotation(6), new Annotation(7)));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_TruncateStartAndEndBeyondSize()
+ {
+ Annotation[] annots = annotsRange(4);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ ann.makeVisibleAnnotation(6, 10, hc);
+ assertThat(ann.annotations, is(emptyArray()));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HiddenRegionBeyondSize()
+ {
+ Annotation[] annots = annotsRange(4);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(6, 7);
+ ann.makeVisibleAnnotation(hc);
+ assertThat(ann.annotations, matchesAnnotations(annots));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HiddenRegionAndTrimEndBeyondSize()
+ {
+ Annotation[] annots = annotsRange(4);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(6, 7);
+ ann.makeVisibleAnnotation(0, 10, hc);
+ assertThat(ann.annotations, matchesAnnotations(annots));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HiddenRegionBeforeStart()
+ {
+ Annotation[] annots = annotsRange(4);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(-3, -2);
+ ann.makeVisibleAnnotation(hc);
+ assertThat(ann.annotations, matchesAnnotations(annots));
+ }
+
+ @Test(groups = "Functional")
+ public void testMakeVisibleAnnotation_HiddenRegionAndTrimStartBeforeStart()
+ {
+ Annotation[] annots = annotsRange(4);
+ AlignmentAnnotation ann = new AlignmentAnnotation("label", "desc", annots);
+ HiddenColumns hc = new HiddenColumns();
+ hc.hideColumns(-3, -2);
+ ann.makeVisibleAnnotation(-5, annots.length - 1, hc);
+ assertThat(ann.annotations, matchesAnnotations(annots));
+ }
+
+ static Annotation[] annotsRange(int stop)
+ {
+ Annotation[] annotations = new Annotation[stop];
+ for (int i = 0; i < stop; i++)
+ annotations[i] = new Annotation(i);
+ return annotations;
+ }
++
+ /**
+ * test the contact matrix nogroups property methods
+ */
+ @Test(groups = { "Functional" })
+ public void test_contactMatrixGroups()
+ {
+ AlignmentAnnotation aa = new AlignmentAnnotation("foo", "foo desc",
+ null);
- assertTrue(aa.isShowGroupsForContactMatrix());
++ Assert.assertTrue(aa.isShowGroupsForContactMatrix());
+ aa.setShowGroupsForContactMatrix(false);
- assertFalse(aa.isShowGroupsForContactMatrix());
++ Assert.assertFalse(aa.isShowGroupsForContactMatrix());
+ AlignmentAnnotation copy = new AlignmentAnnotation(aa);
- assertFalse(copy.isShowGroupsForContactMatrix());
++ Assert.assertFalse(copy.isShowGroupsForContactMatrix());
+ aa.setShowGroupsForContactMatrix(true);
- assertTrue(aa.isShowGroupsForContactMatrix());
++ Assert.assertTrue(aa.isShowGroupsForContactMatrix());
+ // copy should not be updated
- assertFalse(copy.isShowGroupsForContactMatrix());
++ Assert.assertFalse(copy.isShowGroupsForContactMatrix());
+
+ }
}
import org.testng.annotations.Test;
import jalview.analysis.AlignmentGenerator;
+import jalview.commands.EditCommand;
+import jalview.commands.EditCommand.Action;
+import jalview.datamodel.PDBEntry.Type;
+import jalview.gui.JvOptionPane;
+import jalview.util.MapList;
+
++import jalview.analysis.AlignmentGenerator;
+ import jalview.bin.Cache;
+ import jalview.commands.EditCommand;
+ import jalview.commands.EditCommand.Action;
+ import jalview.datamodel.PDBEntry.Type;
+ import jalview.gui.JvOptionPane;
+ import jalview.util.MapList;
import junit.extensions.PA;
public class SequenceTest
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" })
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@AfterMethod(alwaysRun = true)
@AfterMethod(alwaysRun = true)
public void tearDown()
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
/**
@BeforeMethod(alwaysRun = true)
public void setUp() throws InvocationTargetException, InterruptedException
{
- Jalview.main(new String[] { "-nonews",
- "-props", "test/jalview/testProps.jvprops",
- Jalview.main(
- new String[]
- { "--nonews", "--props", "test/jalview/testProps.jvprops" });
++ Jalview.main(new String[] { "--nonews",
++ "--props", "test/jalview/testProps.jvprops",
+ "-jabaws", "none"});
- Cache.applicationProperties.setProperty("SHOW_IDENTITY",
+ Cache.setPropertyNoSave("SHOW_IDENTITY",
Boolean.TRUE.toString());
af = new FileLoader().LoadFileWaitTillLoaded("examples/uniref50.fa",
DataSourceType.FILE);
* note 4 pixels 'padding' are added to the longest seq name/annotation label
*/
Dimension d = af.alignPanel.calculateIdWidth(2000);
+ // Assumption ID_WIDTH_PADDING == 4
+ int expwidth = 3 + fmfor.stringWidth("Conservation");
+
- assertEquals(d.width, 166); // 4 + pixel width of "Q93Z60_ARATH/1-118"
+ assertEquals(d.width, Platform.forArch(166).forWin(172).value().intValue()); // 4 + pixel width of "Q93Z60_ARATH/1-118"
assertEquals(d.height, 12); // fixed value (not used?)
- assertEquals(av.getIdWidth(), 18); // not changed by this method
+ assertEquals(av.getIdWidth(), expwidth); // not changed by this method
/*
* make the longest sequence name longer
*/
AlignmentAnnotation aa = av.getAlignment().getAlignmentAnnotation()[0];
aa.label = "THIS IS A VERY LONG LABEL INDEED";
- FontMetrics fmfor = af.alignPanel
++ fmfor = af.alignPanel
+ .getFontMetrics(af.alignPanel.getAlabels().getFont());
+ // Assumption ID_WIDTH_PADDING == 4
+ // AH! But with those added MMMM above, this was NOT the longest label!
- int expwidth = 4 + fmfor.stringWidth(aa.label);
++ // TODO: JBPNote review if this test is failing - probably bad merge
++ expwidth = 4 + fmfor.stringWidth(aa.label);
d = af.alignPanel.calculateIdWidth(2000);
- assertEquals(d.width, expwidth); // 191 == ID_WIDTH_PADDING + pixel width of "THIS IS A VERY LONG LABEL INDEED"
- // Assumption ID_WIDTH_PADDING == 3
- expwidth = 3 + fmfor.stringWidth(aa.label);
-
++ // 2.11 - Assumption ID_WIDTH_PADDING == 3
++ // expwidth = 3 + fmfor.stringWidth(aa.label);
++ // 2.12:
++ // 191 == ID_WIDTH_PADDING + pixel width of "THIS IS A VERY LONG LABEL INDEED"
+ assertEquals(d.width, expwidth); // 228 == ID_WIDTH_PADDING + pixel width of
+ // "THIS IS A VERY LONG LABEL INDEED"
assertEquals(d.height, 12);
/*
* preference for auto id width overrides fixed width
*/
Cache.setProperty("FIGURE_AUTOIDWIDTH", Boolean.TRUE.toString());
- assertEquals(115, af.alignPanel.getVisibleIdWidth(false));
+ assertEquals(af.alignPanel.getVisibleIdWidth(false),
+ Platform.forArch(115).forWin(106).forMac(115).forLinux(114)
+ .value().intValue());
}
- }
+
+ @Test(groups = { "Functional", "Not-bamboo" })
+ public void testresetIdWidth()
+ {
+ /*
+ * width for onscreen rendering is IDPanel width
+ */
+ int w = af.alignPanel.getVisibleIdWidth(true);
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+ assertEquals(w, 115);
+
+ // manually adjust
+ af.viewport.setIdWidth(200);
+ w = af.alignPanel.calculateIdWidth().width;
+ assertTrue(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+
+ af.viewport.setIdWidth(-1);
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(false);
+ w = af.alignPanel.calculateIdWidth().width;
+
+ assertEquals(w, af.alignPanel.getIdPanel().getWidth());
+
+ assertNotEquals(w, 115);
+ }
-
+ @Test(groups = "Functional")
+ public void testSetOverviewTitle()
+ {
+ OverviewPanel ov1 = this.af.openOverviewPanel(true);
+ String alignFrameTitle = af.getTitle();
+ assertEquals(ov1.getTitle(), "Overview " + alignFrameTitle);
+
+ /*
+ * on New View, existing overview should get " Original" added to title
+ * and new view's overview should get " View 1" added
+ */
+ af.newView_actionPerformed(null);
+ assertEquals(ov1.getTitle(),
+ "Overview " + alignFrameTitle + " Original");
+ OverviewPanel ov2 = this.af.openOverviewPanel(true);
+ assertEquals(ov2.getTitle(), "Overview " + alignFrameTitle + " View 1");
+ }
+
+ @Test(groups = "Functional")
+ public void testSetOverviewTitle_automaticOverview()
+ {
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.fa", DataSourceType.FILE);
+ OverviewPanel ov1 = alignFrame.alignPanel.getOverviewPanel();
+ assertNotNull(ov1);
+ String alignFrameTitle = alignFrame.getTitle();
+ assertEquals(ov1.getTitle(), "Overview " + alignFrameTitle);
+
+ /*
+ * on New View, existing overview should get " Original" added to title
+ * and new view's automatic overview should have " View 1" added
+ */
+ alignFrame.newView_actionPerformed(null);
+ assertEquals(ov1.getTitle(),
+ "Overview " + alignFrameTitle + " Original");
+ OverviewPanel ov2 = alignFrame.alignPanel.getOverviewPanel();
+ assertNotNull(ov2);
+ assertEquals(ov2.getTitle(), "Overview " + alignFrameTitle + " View 1");
+ }
+ }
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.gui;
+
+ import static org.testng.Assert.assertEquals;
+ import static org.testng.Assert.assertFalse;
+ import static org.testng.Assert.assertTrue;
+
+ import java.io.File;
+
+ import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.BeforeMethod;
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+
+ import jalview.bin.Cache;
+ import jalview.bin.Jalview;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.SequenceI;
+ import jalview.gui.StructureViewer.ViewerType;
+ import jalview.io.DataSourceType;
+ import jalview.io.FileLoader;
+ import jalview.structure.StructureImportSettings.TFType;
+
+ public class AnnotationLabelsTest2
+ {
+ @BeforeClass(alwaysRun = true)
+ public static void setUpBeforeClass() throws Exception
+ {
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ setUpJvOptionPane();
+ /*
+ * use read-only test properties file
+ */
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ Jalview.main(new String[] { "--nonews", "--nosplash", });
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
+
+ /**
+ * configure (read-only) properties for test to ensure Consensus is computed
+ * for colour Above PID testing
+ */
+ @BeforeMethod(alwaysRun = true)
+ public void setUp()
+ {
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.applicationProperties.setProperty("SHOW_IDENTITY",
++ Cache.setProperty("SHOW_IDENTITY",
+ Boolean.TRUE.toString());
+
+ }
+
+ public static void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ @Test(
+ groups =
+ { "Functional", "testTask1" },
+ dataProvider = "openFilesWithIdWidthChanges")
+ public void testIdWidthChanges(String alignmentFilename, boolean wrap,
+ int idWidth1min, int idWidth1max, int manualWidth,
+ String structureFilename, String paeFilename,
+ boolean secondaryStructureView, TFType temperatureFactorType,
+ ViewerType viewerType, int idWidth2min, int idWidth2max)
+ {
+ AlignFrame af = new FileLoader()
+ .LoadFileWaitTillLoaded(alignmentFilename, DataSourceType.FILE);
+ try
+ {
+ Thread.sleep(200); // to allow alignment annotations to open
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ AlignViewport av = af.getCurrentView();
+
+ int idWidth = 0;
+
+ idWidth = av.getIdWidth();
+ assertTrue(idWidth > idWidth1min,
+ "idWidth (" + idWidth + ") is not greater than " + idWidth1min);
+ assertTrue(idWidth < idWidth1max,
+ "idWidth (" + idWidth + ") is not narrower than" + idWidth1max);
+
+ // set wrap
+ if (wrap)
+ {
+ af.setWrapFormat(true, false);
+ idWidth = av.getIdWidth();
+ assertTrue(idWidth > idWidth1min, "After wrap idWidth (" + idWidth
+ + ") is not greater than " + idWidth1min);
+ assertTrue(idWidth < idWidth1max, "After wrap idWidth (" + idWidth
+ + ") is not narrower than" + idWidth1max);
+ }
+
+ AlignmentI al = av.getAlignment();
+ SequenceI s = al.getSequenceAt(0);
+ AlignmentPanel ap = af.alignPanel;
+
+ File structureFile = new File(structureFilename);
+ File paeFile = new File(paeFilename);
+
+ StructureViewer sv = StructureChooser.openStructureFileForSequence(null,
+ null, ap, s, false, structureFile.getAbsolutePath(),
+ temperatureFactorType, paeFile.getAbsolutePath(), true,
+ secondaryStructureView, false, viewerType);
+ // give time for annotations to open
+ try
+ {
+ Thread.sleep(200); // to allow alignment annotations to open
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+
+ // idWidth = ap.getIdPanel().getWidth();
+ idWidth = av.getIdWidth();
+ assertTrue(idWidth > idWidth2min,
+ "idWidth (" + idWidth + ") is not greater than " + idWidth2min);
+ assertTrue(idWidth < idWidth2max,
+ "idWidth (" + idWidth + ") is not narrower than" + idWidth2max);
+ }
+
+ @Test(
+ groups =
+ { "Functional", "testTask1" },
+ dataProvider = "openFilesWithIdWidthChanges")
+ public void testIdWidthNoChanges(String alignmentFilename, boolean wrap,
+ int idWidth1min, int idWidth1max, int manualWidth,
+ String structureFilename, String paeFilename,
+ boolean secondaryStructureView, TFType temperatureFactorType,
+ ViewerType viewerType, int idWidth2min, int idWidth2max)
+ {
+ AlignFrame af = new FileLoader()
+ .LoadFileWaitTillLoaded(alignmentFilename, DataSourceType.FILE);
+ try
+ {
+ Thread.sleep(200); // to allow alignment annotations to open
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
+ AlignViewport av = af.getCurrentView();
+
+ int idWidth = 0;
+
+ idWidth = av.getIdWidth();
+ assertTrue(idWidth > idWidth1min,
+ "idWidth (" + idWidth + ") is not greater than " + idWidth1min);
+ assertTrue(idWidth < idWidth1max,
+ "idWidth (" + idWidth + ") is not narrower than" + idWidth1max);
+
+ AlignmentI al = av.getAlignment();
+ SequenceI s = al.getSequenceAt(0);
+ AlignmentPanel ap = af.alignPanel;
+
+ // set width manually
+ av.setIdWidth(manualWidth);
+ ap.validateAnnotationDimensions(false);
+ ap.paintAlignment(true, false);
+ ap.getIdPanel().getIdCanvas().setManuallyAdjusted(true);
+
+ idWidth = av.getIdWidth();
+ assertEquals(idWidth, manualWidth,
+ "idWidth is not set to the manually set width " + manualWidth);
+
+ File structureFile = new File(structureFilename);
+ File paeFile = new File(paeFilename);
+
+ StructureViewer sv = StructureChooser.openStructureFileForSequence(null,
+ null, ap, s, false, structureFile.getAbsolutePath(),
+ temperatureFactorType, paeFile.getAbsolutePath(), false,
+ secondaryStructureView, false, viewerType);
+
+ idWidth = ap.getIdPanel().getWidth();// av.getIdWidth();
+ idWidth = av.getIdWidth();
+ assertEquals(idWidth, manualWidth,
+ "idWidth is not set to the manually set width " + manualWidth
+ + " after adding structure annotations");
+ assertFalse(idWidth > idWidth2min,
+ "idWidth (" + idWidth + ") is greater than " + idWidth2min);
+ }
+
+ @DataProvider(name = "openFilesWithIdWidthChanges")
+ public Object[][] openFilesWithIdWidthChanges()
+ {
+ /*
+ String alignmentFilename,
+ boolean wrap,
+ int idWidth1min,
+ int idWidth1max,
+ int manualWidth, // ignored by testIdWidthChanges()
+ String structureFilename,
+ String paeFilename,
+ boolean secondaryStructureView,
+ TFType temperatureFactorType,
+ ViewerType viewerType,
+ int idWidth2min,
+ int idWidth2max,
+ */
+ return new Object[][] {
+ //
+ /*
+ */
+ { "./test/files/annotation_label_width/sample.a2m", false, 50, 70,
+ 100,
+ "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb",
+ "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json",
+ true, TFType.PLDDT, null, 115, 130 },
+ { "./test/files/annotation_label_width/sample.a2m", true, 50, 70,
+ 100,
+ "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb",
+ "./examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json",
+ true, TFType.PLDDT, null, 115, 130 },
+ /*
+ */
+ };
+ }
+
+ }
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.gui;
+
+ import static org.junit.Assert.assertNotEquals;
+ import static org.testng.Assert.assertEquals;
+ import static org.testng.Assert.assertFalse;
+ import static org.testng.Assert.assertNotSame;
+ import static org.testng.Assert.assertSame;
+ import static org.testng.Assert.assertTrue;
+
+ import java.awt.Color;
+ import java.util.Iterator;
+
+ import javax.swing.SwingUtilities;
+
+ import org.junit.Assert;
+ import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.BeforeMethod;
+ import org.testng.annotations.Test;
+
+ import jalview.api.FeatureColourI;
+ import jalview.bin.Cache;
+ import jalview.bin.Jalview;
+ import jalview.datamodel.Alignment;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.HiddenColumns;
+ import jalview.datamodel.Sequence;
+ import jalview.datamodel.SequenceFeature;
+ import jalview.datamodel.SequenceGroup;
+ import jalview.datamodel.SequenceI;
+ import jalview.io.DataSourceType;
+ import jalview.io.FileLoader;
+ import jalview.project.Jalview2xmlTests;
+ import jalview.renderer.ResidueShaderI;
+ import jalview.schemes.BuriedColourScheme;
+ import jalview.schemes.FeatureColour;
+ import jalview.schemes.HelixColourScheme;
+ import jalview.schemes.JalviewColourScheme;
+ import jalview.schemes.StrandColourScheme;
+ import jalview.schemes.TurnColourScheme;
+ import jalview.util.MessageManager;
+
+ public class DesktopTests
+ {
+
+ @BeforeClass(alwaysRun = true)
+ public static void setUpBeforeClass() throws Exception
+ {
+ setUpJvOptionPane();
+ /*
+ * use read-only test properties file
+ */
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ Jalview.main(new String[] { "--nonews" });
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
+
+ /**
+ *
+ * configure (read-only) properties for test to ensure Consensus is computed
+ * for colour Above PID testing
+ */
+ public AlignFrame loadTestFile()
+ {
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
- Cache.applicationProperties.setProperty("SHOW_IDENTITY",
++ Cache.setProperty("SHOW_IDENTITY",
+ Boolean.TRUE.toString());
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.fa", DataSourceType.FILE);
+
+ /*
+ * wait for Consensus thread to complete
+ */
+ do
+ {
+ try
+ {
+ Thread.sleep(50);
+ } catch (InterruptedException x)
+ {
+ }
+ } while (af.getViewport().getCalcManager().isWorking());
+ return af;
+ }
+
+ public static void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ @Test(groups = { "Functional" })
+ public void testInternalCopyPaste()
+ {
+ AlignFrame internalSource = loadTestFile();
+
+ try
+ {
+ SwingUtilities.invokeAndWait(new Runnable()
+ {
+ @Override
+ public void run()
+ {
+ internalSource.selectAllSequenceMenuItem_actionPerformed(null);
+ internalSource.copy_actionPerformed();
- Desktop.instance.paste();
++ Desktop.getInstance().paste();
+ }
+ });
+ } catch (Exception x)
+ {
+ Assert.fail("Unexpected exception " + x);
+ }
+ AlignFrame[] alfs = Desktop.getDesktopAlignFrames();
+ Assert.assertEquals("Expect just 2 alignment frames", 2, alfs.length);
+ // internal paste should yield a new alignment window with shared dataset
+ AlignmentI dataset = internalSource.getViewport().getAlignment()
+ .getDataset();
+ Assert.assertNotNull(dataset);
+
+ for (AlignFrame alf : alfs)
+ {
+ Assert.assertTrue(
+ "Internal paste should yield alignment with same dataset.",
+ dataset == alf.getViewport().getAlignment().getDataset());
+ }
+
+ }
+ }
public class FeatureSettingsTest
{
+ @BeforeClass(alwaysRun = true)
+ public static void setUpBeforeClass() throws Exception
+ {
+ /*
+ * use read-only test properties file
+ */
+ Cache.loadProperties("test/jalview/io/testProps.jvprops");
+ Jalview.main(new String[] { "--nonews" });
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
+
/**
* Test a roundtrip of save and reload of feature colours and filters as XML
*
{
Jalview.main(
new String[]
- { "-nonews", "-props", "test/jalview/testProps.jvprops" });
+ { "--nonews", "--props", "test/jalview/testProps.jvprops" });
String True = Boolean.TRUE.toString();
- Cache.applicationProperties.setProperty("SHOW_ANNOTATIONS", True);
- Cache.applicationProperties.setProperty("SHOW_QUALITY", True);
- Cache.applicationProperties.setProperty("SHOW_CONSERVATION", True);
- Cache.applicationProperties.setProperty("SHOW_OCCUPANCY", True);
- Cache.applicationProperties.setProperty("SHOW_IDENTITY", True);
+ Cache.setPropertyNoSave("SHOW_ANNOTATIONS", True);
+ Cache.setPropertyNoSave("SHOW_QUALITY", True);
+ Cache.setPropertyNoSave("SHOW_CONSERVATION", True);
+ Cache.setPropertyNoSave("SHOW_OCCUPANCY", True);
+ Cache.setPropertyNoSave("SHOW_IDENTITY", True);
}
+ /**
+ * A simple test that memory is released when all windows are closed.
+ * <ul>
+ * <li>generates a reasonably large alignment and loads it</li>
+ * <li>performs various operations on the alignment</li>
+ * <li>closes all windows</li>
+ * <li>requests garbage collection</li>
+ * <li>asserts that the remaining memory footprint (heap usage) is 'not large'
+ * </li>
+ * </ul>
+ * If the test fails, this suggests that a reference to some large object
+ * (perhaps the alignment data, or some annotation / Tree / PCA data) has
+ * failed to be garbage collected. If this is the case, the heap will need to
+ * be inspected manually (suggest using jvisualvm) in order to track down
+ * where large objects are still referenced. The code (for example
+ * AlignmentViewport.dispose()) should then be updated to ensure references to
+ * large objects are set to null when they are no longer required.
+ *
+ * @throws IOException
+ */
@Test(groups = "Memory")
public void testFreeMemoryOnClose() throws IOException
{
File f = generateAlignment();
f.deleteOnExit();
+ long expectedMin = MAX_RESIDUAL_HEAP;
+ long usedMemoryAtStart=getUsedMemory();
+ if (usedMemoryAtStart>expectedMin)
+ {
+ System.err.println("used memory before test is "+usedMemoryAtStart+" > "+expectedMin+"MB .. adjusting minimum.");
+ expectedMin = usedMemoryAtStart;
+ }
doStuffInJalview(f);
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
- checkUsedMemory(MAX_RESIDUAL_HEAP);
+ checkUsedMemory(expectedMin);
}
/**
--- /dev/null
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
+ package jalview.gui;
+
+ import static org.testng.Assert.assertNotNull;
+
+ import java.io.File;
+ import java.util.ArrayList;
+ import java.util.Date;
+ import java.util.List;
+
+ import org.testng.Assert;
+ import org.testng.annotations.AfterClass;
+ import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.BeforeMethod;
+ import org.testng.annotations.Test;
+
+ import jalview.bin.Cache;
+ import jalview.bin.Jalview;
+ import jalview.gui.QuitHandler.QResponse;
+ import jalview.io.DataSourceType;
+ import jalview.io.FileFormat;
+ import jalview.io.FileLoader;
+ import jalview.project.Jalview2XML;
+
+ @Test(singleThreaded = true)
+ public class QuitHandlerTest
+ {
+ private static String saveProjectFile = "test-output/tempSaveFile.jvp";
+
+ private static String saveFastaFile = "test-output/tempSaveFile.fa";
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ Jalview2XML.setDebugDelaySave(3);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass(alwaysRun = true)
+ public static void setUpBeforeClass() throws Exception
+ {
+ Cache.loadProperties("test/jalview/gui/quitProps.jvprops");
+
+ /*
+ * set news feed last read to a future time to ensure no
+ * 'unread' news item is displayed
+ */
+ Date oneHourFromNow = new Date(
+ System.currentTimeMillis() + 3600 * 1000);
+ Cache.setDateProperty("JALVIEW_NEWS_RSS_LASTMODIFIED", oneHourFromNow);
+
+ Jalview.main(
+ new String[]
+ { "--nowebservicediscovery", "--nosplash", "--nonews" });
+ }
+
+ @AfterClass(alwaysRun = true)
+ public static void resetProps()
+ {
+ // reset quit response
+ QuitHandler.setResponse(QResponse.NULL);
+ // reset mock response
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ // close desktop windows/frames
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ // reset debug delay
+ Jalview2XML.setDebugDelaySave(20);
+ // load normal testprops
+ Cache.loadProperties("test/jalview/testProps.jvprops");
+ }
+
+ @BeforeMethod(alwaysRun = true)
+ public static void tearDownAfterClass() throws Exception
+ {
+ // reset quit response
+ QuitHandler.setResponse(QResponse.NULL);
+ // reset mock response
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ // close desktop windows/frames
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ // reset debug delay
+ Cache.setProperty("DEBUG_DELAY_SAVE", "false");
+ Jalview2XML.setDebugDelaySave(3);
+ // set the project file
- Desktop.instance.setProjectFile(new File(saveProjectFile));
++ Desktop.getInstance().setProjectFile(new File(saveProjectFile));
+ }
+
+ @AfterMethod(alwaysRun = true)
+ public static void cleanup()
+ {
+ // delete save files
+ List<String> files = new ArrayList<>();
+ files.add(saveProjectFile);
+ files.add(saveFastaFile);
+ for (String filename : files)
+ {
+ File file = new File(filename);
+ if (file.exists())
+ {
+ file.delete();
+ }
+ }
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 1)
+ public void testInstantQuit() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+
+ long start = System.currentTimeMillis();
+
+ // if a save is attempted it will delay 3s
+ Jalview2XML.setDebugDelaySave(3);
+ Cache.setProperty("DEBUG_DELAY_SAVE", "true");
+
+ // loaded file but haven't done anything, should just quit
+ QResponse response = QuitHandler.getQuitResponse(true);
+ long end = System.currentTimeMillis();
+
+ Assert.assertEquals(response, QResponse.QUIT);
+ Assert.assertTrue(end - start < 500,
+ "Quit-with-no-save-needed took too long (" + (end - start)
+ + "ms)");
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 10)
+ public void testWaitForSaveQuit() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+
+ long start = System.currentTimeMillis();
+
+ // start a long save (3s)
+ Jalview2XML.setDebugDelaySave(3);
+ Cache.setProperty("DEBUG_DELAY_SAVE", "true");
- Desktop.instance.saveState_actionPerformed(false);
++ Desktop.getInstance().saveState_actionPerformed(false);
+
+ // give the saveState thread time to start!
+ Thread.sleep(500);
+
+ // af.saveAlignment(saveProjectFile, FileFormat.Jalview);
+ QResponse response = QuitHandler.getQuitResponse(true);
+ long end = System.currentTimeMillis();
+
+ Assert.assertEquals(response, QResponse.QUIT);
+ Assert.assertTrue(end - start > 2900,
+ "Quit-whilst-saving was too short (" + (end - start) + "ms)");
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 9)
+ public void testSavedProjectChanges() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+ AlignViewport viewport = af.getViewport();
+ // pretend something has happened
+ viewport.setSavedUpToDate(false);
+ Jalview2XML.setStateSavedUpToDate(false);
+
+ // don't want to hang around here
+ Cache.setProperty("DEBUG_DELAY_SAVE", "false");
+ af.saveAlignment(saveProjectFile, FileFormat.Jalview);
+
+ // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION (to
+ // mean [CANCEL] -- file should already be saved so this doesn't happen and
+ // we get a QUIT response)
+ JvOptionPane.setMockResponse(JvOptionPane.NO_OPTION);
+ QResponse response = QuitHandler.getQuitResponse(true);
+
+ // if not saved this would be CANCEL_QUIT
+ Assert.assertEquals(response, QResponse.QUIT);
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 9)
+ public void testSavedAlignmentChanges() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+ AlignViewport viewport = af.getViewport();
+ // pretend something has happened
+ viewport.setSavedUpToDate(false);
+ Jalview2XML.setStateSavedUpToDate(false);
+
+ // no hanging around needed here
+ Cache.setProperty("DEBUG_DELAY_SAVE", "false");
+ af.saveAlignment(saveFastaFile, FileFormat.Fasta);
+
+ // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION
+ JvOptionPane.setMockResponse(JvOptionPane.NO_OPTION);
+ QResponse response = QuitHandler.getQuitResponse(true);
+
+ // if not saved this would be CANCEL_QUIT
+ Assert.assertEquals(response, QResponse.QUIT);
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 1)
+ public void testUnsavedChanges() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+ AlignViewport viewport = af.getViewport();
+ // pretend something has happened
+ viewport.setSavedUpToDate(false);
+ Jalview2XML.setStateSavedUpToDate(false);
+
+ // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION
+ JvOptionPane.setMockResponse(JvOptionPane.NO_OPTION);
+ QResponse response = QuitHandler.getQuitResponse(true);
+
+ Assert.assertEquals(response, QResponse.CANCEL_QUIT);
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 1)
+ public void testNoGUIUnsavedChanges() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+ AlignViewport viewport = af.getViewport();
+ // pretend something has happened
+ viewport.setSavedUpToDate(false);
+ Jalview2XML.setStateSavedUpToDate(false);
+
+ // this is only a two button dialog [Quit] [Cancel] so use NO_OPTION
+ JvOptionPane.setMockResponse(JvOptionPane.NO_OPTION);
+ /*
+ QResponse response = QuitHandler.getQuitResponse(false,
+ QuitHandler.defaultOkQuit, () -> {
+ // set FORCE_QUIT without the force quit
+ QuitHandler.setResponse(QResponse.FORCE_QUIT);
+ return null;
+ }, QuitHandler.defaultCancelQuit);
+ */
+ QResponse response = QuitHandler.getQuitResponse(false);
+
+ Assert.assertEquals(response, QResponse.QUIT);
+ }
+
+ @Test(groups = { "Functional" }, singleThreaded = true, priority = 11)
+ public void testForceQuit() throws Exception
+ {
+ String inFile = "examples/uniref50.fa";
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(inFile,
+ DataSourceType.FILE);
+ assertNotNull(af, "Didn't read input file " + inFile);
+
+ long start = System.currentTimeMillis();
+
+ // start a long save (10s)
+ Jalview2XML.setDebugDelaySave(10);
+ Cache.setProperty("DEBUG_DELAY_SAVE", "true");
- Desktop.instance.saveState_actionPerformed(false);
++ Desktop.getInstance().saveState_actionPerformed(false);
+
+ // give the saveState thread time to start!
+ Thread.sleep(100);
+
+ // this will select "Force Quit"
+ JvOptionPane.setMockResponse(JvOptionPane.YES_OPTION);
+ QResponse response = QuitHandler.getQuitResponse(true,
+ QuitHandler.defaultOkQuit, () -> {
+ // set FORCE_QUIT without the force quit
+ jalview.bin.Console.debug(
+ "Setting FORCE_QUIT without actually quitting");
+ QuitHandler.setResponse(QResponse.FORCE_QUIT);
+ }, QuitHandler.defaultCancelQuit);
+ long end = System.currentTimeMillis();
+
+ Assert.assertEquals(response, QResponse.FORCE_QUIT);
+ // if the wait (min wait is 1s) wasn't long enough...
+ Assert.assertTrue(end - start > 1000,
+ "Force-Quit-whilst-saving was too short (" + (end - start)
+ + "ms)");
+ // if the wait was too long (probably waited for file to save)
+ Assert.assertTrue(end - start < 9090,
+ "Force-Quit-whilst-saving was too long (" + (end - start)
+ + "ms)");
+
+ }
+
+ }
@AfterMethod(alwaysRun = true)
public void tearDown()
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = "Functional")
}
@Test(groups = "Functional")
- public void testFindColumn_wrapped()
+ public void testFindColumn_and_FindAlignmentColumn_wrapped()
{
- Cache.applicationProperties.setProperty("WRAP_ALIGNMENT", "true");
+ Cache.setPropertyNoSave("WRAP_ALIGNMENT", "true");
AlignFrame alignFrame = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
AlignViewport av = alignFrame.getViewport();
{
Jalview.main(
new String[]
- { "-nonews", "-props", "test/jalview/testProps.jvprops" });
- { "--nonews", "--props", "test/jalview/testProps.jvprops" });
++ { "--nonews", "--props", "test/jalview/testProps.jvprops" });
}
@BeforeMethod(alwaysRun = true)
assertEquals("abcde12345afg",
PDBStructureChooserQuerySource.sanitizeSeqName(name));
}
+
+ @Test(groups = { "Functional" }, dataProvider = "openStructureFileParams")
+ public void openStructureFileForSequenceTest(String alfile, String seqid,
+ String sFilename, TFType tft, String paeFilename,
+ boolean showRefAnnotations, boolean doXferSettings,
+ ViewerType viewerType, int seqNum, int annNum, int viewerNum,
+ String propsFile)
+ {
+ Cache.loadProperties(
+ propsFile == null ? "test/jalview/io/testProps.jvprops"
+ : propsFile);
+
+ Jalview.main(
+ propsFile == null ? null : new String[]
+ { "--props", propsFile });
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.OK_OPTION);
+
+ FileLoader fileLoader = new FileLoader(true);
+ FileFormatI format = null;
+ File alFile = new File(alfile);
+ try
+ {
+ format = new IdentifyFile().identify(alFile, DataSourceType.FILE);
+ } catch (FileFormatException e1)
+ {
+ Assert.fail(
+ "Unknown file format for '" + alFile.getAbsolutePath() + "'");
+ }
+
+ AlignFrame af = fileLoader.LoadFileWaitTillLoaded(alFile,
+ DataSourceType.FILE, format);
+ AlignmentPanel ap = af.alignPanel;
+ Assert.assertNotNull("No alignPanel", ap);
+
+ AlignmentI al = ap.getAlignment();
+ Assert.assertNotNull(al);
+
+ SequenceI seq = al.findName(seqid);
+ Assert.assertNotNull("Sequence '" + seqid + "' not found in alignment",
+ seq);
+
+ StructureChooser.openStructureFileForSequence(null, null, ap, seq,
+ false, sFilename, tft, paeFilename, false, showRefAnnotations,
+ doXferSettings, viewerType);
+
+ List<SequenceI> seqs = al.getSequences();
+ Assert.assertNotNull(seqs);
+
+ Assert.assertEquals("Wrong number of sequences", seqNum, seqs.size());
+
+ AlignViewportI av = ap.getAlignViewport();
+ Assert.assertNotNull(av);
+
+ AlignmentAnnotation[] aas = al.getAlignmentAnnotation();
+ int visibleAnn = 0;
+ for (AlignmentAnnotation aa : aas)
+ {
+ if (aa.visible)
+ visibleAnn++;
+ }
+ Assert.assertEquals("Wrong number of viewed annotations", annNum,
+ visibleAnn);
+
+ if (viewerNum > -1)
+ {
+ try
+ {
+ Thread.sleep(100);
+ } catch (InterruptedException e)
+ {
+ // TODO Auto-generated catch block
+ e.printStackTrace();
+ }
- List<StructureViewerBase> openViewers = Desktop.instance
++ List<StructureViewerBase> openViewers = Desktop.getInstance()
+ .getStructureViewers(ap, null);
+ Assert.assertNotNull(openViewers);
+ int count = 0;
+ for (StructureViewerBase svb : openViewers)
+ {
+ if (svb.isVisible())
+ count++;
+ }
+ Assert.assertEquals("Wrong number of structure viewers opened",
+ viewerNum, count);
+
+ }
+
+ if (af != null)
+ {
+ af.setVisible(false);
+ af.dispose();
+ }
+ }
+
+ @DataProvider(name = "openStructureFileParams")
+ public Object[][] openStructureFileParams()
+ {
+ /*
+ String alFile,
+ String seqid,
+ String structureFilename,
+ TFType tft,
+ String paeFilename,
+ boolean showRefAnnotations,
+ boolean doXferSettings, // false for Commands
+ ViewerType viewerType,
+ int seqNum,
+ int annNum,
+ int viewerNum,
+ String propsFile
+ */
+ return new Object[][] {
+ /*
+ */
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.DEFAULT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ true, false, null, 15, 7, 0, null },
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.PLDDT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ true, false, null, 15, 7, 0, null },
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.PLDDT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ false, false, null, 15, 4, 0, null },
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.DEFAULT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ true, false, ViewerType.JMOL, 15, 7, 1, null },
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.PLDDT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ true, false, ViewerType.JMOL, 15, 7, 1, null },
+ { "examples/uniref50.fa", "FER1_SPIOL",
+ "examples/AlphaFold/AF-P00221-F1-model_v4.cif", TFType.PLDDT,
+ "examples/AlphaFold/AF-P00221-F1-predicted_aligned_error_v4.json",
+ false, false, ViewerType.JMOL, 15, 4, 1, null }, };
+ }
+
}
--- /dev/null
+package jalview.hmmer;
+
+import static org.testng.Assert.assertEquals;
+import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertNotNull;
+import static org.testng.Assert.assertTrue;
+import static org.testng.Assert.fail;
+
+import jalview.bin.Jalview;
+import jalview.datamodel.AlignmentI;
+import jalview.datamodel.HiddenMarkovModel;
+import jalview.datamodel.SequenceI;
+import jalview.gui.AlignFrame;
+import jalview.gui.Desktop;
+import jalview.io.HMMFile;
+import jalview.util.MessageManager;
+import jalview.ws.params.ArgumentI;
+import jalview.ws.params.simple.Option;
+
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.testng.annotations.AfterClass;
+import org.testng.annotations.BeforeClass;
+import org.testng.annotations.Test;
+
+public class HMMERTest {
+
+ AlignFrame frame;
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpBeforeClass() throws Exception
+ {
+ /*
+ * NB: check HMMER_PATH in testProps.jvprops is valid for
+ * the machine on which this runs
+ */
+ Jalview.main(
+ new String[]
+ { "-noquestionnaire", "-nonews", "-props",
+ "test/jalview/hmmer/testProps.jvprops", "-open",
+ "examples/uniref50.fa" });
- frame = Desktop.getAlignFrames()[0];
++ frame = Desktop.getDesktopAlignFrames()[0];
+ }
+
+ @AfterClass(alwaysRun = true)
+ public static void tearDownAfterClass() throws Exception
+ {
+ Desktop.getInstance().closeAll_actionPerformed(null);
+ }
+
+ /**
+ * Test with a dependency on locally installed hmmbuild binaries
+ *
+ * @throws MalformedURLException
+ * @throws IOException
+ */
+ @Test(groups = "External")
+ public void testHMMBuildThenHMMAlign()
+ throws MalformedURLException, IOException
+ {
+ /*
+ * run hmmbuild
+ */
+ testHMMBuild();
+ List<SequenceI> hmms = frame.getViewport().getAlignment()
+ .getHmmSequences();
+ assertFalse(hmms.isEmpty());
+
+ /*
+ * now run hmmalign - by default with respect to the added HMM profile
+ */
+ testHMMAlign();
+ }
+
+ public void testHMMBuild()
+ {
+ /*
+ * set up argument to run hmmbuild for the alignment
+ */
+ ArrayList<ArgumentI> params = new ArrayList<>();
+ String argName = MessageManager.getString("label.hmmbuild_for");
+ String argValue = MessageManager.getString("label.alignment");
+ params.add(
+ new Option(argName, null, false, null, argValue, null, null));
+
+ HMMBuild builder = new HMMBuild(frame, params);
+ builder.run();
+
+ SequenceI seq = frame.getViewport().getAlignment().getSequenceAt(0);
+ HiddenMarkovModel hmm = seq.getHMM();
+ assertNotNull(hmm);
+
+ assertEquals(hmm.getLength(), 148);
+ assertEquals(hmm.getAlphabetType(), "amino");
+ assertEquals(hmm.getName(), "Alignment_HMM");
+ assertEquals(hmm.getProperty(HMMFile.EFF_NUMBER_OF_SEQUENCES),
+ "0.648193");
+ }
+
+ public void testHMMAlign()
+ {
+ HmmerCommand thread = new HMMAlign(frame,
+ new ArrayList<ArgumentI>());
+ thread.run();
+
- AlignFrame[] alignFrames = Desktop.getAlignFrames();
++ AlignFrame[] alignFrames = Desktop.getDesktopAlignFrames();
+ if (alignFrames == null)
+ {
+ fail("No align frame loaded");
+ }
+
+ /*
+ * now have the original align frame, and another for realigned sequences
+ */
+ assertEquals(alignFrames.length, 2);
+ AlignmentI original = alignFrames[0].getViewport().getAlignment();
+ assertNotNull(original);
+ AlignmentI realigned = alignFrames[1].getViewport().getAlignment();
+ assertNotNull(realigned);
+ assertFalse(original.getHmmSequences().isEmpty());
+ assertFalse(realigned.getHmmSequences().isEmpty());
+
+ SequenceI ferCapan = original.findName("FER_CAPAN");
+ assertTrue(ferCapan.getSequenceAsString().startsWith("MA------SVSAT"));
+
+ SequenceI ferCapanRealigned = realigned.findName("FER_CAPAN");
+ assertTrue(ferCapanRealigned.getSequenceAsString()
+ .startsWith("-------m-A----SVSAT"));
+ }
+}
+
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
-
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = { "Functional" })
{
// retrieve dbref
- SequenceFetcher sf = new SequenceFetcher(Desktop.instance,
+ SequenceFetcher sf = new SequenceFetcher(Desktop.getInstance(),
forSource, forAccession);
sf.run();
- AlignFrame[] afs = Desktop.getAlignFrames();
+ AlignFrame[] afs = Desktop.getDesktopAlignFrames();
if (afs.length == 0)
{
failedDBRetr.add("Didn't retrieve " + first);
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
// recover stored project
af = new FileLoader(false).LoadFileWaitTillLoaded(
savedProjects.get(first).toString(), DataSourceType.FILE);
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
pass3 = 0;
// recover stored project
File storedProject = savedProjects.get(nextxref);
}
else
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
// recover stored project
File storedProject = savedProjects.get(nextnextxref);
if (storedProject == null)
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@BeforeTest(alwaysRun = true)
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- jalview.gui.Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
{
seq.addDBRef(new DBRefEntry("Uniprot", "0", "P3041" + i));
}
-
+
sar.createSequenceAnnotationReport(sb, seq, true, true, null, true);
String report = sb.toString();
- assertTrue(report.startsWith("<i>\n" + "<br>\n" + "UNIPROT P30410,\n"
- + " P30411,\n" + " P30412,\n" + " P30413,...<br>\n"
- + "PDB0 3iu1<br>\n" + "PDB1 3iu1<br>"));
- assertTrue(report.endsWith("PDB5 3iu1<br>\n" + "PDB6 3iu1<br>\n"
- + "PDB7 3iu1<br>\n" + "PDB8,...<br>\n"
+ assertTrue(report.startsWith("<i>\n" + "<br/>\n" + "UNIPROT P30410,\n"
+ + " P30411,\n" + " P30412,\n" + " P30413,...<br/>\n"
+ + "PDB0 3iu1<br/>\n" + "PDB1 3iu1<br/>"));
+ assertTrue(report.endsWith("PDB3 3iu1<br/>\n" + "PDB4,...<br/>\n"
+ "(Output Sequence Details to list all database references)\n"
+ "</i>"));
}
import jalview.api.AlignmentViewPanel;
import jalview.api.FeatureColourI;
import jalview.api.ViewStyleI;
+ import jalview.bin.Cache;
import jalview.datamodel.AlignmentAnnotation;
import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.Annotation;
+ import jalview.datamodel.ContactListI;
+ import jalview.datamodel.ContactMatrix;
+ import jalview.datamodel.ContactMatrixI;
import jalview.datamodel.DBRefEntry;
import jalview.datamodel.GeneLocus;
+import jalview.datamodel.HiddenMarkovModel;
+ import jalview.datamodel.GroupSet;
import jalview.datamodel.HiddenSequences;
import jalview.datamodel.Mapping;
import jalview.datamodel.PDBEntry;
import jalview.util.matcher.Condition;
import jalview.viewmodel.AlignmentViewport;
import jalview.viewmodel.seqfeatures.FeatureRendererModel;
+import jalview.ws.sifts.SiftsSettings;
+import junit.extensions.PA;
+ import jalview.ws.datamodel.MappableContactMatrixI;
+ import jalview.ws.datamodel.alphafold.PAEContactMatrix;
+
@Test(singleThreaded = true)
public class Jalview2xmlTests extends Jalview2xmlBase
{
@BeforeClass(alwaysRun = true)
public void setUpJvOptionPane()
{
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
JvOptionPane.setInteractiveMode(false);
JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
}
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/exampleFile_2_7.jar", DataSourceType.FILE);
assertNotNull(af, "Didn't read in the example file correctly.");
- assertEquals(Desktop.getAlignFrames().length,
- assertTrue(Desktop.getDesktopAlignFrames().length == 1 + origCount,
++ assertEquals(Desktop.getDesktopAlignFrames().length,
+ 1 + origCount,
"Didn't gather the views in the example file.");
}
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.getAlignFrames() != null)
+ if (Desktop.getDesktopAlignFrames() != null)
{
- Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+ Assert.assertEquals(Desktop.getDesktopAlignFrames().length, 0);
}
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
DataSourceType.FILE);
Assert.assertNotNull(af);
- Assert.assertEquals(Desktop.getAlignFrames().length,
+ Assert.assertEquals(Desktop.getDesktopAlignFrames().length,
Desktop.getAlignmentPanels(
af.getViewport().getSequenceSetId()).length);
- Assert.assertEquals(Desktop
- .getAlignmentPanels(af.getViewport().getSequenceSetId()).length,
+ Assert.assertEquals(
+ Desktop.getAlignmentPanels(
+ af.getViewport().getSequenceSetId()).length,
oldviews);
}
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.getAlignFrames() != null)
+ if (Desktop.getDesktopAlignFrames() != null)
{
- Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+ Assert.assertEquals(Desktop.getDesktopAlignFrames().length, 0);
}
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
{
Assert.fail("Didn't save the expanded view state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.getAlignFrames() != null)
+ if (Desktop.getDesktopAlignFrames() != null)
{
- Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+ Assert.assertEquals(Desktop.getDesktopAlignFrames().length, 0);
}
af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
{
Assert.fail("Didn't save the state", e);
}
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.getAlignFrames() != null)
+ if (Desktop.getDesktopAlignFrames() != null)
{
- Assert.assertEquals(Desktop.getAlignFrames().length, 0);
+ Assert.assertEquals(Desktop.getDesktopAlignFrames().length, 0);
}
AlignFrame restoredFrame = new FileLoader().LoadFileWaitTillLoaded(
"Mismatch PDBEntry 'Type'");
Assert.assertNotNull(recov.getFile(),
"Recovered PDBEntry should have a non-null file entry");
- Assert.assertEquals(
- recov.getFile().toLowerCase(Locale.ENGLISH)
- .lastIndexOf("pdb"),
- recov.getFile().length() - 3,
- "Recovered PDBEntry file should have PDB suffix");
+ Assert.assertEquals(recov.getFile().toLowerCase(Locale.ENGLISH).lastIndexOf("pdb"),recov.getFile().length()-3, "Recovered PDBEntry file should have PDB suffix");
}
}
--
/**
* Configure an alignment and a sub-group each with distinct colour schemes,
* Conservation and PID thresholds, and confirm these are restored from the
* @throws IOException
*/
@Test(groups = { "Functional" })
- public void testStoreAndRecoverColourThresholds() throws IOException
+ public void testStoreAndRecoverAnnotationRowElementColours()
+ throws IOException
{
- Desktop.instance.closeAll_actionPerformed(null);
- AlignFrame af = new FileLoader().LoadFileWaitTillLoaded("SEQ\tMNQ",
- DataSourceType.PASTE);
-
- AlignViewport av = af.getViewport();
- AlignmentI al = av.getAlignment();
- SequenceI fsq;
- fsq = al.getSequenceAt(0);
- Annotation annots[] = new Annotation[fsq.getLength()];
- AlignmentAnnotation ala = new AlignmentAnnotation("Colour", "Annots",
- annots);
- annots[0] = new Annotation(1.0f);
- annots[1] = new Annotation(2.0f);
- annots[2] = new Annotation(3.0f);
- annots[0].colour = Color.RED;
- annots[1].colour = Color.GREEN;
- annots[2].colour = Color.BLUE;
- ala.validateRangeAndDisplay();
- al.getSequenceAt(0).addAlignmentAnnotation(ala);
- al.addAnnotation(ala);
- /*
- * and colour by annotation
- */
- AnnotationColourGradient acg = new AnnotationColourGradient(ala,
- af.alignPanel.av.getGlobalColourScheme(), 0);
- acg.setSeqAssociated(true);
- acg.setPredefinedColours(true);
- af.changeColour(acg);
- Color seqcol[] = new Color[3];
- for (int iStart = fsq.findIndex(fsq.getStart()), i = 0; i < 3; i++)
- {
- seqcol[i] = af.alignPanel.getSeqPanel().seqCanvas
- .getSequenceRenderer()
- .getResidueColour(fsq, iStart + i, null);
- }
- /*
- * save project, close windows, reload project, verify
- */
- File tfile = File.createTempFile(
- "testStoreAndRecoverAnnotRowElemColors", ".jvp");
- tfile.deleteOnExit();
- new Jalview2XML(false).saveState(tfile);
- // Desktop.instance.closeAll_actionPerformed(null);
- af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
- DataSourceType.FILE);
- Assert.assertNotNull(af, "Failed to reload project");
- /*
- * verify alignment annotation has colors
- */
- av = af.getViewport();
-
- ColourSchemeI loadedCscheme = av.getGlobalColourScheme();
- Assert.assertTrue(loadedCscheme instanceof AnnotationColourGradient,
- "Didn't apply Annotation colour gradient");
- acg = (AnnotationColourGradient) loadedCscheme;
- assertTrue(acg.isSeqAssociated());
- assertTrue(acg.isPredefinedColours());
-
- al = av.getAlignment();
- fsq = al.getSequenceAt(0);
- ala = fsq.getAnnotation()[0];
- Assert.assertNotNull(ala, "No annotation row recovered");
- Assert.assertNotNull(ala.annotations);
- for (int iStart = al.getSequenceAt(0)
- .findIndex(al.getSequenceAt(0).getStart()), i = 0; i < 3; i++)
- {
- Assert.assertTrue(ala.annotations[i].colour != null);
- Assert.assertTrue(ala.annotations[i].colour.equals(annots[i].colour));
- Color newseqcol = af.alignPanel.getSeqPanel().seqCanvas
- .getSequenceRenderer()
- .getResidueColour(fsq, iStart + i, null);
- Assert.assertTrue(seqcol[i].equals(newseqcol),
- "Sequence shading is different");
-
- }
-
- }
-
- /**
- * Configure an alignment and a sub-group each with distinct colour schemes,
- * Conservation and PID thresholds, and confirm these are restored from the
- * saved project.
- *
- * @throws IOException
- */
- @Test(groups = { "Functional" })
- public void testStoreAndRecoverColourThresholds() throws IOException
- {
- Desktop.instance.closeAll_actionPerformed(null);
+ Desktop.getInstance().closeAll_actionPerformed(null);
AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
"examples/uniref50.fa", DataSourceType.FILE);
assertTrue(dbRef instanceof GeneLocus);
assertEquals(dbRef, dbref3);
}
+
+ /**
+ * test store and recovery of Overview windows
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = true)
+ public void testStoreAndRecoverOverview() throws Exception
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ Cache.setProperty("SHOW_OVERVIEW", "false");
+ Cache.setProperty(Preferences.USE_LEGACY_GAP, "false");
- Cache.setColourProperty(Preferences.GAP_COLOUR, Color.green);
- Cache.setColourProperty(Preferences.HIDDEN_COLOUR, Color.yellow);
++ Cache.setColourPropertyNoSave(Preferences.GAP_COLOUR, Color.green);
++ Cache.setColourPropertyNoSave(Preferences.HIDDEN_COLOUR, Color.yellow);
+ Cache.setProperty(Preferences.SHOW_OV_HIDDEN_AT_START, "true");
+
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/uniref50.fa", DataSourceType.FILE);
+
+ /*
+ * open and resize / reposition overview
+ */
+ af.overviewMenuItem_actionPerformed(null);
+ OverviewPanel ov1 = af.alignPanel.getOverviewPanel();
+ assertNotNull(ov1);
+ ov1.setFrameBounds(20, 30, 200, 400);
+ assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa");
+ assertTrue(ov1.isShowHiddenRegions());
+
+ /*
+ * open a New View and its Overview and reposition it
+ */
+ af.newView_actionPerformed(null);
+ af.overviewMenuItem_actionPerformed(null);
+ OverviewPanel ov2 = af.alignPanel.getOverviewPanel();
+ assertNotNull(ov2);
+ assertNotSame(ov1, ov2);
+ ov2.setFrameBounds(25, 35, 205, 405);
+ assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa Original");
+ assertEquals(ov2.getTitle(), "Overview examples/uniref50.fa View 1");
+
+ File tfile = File.createTempFile("testStoreAndRecoverOverview", ".jvp");
+ new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ /*
+ * change preferences (should _not_ affect reloaded Overviews)
+ */
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ Cache.setProperty(Preferences.USE_LEGACY_GAP, "true");
- Cache.setColourProperty(Preferences.GAP_COLOUR, Color.blue);
- Cache.setColourProperty(Preferences.HIDDEN_COLOUR, Color.orange);
++ Cache.setColourPropertyNoSave(Preferences.GAP_COLOUR, Color.blue);
++ Cache.setColourPropertyNoSave(Preferences.HIDDEN_COLOUR, Color.orange);
+ Cache.setProperty(Preferences.SHOW_OV_HIDDEN_AT_START, "false");
+
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+
+ /*
+ * workaround: explicitly select View 1 (not in focus after restore)
+ */
+ af.tabSelectionChanged(1);
+
+ /*
+ * verify restored overview for View 1
+ */
+ ov2 = af.alignPanel.getOverviewPanel();
+ assertEquals(ov2.getCanvas().getGapColour(), Color.green);
+ // 'non-legacy' colouring uses white for non-gapped residues
+ assertEquals(ov2.getCanvas().getResidueColour(), Color.white);
+ assertEquals(ov2.getCanvas().getHiddenColour(), Color.yellow);
+ assertEquals(ov2.getTitle(), "Overview examples/uniref50.fa View 1");
+ assertEquals(ov2.getFrameBounds(), new Rectangle(25, 35, 205, 405));
+ assertTrue(ov2.isShowHiddenRegions());
+
+ /*
+ * verify restored overview for Original view
+ */
+ af.tabSelectionChanged(0);
+ ov1 = af.alignPanel.getOverviewPanel();
+ assertEquals(ov1.getCanvas().getGapColour(), Color.green);
+ // 'non-legacy' colouring uses white for non-gapped residues
+ assertEquals(ov1.getCanvas().getResidueColour(), Color.white);
+ assertEquals(ov1.getCanvas().getHiddenColour(), Color.yellow);
+ assertEquals(ov1.getTitle(), "Overview examples/uniref50.fa Original");
+ assertEquals(ov1.getFrameBounds(), new Rectangle(20, 30, 200, 400));
+ assertTrue(ov1.isShowHiddenRegions());
+ }
+
+ /**
+ * Test that a view with no Overview is restored with no Overview, even if
+ * 'Open Overview' is selected in Preferences
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = true)
+ public void testStoreAndRecoverNoOverview() throws Exception
+ {
+ Cache.setProperty("SHOW_OVERVIEW", "false");
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ ">seq1\nMATRSQFLVNF\n", DataSourceType.PASTE);
+
+ File tfile = File.createTempFile("testStoreAndRecoverOverview", ".jvp");
+ new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+
+ assertNull(af.alignPanel.getOverviewPanel());
+ }
+
+ /**
+ * Test that a view from an older version of Jalview is restored with Overview
+ * automatically shown when the preference is set
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = true)
+ public void testAutoShowOverviewForLegacyProjects() throws Exception
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ Cache.setProperty("SHOW_OVERVIEW", "true");
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile.jvp", DataSourceType.FILE);
+
+ Cache.setProperty("SHOW_OVERVIEW", "false");
+ assertNotNull(af.alignPanel.getOverviewPanel());
+ }
+
+ /**
+ * Test that loading example.jvp, doing some stuff, then hitting reload
+ * doesn't leave the modified window still open
+ *
+ * See JAL-4127 - interactively performing the same actions and reloading
+ * works fine, but programmatically they do not
+ *
+ * @throws Exception
+ */
+ @Test(groups = { "Functional" }, enabled = false)
+ public void testReloadActuallyReloads() throws Exception
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile.jvp", DataSourceType.FILE);
+ af.getViewport().getColumnSelection().addElement(3);
+ af.hideSelColumns_actionPerformed(null);
+ af.newView("new", true);
+ af.reload_actionPerformed(null);
+ Thread.sleep(30);
+ // af exists still but isn't shown
+ assertTrue(af.isClosed());
+ }
+
+ @Test(groups = { "Functional" })
+ public void testMatrixToFloatsAndBack()
+ {
+ int imax = 2000;
+ int i = imax;
+ SequenceI sq = new Sequence("dummy", "SEQ");
+ while (sq.getLength() < i)
+ {
+ sq.setSequence(sq.getSequenceAsString() + 'Q');
+ }
+ float[][] paevals = new float[i][i];
+ for (i = imax - 1; i >= 0; i--)
+ {
+ for (int j = 0; j <= i; j++)
+ {
+ paevals[i][j] = ((i - j < 2)
+ || ((i > 1 && i < 5) && (j > 1 && i < 5))) ? 1 : 0f;
+ paevals[j][i] = -paevals[i][j];
+ }
+ }
+ PAEContactMatrix dummyMat = new PAEContactMatrix(sq, paevals);
+ String content = ContactMatrix.contactToFloatString(dummyMat);
+ Assert.assertTrue(content.contains("\t1.")); // at least one element must be
+ // 1
+ float[][] vals = ContactMatrix.fromFloatStringToContacts(content,
+ sq.getLength(), sq.getLength());
+ assertEquals(vals[3][4], paevals[3][4]);
+ assertEquals(vals[4][3], paevals[4][3]);
+
+ // test recovery
+ for (i = 0; i < imax; i++)
+ {
+ for (int j = 0; j < imax; j++)
+ {
+ assertEquals(vals[i][j], paevals[i][j]);
+ }
+ }
+ }
+
+ @Test(groups = { "Functional" })
+ public void testPAEsaveRestore() throws Exception
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ ">seq1\nMATRSQFLVNF\n", DataSourceType.PASTE);
+ AlignmentI al = af.getViewport().getAlignment();
+ // PAE matrices are added as reference annotation to the dataset sequence
+ // at least for now.
+ SequenceI sq = al.getSequenceAt(0).getDatasetSequence();
+ int i = sq.getLength();
+ float[][] paevals = new float[i][i];
+ for (i = i - 1; i >= 0; i--)
+ {
+ for (int j = 0; j <= i; j++)
+ {
+ paevals[i][j] = ((i - j < 2)
+ || ((i > 1 && i < 5) && (j > 1 && i < 5))) ? 1 : 0f;
+ paevals[j][i] = -paevals[i][j];
+ }
+ }
+ PAEContactMatrix dummyMat = new PAEContactMatrix(sq, paevals);
+ String content = ContactMatrix.contactToFloatString(dummyMat);
+ Assert.assertTrue(content.contains("\t1.")); // at least one element must be
+ // 1
+ float[][] vals = ContactMatrix.fromFloatStringToContacts(content,
+ sq.getLength(), sq.getLength());
+ assertEquals(vals[3][4], paevals[3][4]);
+ assertEquals(vals[4][3], paevals[4][3]);
+ dummyMat.setGroupSet(GroupSet.makeGroups(dummyMat, false, 0.5f, false));
+ Assert.assertNotSame(dummyMat.getNewick(), "");
+ AlignmentAnnotation paeCm = sq.addContactList(dummyMat);
+ al.addAnnotation(paeCm);
+ // verify store/restore of group bitsets
+ for (BitSet gp : dummyMat.getGroups())
+ {
+ StringBuilder sb = new StringBuilder();
+ for (long val : gp.toLongArray())
+ {
+ if (sb.length() > 0)
+ {
+ sb.append(",");
+ }
+ sb.append(val);
+ }
+ String[] longvals = sb.toString().split(",");
+ long[] newlongvals = new long[longvals.length];
+ for (int lv = 0; lv < longvals.length; lv++)
+ {
+ try
+ {
+ newlongvals[lv] = Long.valueOf(longvals[lv]);
+ } catch (Exception x)
+ {
+ Assert.fail("failed to deserialise bitset element ");
+ }
+ }
+ BitSet newGp = BitSet.valueOf(newlongvals);
+ assertTrue(gp.equals(newGp));
+ }
+ File tfile = File.createTempFile("testStoreAndRecoverPAEmatrix",
+ ".jvp");
+ new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+ AlignmentI newAl = af.getViewport().getAlignment();
+ SequenceI newSeq = newAl.getSequenceAt(0).getDatasetSequence();
+ // check annotation of the expected type exists
+ Assert.assertEquals(newSeq.getAnnotation().length, 1);
+ Assert.assertEquals(newSeq.getAnnotation()[0].graph, paeCm.graph);
+
+ // check a contact matrix was recovered
+ Assert.assertEquals(newSeq.getContactMaps().size(), 1);
+ // and can be found for the annotation on the sequence
+ ContactMatrixI restoredMat = newSeq
+ .getContactMatrixFor(newSeq.getAnnotation()[0]);
+ Assert.assertNotNull(restoredMat);
+ MapList oldMap = ((MappableContactMatrixI) dummyMat).getMapFor(sq);
+ MapList newMap = ((MappableContactMatrixI) restoredMat)
+ .getMapFor(newSeq);
+ Assert.assertEquals(oldMap.getFromRanges(), newMap.getFromRanges());
+ Assert.assertEquals(oldMap.getToRanges(), newMap.getToRanges());
+ Assert.assertEquals(oldMap.getFromRatio(), newMap.getFromRatio());
+ Assert.assertEquals(oldMap.getToRatio(), newMap.getToRatio());
+ for (i = sq.getLength() - 1; i >= 0; i--)
+ {
+ ContactListI oldCM = dummyMat.getContactList(i),
+ newCM = restoredMat.getContactList(i);
+ for (int j = oldCM.getContactHeight(); j >= 0; j--)
+ {
+ double old_j = oldCM.getContactAt(j);
+ double new_j = newCM.getContactAt(j);
+ Assert.assertEquals(old_j, new_j);
+ }
+ }
+ Assert.assertEquals(restoredMat.hasGroups(), dummyMat.hasGroups());
+ Assert.assertEquals(restoredMat.getGroups(), dummyMat.getGroups());
+ Assert.assertEquals(restoredMat.hasTree(), dummyMat.hasTree());
+ Assert.assertEquals(restoredMat.getNewick(), dummyMat.getNewick());
+
+ // verify no duplicate PAE matrix data when new view created and saved
+
+ // add reference annotations to view first, then copy
+ AlignmentUtils.addReferenceAnnotationTo(newAl, newAl.getSequenceAt(0),
+ newSeq.getAnnotation()[0], null);
+
+ AlignmentViewPanel newview = af.newView("copy of PAE", true);
+
+ // redundant asserts here check all is good with the new view firest...
+ AlignmentI newviewAl = newview.getAlignment();
+ SequenceI newviewSeq = newviewAl.getSequenceAt(0);
+ // check annotation of the expected type exists
+ Assert.assertEquals(newviewSeq.getAnnotation().length, 1);
+ Assert.assertEquals(newviewSeq.getAnnotation()[0].graph, paeCm.graph);
+ // check we have just one contact matrix mapping
+ Assert.assertEquals(newviewSeq.getContactMaps().size(), 1);
+
+ // and can be found for the annotation on the sequence
+ ContactMatrixI newviewMat = newviewSeq
+ .getContactMatrixFor(newviewSeq.getAnnotation()[0]);
+ Assert.assertNotNull(newviewMat);
+
+ Assert.assertTrue(newviewMat == restoredMat);
+
+ // save the two views and restore. Now look at visible annotation to check
+ // all views have shared refs.
+
+ tfile = File.createTempFile("testStoreAndRecoverPAEmatrixTwoViews",
+ ".jvp");
+ new Jalview2XML(false).saveState(tfile);
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+
+ af = new FileLoader().LoadFileWaitTillLoaded(tfile.getAbsolutePath(),
+ DataSourceType.FILE);
+ newAl = af.getAlignPanels().get(0).getAlignment();
+ AlignmentAnnotation view1aa = newAl.getSequenceAt(0).getAnnotation()[0];
+
+ newviewAl = af.getAlignPanels().get(1).getAlignment();
+ AlignmentAnnotation view2aa = newviewAl.getSequenceAt(0)
+ .getAnnotation()[0];
+
+ // annotations are shared across alignment views - so should still have an
+ // identical pair of annotations.
+ Assert.assertTrue(view1aa == view2aa);
+ // identical annotations means identical contact matrix mappings
+ Assert.assertEquals(
+ newAl.getDataset().getSequenceAt(0).getContactMaps().size(), 1);
+
+ // TODO Verify when distinct mappable PAEs are created, only one PAE dataset
+ // is actually held.
+ // Assert.assertTrue(view1aa!=view2aa);
+ // restoredMat = newAl.getContactMatrixFor(view1aa);
+ // newviewMat = newviewAl.getContactMatrixFor(view2aa);
+ // Assert.assertTrue(restoredMat!=newviewMat);
+
+ }
+
+ @Test(groups = "Functional")
+ public void testStoreAndRestoreIDwidthAndAnnotationHeight()
+ throws IOException
+ {
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ final String SECONDVIEW = "With Diffferent IDwidth";
+ // create a new tempfile
+ File tempfile = File.createTempFile("jvIdWidthStoreRestore", "jvp");
+
+ AlignFrame af = new FileLoader().LoadFileWaitTillLoaded(
+ "examples/exampleFile.jvp", DataSourceType.FILE);
+ assertNotNull(af, "Didn't read in the example file correctly.");
+ // FIXME JAL-4281 test made platform dependent to pass, but probably
+ // shouldn't be platform dependent
+ assertEquals(af.alignPanel.getAlignViewport().getIdWidth(),
+ Platform.isAMacAndNotJS() ? 144 : 138,
+ "Legacy project import should have fixed ID width");
+ assertTrue(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+
+ af.alignPanel.getAlignViewport().setIdWidth(100);
+ af.alignPanel.updateLayout();
+ assertTrue(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+
+ Jalview2XML jv2xml = new jalview.project.Jalview2XML(false);
+ tempfile.delete();
+ jv2xml.saveState(tempfile);
+ assertTrue(jv2xml.errorMessage == null,
+ "Failed to save dummy project with PCA: test broken");
+ af = null;
+ // load again.
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ af = new FileLoader().LoadFileWaitTillLoaded(
+ tempfile.getCanonicalPath(), DataSourceType.FILE);
+ assertTrue(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+ assertEquals(af.alignPanel.getAlignViewport().getIdWidth(), 100,
+ "New project exported and import should have adjusted ID width");
+
+ af.alignPanel.getAlignViewport().setIdWidth(100);
+ af.alignPanel.updateLayout();
+ assertTrue(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+
+ // now make it autoadjusted
+ af.alignPanel.getAlignViewport().setIdWidth(-1);
+ af.alignPanel.getIdPanel().getIdCanvas().setManuallyAdjusted(false);
+ af.alignPanel.updateLayout();
+ assertFalse(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+ assertTrue(af.alignPanel.getAlignViewport().getIdWidth() > -1,
+ "New project exported and import should have adjusted ID width");
+
+ jv2xml = new jalview.project.Jalview2XML(false);
+ tempfile.delete();
+ jv2xml.saveState(tempfile);
+ assertTrue(jv2xml.errorMessage == null,
+ "Failed to save dummy project with PCA: test broken");
+ af = null;
+ // load again.
- Desktop.instance.closeAll_actionPerformed(null);
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ af = new FileLoader().LoadFileWaitTillLoaded(
+ tempfile.getCanonicalPath(), DataSourceType.FILE);
+ assertFalse(
+ af.alignPanel.getIdPanel().getIdCanvas().isManuallyAdjusted());
+ assertTrue(af.alignPanel.getAlignViewport().getIdWidth() > -1,
+ "New project exported and import should have adjusted ID width");
+ }
+
}
import static org.testng.AssertJUnit.assertEquals;
+ import java.awt.Color;
+ import java.util.ArrayList;
+
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.Test;
+
+import jalview.api.AlignViewportI;
import jalview.bin.Cache;
import jalview.datamodel.Alignment;
import jalview.datamodel.AlignmentI;
// gaps gap colour
c = rcf.getBoxColour(shader, seq, 3);
- assertEquals(OverviewResColourFinder.OVERVIEW_DEFAULT_GAP, c);
++ // 2.12 was assertEquals(OverviewResColourFinder.OVERVIEW_DEFAULT_GAP, c);
+ assertEquals(OverviewCanvas.OVERVIEW_DEFAULT_GAP, c);
// non legacy colouring with colour scheme
- rcf = new OverviewResColourFinder(false, Color.blue, Color.red);
+ rcf = new OverviewResColourFinder(Color.blue, Color.white, Color.red);
shader = new ResidueShader(new ZappoColourScheme());
// M residue pink
import java.util.List;
import java.util.Map;
+import org.testng.annotations.AfterMethod;
+ import org.testng.annotations.BeforeMethod;
import org.testng.annotations.Test;
import jalview.analysis.GeneticCodes;
public class FeatureRendererTest
{
+ @AfterMethod(alwaysRun = true)
+ public void tearDown()
+ {
- Desktop.getInstance().closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
++ }
++
+ @BeforeMethod(alwaysRun = true)
+ public void closeAll()
+ {
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = "Functional")
@AfterClass(alwaysRun = true)
public static void tearDownAfterClass() throws Exception
{
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
++ if (Desktop.getInstance()!= null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
}
@Test(groups = "Functional")
">FER1_MAIZE/1-150 Ferredoxin-1, chloroplast precursor\nMATVLGSPRAPAFFFSSSSLRAAPAPTAVALPAAKVGIMGRSASSRRRLRAQATYNVKLITPEGEVELQVPD\nDVYILDQAEEDGIDLPYSCRAGSCSSCAGKVVSGSVDQSDQSYLDDGQIADGWVLTCHAYPTSDVVIETHKE\nEELTGA",
DataSourceType.PASTE, FileFormat.Fasta);
SequenceI newseq = seqf.getViewport().getAlignment().getSequenceAt(0);
- StructureSelectionManager ssm = new jalview.structure.StructureSelectionManager();
+ StructureSelectionManager ssm = StructureSelectionManager
+ .getStructureSelectionManager(null);
StructureFile pmap = ssm.setMapping(true, new SequenceI[] { newseq },
new String[]
- { null }, "examples/3W5V.pdb", DataSourceType.FILE);
+ { null }, "examples/3W5V.pdb", DataSourceType.FILE, null, null);
if (pmap == null)
{
AssertJUnit.fail("Couldn't make a mapping for 3W5V to FER1_MAIZE");
sm.setProcessSecondaryStructure(true);
sm.setAddTempFacAnnot(true);
StructureFile pmap = sm.setMapping(true, new SequenceI[] { seq },
- new String[] { null }, "examples/1gaq.txt", DataSourceType.FILE);
- new String[]
- { null }, "examples/1gaq.txt", DataSourceType.FILE, null, null);
++ new String[] { null }, "examples/1gaq.txt", DataSourceType.FILE, null, null);
assertTrue(pmap != null);
assertEquals(3, pmap.getSeqs().size());
{
// for some reason 'BeforeMethod' (which should be inherited from
// Jalview2XmlBase isn't always called)...
- Desktop.getInstance().closeAll_actionPerformed(null);
- if (Desktop.instance != null)
- Desktop.instance.closeAll_actionPerformed(null);
- try
- {
++ if (Desktop.getInstance() != null)
++ Desktop.getInstance().closeAll_actionPerformed(null);
+ try {
Thread.sleep(200);
- } catch (Exception foo)
- {
- }
- ;
+ } catch (Exception foo) {};
SequenceI seq = new Sequence("4IM2|A",
"LDFCIRNIEKTVMGEISDIHTKLLRLSSSQGTIE");
String P4IM2_MISSING = "examples/testdata/4IM2_missing.pdb";
sm.setAddTempFacAnnot(true);
StructureFile pmap = sm.setMapping(true, new SequenceI[] { seq },
new String[]
- { null }, P4IM2_MISSING, DataSourceType.FILE, null, null);
+ { null }, P4IM2_MISSING,
- DataSourceType.FILE);
++ DataSourceType.FILE, null, null);
assertTrue(pmap != null);
assertEquals(1, pmap.getSeqs().size());
+ /*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * This file is part of Jalview.
+ *
+ * Jalview is free software: you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation, either version 3
+ * of the License, or (at your option) any later version.
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ * PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with Jalview. If not, see <http://www.gnu.org/licenses/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.util;
- import static org.testng.Assert.assertFalse;
+import static org.testng.Assert.assertTrue;
++import static org.testng.Assert.assertFalse;
+
+ import java.io.File;
+import java.io.IOException;
+import java.nio.file.Paths;
import java.util.List;
+ import org.testng.Assert;
+ import org.testng.annotations.DataProvider;
import org.testng.annotations.Test;
+ @Test
public class FileUtilsTest
{
- /*
++ // jalview 2.12
++ /*
+ * FIXME fails on bamboo since it the working directory named according to the build number
+ */
- @Test(groups = {"Functional","Not-bamboo"})
- public void testFindMatchingPaths() throws IOException
++ @Test(groups = {"Functional","Not-bamboo"})
++ public void testFindMatchingPaths() throws IOException
++ {
++ String expect1 = Paths.get("..", "jalview", "examples", "plantfdx.fa")
++ .toString();
++ String expect2 = Paths.get("../jalview/examples/plantfdx.features")
++ .toString();
++ String expect3 = Paths
++ .get("../jalview/examples/testdata/plantfdx.features")
++ .toString();
++
++ List<String> matches = FileUtils
++ .findMatchingPaths(Paths.get(".."),
++ ".*[\\\\/]plant.*\\.f.*");
++ System.out.println(matches);
++ assertTrue(matches.contains(expect1));
++ assertTrue(matches.contains(expect2));
++ assertTrue(matches.contains(expect3));
++ }
++
++ @Test(groups = "External")
++ public void testWindowsPath() throws IOException
++ {
++ if (System.getProperty("os.name").startsWith("Windows"))
++ {
++ /*
++ * should pass provided Eclipse is installed
++ */
++ List<String> matches = FileUtils.findMatches("C:\\",
++ "Program Files*/eclips*/eclips?.exe");
++ assertFalse(matches.isEmpty());
++
++ /*
++ * should pass provided Chimera is installed
++ */
++ matches = FileUtils.findMatches("C:\\",
++ "Program Files*/Chimera*/bin/{chimera,chimera.exe}");
++ assertFalse(matches.isEmpty());
++ }
++ }
++
++ /*
++ * FIXME fails on bamboo since it the working directory named according to the build number
++ */
++ @Test(groups = {"Functional","Not-bamboo"})
++ public void testFindMatches() throws IOException
++ {
++ String expect1 = Paths.get("..", "jalview", "examples", "plantfdx.fa")
++ .toString();
++ String expect2 = Paths.get("../jalview/examples/plantfdx.features")
++ .toString();
++ String expect3 = Paths
++ .get("../jalview/examples/testdata/plantfdx.features")
++ .toString();
++
++ List<String> matches = FileUtils
++ .findMatches("..", "jalview/ex*/plant*.f*");
++ System.out.println(matches);
++ assertTrue(matches.contains(expect1));
++ assertTrue(matches.contains(expect2));
++ assertFalse(matches.contains(expect3));
++ }
++ // end jalview 2.12
+ @Test(groups = "Functional", dataProvider = "patternsAndMinNumFiles")
+ public void testJavaFileGlob(String pattern, int atLeast, int atMost)
+ {
+ List<File> files = FileUtils.getFilesFromGlob(pattern);
+ if (atLeast != -1)
+ {
+ Assert.assertTrue(files.size() > atLeast,
+ "Did not find more than " + atLeast + " files with " + pattern
+ + " (found " + files.size() + ")");
+ }
+ if (atLeast != -1)
+ {
+ Assert.assertTrue(files.size() > atLeast,
+ "Did not find more than " + atLeast + " files with " + pattern
+ + " (found " + files.size() + ")");
+ }
+ if (atMost != -1)
+ {
+ Assert.assertTrue(files.size() < atMost,
+ "Did not find fewer than " + atMost + " files with " + pattern
+ + " (found " + files.size() + ")");
+ }
+ }
+
+ @Test(groups = "Functional", dataProvider = "dirnamesAndBasenames")
+ public void testDirnamesAndBasenames(String filename, String dirname,
+ String endsWith, String basename, String notInDirname)
{
- String expect1 = Paths.get("..", "jalview", "examples", "plantfdx.fa")
- .toString();
- String expect2 = Paths.get("../jalview/examples/plantfdx.features")
- .toString();
- String expect3 = Paths
- .get("../jalview/examples/testdata/plantfdx.features")
- .toString();
+ File file = new File(filename);
+ String d = FileUtils.getDirname(file);
+ String b = FileUtils.getBasename(file);
+ Assert.assertEquals(b, basename);
+ Assert.assertTrue(d.startsWith(dirname), "getDirname(" + file.getPath()
+ + ")=" + d + " didn't start with '" + dirname + "'");
+ Assert.assertTrue(d.endsWith(endsWith), "getDirname(" + file.getPath()
+ + ")=" + d + " didn't end with '" + endsWith + "'");
- List<String> matches = FileUtils
- .findMatchingPaths(Paths.get(".."),
- ".*[\\\\/]plant.*\\.f.*");
- System.out.println(matches);
- assertTrue(matches.contains(expect1));
- assertTrue(matches.contains(expect2));
- assertTrue(matches.contains(expect3));
+ // ensure dirname doesn't end with basename (which means you can't use same
+ // filename as dir in tests!)
+ Assert.assertFalse(d.endsWith(b), "Processed dirname '" + d
+ + "' ends with '" + b + "' when it shouldn't");
+
+ if (notInDirname != null)
+ Assert.assertFalse(d.contains(notInDirname), "Processed directory '"
+ + d + "' contains '" + notInDirname + "' when it shouldn't");
}
- @Test(groups = "External")
- public void testWindowsPath() throws IOException
+ @DataProvider(name = "patternsAndMinNumFiles")
+ public Object[][] patternsAndMinNumFiles()
{
- if (System.getProperty("os.name").startsWith("Windows"))
- {
- /*
- * should pass provided Eclipse is installed
- */
- List<String> matches = FileUtils.findMatches("C:\\",
- "Program Files*/eclips*/eclips?.exe");
- assertFalse(matches.isEmpty());
+ return new Object[][] { { "src/**/*.java", 900, 100000 },
+ { "src/**.java", 900, 100000 },
+ { "test/**/*.java", 250, 2500 },
+ { "test/**.java", 250, 2500 },
+ { "help/**/*.html", 100, 1000 },
+ { "test/**/F*.java", 15, 150 },
+ { "test/jalview/*/F*.java", 10, 15 }, // 12 at time of writing
+ { "test/jalview/**/F*.java", 18, 30 }, // 20 at time of writing
+ { "test/jalview/util/F**.java", 1, 5 }, // 2 at time of writing
+ { "src/jalview/b*/*.java", 14, 19 }, // 15 at time of writing
+ { "src/jalview/b**/*.java", 20, 25 }, // 22 at time of writing
+ };
+ }
- /*
- * should pass provided Chimera is installed
- */
- matches = FileUtils.findMatches("C:\\",
- "Program Files*/Chimera*/bin/{chimera,chimera.exe}");
- assertFalse(matches.isEmpty());
- }
+ @DataProvider(name = "dirnamesAndBasenames")
+ public Object[][] dirnamesAndBasenames()
+ {
+ String homeDir = new File(System.getProperty("user.home")).getPath();
+ return new Object[][] { // -1=startsWith, 0=equals, 1=endsWith
+ { "~/hello/sailor", homeDir, "/hello", "sailor", "~" }, //
+ { "./examples/uniref50.fa", "./", "examples", "uniref50", "Users" }, //
+ { "./examples/uniref50.1.fa", "./", "examples", "uniref50.1",
+ "Users" }, //
+ { "examples/uniref50.fa", "examples", "examples", "uniref50",
+ ".fa" }, //
+ };
}
- /*
- * FIXME fails on bamboo since it the working directory named according to the build number
- */
- @Test(groups = {"Functional","Not-bamboo"})
- public void testFindMatches() throws IOException
+ @Test(groups = "Functional", dataProvider = "convertWildcardsToPathData")
+ public void convertWildcardsToPathTest(String value, String wildcard,
+ String dirname, String basename, String path)
{
- String expect1 = Paths.get("..", "jalview", "examples", "plantfdx.fa")
- .toString();
- String expect2 = Paths.get("../jalview/examples/plantfdx.features")
- .toString();
- String expect3 = Paths
- .get("../jalview/examples/testdata/plantfdx.features")
- .toString();
-
- List<String> matches = FileUtils
- .findMatches("..", "jalview/ex*/plant*.f*");
- System.out.println(matches);
- assertTrue(matches.contains(expect1));
- assertTrue(matches.contains(expect2));
- assertFalse(matches.contains(expect3));
+
+ Assert.assertEquals(
+ FileUtils.convertWildcardsToPath(value, wildcard, dirname,
+ basename),
+ path, "Conversion of wildcard output path is not right.");
+
}
+
+ @DataProvider(name = "convertWildcardsToPathData")
+ public Object[][] convertWildcardsToPathData()
+ {
+ return new Object[][] {
+ /*
+ * cmdline args
+ * Arg (null if only testing headless)
+ * String value if there is one (null otherwise)
+ * boolean value if String value is null
+ * expected value of isHeadless()
+ */
+ /*
+ */
+ { "*/*", "*", "{dirname}", "{basename}", "{dirname}/{basename}" },
+ { "*/", "*", "{dirname}", "{basename}", "{dirname}/" },
+ { "/*", "*", "{dirname}", "{basename}", "/{basename}" },
+ { "*", "*", "{dirname}", "{basename}", "{basename}" },
+ { "tmp/output/*/file-*.stk", "*", "{dirname}", "{basename}",
+ "tmp/output/{dirname}/file-{basename}.stk" },
+ { "/*.file", "*", "{dirname}", "{basename}", "/{basename}.file" },
+ { "*/file.stk", "*", "{dirname}", "{basename}",
+ "{dirname}/file.stk" },
+ { "tmp/abc*def/file.stk", "*", "{dirname}", "{basename}",
+ "tmp/abc{dirname}def/file.stk" },
+ { "a*b/c*d", "*", "{dirname}", "{basename}",
+ "a{dirname}b/c{basename}d" },
+ { "a*b/c", "*", "{dirname}", "{basename}", "a{dirname}b/c" },
+ { "a/b*c", "*", "{dirname}", "{basename}", "a/b{basename}c" },
+ { "a*b", "*", "{dirname}", "{basename}", "a{basename}b" },
+ { "aSTARb/cSTARd", "STAR", "BEFORE", "AFTER", "aBEFOREb/cAFTERd" },
+ { "aSTARb/c", "STAR", "BEFORE", "AFTER", "aBEFOREb/c" },
+ { "a/bSTARc", "STAR", "BEFORE", "AFTER", "a/bAFTERc" },
+ { "aSTARb", "STAR", "BEFORE", "AFTER", "aAFTERb" },
+ //
+ };
+ }
+
}
--- /dev/null
+ package jalview.ws.dbsources;
+
+ import java.io.File;
+ import java.io.FileInputStream;
+ import java.io.FileNotFoundException;
+ import java.io.IOException;
+
+ import org.json.simple.parser.ParseException;
+ import org.testng.Assert;
+ import org.testng.FileAssert;
+ import org.testng.annotations.BeforeClass;
+ import org.testng.annotations.DataProvider;
+ import org.testng.annotations.Test;
+
+ import jalview.datamodel.Alignment;
+ import jalview.datamodel.AlignmentI;
+ import jalview.datamodel.Sequence;
+ import jalview.datamodel.SequenceI;
+ import jalview.gui.Desktop;
+ import jalview.gui.JvOptionPane;
+ import jalview.structure.StructureMapping;
+ import jalview.structure.StructureSelectionManager;
+ import jalview.ws.datamodel.alphafold.PAEContactMatrix;
+
+ public class EBIAlphaFoldTest
+ {
+
+ @BeforeClass(alwaysRun = true)
+ public void setUpJvOptionPane()
+ {
+ JvOptionPane.setInteractiveMode(false);
+ JvOptionPane.setMockResponse(JvOptionPane.CANCEL_OPTION);
+ }
+
+ @DataProvider(name = "getExamplePAEfiles")
+ public Object[][] getExamplePAEfiles()
+ {
+ return new String[][] {
+ //
+ { "examples/test_fab41.result/test_fab41_predicted_aligned_error_v1.json" },
+ { "examples/AlphaFold/AF-A0A1U8FD60-F1-predicted_aligned_error_v4.json" },
+ { "examples/AlphaFold/AF-Q5VSL9-F1-predicted_aligned_error_v4.json" },
+ //
+ };
+ }
+
+ @Test(groups = { "Functional" }, dataProvider = "getExamplePAEfiles")
+ public void checkPAEimport(String paeFile) throws Exception
+ {
+ PAEContactMatrix cm = new PAEContactMatrix(
+ new Sequence("Dummy/1-2000", "ASDASDA"),
+ EBIAlfaFold.parseJSONtoPAEContactMatrix(
+ new FileInputStream(paeFile)));
+ Assert.assertNotEquals(cm.getMax(), 0.0f, "No data from " + paeFile);
+ }
+
+ @Test(groups = { "Functional" }, dataProvider = "getPDBandPAEfiles")
+ public void checkImportPAEToStructure(String pdbFile, String paeFile)
+ {
+ FileInputStream paeInput = null;
+ try
+ {
+ paeInput = new FileInputStream(paeFile);
+ } catch (FileNotFoundException e)
+ {
+ e.printStackTrace();
+ FileAssert.assertFile(new File(paeFile),
+ "Test file '" + paeFile + "' doesn't seem to exist");
+ }
+ SequenceI seq = new Sequence("Dummy/1-2000", "ASDASDA");
+ AlignmentI al = new Alignment(new SequenceI[] { seq });
+ StructureSelectionManager ssm = StructureSelectionManager
- .getStructureSelectionManager(Desktop.instance);
++ .getStructureSelectionManager(Desktop.getInstance());
+ StructureMapping sm = new StructureMapping(seq, pdbFile, null, null,
+ null, null);
+ ssm.addStructureMapping(sm);
+
+ StructureMapping[] smArray = ssm.getMapping(pdbFile);
+
+ try
+ {
+ boolean done = EBIAlfaFold.importPaeJSONAsContactMatrixToStructure(
+ smArray, paeInput, "label");
+ Assert.assertTrue(done,
+ "Import of '" + paeFile + "' didn't complete successfully");
+ } catch (IOException | ParseException e)
+ {
+ Assert.fail("Exception importing paefile '" + paeFile + "'", e);
+ }
+ }
+
+ @DataProvider(name = "getPDBandPAEfiles")
+ public Object[][] getPDBandPAEfiles()
+ {
+ return new String[][] {
+ //
+ /*
+ */
+ { "examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3.pdb",
+ "examples/test_fab41.result/test_fab41_unrelaxed_rank_1_model_3_scores.json" },
+ { "examples/AlphaFold/AF-A0A1U8FD60-F1-model_v4.pdb",
+ "examples/AlphaFold/AF-A0A1U8FD60-F1-predicted_aligned_error_v4.json" },
+ { "examples/AlphaFold/AF-Q5VSL9-F1-model_v4.pdb",
+ "examples/AlphaFold/AF-Q5VSL9-F1-predicted_aligned_error_v4.json" },
+ /*
+ */
+ };
+ }
+
+ }
SiftsSettings.setCacheThresholdInDays("2");
SiftsSettings.setFailSafePIDThreshold("70");
PDBfile pdbFile;
+
- pdbFile = new PDBfile(false, false, false,
- "test/jalview/io/" + testPDBId + ".pdb", DataSourceType.FILE);
- // TODO: this uses a network connection - we should mock the sifts
+ pdbFile = new PDBfile(false, false, false, "test/jalview/io/"
+ + testPDBId + ".pdb", DataSourceType.FILE);
+ try {
- siftsClient = new SiftsClient(pdbFile);
++ // TODO: this uses a network connection - we should mock the sifts
+ // testPDBId.xml.gz
+ siftsClient = new SiftsClient(pdbFile);
+ }
+ catch (Exception x)
+ {
+ System.err.println("SiftsClientTest setupSiftsClient failed.");
+ }
}
@AfterTest(alwaysRun = true)