Merge branch 'r281_JAL-1211' into Release_2_8_1_Branch
authorJim Procter <jprocter@dundee.ac.uk>
Sat, 5 Apr 2014 12:23:27 +0000 (13:23 +0100)
committerJim Procter <jprocter@dundee.ac.uk>
Sat, 5 Apr 2014 12:23:27 +0000 (13:23 +0100)
1  2 
src/jalview/appletgui/AlignFrame.java
src/jalview/gui/Desktop.java

@@@ -122,7 -122,28 +122,28 @@@ public class AlignFrame extends Embmenu
      {
        ex.printStackTrace();
      }
+     // need to get window geometry before we calculate alignment layout
+     if (applet != null)
+     {
+       String param;
+       try
+       {
+         param = applet.getParameter("windowWidth");
+         if (param != null)
+         {
+           int width = Integer.parseInt(param);
+           DEFAULT_WIDTH = width;
+         }
+         param = applet.getParameter("windowHeight");
+         if (param != null)
+         {
+           int height = Integer.parseInt(param);
+           DEFAULT_HEIGHT = height;
+         }
+       } catch (Exception ex)
+       {
+       }
+     }
      viewport = new AlignViewport(al, applet);
      alignPanel = new AlignmentPanel(this, viewport);
      avc = new jalview.controller.AlignViewController(this, viewport, alignPanel);
          centreColumnLabelFlag.setState(true);
          centreColumnLabelFlag_stateChanged();
        }
-       try
-       {
-         param = applet.getParameter("windowWidth");
-         if (param != null)
-         {
-           int width = Integer.parseInt(param);
-           DEFAULT_WIDTH = width;
-         }
-         param = applet.getParameter("windowHeight");
-         if (param != null)
-         {
-           int height = Integer.parseInt(param);
-           DEFAULT_HEIGHT = height;
-         }
-       } catch (Exception ex)
-       {
-       }
  
      }
      if (viewport.getAlignment().isNucleotide())
      menu1.setLabel(MessageManager.getString("action.show"));
      showColumns.setLabel(MessageManager.getString("label.all_columns"));
      showSeqs.setLabel(MessageManager.getString("label.all_sequences"));
 -    menu2.setLabel(MessageManager.getString("aciton.hide"));
 +    menu2.setLabel(MessageManager.getString("action.hide"));
      hideColumns.setLabel(MessageManager.getString("label.selected_columns"));
      hideSequences.setLabel(MessageManager.getString("label.selected_sequences"));
      hideAllButSelection.setLabel(MessageManager.getString("label.all_but_selected_region"));
@@@ -807,7 -807,6 +807,7 @@@ public class Desktop extends jalview.jb
     */
    public void drop(DropTargetDropEvent evt)
    {
 +    boolean success=true;
      Transferable t = evt.getTransferable();
      java.util.List files = null;
      java.util.List protocols = null;
        }
      } catch (Exception e)
      {
 +      success=false;
      }
  
      if (files != null)
          }
        } catch (Exception ex)
        {
 +        success=false;
        }
      }
 +    evt.dropComplete(success); // need this to ensure input focus is properly transfered to any new windows created 
    }
  
    /**
                .getSelectedFile().getParent());
  
        String format = null;
-       if (chooser.getSelectedFormat().equals("Jalview"))
+       if (chooser.getSelectedFormat()!=null && chooser.getSelectedFormat().equals("Jalview"))
        {
          format = "Jalview";
        }