added 'showbutton' applet parameter
authorjprocter <Jim Procter>
Mon, 4 Aug 2008 11:08:03 +0000 (11:08 +0000)
committerjprocter <Jim Procter>
Mon, 4 Aug 2008 11:08:03 +0000 (11:08 +0000)
src/jalview/bin/JalviewLite.java

index c7cc4f3..86aacf1 100755 (executable)
@@ -352,26 +352,35 @@ public class JalviewLite
     if (getParameter("embedded") != null
         && getParameter("embedded").equalsIgnoreCase("true"))
     {
+      // Launch as embedded applet in page
       embedded = true;
       LoadingThread loader = new LoadingThread(file, applet);
       loader.start();
     }
     else if (file != null)
     {
-      add(launcher);
-
-      launcher.addActionListener(new java.awt.event.ActionListener()
+      if (getParameter("showbutton")!=null && !getParameter("showbutton").equalsIgnoreCase("false"))
       {
-        public void actionPerformed(ActionEvent e)
+        // Add the JalviewLite 'Button' to the page
+        add(launcher);
+        launcher.addActionListener(new java.awt.event.ActionListener()
         {
-          LoadingThread loader = new LoadingThread(file,
+          public void actionPerformed(ActionEvent e)
+          {
+            LoadingThread loader = new LoadingThread(file,
               applet);
+            loader.start();
+          }
+        });
+        } else {
+          // Open jalviewLite immediately.
+          LoadingThread loader = new LoadingThread(file, applet);
           loader.start();
         }
-      });
     }
     else
     {
+      // jalview initialisation with no alignment. loadAlignment() method can still be called to open new alignments.
       file = "NO FILE";
       fileFound = false;
     }