}
- 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
{
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);
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;
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!
*/