Merge "Issue #1606 Did not set default bullets for CORs." into development

Former-commit-id: 15403138929b735070553ec08d4e44e4bfc1811e
This commit is contained in:
Lee Venable 2013-02-13 10:31:14 -06:00 committed by Gerrit Code Review
commit ffd4bf0028

View file

@ -33,6 +33,7 @@ import com.raytheon.uf.common.dataplugin.warning.config.WarngenConfiguration;
*
* 01/26/2012 14466 D.Friedman Fix parseString processing.
* 01/26/2012 14469 D.Friedman Fix followup bullet processing
* Feb 13, 2013 1606 jsanchez Did not set default bullets for CORs.
*
* </pre>
*
@ -87,6 +88,19 @@ public class BulletListManager {
* @param damInfoBullets
*/
public void recreateBullets(Bullet[] bullets, DamInfoBullet[] damInfoBullets) {
recreateBullets(bullets, damInfoBullets, null);
}
/**
* Separates all the bullets in it's corresponding group. Identifies all the
* bullets that should be selected by default unless the action is a COR.
*
* @param bullets
* @param damInfoBullets
* @param action
*/
public void recreateBullets(Bullet[] bullets,
DamInfoBullet[] damInfoBullets, WarningAction action) {
loadBullets(bullets, damInfoBullets);
clear();
String damName = null;
@ -128,10 +142,12 @@ public class BulletListManager {
}
}
if (action != WarningAction.COR) {
for (Integer index : defaultIndices) {
updateSelectedIndices(index, false);
}
}
}
/**
* Updates the bullets that should be selected based on the warning text and
@ -155,15 +171,14 @@ public class BulletListManager {
ArrayList<Bullet> displayedDamInfoBullets = null;
for (int pass = 0; pass < 2; ++pass) {
Bullet[] sourceList = pass == 0 ?
configuration.getBullets() :
configuration.getDamInfoBullets();
Bullet[] sourceList = pass == 0 ? configuration.getBullets()
: configuration.getDamInfoBullets();
ArrayList<Bullet> resultList = new ArrayList<Bullet>();
if (sourceList != null) {
for (Bullet b : sourceList) {
if (b != null
&& (b.getShowString() == null ||
selectBulletFromFollowup(b.getShowString(), warningText))) {
&& (b.getShowString() == null || selectBulletFromFollowup(
b.getShowString(), warningText))) {
resultList.add(b);
}
}
@ -175,9 +190,11 @@ public class BulletListManager {
}
/* Sets up the appropriate bullet groups */
recreateBullets(
displayedBullets.toArray(new Bullet[displayedBullets.size()]),
displayedDamInfoBullets.toArray(new DamInfoBullet[displayedDamInfoBullets.size()]));
recreateBullets(displayedBullets.toArray(new Bullet[displayedBullets
.size()]),
displayedDamInfoBullets
.toArray(new DamInfoBullet[displayedDamInfoBullets
.size()]), action);
if (configuration.getLockedGroupsOnFollowup() != null) {
for (String lockedGroup : configuration.getLockedGroupsOnFollowup()
@ -234,7 +251,8 @@ public class BulletListManager {
* @param isFollowup
* @param selectUnconditionally
*/
public void updateSelectedIndices(int selectionIndex, boolean isFollowup, boolean selectUnconditionally) {
public void updateSelectedIndices(int selectionIndex, boolean isFollowup,
boolean selectUnconditionally) {
if (selectionIndex < 0 || selectionIndex >= bullets.length
|| titleGroup.contains(selectionIndex)) {
return;