stretchGroup = av.getSelectionGroup();
- if (stretchGroup == null)
+ if (stretchGroup == null || !stretchGroup.contains(sequence, res))
{
stretchGroup = av.getAlignment().findGroup(sequence, res);
- av.setSelectionGroup(stretchGroup);
- }
- if (stretchGroup == null
- || !stretchGroup.getSequences(null).contains(sequence)
- || (stretchGroup.getStartRes() > res)
- || (stretchGroup.getEndRes() < res))
- {
- stretchGroup = null;
-
- SequenceGroup[] allGroups = av.getAlignment().findAllGroups(sequence);
-
- if (allGroups != null)
+ if (stretchGroup != null)
{
- for (int i = 0; i < allGroups.length; i++)
- {
- if ((allGroups[i].getStartRes() <= res)
- && (allGroups[i].getEndRes() >= res))
- {
- stretchGroup = allGroups[i];
- break;
- }
- }
+ // only update the current selection if the popup menu has a group to
+ // focus on
+ av.setSelectionGroup(stretchGroup);
}
-
- av.setSelectionGroup(stretchGroup);
}
if (evt.isPopupTrigger()) // Mac: mousePressed
SliderPanel.setPIDSliderSource(ap, av.getResidueShading(),
ap.getViewName());
}
+ // TODO: stretchGroup will always be not null. Is this a merge error ?
if ((stretchGroup != null) && (stretchGroup.getEndRes() == res))
{
// Edit end res position of selected group