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

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

1  2 
src/jalview/appletgui/APopupMenu.java
src/jalview/appletgui/AlignFrame.java
src/jalview/appletgui/SliderPanel.java
src/jalview/gui/AlignFrame.java
src/jalview/gui/Jalview2XML.java
src/jalview/gui/PopupMenu.java
src/jalview/gui/SliderPanel.java

Simple merge
Simple merge
@@@ -119,20 -119,20 +121,20 @@@ public class SliderPanel extends Panel 
  
    }
  
 -  public static int setPIDSliderSource(AlignmentPanel ap, ColourSchemeI cs,
 -          String source)
 +  public static int setPIDSliderSource(AlignmentPanel ap,
-           CollectionColourSchemeI collectionColourSchemeI, String source)
++          CollectionColourSchemeI ccs, String source)
    {
      SliderPanel pid = null;
      if (PIDSlider == null)
      {
-       pid = new SliderPanel(ap, 50, false, collectionColourSchemeI);
 -      pid = new SliderPanel(ap, cs.getThreshold(), false, cs);
++      pid = new SliderPanel(ap, ccs.getThreshold(), false, ccs);
        PIDSlider = new Frame();
        PIDSlider.add(pid);
      }
      else
      {
        pid = (SliderPanel) PIDSlider.getComponent(0);
-       pid.cs = collectionColourSchemeI;
 -      pid.cs = cs;
++      pid.cs = ccs;
      }
      PIDSlider
              .setTitle(MessageManager.formatMessage(
  
    }
  
+   /**
+    * Hides the PID slider panel if it is shown
+    */
+   public static void hidePIDSlider()
+   {
+     if (PIDSlider != null)
+     {
+       PIDSlider.setVisible(false);
+       PIDSlider = null;
+     }
+   }
+   /**
+    * Hides the Conservation slider panel if it is shown
+    */
+   public static void hideConservationSlider()
+   {
+     if (conservationSlider != null)
+     {
+       conservationSlider.setVisible(false);
+       conservationSlider = null;
+     }
+   }
    public SliderPanel(AlignmentPanel ap, int value, boolean forConserve,
 -          ColourSchemeI cs)
 +          CollectionColourSchemeI collectionColourSchemeI)
    {
      try
      {
Simple merge
@@@ -3372,7 -3375,7 +3372,8 @@@ public class Jalview2XM
          SequenceGroup sg = new SequenceGroup(seqs, jGroup.getName(), cs,
                  jGroup.getDisplayBoxes(), jGroup.getDisplayText(),
                  jGroup.getColourText(), jGroup.getStart(), jGroup.getEnd());
 -
 +        sg.getGroupColourScheme().setThreshold(pidThreshold, true);
++        sg.getGroupColourScheme().setConservationInc(jGroup.getConsThreshold());
          sg.setOutlineColour(new java.awt.Color(jGroup.getOutlineColour()));
  
          sg.textColour = new java.awt.Color(jGroup.getTextCol1());
        {
          cs = ColourSchemeProperty.getColourScheme(al, view.getBgColour());
        }
--
-       // if (cs != null)
-       // {
-       // cs.setThreshold(view.getPidThreshold(), true);
-       // cs.setConsensus(af.viewport.getSequenceConsensusHash());
-       // }
 -      if (cs != null)
 -      {
 -        cs.setConsensus(af.viewport.getSequenceConsensusHash());
 -      }
      }
  
      af.viewport.setGlobalColourScheme(cs);
Simple merge
@@@ -22,12 -22,13 +22,12 @@@ package jalview.gui
  
  import jalview.datamodel.SequenceGroup;
  import jalview.jbgui.GSliderPanel;
 -import jalview.schemes.ColourSchemeI;
 +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 java.util.Iterator;
  
  import javax.swing.JInternalFrame;
  import javax.swing.JLayeredPane;
@@@ -219,7 -249,8 +249,8 @@@ public class SliderPanel extends GSlide
      else
      {
        pid = (SliderPanel) PIDSlider.getContentPane();
 -      pid.slider.setValue(cs.getThreshold());
 -      pid.cs = cs;
 +      pid.cs = collectionColourScheme;
++      pid.slider.setValue(collectionColourScheme.getThreshold());
      }
  
      PIDSlider
    /**
     * DOCUMENT ME!
     * 
 +   * @param e
 +   *          DOCUMENT ME!
 +   */
 +  @Override
-   public void valueField_actionPerformed(ActionEvent e)
++  public void valueField_actionPerformed()
 +  {
 +    try
 +    {
 +      int i = Integer.parseInt(valueField.getText());
 +      slider.setValue(i);
 +    } catch (NumberFormatException ex)
 +    {
 +      valueField.setText(slider.getValue() + "");
 +    }
 +  }
 +
 +  /**
 +   * DOCUMENT ME!
 +   * 
     * @param value
     *          DOCUMENT ME!
     */