stretchGroup = av.getSelectionGroup();
- if (stretchGroup == null)
- {
- stretchGroup = av.getAlignment().findGroup(sequence);
- if (stretchGroup != null && res > stretchGroup.getStartRes()
- && res < stretchGroup.getEndRes())
- {
- av.setSelectionGroup(stretchGroup);
- }
- else
- {
- stretchGroup = null;
- }
- }
-
- else if (!stretchGroup.getSequences(null).contains(sequence)
- || stretchGroup.getStartRes() > res
- || stretchGroup.getEndRes() < res)
+ if (stretchGroup == null || !stretchGroup.contains(sequence, res))
{
- stretchGroup = null;
-
- SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
-
- if (allGroups != null)
- {
- for (int i = 0; i < allGroups.length; i++)
- {
- if (allGroups[i].getStartRes() <= res
- && allGroups[i].getEndRes() >= res)
- {
- stretchGroup = allGroups[i];
- break;
- }
- }
- }
+ stretchGroup = av.getAlignment().findGroup(sequence, res);
av.setSelectionGroup(stretchGroup);
}
if (av.getConservationSelected())
{
- SliderPanel.setConservationSlider(ap, av.getViewportColourScheme(),
- "Background");
+ SliderPanel.setConservationSlider(ap, av.getResidueShading(),
+ ap.getViewName());
}
if (av.getAbovePIDThreshold())
{
- SliderPanel.setPIDSliderSource(ap, av.getViewportColourScheme(),
- "Background");
+ SliderPanel.setPIDSliderSource(ap, av.getResidueShading(),
+ ap.getViewName());
}
}
SliderPanel.setConservationSlider(ap, stretchGroup.cs,
stretchGroup.getName());
}
- else
+ if (stretchGroup.cs.getThreshold() > 0)
{
SliderPanel.setPIDSliderSource(ap, stretchGroup.cs,
stretchGroup.getName());