JAL-1519 fix author update issue (doh)
[jalview.git] / src / jalview / gui / Desktop.java
index 51b6ed4..e65bffa 100644 (file)
@@ -6,14 +6,16 @@
  * 
  * 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.
+ * 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/>.
+ * 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;
@@ -559,7 +561,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   void showPasteMenu(int x, int y)
   {
     JPopupMenu popup = new JPopupMenu();
-    JMenuItem item = new JMenuItem(MessageManager.getString("label.paste_new_window"));
+    JMenuItem item = new JMenuItem(
+            MessageManager.getString("label.paste_new_window"));
     item.addActionListener(new ActionListener()
     {
       public void actionPerformed(ActionEvent evt)
@@ -649,8 +652,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     // A HEADLESS STATE WHEN NO DESKTOP EXISTS. MUST RETURN
     // IF JALVIEW IS RUNNING HEADLESS
     // ///////////////////////////////////////////////
-    if (instance == null || (System.getProperty("java.awt.headless") != null
-            && System.getProperty("java.awt.headless").equals("true")))
+    if (instance == null
+            || (System.getProperty("java.awt.headless") != null && System
+                    .getProperty("java.awt.headless").equals("true")))
     {
       return;
     }
@@ -807,7 +811,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
    */
   public void drop(DropTargetDropEvent evt)
   {
-    boolean success=true;
+    boolean success = true;
     Transferable t = evt.getTransferable();
     java.util.List files = null;
     java.util.List protocols = null;
@@ -856,7 +860,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
       }
     } catch (Exception e)
     {
-      success=false;
+      success = false;
     }
 
     if (files != null)
@@ -885,10 +889,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         }
       } catch (Exception ex)
       {
-        success=false;
+        success = false;
       }
     }
