From a53d1197abfc832020cefd499d3b08188d04bafb Mon Sep 17 00:00:00 2001 From: amwaterhouse Date: Mon, 21 Mar 2005 18:45:56 +0000 Subject: [PATCH] maintain slider values when click on a group --- src/jalview/gui/Desktop.java | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/jalview/gui/Desktop.java b/src/jalview/gui/Desktop.java index fe25cd4..8928acc 100755 --- a/src/jalview/gui/Desktop.java +++ b/src/jalview/gui/Desktop.java @@ -42,7 +42,6 @@ public class Desktop extends jalview.jbgui.GDesktop setTitle("Jalview 2005"); setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); - setVisible(true); desktop = new JDesktopPane(); desktop.setBackground(Color.white); setContentPane(desktop); @@ -77,6 +76,7 @@ public void windowClosing(WindowEvent evt) jalview.bin.Cache.setProperty("SCREEN_HEIGHT", getHeight() + ""); } }); + setVisible(true); /////////Add a splashscreen on startup @@ -87,7 +87,7 @@ public void windowClosing(WindowEvent evt) SplashScreen splash = new SplashScreen(frame, image); frame.setContentPane(splash); desktop.add(frame); - frame.setVisible(true); + openFrameCount++; try { @@ -102,13 +102,13 @@ public void windowClosing(WindowEvent evt) frame.setIconifiable(false); frame.setMaximizable(false); frame.setFrameIcon(null); + frame.setVisible(true); } public static void addInternalFrame(final JInternalFrame frame, String title, int w, int h) { desktop.add(frame); - frame.setVisible(true); openFrameCount++; try { frame.setSelected(true); @@ -140,6 +140,7 @@ public void windowClosing(WindowEvent evt) } }); + frame.setVisible(true); windowMenu.add(menuItem); } @@ -175,7 +176,6 @@ public void windowClosing(WindowEvent evt) addInternalFrame(af, file, 700, 500); af.statusBar.setText("Successfully loaded file " + file); - } else JOptionPane.showInternalMessageDialog(Desktop.desktop, "Couldn't open file.\n" @@ -291,14 +291,16 @@ public void windowClosing(WindowEvent evt) public static int setConservationSliderSource(AlignmentPanel ap, ColourSchemeI cs, String source) { SliderPanel sp = null; + ConservationColourScheme ccs = (ConservationColourScheme)cs; + int value = ccs.inc; if(conservationSlider == null) { - sp = new SliderPanel(ap, 30, true, cs); + sp = new SliderPanel(ap, value, true, cs); conservationSlider = new JInternalFrame(); conservationSlider.setContentPane(sp); - conservationSlider.setResizable(false); addInternalFrame(conservationSlider, "Conservation Colour Increment ("+source+")", 420, 90); + conservationSlider.setResizable(false); conservationSlider.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() { public void internalFrameClosed(javax.swing.event.InternalFrameEvent e) @@ -309,9 +311,11 @@ public void windowClosing(WindowEvent evt) } else { + conservationSlider.setTitle("Conservation Colour Increment ("+source+")"); sp = (SliderPanel)conservationSlider.getContentPane(); sp.cs = cs; + sp.setValue(value); } if(ap.av.alignment.getGroups()!=null) @@ -348,8 +352,8 @@ public void windowClosing(WindowEvent evt) pid = new SliderPanel(ap, 50, false, cs); PIDSlider = new JInternalFrame(); PIDSlider.setContentPane(pid); - PIDSlider.setResizable(false); addInternalFrame(PIDSlider, "Percentage Identity Threshold ("+source+")", 420, 90); + PIDSlider.setResizable(false); } else { -- 1.7.10.2