From: amwaterhouse Date: Wed, 28 Sep 2005 16:53:46 +0000 (+0000) Subject: Applet frame name X-Git-Tag: Release_2_06~1 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=04b6d995eb9395cb4107b28119fff413d8bacafd;p=jalview.git Applet frame name --- diff --git a/src/jalview/appletgui/AlignFrame.java b/src/jalview/appletgui/AlignFrame.java index bda314d..0f275de 100755 --- a/src/jalview/appletgui/AlignFrame.java +++ b/src/jalview/appletgui/AlignFrame.java @@ -35,12 +35,12 @@ public class AlignFrame { final AlignmentPanel alignPanel; final AlignViewport viewport; - public static int NEW_WINDOW_WIDTH = 700; - public static int NEW_WINDOW_HEIGHT = 500; + int NEW_WINDOW_WIDTH = 700; + int NEW_WINDOW_HEIGHT = 500; jalview.bin.JalviewLite applet; - public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet) + public AlignFrame(AlignmentI al, jalview.bin.JalviewLite applet, String title) { this.applet = applet; viewport = new AlignViewport(al, applet); @@ -93,6 +93,25 @@ public class AlignFrame wrapMenuItem_actionPerformed(null); } } + + try + { + param = applet.getParameter("windowWidth"); + if (param != null) + { + int width = Integer.parseInt(param); + NEW_WINDOW_WIDTH = width; + } + param = applet.getParameter("windowHeight"); + if (param != null) + { + int height = Integer.parseInt(param); + NEW_WINDOW_HEIGHT = height; + } + } + catch (Exception ex) + {} + } this.addWindowListener(new WindowAdapter() @@ -113,6 +132,12 @@ public class AlignFrame } } }); + + jalview.bin.JalviewLite.addFrame(this, title, + NEW_WINDOW_WIDTH, + NEW_WINDOW_HEIGHT); + + } public void inputText_actionPerformed(ActionEvent e) @@ -412,7 +437,6 @@ public class AlignFrame newSeqs[i] = (SequenceI) seqs.elementAt(i); } - AlignFrame af = new AlignFrame(new Alignment(newSeqs), applet); String newtitle = new String("Copied sequences"); if (getTitle().startsWith("Copied sequences")) { @@ -422,6 +446,8 @@ public class AlignFrame { newtitle = newtitle.concat("- from " + getTitle()); } + AlignFrame af = new AlignFrame(new Alignment(newSeqs), applet, newtitle); + jalview.bin.JalviewLite.addFrame(af, newtitle, NEW_WINDOW_WIDTH, NEW_WINDOW_HEIGHT); } diff --git a/src/jalview/appletgui/CutAndPasteTransfer.java b/src/jalview/appletgui/CutAndPasteTransfer.java index 90bd343..4c0d3de 100755 --- a/src/jalview/appletgui/CutAndPasteTransfer.java +++ b/src/jalview/appletgui/CutAndPasteTransfer.java @@ -78,10 +78,8 @@ public class CutAndPasteTransfer if (sequences != null) { - AlignFrame af = new AlignFrame(new Alignment(sequences), applet); - jalview.bin.JalviewLite.addFrame(af, "Cut & Paste input - " + format, - AlignFrame.NEW_WINDOW_WIDTH, - AlignFrame.NEW_WINDOW_HEIGHT); + AlignFrame af = new AlignFrame(new Alignment(sequences), applet, + "Cut & Paste input - " + format); af.statusBar.setText("Successfully pasted alignment file"); } diff --git a/src/jalview/appletgui/PairwiseAlignPanel.java b/src/jalview/appletgui/PairwiseAlignPanel.java index 0ff2708..c9285dd 100755 --- a/src/jalview/appletgui/PairwiseAlignPanel.java +++ b/src/jalview/appletgui/PairwiseAlignPanel.java @@ -88,10 +88,9 @@ public class PairwiseAlignPanel seq[i] = (Sequence) sequences.elementAt(i); } - AlignFrame af = new AlignFrame(new Alignment(seq), ap.alignFrame.applet); - jalview.bin.JalviewLite.addFrame(af, "Pairwise Aligned Sequences", - AlignFrame.NEW_WINDOW_WIDTH, - AlignFrame.NEW_WINDOW_HEIGHT); + AlignFrame af = new AlignFrame(new Alignment(seq), + ap.alignFrame.applet, + "Pairwise Aligned Sequences"); } diff --git a/src/jalview/bin/JalviewLite.java b/src/jalview/bin/JalviewLite.java index 9b73944..1e94a0d 100755 --- a/src/jalview/bin/JalviewLite.java +++ b/src/jalview/bin/JalviewLite.java @@ -73,23 +73,6 @@ public class JalviewLite extends Applet } } - AlignFrame.NEW_WINDOW_WIDTH = 700; - AlignFrame.NEW_WINDOW_HEIGHT = 500; - try{ - param = applet.getParameter("windowWidth"); - if (param != null) - { - int width = Integer.parseInt(param); - AlignFrame.NEW_WINDOW_WIDTH = width; - } - param = applet.getParameter("windowHeight"); - if (param != null) - { - int height = Integer.parseInt(param); - AlignFrame.NEW_WINDOW_HEIGHT = height; - } - }catch(Exception ex){} - this.setBackground(new Color(r, g, b)); file = getParameter("file"); @@ -129,9 +112,7 @@ public class JalviewLite extends Applet if ( (sequences != null) && (sequences.length > 0)) { - AlignFrame af = new AlignFrame(new Alignment(sequences), null); - addFrame(af, args[0], AlignFrame.NEW_WINDOW_WIDTH, - AlignFrame.NEW_WINDOW_HEIGHT); + AlignFrame af = new AlignFrame(new Alignment(sequences), null, args[0]); af.statusBar.setText("Successfully loaded file " + args[0]); } } @@ -251,9 +232,7 @@ public class JalviewLite extends Applet if ((sequences != null) && (sequences.length > 0)) { AlignFrame af = new AlignFrame(new Alignment(sequences), - jlapplet); - addFrame(af, file, AlignFrame.NEW_WINDOW_WIDTH, - AlignFrame.NEW_WINDOW_HEIGHT); + jlapplet, file); af.statusBar.setText("Successfully loaded file " + file); } else