From: gmungoc Date: Fri, 20 Jan 2017 12:21:42 +0000 (+0000) Subject: Merge branch 'features/JAL-2360colourSchemeApplicability' into X-Git-Tag: Release_2_10_3b1~357^2~15 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=fd7eebe6dcf2346692d718ef91bb468cc12ebf44;p=jalview.git Merge branch 'features/JAL-2360colourSchemeApplicability' into features/JAL-2371collectionColourScheme Conflicts: src/jalview/appletgui/SliderPanel.java src/jalview/gui/Jalview2XML.java src/jalview/gui/SliderPanel.java --- fd7eebe6dcf2346692d718ef91bb468cc12ebf44 diff --cc src/jalview/appletgui/SliderPanel.java index 9335e2f,53a2824..2aa010f --- a/src/jalview/appletgui/SliderPanel.java +++ b/src/jalview/appletgui/SliderPanel.java @@@ -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( @@@ -178,8 -178,31 +180,31 @@@ } + /** + * 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 { diff --cc src/jalview/gui/Jalview2XML.java index cda08c6,b6587fb..8393693 --- a/src/jalview/gui/Jalview2XML.java +++ b/src/jalview/gui/Jalview2XML.java @@@ -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()); @@@ -4468,12 -4473,11 +4471,6 @@@ { 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); diff --cc src/jalview/gui/SliderPanel.java index e28778c,7d733c9..b386dec --- a/src/jalview/gui/SliderPanel.java +++ b/src/jalview/gui/SliderPanel.java @@@ -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 @@@ -334,25 -356,6 +357,25 @@@ /** * 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! */