Applet frame name
authoramwaterhouse <Andrew Waterhouse>
Wed, 28 Sep 2005 16:53:46 +0000 (16:53 +0000)
committeramwaterhouse <Andrew Waterhouse>
Wed, 28 Sep 2005 16:53:46 +0000 (16:53 +0000)
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/CutAndPasteTransfer.java
src/jalview/appletgui/PairwiseAlignPanel.java
src/jalview/bin/JalviewLite.java

index bda314d..0f275de 100755 (executable)
@@ -35,12 +35,12 @@ public class AlignFrame
 {\r
   final AlignmentPanel alignPanel;\r
   final AlignViewport viewport;\r
-  public static int NEW_WINDOW_WIDTH = 700;\r
-  public static int NEW_WINDOW_HEIGHT = 500;\r
+  int NEW_WINDOW_WIDTH = 700;\r
+  int NEW_WINDOW_HEIGHT = 500;\r
   jalview.bin.JalviewLite applet;\r
 \r
 \r
-  public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet)\r
+  public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet, String title)\r
   {\r
     this.applet = applet;\r
     viewport = new AlignViewport(al, applet);\r
@@ -93,6 +93,25 @@ public class AlignFrame
           wrapMenuItem_actionPerformed(null);\r
         }\r
       }\r
+\r
+      try\r
+      {\r
+        param = applet.getParameter("windowWidth");\r
+        if (param != null)\r
+        {\r
+          int width = Integer.parseInt(param);\r
+          NEW_WINDOW_WIDTH = width;\r
+        }\r
+        param = applet.getParameter("windowHeight");\r
+        if (param != null)\r
+        {\r
+          int height = Integer.parseInt(param);\r
+          NEW_WINDOW_HEIGHT = height;\r
+        }\r
+      }\r
+      catch (Exception ex)\r
+      {}\r
+\r
     }\r
 \r
     this.addWindowListener(new WindowAdapter()\r
@@ -113,6 +132,12 @@ public class AlignFrame
        }\r
      }\r
    });\r
+\r
+   jalview.bin.JalviewLite.addFrame(this, title,\r
+                                    NEW_WINDOW_WIDTH,\r
+                                    NEW_WINDOW_HEIGHT);\r
+\r
+\r
   }\r
 \r
   public void inputText_actionPerformed(ActionEvent e)\r
@@ -412,7 +437,6 @@ public class AlignFrame
           newSeqs[i] = (SequenceI) seqs.elementAt(i);\r
         }\r
 \r
-        AlignFrame af = new AlignFrame(new Alignment(newSeqs), applet);\r
         String newtitle = new String("Copied sequences");\r
         if (getTitle().startsWith("Copied sequences"))\r
         {\r
@@ -422,6 +446,8 @@ public class AlignFrame
         {\r
           newtitle = newtitle.concat("- from " + getTitle());\r
         }\r
+        AlignFrame af = new AlignFrame(new Alignment(newSeqs), applet, newtitle);\r
+\r
         jalview.bin.JalviewLite.addFrame(af, newtitle, NEW_WINDOW_WIDTH,\r
                                          NEW_WINDOW_HEIGHT);\r
       }\r
index 90bd343..4c0d3de 100755 (executable)
@@ -78,10 +78,8 @@ public class CutAndPasteTransfer
 \r
     if (sequences != null)\r
     {\r
-      AlignFrame af = new AlignFrame(new Alignment(sequences), applet);\r
-      jalview.bin.JalviewLite.addFrame(af, "Cut & Paste input - " + format,\r
-                                       AlignFrame.NEW_WINDOW_WIDTH,\r
-                                       AlignFrame.NEW_WINDOW_HEIGHT);\r
+      AlignFrame af = new AlignFrame(new Alignment(sequences), applet,\r
+                                     "Cut & Paste input - " + format);\r
       af.statusBar.setText("Successfully pasted alignment file");\r
     }\r
 \r
index 0ff2708..c9285dd 100755 (executable)
@@ -88,10 +88,9 @@ public class PairwiseAlignPanel
       seq[i] = (Sequence) sequences.elementAt(i);\r
     }\r
 \r
-    AlignFrame af = new AlignFrame(new Alignment(seq), ap.alignFrame.applet);\r
-    jalview.bin.JalviewLite.addFrame(af, "Pairwise Aligned Sequences",\r
-                                     AlignFrame.NEW_WINDOW_WIDTH,\r
-                                     AlignFrame.NEW_WINDOW_HEIGHT);\r
+    AlignFrame af = new AlignFrame(new Alignment(seq),\r
+                                   ap.alignFrame.applet,\r
+                                   "Pairwise Aligned Sequences");\r
 \r
   }\r
 \r
index 9b73944..1e94a0d 100755 (executable)
@@ -73,23 +73,6 @@ public class JalviewLite extends Applet
             }\r
         }\r
 \r
-        AlignFrame.NEW_WINDOW_WIDTH = 700;\r
-        AlignFrame.NEW_WINDOW_HEIGHT = 500;\r
-        try{\r
-          param = applet.getParameter("windowWidth");\r
-          if (param != null)\r
-          {\r
-            int width = Integer.parseInt(param);\r
-            AlignFrame.NEW_WINDOW_WIDTH = width;\r
-          }\r
-          param = applet.getParameter("windowHeight");\r
-          if (param != null)\r
-          {\r
-            int height = Integer.parseInt(param);\r
-            AlignFrame.NEW_WINDOW_HEIGHT = height;\r
-          }\r
-        }catch(Exception ex){}\r
-\r
         this.setBackground(new Color(r, g, b));\r
 \r
         file = getParameter("file");\r
@@ -129,9 +112,7 @@ public class JalviewLite extends Applet
 \r
       if ( (sequences != null) && (sequences.length > 0))\r
       {\r
-        AlignFrame af = new AlignFrame(new Alignment(sequences), null);\r
-        addFrame(af, args[0], AlignFrame.NEW_WINDOW_WIDTH,\r
-                 AlignFrame.NEW_WINDOW_HEIGHT);\r
+        AlignFrame af = new AlignFrame(new Alignment(sequences), null, args[0]);\r
         af.statusBar.setText("Successfully loaded file " + args[0]);\r
       }\r
     }\r
@@ -251,9 +232,7 @@ public class JalviewLite extends Applet
             if ((sequences != null) && (sequences.length > 0))\r
             {\r
                 AlignFrame af = new AlignFrame(new Alignment(sequences),\r
-                        jlapplet);\r
-                addFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH,\r
-                    AlignFrame.NEW_WINDOW_HEIGHT);\r
+                        jlapplet, file);\r
                 af.statusBar.setText("Successfully loaded file " + file);\r
             }\r
             else\r