return;
}
- ColourSchemeI toChange = null;
+ ColourSchemeI toChange = cs;
Iterator<SequenceGroup> allGroups = null;
if (allGroupsCheck.getState())
{
allGroups = ap.av.getAlignment().getGroups().listIterator();
}
- else
- {
- toChange = cs;
- }
- do
+ while (toChange != null)
{
- if (allGroups != null)
- {
- toChange = allGroups.next().cs;
- }
-
if (forConservation)
{
toChange.setConservationInc(i);
{
toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus());
}
-
- } while (allGroups != null && allGroups.hasNext());
+ if (allGroups != null && allGroups.hasNext())
+ {
+ while ((toChange = allGroups.next().cs) == null
+ && allGroups.hasNext())
+ ;
+ }
+ else
+ {
+ toChange = null;
+ }
+ }
ap.seqPanel.seqCanvas.repaint();
return;
}
- ColourSchemeI toChange = null;
- List<SequenceGroup> allGroups = null;
- int groupIndex = 0;
+ ColourSchemeI toChange = cs;
+ Iterator<SequenceGroup> allGroups = null;
if (allGroupsCheck.isSelected())
{
- allGroups = ap.av.getAlignment().getGroups();
- groupIndex = allGroups.size() - 1;
- }
- else
- {
- toChange = cs;
+ allGroups = ap.av.getAlignment().getGroups().listIterator();
}
- while (groupIndex > -1)
+ while (toChange != null)
{
- if (allGroups != null)
- {
- toChange = ((SequenceGroup) allGroups.get(groupIndex)).cs;
-
- if (toChange == null)
- {
- groupIndex--;
-
- continue;
- }
- }
-
if (forConservation)
{
- if (toChange.conservationApplied())
- {
- toChange.setConservationInc(i);
- }
+ toChange.setConservationInc(i);
}
else
{
toChange.setThreshold(i, ap.av.getIgnoreGapsConsensus());
}
-
- groupIndex--;
+ if (allGroups != null && allGroups.hasNext())
+ {
+ while ((toChange = allGroups.next().cs) == null
+ && allGroups.hasNext())
+ ;
+ }
+ else
+ {
+ toChange = null;
+ }
}
ap.seqPanel.seqCanvas.repaint();