Merge "Issue #1606 Did not set default bullets for CORs." into development
Former-commit-id: 15403138929b735070553ec08d4e44e4bfc1811e
This commit is contained in:
commit
ffd4bf0028
1 changed files with 83 additions and 65 deletions
|
@ -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 14466 D.Friedman Fix parseString processing.
|
||||||
* 01/26/2012 14469 D.Friedman Fix followup bullet processing
|
* 01/26/2012 14469 D.Friedman Fix followup bullet processing
|
||||||
|
* Feb 13, 2013 1606 jsanchez Did not set default bullets for CORs.
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -87,6 +88,19 @@ public class BulletListManager {
|
||||||
* @param damInfoBullets
|
* @param damInfoBullets
|
||||||
*/
|
*/
|
||||||
public void recreateBullets(Bullet[] bullets, DamInfoBullet[] 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);
|
loadBullets(bullets, damInfoBullets);
|
||||||
clear();
|
clear();
|
||||||
String damName = null;
|
String damName = null;
|
||||||
|
@ -128,10 +142,12 @@ public class BulletListManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (action != WarningAction.COR) {
|
||||||
for (Integer index : defaultIndices) {
|
for (Integer index : defaultIndices) {
|
||||||
updateSelectedIndices(index, false);
|
updateSelectedIndices(index, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Updates the bullets that should be selected based on the warning text and
|
* Updates the bullets that should be selected based on the warning text and
|
||||||
|
@ -155,15 +171,14 @@ public class BulletListManager {
|
||||||
ArrayList<Bullet> displayedDamInfoBullets = null;
|
ArrayList<Bullet> displayedDamInfoBullets = null;
|
||||||
|
|
||||||
for (int pass = 0; pass < 2; ++pass) {
|
for (int pass = 0; pass < 2; ++pass) {
|
||||||
Bullet[] sourceList = pass == 0 ?
|
Bullet[] sourceList = pass == 0 ? configuration.getBullets()
|
||||||
configuration.getBullets() :
|
: configuration.getDamInfoBullets();
|
||||||
configuration.getDamInfoBullets();
|
|
||||||
ArrayList<Bullet> resultList = new ArrayList<Bullet>();
|
ArrayList<Bullet> resultList = new ArrayList<Bullet>();
|
||||||
if (sourceList != null) {
|
if (sourceList != null) {
|
||||||
for (Bullet b : sourceList) {
|
for (Bullet b : sourceList) {
|
||||||
if (b != null
|
if (b != null
|
||||||
&& (b.getShowString() == null ||
|
&& (b.getShowString() == null || selectBulletFromFollowup(
|
||||||
selectBulletFromFollowup(b.getShowString(), warningText))) {
|
b.getShowString(), warningText))) {
|
||||||
resultList.add(b);
|
resultList.add(b);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -175,9 +190,11 @@ public class BulletListManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Sets up the appropriate bullet groups */
|
/* Sets up the appropriate bullet groups */
|
||||||
recreateBullets(
|
recreateBullets(displayedBullets.toArray(new Bullet[displayedBullets
|
||||||
displayedBullets.toArray(new Bullet[displayedBullets.size()]),
|
.size()]),
|
||||||
displayedDamInfoBullets.toArray(new DamInfoBullet[displayedDamInfoBullets.size()]));
|
displayedDamInfoBullets
|
||||||
|
.toArray(new DamInfoBullet[displayedDamInfoBullets
|
||||||
|
.size()]), action);
|
||||||
|
|
||||||
if (configuration.getLockedGroupsOnFollowup() != null) {
|
if (configuration.getLockedGroupsOnFollowup() != null) {
|
||||||
for (String lockedGroup : configuration.getLockedGroupsOnFollowup()
|
for (String lockedGroup : configuration.getLockedGroupsOnFollowup()
|
||||||
|
@ -234,7 +251,8 @@ public class BulletListManager {
|
||||||
* @param isFollowup
|
* @param isFollowup
|
||||||
* @param selectUnconditionally
|
* @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
|
if (selectionIndex < 0 || selectionIndex >= bullets.length
|
||||||
|| titleGroup.contains(selectionIndex)) {
|
|| titleGroup.contains(selectionIndex)) {
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Add table
Reference in a new issue