maintain slider values when click on a group
authoramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:45:56 +0000 (18:45 +0000)
committeramwaterhouse <Andrew Waterhouse>
Mon, 21 Mar 2005 18:45:56 +0000 (18:45 +0000)
src/jalview/gui/Desktop.java

index fe25cd4..8928acc 100755 (executable)
@@ -42,7 +42,6 @@ public class Desktop extends jalview.jbgui.GDesktop
 \r
     setTitle("Jalview 2005");\r
     setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);\r
-    setVisible(true);\r
     desktop = new JDesktopPane();\r
     desktop.setBackground(Color.white);\r
     setContentPane(desktop);\r
@@ -77,6 +76,7 @@ public void windowClosing(WindowEvent evt)
  jalview.bin.Cache.setProperty("SCREEN_HEIGHT", getHeight() + "");\r
 }\r
 });\r
+      setVisible(true);\r
 \r
 /////////Add a splashscreen on startup\r
 \r
@@ -87,7 +87,7 @@ public void windowClosing(WindowEvent evt)
     SplashScreen splash = new SplashScreen(frame, image);\r
     frame.setContentPane(splash);\r
     desktop.add(frame);\r
-    frame.setVisible(true);\r
+\r
     openFrameCount++;\r
     try\r
     {\r
@@ -102,13 +102,13 @@ public void windowClosing(WindowEvent evt)
     frame.setIconifiable(false);\r
     frame.setMaximizable(false);\r
     frame.setFrameIcon(null);\r
+    frame.setVisible(true);\r
 \r
   }\r
 \r
   public static void addInternalFrame(final JInternalFrame frame, String title, int w, int h)\r
   {\r
    desktop.add(frame);\r
-   frame.setVisible(true);\r
    openFrameCount++;\r
    try {\r
        frame.setSelected(true);\r
@@ -140,6 +140,7 @@ public void windowClosing(WindowEvent evt)
       }\r
     });\r
 \r
+   frame.setVisible(true);\r
    windowMenu.add(menuItem);\r
  }\r
 \r
@@ -175,7 +176,6 @@ public void windowClosing(WindowEvent evt)
      addInternalFrame(af, file, 700, 500);\r
      af.statusBar.setText("Successfully loaded file " + file);\r
 \r
-\r
    }\r
    else\r
      JOptionPane.showInternalMessageDialog(Desktop.desktop,  "Couldn't open file.\n"\r
@@ -291,14 +291,16 @@ public void windowClosing(WindowEvent evt)
  public static int setConservationSliderSource(AlignmentPanel ap, ColourSchemeI cs, String source)\r
  {\r
    SliderPanel sp = null;\r
+   ConservationColourScheme ccs = (ConservationColourScheme)cs;\r
+   int value = ccs.inc;\r
 \r
    if(conservationSlider == null)\r
    {\r
-     sp = new SliderPanel(ap, 30, true, cs);\r
+     sp = new SliderPanel(ap, value, true, cs);\r
      conservationSlider = new JInternalFrame();\r
      conservationSlider.setContentPane(sp);\r
-     conservationSlider.setResizable(false);\r
      addInternalFrame(conservationSlider, "Conservation Colour Increment  ("+source+")", 420, 90);\r
+     conservationSlider.setResizable(false);\r
      conservationSlider.addInternalFrameListener(new javax.swing.event.InternalFrameAdapter()\r
                   {\r
                     public void internalFrameClosed(javax.swing.event.InternalFrameEvent e)\r
@@ -309,9 +311,11 @@ public void windowClosing(WindowEvent evt)
    }\r
    else\r
    {\r
+\r
        conservationSlider.setTitle("Conservation Colour Increment  ("+source+")");\r
        sp = (SliderPanel)conservationSlider.getContentPane();\r
        sp.cs = cs;\r
+       sp.setValue(value);\r
    }\r
 \r
    if(ap.av.alignment.getGroups()!=null)\r
@@ -348,8 +352,8 @@ public void windowClosing(WindowEvent evt)
      pid = new SliderPanel(ap, 50, false, cs);\r
      PIDSlider = new JInternalFrame();\r
      PIDSlider.setContentPane(pid);\r
-     PIDSlider.setResizable(false);\r
      addInternalFrame(PIDSlider, "Percentage Identity Threshold ("+source+")", 420, 90);\r
+     PIDSlider.setResizable(false);\r
    }\r
    else\r
    {\r