Merge branch 'features/JAL-2360colourSchemeApplicability' into
authorgmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 20 Jan 2017 14:44:02 +0000 (14:44 +0000)
committergmungoc <g.m.carstairs@dundee.ac.uk>
Fri, 20 Jan 2017 14:44:02 +0000 (14:44 +0000)
features/JAL-2371collectionColourScheme

Conflicts:
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/SliderPanel.java

1  2 
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/SeqPanel.java
src/jalview/gui/SliderPanel.java

@@@ -60,22 -60,21 +60,21 @@@ public class SliderPanel extends Panel 
    static Frame PIDSlider;
  
    public static int setConservationSlider(AlignmentPanel ap,
-           CollectionColourSchemeI collectionColourSchemeI, String source)
 -          ColourSchemeI cs, String source)
++          CollectionColourSchemeI ccs, String source)
    {
      SliderPanel sp = null;
  
      if (conservationSlider == null)
      {
-       sp = new SliderPanel(ap,
-               collectionColourSchemeI.getConservationInc(), true,
-               collectionColourSchemeI);
 -      sp = new SliderPanel(ap, cs.getConservationInc(), true, cs);
++      sp = new SliderPanel(ap, ccs.getConservationInc(), true, ccs);
        conservationSlider = new Frame();
        conservationSlider.add(sp);
      }
      else
      {
        sp = (SliderPanel) conservationSlider.getComponent(0);
-       sp.cs = collectionColourSchemeI;
 -      sp.valueField.setText(String.valueOf(cs.getConservationInc()));
 -      sp.cs = cs;
++      sp.cs = ccs;
++      sp.valueField.setText(String.valueOf(ccs.getConservationInc()));
      }
  
      conservationSlider
      else
      {
        pid = (SliderPanel) PIDSlider.getComponent(0);
 -      pid.valueField.setText(String.valueOf(cs.getThreshold()));
 -      pid.cs = cs;
 +      pid.cs = ccs;
++      pid.valueField.setText(String.valueOf(ccs.getThreshold()));
      }
      PIDSlider
              .setTitle(MessageManager.formatMessage(
@@@ -1733,15 -1732,15 +1733,15 @@@ public class SeqPanel extends JPanel im
        stretchGroup.cs.alignmentChanged(stretchGroup,
                av.getHiddenRepSequences());
  
 +      CollectionColourSchemeI groupColourScheme = stretchGroup.getGroupColourScheme();
 +      String name = stretchGroup.getName();
        if (stretchGroup.cs.conservationApplied())
        {
 -        SliderPanel.setConservationSlider(ap, stretchGroup.cs,
 -                stretchGroup.getName());
 +        SliderPanel.setConservationSlider(ap, groupColourScheme, name);
        }
-       else
+       if (stretchGroup.cs.getThreshold() > 0)
        {
 -        SliderPanel.setPIDSliderSource(ap, stretchGroup.cs,
 -                stretchGroup.getName());
 +        SliderPanel.setPIDSliderSource(ap, groupColourScheme, name);
        }
      }
      PaintRefresher.Refresh(this, av.getSequenceSetId());
@@@ -118,7 -119,7 +118,7 @@@ public class SliderPanel extends GSlide
     * 
     * @param ap
     *          DOCUMENT ME!
--   * @param cs
++   * @param ccs
     *          DOCUMENT ME!
     * @param source
     *          DOCUMENT ME!
     * @return DOCUMENT ME!
     */
    public static int setConservationSlider(AlignmentPanel ap,
-           CollectionColourSchemeI cs, String source)
 -          ColourSchemeI cs, String source)
++          CollectionColourSchemeI ccs, String source)
    {
      SliderPanel sp = null;
  
      if (conservationSlider == null)
      {
--      sp = new SliderPanel(ap, cs.getConservationInc(), true, cs);
++      sp = new SliderPanel(ap, ccs.getConservationInc(), true, ccs);
        conservationSlider = new JInternalFrame();
        conservationSlider.setContentPane(sp);
        conservationSlider.setLayer(JLayeredPane.PALETTE_LAYER);
      else
      {
        sp = (SliderPanel) conservationSlider.getContentPane();
-       sp.slider.setValue(cs.getConservationInc());
-       sp.cs = cs;
 -      sp.valueField.setText(String.valueOf(cs.getConservationInc()));
 -      sp.cs = cs;
++      sp.valueField.setText(String.valueOf(ccs.getConservationInc()));
++      sp.cs = ccs;
      }
  
      conservationSlider
     * 
     * @param ap
     *          DOCUMENT ME!
-    * @param collectionColourScheme
 -   * @param cs
++   * @param ccs
     *          DOCUMENT ME!
     * @param source
     *          DOCUMENT ME!
     * 
     * @return DOCUMENT ME!
     */
 -  public static int setPIDSliderSource(AlignmentPanel ap, ColourSchemeI cs,
 -          String source)
 +  public static int setPIDSliderSource(AlignmentPanel ap,
-           CollectionColourSchemeI collectionColourScheme,
-           String source)
++          CollectionColourSchemeI ccs, String source)
    {
      SliderPanel pid = null;
  
-     int threshold = collectionColourScheme.getThreshold();
 -    int threshold = cs.getThreshold();
++    int threshold = ccs.getThreshold();
  
      if (PIDSlider == null)
      {
-       pid = new SliderPanel(ap, threshold, false, collectionColourScheme);
 -      pid = new SliderPanel(ap, threshold, false, cs);
++      pid = new SliderPanel(ap, threshold, false, ccs);
        PIDSlider = new JInternalFrame();
        PIDSlider.setContentPane(pid);
        PIDSlider.setLayer(JLayeredPane.PALETTE_LAYER);
      else
      {
        pid = (SliderPanel) PIDSlider.getContentPane();
-       pid.cs = collectionColourScheme;
-       pid.slider.setValue(collectionColourScheme.getThreshold());
 -      pid.valueField.setText(String.valueOf(cs.getThreshold()));
 -      pid.cs = cs;
++      pid.cs = ccs;
++      pid.valueField.setText(String.valueOf(ccs.getThreshold()));
      }
  
      PIDSlider