+ Object ret = openPcaPanel(af, modelName, params);
+ if (ret instanceof String)
+ {
+ JvOptionPane.showInternalMessageDialog(this,
+ MessageManager.formatMessage(
+ (String) ret,
+ MIN_PCA_SELECTION),
+ MessageManager
+ .getString("label.sequence_selection_insufficient"),
+ JvOptionPane.WARNING_MESSAGE);
+ }
+ else
+ {
+ // only used for test suite
+ pcaPanel = (PCAPanel) ret;
+ }
+
+ }
+
+ /**
+ * Open a new Tree panel on the desktop statically
+ *
+ * @param af
+ * @param treeType
+ * @param modelName
+ * @param params
+ * @return null, or the string "label.you_need_at_least_n_sequences" if number
+ * of sequences selected is inappropriate
+ */
+ public static Object openTreePanel(AlignFrame af, String treeType,
+ String modelName, SimilarityParamsI params)
+ {
+
+ /*
+ * gui validation shouldn't allow insufficient sequences here, but leave
+ * this check in in case this method gets exposed programmatically in future
+ */
+ AlignViewportI viewport = af.getViewport();
+ SequenceGroup sg = viewport.getSelectionGroup();
+ if (sg != null && sg.getSize() < MIN_TREE_SELECTION)
+ {
+ return "label.you_need_at_least_n_sequences";
+ }
+
+ if (params == null)
+ {
+ params = getSimilarityParameters(false);
+ }
+
+ af.newTreePanel(treeType, modelName, params);
+ return null;
+ }
+
+ /**
+ * public static method for JalviewJS API
+ *
+ * @param af
+ * @param modelName
+ * @param params
+ * @return the PCAPanel, or null if number of sequences selected is
+ * inappropriate
+ */
+ public static Object openPcaPanel(AlignFrame af, String modelName,
+ SimilarityParamsI params)
+ {
+ AlignViewportI viewport = af.getViewport();
+
+ /*
+ * gui validation shouldn't allow insufficient sequences here, but leave
+ * this check in in case this method gets exposed programmatically in future
+ *
+ *
+ */