-    evt.dropComplete(success); // need this to ensure input focus is properly transfered to any new windows created 
+    evt.dropComplete(success); // need this to ensure input focus is properly
+                               // transfered to any new windows created
   }
 
   /**
@@ -906,7 +911,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
             jalview.bin.Cache.getProperty("DEFAULT_FILE_FORMAT"));
 
     chooser.setFileView(new JalviewFileView());
-    chooser.setDialogTitle(MessageManager.getString("label.open_local_file"));
+    chooser.setDialogTitle(MessageManager
+            .getString("label.open_local_file"));
     chooser.setToolTipText(MessageManager.getString("action.open"));
 
     int value = chooser.showOpenDialog(this);
@@ -918,7 +924,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
               .getSelectedFile().getParent());
 
       String format = null;
-      if (chooser.getSelectedFormat()!=null && chooser.getSelectedFormat().equals("Jalview"))
+      if (chooser.getSelectedFormat() != null
+              && chooser.getSelectedFormat().equals("Jalview"))
       {
         format = "Jalview";
       }
@@ -949,7 +956,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     // This construct allows us to have a wider textfield
     // for viewing
-    JLabel label = new JLabel(MessageManager.getString("label.input_file_url"));
+    JLabel label = new JLabel(
+            MessageManager.getString("label.input_file_url"));
     final JComboBox history = new JComboBox();
 
     JPanel panel = new JPanel(new GridLayout(2, 1));
@@ -974,7 +982,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     }
 
     int reply = JOptionPane.showInternalConfirmDialog(desktop, panel,
-            MessageManager.getString("label.input_alignment_from_url"), JOptionPane.OK_CANCEL_OPTION);
+            MessageManager.getString("label.input_alignment_from_url"),
+            JOptionPane.OK_CANCEL_OPTION);
 
     if (reply != JOptionPane.OK_OPTION)
     {
@@ -1151,11 +1160,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     message.append("<br>Authors:  "
             + jalview.bin.Cache
                     .getDefault(
-                            "AUTHORNAMES",
                             "Jim Procter, Andrew Waterhouse, Jan Engelhardt, Lauren Lui, Michele Clamp, James Cuff, Steve Searle, David Martin & Geoff Barton")
             + "<br>Development managed by The Barton Group, University of Dundee, Scotland, UK.<br>"
             + "<br>For help, see the FAQ at <a href=\"http://www.jalview.org\">www.jalview.org</a> and/or join the jalview-discuss@jalview.org mailing list"
             + "<br>If  you use Jalview, please cite:"
+                            "AUTHORFNAMES",
             + "<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"
             + "<br>Bioinformatics doi: 10.1093/bioinformatics/btp033"
@@ -1429,8 +1438,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     JalviewFileChooser chooser = new JalviewFileChooser(
             jalview.bin.Cache.getProperty("LAST_DIRECTORY"), new String[]
-            { "jvp","jar" }, new String[]
-            { "Jalview Project", "Jalview Project (old)" }, "Jalview Project");
+            { "jvp", "jar" }, new String[]
+            { "Jalview Project", "Jalview Project (old)" },
+            "Jalview Project");
     chooser.setFileView(new JalviewFileView());
     chooser.setDialogTitle("Restore state");
 
@@ -1515,15 +1525,16 @@ public class Desktop extends jalview.jbgui.GDesktop implements
   {
     if (progressPanel != null)
     {
-      synchronized(progressPanel) {
-      progressPanel.remove(progbar);
-      GridLayout gl = (GridLayout) progressPanel.getLayout();
-      gl.setRows(gl.getRows() - 1);
-      if (--totalProgressCount < 1)
+      synchronized (progressPanel)
       {
-        this.getContentPane().remove(progressPanel);
-        progressPanel = null;
-      }
+        progressPanel.remove(progbar);
+        GridLayout gl = (GridLayout) progressPanel.getLayout();
+        gl.setRows(gl.getRows() - 1);
+        if (--totalProgressCount < 1)
+        {
+          this.getContentPane().remove(progressPanel);
+          progressPanel = null;
+        }
       }
     }
     validate();
@@ -1534,7 +1545,7 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     fileLoadingCount--;
     if (fileLoadingCount < 1)
     {
-      while (fileLoadingPanels.size()>0)
+      while (fileLoadingPanels.size() > 0)
       {
         removeProgressPanel(fileLoadingPanels.remove(0));
       }
@@ -1719,7 +1730,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
 
       chooser.setFileView(new JalviewFileView());
       chooser.setDialogTitle("Open a saved VAMSAS session");
-      chooser.setToolTipText(MessageManager.getString("label.select_vamsas_session_opened_as_new_vamsas_session"));
+      chooser.setToolTipText(MessageManager
+              .getString("label.select_vamsas_session_opened_as_new_vamsas_session"));
 
       int value = chooser.showOpenDialog(this);
 
@@ -1728,10 +1740,16 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         String fle = chooser.getSelectedFile().toString();
         if (!vamsasImport(chooser.getSelectedFile()))
         {
-          JOptionPane.showInternalMessageDialog(Desktop.desktop,
-                  MessageManager.formatMessage("label.couldnt_import_as_vamsas_session", new String[]{fle}),
-                  MessageManager.getString("label.vamsas_document_import_failed"),
-                  JOptionPane.ERROR_MESSAGE);
+          JOptionPane
+                  .showInternalMessageDialog(
+                          Desktop.desktop,
+                          MessageManager.formatMessage(
+                                  "label.couldnt_import_as_vamsas_session",
+                                  new String[]
+                                  { fle }),
+                          MessageManager
+                                  .getString("label.vamsas_document_import_failed"),
+                          JOptionPane.ERROR_MESSAGE);
         }
       }
     }
@@ -1885,7 +1903,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     vamsasSave.setVisible(false);
     vamsasStop.setVisible(false);
     vamsasImport.setVisible(true);
-    vamsasStart.setText(MessageManager.getString("label.new_vamsas_session"));
+    vamsasStart.setText(MessageManager
+            .getString("label.new_vamsas_session"));
   }
 
   public void vamsasStop_actionPerformed(ActionEvent e)
@@ -1921,7 +1940,9 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         {
           JMenuItem sessit = new JMenuItem();
           sessit.setText(sess[i]);
-          sessit.setToolTipText(MessageManager.formatMessage("label.connect_to_session", new String[]{sess[i]}));
+          sessit.setToolTipText(MessageManager.formatMessage(
+                  "label.connect_to_session", new String[]
+                  { sess[i] }));
           final Desktop dsktp = this;
           final String mysesid = sess[i];
           sessit.addActionListener(new ActionListener()
@@ -2143,8 +2164,11 @@ public class Desktop extends jalview.jbgui.GDesktop implements
         FontMetrics fm = g.getFontMetrics();
         if (fm != null)
         {
-          g.drawString(
-                         MessageManager.formatMessage("label.memory_stats", new String[]{df.format(totalFreeMemory),df.format(maxMemory),df.format(percentUsage)}), 10,
+          g.drawString(MessageManager.formatMessage(
+                  "label.memory_stats",
+                  new String[]
+                  { df.format(totalFreeMemory), df.format(maxMemory),
+                      df.format(percentUsage) }), 10,
                   getHeight() - fm.getHeight());
         }
       }
@@ -2347,7 +2371,8 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     final JPanel progressPanel = (JPanel) progressBars.get(new Long(id));
     if (handler.canCancel())
     {
-      JButton cancel = new JButton(MessageManager.getString("action.cancel"));
+      JButton cancel = new JButton(
+              MessageManager.getString("action.cancel"));
       final IProgressIndicator us = this;
       cancel.addActionListener(new ActionListener()
       {
@@ -2445,15 +2470,15 @@ public class Desktop extends jalview.jbgui.GDesktop implements
     // JAL-940 - JALVIEW 1 services are now being EOLed as of JABA 2.1 release
     if (true)
     {
-    // todo: changesupport handlers need to be transferred
-    if (discoverer == null)
-    {
-      discoverer = new jalview.ws.jws1.Discoverer();
-      // register PCS handler for desktop.
-      discoverer.addPropertyChangeListener(changeSupport);
-    }
-    // JAL-940 - disabled JWS1 service configuration - always start discoverer
-    // until we phase out completely
+      // todo: changesupport handlers need to be transferred
+      if (discoverer == null)
+      {
+        discoverer = new jalview.ws.jws1.Discoverer();
+        // register PCS handler for desktop.
+        discoverer.addPropertyChangeListener(changeSupport);
+      }
+      // JAL-940 - disabled JWS1 service configuration - always start discoverer
+      // until we phase out completely
       (t0 = new Thread(discoverer)).start();
     }