X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Fjalview%2Fgui%2FSliderPanel.java;fp=src%2Fjalview%2Fgui%2FSliderPanel.java;h=b386decc407928215ce507387cf3e4c7dfc556d0;hb=fd7eebe6dcf2346692d718ef91bb468cc12ebf44;hp=e28778c0325b4a9342526851e1ac829df55a1a2e;hpb=e94dbf72fe43a100b938e9ca60b9b1b1508a521f;p=jalview.git diff --git a/src/jalview/gui/SliderPanel.java b/src/jalview/gui/SliderPanel.java index e28778c..b386dec 100755 --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@ -25,14 +25,16 @@ import jalview.jbgui.GSliderPanel; import jalview.schemes.CollectionColourSchemeI; import jalview.util.MessageManager; -import java.awt.event.ActionEvent; import java.awt.event.MouseAdapter; import java.awt.event.MouseEvent; +import java.beans.PropertyVetoException; import javax.swing.JInternalFrame; import javax.swing.JLayeredPane; import javax.swing.event.ChangeEvent; import javax.swing.event.ChangeListener; +import javax.swing.event.InternalFrameAdapter; +import javax.swing.event.InternalFrameEvent; /** * DOCUMENT ME! @@ -138,6 +140,7 @@ public class SliderPanel extends GSliderPanel else { sp = (SliderPanel) conservationSlider.getContentPane(); + sp.slider.setValue(cs.getConservationInc()); sp.cs = cs; } @@ -159,28 +162,55 @@ public class SliderPanel extends GSliderPanel } /** - * DOCUMENT ME! + * Hides the PID slider panel if it is shown */ - public static void showConservationSlider() + public static void hidePIDSlider() { - try + if (PIDSlider != null) { - PIDSlider.setClosed(true); - PIDSlider = null; - } catch (Exception ex) + try + { + PIDSlider.setClosed(true); + PIDSlider = null; + } catch (PropertyVetoException ex) + { + } + } + } + + /** + * Hides the conservation slider panel if it is shown + */ + public static void hideConservationSlider() + { + if (conservationSlider != null) { + try + { + conservationSlider.setClosed(true); + conservationSlider = null; + } catch (PropertyVetoException ex) + { + } } + } + + /** + * DOCUMENT ME! + */ + public static void showConservationSlider() + { + hidePIDSlider(); if (!conservationSlider.isVisible()) { Desktop.addInternalFrame(conservationSlider, conservationSlider.getTitle(), 420, 90, false); conservationSlider - .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() + .addInternalFrameListener(new InternalFrameAdapter() { @Override - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent e) + public void internalFrameClosed(InternalFrameEvent e) { conservationSlider = null; } @@ -220,6 +250,7 @@ public class SliderPanel extends GSliderPanel { pid = (SliderPanel) PIDSlider.getContentPane(); pid.cs = collectionColourScheme; + pid.slider.setValue(collectionColourScheme.getThreshold()); } PIDSlider @@ -244,29 +275,21 @@ public class SliderPanel extends GSliderPanel */ public static void showPIDSlider() { - try - { - conservationSlider.setClosed(true); - conservationSlider = null; - } catch (Exception ex) - { - } + hideConservationSlider(); if (!PIDSlider.isVisible()) { Desktop.addInternalFrame(PIDSlider, PIDSlider.getTitle(), 420, 90, false); PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER); - PIDSlider - .addInternalFrameListener(new javax.swing.event.InternalFrameAdapter() - { - @Override - public void internalFrameClosed( - javax.swing.event.InternalFrameEvent e) - { - PIDSlider = null; - } - }); + PIDSlider.addInternalFrameListener(new InternalFrameAdapter() + { + @Override + public void internalFrameClosed(InternalFrameEvent e) + { + PIDSlider = null; + } + }); PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER); } } @@ -338,7 +361,7 @@ public class SliderPanel extends GSliderPanel * DOCUMENT ME! */ @Override - public void valueField_actionPerformed(ActionEvent e) + public void valueField_actionPerformed() { try {