JAL-2871 Added check whether configuration has been loaded in
[jalview.git] / src / jalview / ext / archaeopteryx / AptxInit.java
index da9e348..b9a2266 100644 (file)
@@ -46,9 +46,9 @@ import org.forester.util.ForesterUtil;
  */
 public final class AptxInit
 {
-
   private final static Configuration APTX_CONFIG = new Configuration(
-          "_aptx_jalview_configuration_file", false, false, false);
+          "_aptx_jalview_configuration_file",
+            false, false, false);
 
   private final static boolean VALIDATE_PHYLOXML_XSD = APTX_CONFIG
           .isValidatePhyloXmlAgainstSchema();
@@ -470,6 +470,23 @@ public final class AptxInit
           final Phylogeny aptxTree,
           final AlignmentViewport jalviewAlignport, String treeTitle)
   {
+    if (APTX_CONFIG == null || APTX_CONFIG.isCouldReadConfigFile() == false)
+    {
+      int keepGoing = JvOptionPane.showConfirmDialog(Desktop.desktop,
+              MessageManager.getString("label.aptx_config_not_found"),
+              MessageManager.formatMessage("label.couldnt_locate",
+                      new String[]
+                      { "_aptx_jalview_configuration_file" }),
+              JvOptionPane.YES_NO_CANCEL_OPTION);
+
+      if (keepGoing == JvOptionPane.CANCEL_OPTION
+              || keepGoing == JvOptionPane.CLOSED_OPTION
+              || keepGoing == JvOptionPane.NO_OPTION)
+      {
+        return null;
+      }
+
+    }
     MainFrame aptxApp = Archaeopteryx.createApplication(aptxTree,
             APTX_CONFIG, treeTitle);
 
@@ -528,5 +545,8 @@ public final class AptxInit
     return activeAptx;
   }
 
+  private static void disableRedundantGuiMenus()
+  {
 
+  }
 }