Issue #2176 Increased line width of emergency polygon and changed font for regular warning products.

Change-Id: Icb5456d038a8a2fadbe10f70a2ef32c8ba1f7816

Former-commit-id: 3f0c709b3f [formerly ce051787a7] [formerly a57cec0ed8 [formerly 61dd32d0244c9a6af8e63ed2b789cfa15d7c9539]]
Former-commit-id: a57cec0ed8
Former-commit-id: ff9bac0d3b
This commit is contained in:
Jonathan Sanchez 2013-09-05 11:24:16 -05:00
parent 57db023bfd
commit 18e48b4ab5
8 changed files with 210 additions and 148 deletions

View file

@ -27,6 +27,7 @@ import com.raytheon.uf.common.activetable.ActiveTableMode;
import com.raytheon.uf.common.activetable.ActiveTableRecord; import com.raytheon.uf.common.activetable.ActiveTableRecord;
import com.raytheon.uf.common.activetable.GetActiveTableRequest; import com.raytheon.uf.common.activetable.GetActiveTableRequest;
import com.raytheon.uf.common.activetable.GetActiveTableResponse; import com.raytheon.uf.common.activetable.GetActiveTableResponse;
import com.raytheon.uf.common.dataplugin.warning.EmergencyType;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.status.IUFStatusHandler; import com.raytheon.uf.common.status.IUFStatusHandler;
import com.raytheon.uf.common.status.UFStatus; import com.raytheon.uf.common.status.UFStatus;
@ -48,6 +49,7 @@ import com.raytheon.viz.texteditor.util.VtecUtil;
* Date Ticket# Engineer Description * Date Ticket# Engineer Description
* ------------ ---------- ----------- -------------------------- * ------------ ---------- ----------- --------------------------
* Jul 23, 2013 2176 jsanchez Initial creation * Jul 23, 2013 2176 jsanchez Initial creation
* Sep 4, 2013 2176 jsanchez Moved EmergencyType to a public class.
* *
* </pre> * </pre>
* *
@ -62,38 +64,6 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable {
private String productMessage; private String productMessage;
private static class EmergencyType {
private static final EmergencyType TORNADO = new EmergencyType(
"TORNADO EMERGENCY", "TO.W");
private static final EmergencyType FLASH_FLOOD = new EmergencyType(
"FLASH FLOOD EMERGENCY", "FF.W");
private final String value;
private final String phensig;
private final static EmergencyType[] values = new EmergencyType[] {
TORNADO, FLASH_FLOOD };
private EmergencyType(String type, String phensig) {
this.value = type;
this.phensig = phensig;
}
public static EmergencyType valueOf(String phensig) {
EmergencyType type = null;
for (EmergencyType t : values) {
if (t.phensig.equals(phensig)) {
type = t;
break;
}
}
return type;
}
};
/** /**
* Orders the ActiveTableRecord based on the issue time (ascending) * Orders the ActiveTableRecord based on the issue time (ascending)
*/ */
@ -126,11 +96,11 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable {
// Check if the warning product is a valid EmergencyType. // Check if the warning product is a valid EmergencyType.
if (type != null) { if (type != null) {
boolean currentEmergency = body.contains("EMERGENCY"); boolean currentEmergency = EmergencyType.isEmergency(body);
if (action == WarningAction.NEW && currentEmergency) { if (action == WarningAction.NEW && currentEmergency) {
// Only occurs when the warning is first issued and not any // Only occurs when the warning is first issued and not any
// other action // other action
productMessage = "This is a " + type.value; productMessage = "This is a " + type.getValue();
} else if (action == WarningAction.CON } else if (action == WarningAction.CON
|| action == WarningAction.EXT || action == WarningAction.EXT
|| action == WarningAction.CANCON) { || action == WarningAction.CANCON) {
@ -159,14 +129,14 @@ public class EmergencyConfirmationMsg implements IWarnGenConfirmationable {
new ActiveTableRecordComparator()); new ActiveTableRecordComparator());
ActiveTableRecord record = records ActiveTableRecord record = records
.get(records.size() - 1); .get(records.size() - 1);
boolean wasEmergency = record.getRawmessage().contains( boolean wasEmergency = EmergencyType.isEmergency(record
"EMERGENCY"); .getRawmessage());
if (!wasEmergency && currentEmergency) { if (!wasEmergency && currentEmergency) {
productMessage = "This is an upgrade of a " productMessage = "This is an upgrade of a "
+ type.value; + type.getValue();
} else if (wasEmergency && !currentEmergency) { } else if (wasEmergency && !currentEmergency) {
productMessage = "This is a downgrade of a " productMessage = "This is a downgrade of a "
+ type.value; + type.getValue();
} }
} }
} catch (VizException e) { } catch (VizException e) {

View file

@ -44,7 +44,6 @@ import java.util.Scanner;
import java.util.TimeZone; import java.util.TimeZone;
import java.util.Timer; import java.util.Timer;
import java.util.TimerTask; import java.util.TimerTask;
import java.util.concurrent.atomic.AtomicInteger;
import java.util.regex.Matcher; import java.util.regex.Matcher;
import java.util.regex.Pattern; import java.util.regex.Pattern;
@ -331,7 +330,7 @@ import com.raytheon.viz.ui.dialogs.SWTMessageBox;
* 25July2013 15733 GHull Read font and color prefs from TextEditorCfg. * 25July2013 15733 GHull Read font and color prefs from TextEditorCfg.
* 23Aug2013 DR 16514 D. Friedman Fix handling of completed product requests. Do not change * 23Aug2013 DR 16514 D. Friedman Fix handling of completed product requests. Do not change
* command history or close browser window for "update obs". * command history or close browser window for "update obs".
* * 04Sep2013 2176 jsanchez Changed the order of the QC check dialogs.
* </pre> * </pre>
* *
* @author lvenable * @author lvenable
@ -2952,20 +2951,23 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
* The font size sub menu. * The font size sub menu.
*/ */
private void createFontSizeSubMenu(Menu fontSizeSubMenu) { private void createFontSizeSubMenu(Menu fontSizeSubMenu) {
FontSizeCfg fontSizeCfg = TextEditorCfg.getTextEditorCfg().getFontSizeCfg(); FontSizeCfg fontSizeCfg = TextEditorCfg.getTextEditorCfg()
SizeButtonCfg seldFontBtn = TextEditorCfg.getTextEditorCfg().getSelectedFontButton(); .getFontSizeCfg();
SizeButtonCfg seldFontBtn = TextEditorCfg.getTextEditorCfg()
.getSelectedFontButton();
for (SizeButtonCfg buttonCfg : fontSizeCfg.getButtons()) { for (SizeButtonCfg buttonCfg : fontSizeCfg.getButtons()) {
MenuItem item = new MenuItem(fontSizeSubMenu, SWT.RADIO); MenuItem item = new MenuItem(fontSizeSubMenu, SWT.RADIO);
item.setText(buttonCfg.getLabelName()); item.setText(buttonCfg.getLabelName());
item.setSelection( false ); item.setSelection(false);
item.setData(buttonCfg); item.setData(buttonCfg);
// if this button is the initial selection. // if this button is the initial selection.
if( seldFontBtn.getLabelName().equals( buttonCfg.getLabelName() ) ) { if (seldFontBtn.getLabelName().equals(buttonCfg.getLabelName())) {
item.setSelection(true); item.setSelection(true);
setDefaultFont( seldFontBtn.getFontSize(), seldFontBtn.getFontName() ); setDefaultFont(seldFontBtn.getFontSize(),
seldFontBtn.getFontName());
} }
item.addSelectionListener(new SelectionAdapter() { item.addSelectionListener(new SelectionAdapter() {
@ -2973,10 +2975,12 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
public void widgetSelected(SelectionEvent event) { public void widgetSelected(SelectionEvent event) {
MenuItem item = (MenuItem) event.getSource(); MenuItem item = (MenuItem) event.getSource();
if (item.getSelection()) { if (item.getSelection()) {
int selectFontSize = ( (SizeButtonCfg) item.getData()).getFontSize(); int selectFontSize = ((SizeButtonCfg) item.getData())
String seldFontName = ((SizeButtonCfg) item.getData()).getFontName(); .getFontSize();
String seldFontName = ((SizeButtonCfg) item.getData())
setDefaultFont( selectFontSize, seldFontName ); .getFontName();
setDefaultFont(selectFontSize, seldFontName);
textEditor.setFont(dftFont); textEditor.setFont(dftFont);
headerTF.setFont(dftFont); headerTF.setFont(dftFont);
@ -2987,8 +2991,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
} }
public void setDefaultFont( int fontSize, String fontName ) { public void setDefaultFont(int fontSize, String fontName) {
dftFont = new Font( getDisplay(), fontName, fontSize, SWT.NORMAL); dftFont = new Font(getDisplay(), fontName, fontSize, SWT.NORMAL);
} }
/** /**
@ -3723,7 +3727,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true); GridData gd = new GridData(SWT.FILL, SWT.FILL, true, true);
textEditorComp = new Composite(shell, SWT.NONE); textEditorComp = new Composite(shell, SWT.NONE);
GridLayout gridLayout = new GridLayout(1, false); GridLayout gridLayout = new GridLayout(1, false);
// TextColorsCfg textColorCfg = null; // TextColorsCfg textColorCfg = null;
textEditorComp.setLayout(gridLayout); textEditorComp.setLayout(gridLayout);
textEditorComp.setLayoutData(gd); textEditorComp.setLayoutData(gd);
@ -3745,8 +3749,8 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
airportToolTip = new DefaultToolTip(textEditor, SWT.DEFAULT, true); airportToolTip = new DefaultToolTip(textEditor, SWT.DEFAULT, true);
textEditor.setKeyBinding(SWT.INSERT, SWT.NULL); // DR 7826 textEditor.setKeyBinding(SWT.INSERT, SWT.NULL); // DR 7826
// textColorCfg = getTextColorCfg(); // textColorCfg = getTextColorCfg();
setDefaultTextColor( TextEditorCfg.getTextEditorCfg() ); setDefaultTextColor(TextEditorCfg.getTextEditorCfg());
textEditor.setForeground(textForeground); textEditor.setForeground(textForeground);
textEditor.setBackground(textBackground); textEditor.setBackground(textBackground);
@ -3948,42 +3952,46 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
}); });
} }
// private TextColorsCfg getTextColorCfg() { // private TextColorsCfg getTextColorCfg() {
// TextColorsCfg textColorsCfg = TextEditorCfg.getTextEditorCfg().getTextColorsCfg(); // TextColorsCfg textColorsCfg =
// // TextEditorCfg.getTextEditorCfg().getTextColorsCfg();
// // Perform Sanity Checks on configuration. //
// StringBuilder message = new StringBuilder(); // // Perform Sanity Checks on configuration.
// // StringBuilder message = new StringBuilder();
// for (TextColorElement textElm : textColorsCfg.getTextColorElements()) { //
// String prmtName = textElm.getParamName(); // for (TextColorElement textElm : textColorsCfg.getTextColorElements()) {
// if (prmtName == null) { // String prmtName = textElm.getParamName();
// message.append("Item \"paramName\" problem!\n"); // if (prmtName == null) {
// // message.append("Item \"paramName\" problem!\n");
// } //
// // }
// if( textElm.getColor() == null ) { //
// message.append("Item \"color\" data enter problem!\n"); // if( textElm.getColor() == null ) {
// } // message.append("Item \"color\" data enter problem!\n");
// // }
// if (message.length() > 0) { //
// message.insert(0, "TextColorsCfg broblem(s): "); // if (message.length() > 0) {
// IUFStatusHandler statusHandler = UFStatus // message.insert(0, "TextColorsCfg broblem(s): ");
// .getHandler(TextEditorDialog.class); // IUFStatusHandler statusHandler = UFStatus
// statusHandler.handle(Priority.PROBLEM, message.toString()); // .getHandler(TextEditorDialog.class);
// } // statusHandler.handle(Priority.PROBLEM, message.toString());
// // }
// } //
// // }
// return textColorsCfg; //
// } // return textColorsCfg;
// }
private void setDefaultTextColor(TextEditorCfg txtClrCfg) {
private void setDefaultTextColor(TextEditorCfg txtClrCfg ) {
textBackground = new Color(shell.getDisplay(),
textBackground = new Color( shell.getDisplay(), txtClrCfg.getTextBackgroundColor() ); txtClrCfg.getTextBackgroundColor());
textForeground = new Color(shell.getDisplay(), txtClrCfg.getTextForegroundColor() ); textForeground = new Color(shell.getDisplay(),
highlightBackground = new Color(shell.getDisplay(), txtClrCfg.getHighlightTextBackgroundColor() ); txtClrCfg.getTextForegroundColor());
highlightForeground = new Color(shell.getDisplay(), txtClrCfg.getHighlightTextForegroundColor() ); highlightBackground = new Color(shell.getDisplay(),
txtClrCfg.getHighlightTextBackgroundColor());
highlightForeground = new Color(shell.getDisplay(),
txtClrCfg.getHighlightTextForegroundColor());
} }
/** /**
@ -4858,14 +4866,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
@Override @Override
public void dialogClosed(Object returnValue) { public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue)) { if (Boolean.TRUE.equals(returnValue)) {
checkEmergencyProduct(resend); finishSendProduct(resend);
} }
} }
}); });
wgcd.open(); wgcd.open();
} else { } else {
checkEmergencyProduct(resend); finishSendProduct(resend);
} }
} else { } else {
finishSendProduct(resend); finishSendProduct(resend);
@ -4915,7 +4923,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
@Override @Override
public void dialogClosed(Object returnValue) { public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue)) { if (Boolean.TRUE.equals(returnValue)) {
warngenCloseCallback(resend); checkEmergencyProduct(resend);
} }
} }
}); });
@ -4943,14 +4951,14 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
@Override @Override
public void dialogClosed(Object returnValue) { public void dialogClosed(Object returnValue) {
if (Boolean.TRUE.equals(returnValue)) { if (Boolean.TRUE.equals(returnValue)) {
finishSendProduct(resend); warngenCloseCallback(resend);
} }
} }
}); });
wgcd.open(); wgcd.open();
} else { } else {
finishSendProduct(resend); warngenCloseCallback(resend);
} }
} }
@ -5903,7 +5911,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
return; return;
} }
if (! isObsUpdated) { if (!isObsUpdated) {
if (browser != null) { if (browser != null) {
browser.close(); browser.close();
browser = null; browser = null;
@ -6097,7 +6105,7 @@ public class TextEditorDialog extends CaveSWTDialog implements VerifyListener,
private void postExecute(boolean hasAttachment, boolean enterEditor, private void postExecute(boolean hasAttachment, boolean enterEditor,
boolean validExecuteCommand, String attachedFilename) { boolean validExecuteCommand, String attachedFilename) {
if (!this.isDisposed()) { if (!this.isDisposed()) {
if (! productQueryJob.isExpectingRequests()) { if (!productQueryJob.isExpectingRequests()) {
if (hasAttachment) { if (hasAttachment) {
statusBarLabel.setText("Attachment: " + attachedFilename); statusBarLabel.setText("Attachment: " + attachedFilename);
} else { } else {

View file

@ -20,6 +20,7 @@
package com.raytheon.viz.warngen.gui; package com.raytheon.viz.warngen.gui;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.EmergencyType;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.time.SimulatedTime; import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.common.time.util.TimeUtil; import com.raytheon.uf.common.time.util.TimeUtil;
@ -39,6 +40,7 @@ import com.raytheon.uf.common.time.util.TimeUtil;
* Aug 7, 2013 2243 jsanchez Set all the attributes of an AbstractWarningRecord and added an expiration string. Removed calendar object. * Aug 7, 2013 2243 jsanchez Set all the attributes of an AbstractWarningRecord and added an expiration string. Removed calendar object.
* Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. Fixed for practice mode. * Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. Fixed for practice mode.
* Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute. * Aug 15,2013 2243 jsanchez Improved the expiration string off by one minute.
* Sep 4,2013 2176 jsanchez Used EmergencyType class to identify emergency products.
* </pre> * </pre>
* *
* @author rferrel * @author rferrel
@ -96,8 +98,8 @@ public class FollowupData extends AbstractWarningRecord {
rval.append(buildExpStr(status, record)); rval.append(buildExpStr(status, record));
} }
if (record.getRawmessage().contains("EMERGENCY")) { if (EmergencyType.isEmergency(record.getRawmessage())) {
rval.append(" EMER"); rval.append(" " + EmergencyType.EMER);
} }
equvialentString = rval.substring(0, equvialentString = rval.substring(0,
record.getProductClass().equals("T") ? 20 : 18); record.getProductClass().equals("T") ? 20 : 18);

View file

@ -15,6 +15,7 @@ import org.opengis.referencing.crs.CoordinateReferenceSystem;
import com.raytheon.uf.common.dataplugin.PluginDataObject; import com.raytheon.uf.common.dataplugin.PluginDataObject;
import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord; import com.raytheon.uf.common.dataplugin.warning.AbstractWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.EmergencyType;
import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord; import com.raytheon.uf.common.dataplugin.warning.PracticeWarningRecord;
import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction; import com.raytheon.uf.common.dataplugin.warning.WarningRecord.WarningAction;
import com.raytheon.uf.common.dataquery.requests.RequestConstraint; import com.raytheon.uf.common.dataquery.requests.RequestConstraint;
@ -80,6 +81,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
* Remove frameAltered condition in matchesFrame. It prevented entries from being displayed. * Remove frameAltered condition in matchesFrame. It prevented entries from being displayed.
* Check if geometry is null when inspecting. * Check if geometry is null when inspecting.
* Jul 22, 2013 2176 jsanchez Updated the wire frame and text for EMERGENCY warnings. * Jul 22, 2013 2176 jsanchez Updated the wire frame and text for EMERGENCY warnings.
* Sep 4, 2013 2176 jsanchez Made the polygon line width thicker and made regular text not bold.
* </pre> * </pre>
* *
* @author jsanchez * @author jsanchez
@ -133,7 +135,9 @@ public abstract class AbstractWWAResource extends
/** map of dataURI to a warning entry **/ /** map of dataURI to a warning entry **/
protected Map<String, WarningEntry> entryMap; protected Map<String, WarningEntry> entryMap;
protected IFont warningsFont; protected IFont warningsFont = null;
protected IFont emergencyFont = null;
protected RGB color; protected RGB color;
@ -368,8 +372,8 @@ public abstract class AbstractWWAResource extends
int outlineWidth = getCapability(OutlineCapability.class) int outlineWidth = getCapability(OutlineCapability.class)
.getOutlineWidth(); .getOutlineWidth();
// Make wire frame outline thicker for EMERGENCY warnings // Make wire frame outline thicker for EMERGENCY warnings
if (record.getRawmessage().contains("EMERGENCY")) { if (EmergencyType.isEmergency(record.getRawmessage())) {
outlineWidth *= 2; outlineWidth *= 3;
} }
target.drawWireframeShape( target.drawWireframeShape(
@ -398,7 +402,10 @@ public abstract class AbstractWWAResource extends
* paintProps.getZoomLevel() / 1000; * paintProps.getZoomLevel() / 1000;
String[] textToPrint = getText(record, mapWidth); String[] textToPrint = getText(record, mapWidth);
if (warningsFont == null) { if (warningsFont == null) {
warningsFont = target.getDefaultFont().deriveWithSize( warningsFont = target.initializeFont(target
.getDefaultFont().getFontName(), 11,
new IFont.Style[0]);
emergencyFont = target.getDefaultFont().deriveWithSize(
11); 11);
} }
// DR14992: reverse the textToPrint array to plot the // DR14992: reverse the textToPrint array to plot the
@ -418,15 +425,24 @@ public abstract class AbstractWWAResource extends
params.verticallAlignment = VerticalAlignment.BOTTOM; params.verticallAlignment = VerticalAlignment.BOTTOM;
params.magnification = getCapability( params.magnification = getCapability(
MagnificationCapability.class).getMagnification(); MagnificationCapability.class).getMagnification();
target.drawStrings(params);
// Draws the string again to have it appear bolder // Draws the string again to have it appear bolder
if (textToPrintReversed[2].endsWith("EMER")) { if (EmergencyType.isEmergency(record.getRawmessage())) {
params.setText(new String[] { "", "", "EMER", "" }, // moves over text to add EMER in a different font
color); textToPrintReversed[2] = String.format("%1$-21" + "s",
target.drawStrings(params); textToPrintReversed[2]);
params.setText(textToPrintReversed, color);
DrawableString emergencyString = new DrawableString(
params);
emergencyString.font = emergencyFont;
emergencyString.setText(new String[] { "", "",
" " + EmergencyType.EMER, "" }, color);
target.drawStrings(emergencyString);
} }
target.drawStrings(params);
} }
} }
} }
@ -598,12 +614,7 @@ public abstract class AbstractWWAResource extends
textToPrint[0] += "." + vid; textToPrint[0] += "." + vid;
} }
textToPrint[0] += "." + record.getEtn(); textToPrint[0] += "." + record.getEtn();
textToPrint[1] = record.getPil();
if (record.getRawmessage().contains("EMERGENCY")) {
textToPrint[1] = record.getPil() + " EMER";
} else {
textToPrint[1] = record.getPil();
}
SimpleDateFormat startFormat = DEFAULT_FORMAT; SimpleDateFormat startFormat = DEFAULT_FORMAT;
SimpleDateFormat endFormat = DEFAULT_FORMAT; SimpleDateFormat endFormat = DEFAULT_FORMAT;

View file

@ -60,7 +60,8 @@ import com.vividsolutions.jts.geom.Geometry;
* Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class.
* Apr 18, 2013 1877 jsanchez Ordered the records the same for update and initial load. * Apr 18, 2013 1877 jsanchez Ordered the records the same for update and initial load.
* Removed no longer needed frameAltered. Do not set wire frame for a CAN. * Removed no longer needed frameAltered. Do not set wire frame for a CAN.
* Jul 24, 2013 DR16350 mgamazaychikov Fix the problem with plotting EXP warning * Jul 24, 2013 DR16350 mgamazaychikov Fix the problem with plotting EXP warning
* Sep 5, 2013 2176 jsanchez Disposed the emergency font.
* </pre> * </pre>
* *
* @author jsanchez * @author jsanchez
@ -143,6 +144,10 @@ public class WarningsResource extends AbstractWWAResource {
if (warningsFont != null) { if (warningsFont != null) {
warningsFont.dispose(); warningsFont.dispose();
} }
if (emergencyFont != null) {
emergencyFont.dispose();
}
} }
@Override @Override
@ -234,7 +239,7 @@ public class WarningsResource extends AbstractWWAResource {
for (AbstractWarningRecord warnrec : recordsToLoad) { for (AbstractWarningRecord warnrec : recordsToLoad) {
WarningAction act = WarningAction.valueOf(warnrec.getAct()); WarningAction act = WarningAction.valueOf(warnrec.getAct());
if (act == WarningAction.CON || act == WarningAction.CAN if (act == WarningAction.CON || act == WarningAction.CAN
|| act == WarningAction.EXT) { || act == WarningAction.EXT) {
AbstractWarningRecord createShape = null; AbstractWarningRecord createShape = null;
for (String key : entryMap.keySet()) { for (String key : entryMap.keySet()) {
WarningEntry entry = entryMap.get(key); WarningEntry entry = entryMap.get(key);

View file

@ -49,6 +49,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
* Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class. * Sep 27, 2012 1149 jsanchez Refactored methods from AbstractWarningsResource into this class.
* May 06, 2013 1930 bsteffen Check for null in WatchesResource. * May 06, 2013 1930 bsteffen Check for null in WatchesResource.
* May 10, 2013 1951 rjpeter Updated ugcZones references * May 10, 2013 1951 rjpeter Updated ugcZones references
* Sep 5, 2013 2176 jsanchez Disposed the emergency font.
* </pre> * </pre>
* *
* @author jsanchez * @author jsanchez
@ -140,6 +141,10 @@ public class WatchesResource extends AbstractWWAResource {
if (warningsFont != null) { if (warningsFont != null) {
warningsFont.dispose(); warningsFont.dispose();
} }
if (emergencyFont != null) {
emergencyFont.dispose();
}
} }
@Override @Override

View file

@ -0,0 +1,91 @@
/**
* This software was developed and / or modified by Raytheon Company,
* pursuant to Contract DG133W-05-CQ-1067 with the US Government.
*
* U.S. EXPORT CONTROLLED TECHNICAL DATA
* This software product contains export-restricted data whose
* export/transfer/disclosure is restricted by U.S. law. Dissemination
* to non-U.S. persons whether in the United States or abroad requires
* an export license or other authorization.
*
* Contractor Name: Raytheon Company
* Contractor Address: 6825 Pine Street, Suite 340
* Mail Stop B8
* Omaha, NE 68106
* 402.291.0100
*
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
* further licensing information.
**/
package com.raytheon.uf.common.dataplugin.warning;
/**
* Helps manage and identify emergency products.
*
* <pre>
*
* SOFTWARE HISTORY
*
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Sep 4, 2013 2176 jsanchez Initial creation
*
* </pre>
*
* @author jsanchez
* @version 1.0
*/
public class EmergencyType {
public static final String EMER = "EMER";
private static final EmergencyType TORNADO = new EmergencyType(
"TORNADO EMERGENCY", "TO.W");
private static final EmergencyType FLASH_FLOOD = new EmergencyType(
"FLASH FLOOD EMERGENCY", "FF.W");
private final String value;
private final String phensig;
private final static EmergencyType[] values = new EmergencyType[] {
TORNADO, FLASH_FLOOD };
private EmergencyType(String type, String phensig) {
this.value = type;
this.phensig = phensig;
}
public static EmergencyType valueOf(String phensig) {
EmergencyType type = null;
for (EmergencyType t : values) {
if (t.phensig.equals(phensig)) {
type = t;
break;
}
}
return type;
}
/**
* Checks to see if the text product is an emergency product.
*
* @param rawmessage
* @return
*/
public static boolean isEmergency(String rawmessage) {
for (EmergencyType type : values) {
if (rawmessage != null && rawmessage.contains(type.getValue())) {
return true;
}
}
return false;
}
public String getValue() {
return value;
}
}

View file

@ -1,30 +0,0 @@
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!--
This_software_was_developed_and_/_or_modified_by_Raytheon_Company,
pursuant_to_Contract_DG133W-05-CQ-1067_with_the_US_Government.
U.S._EXPORT_CONTROLLED_TECHNICAL_DATA
This_software_product_contains_export-restricted_data_whose
export/transfer/disclosure_is_restricted_by_U.S._law._Dissemination
to_non-U.S._persons_whether_in_the_United_States_or_abroad_requires
an_export_license_or_other_authorization.
Contractor_Name:________Raytheon_Company
Contractor_Address:_____6825_Pine_Street,_Suite_340
________________________Mail_Stop_B8
________________________Omaha,_NE_68106
________________________402.291.0100
See_the_AWIPS_II_Master_Rights_File_("Master_Rights_File.pdf")_for
further_licensing_information.
-->
<configuration>
<warngenOfficeShort>OMAHA/VALLEY NE</warngenOfficeShort>
<warngenOfficeLoc>OMAHA</warngenOfficeLoc>
<backupCWAs>EAX/KANSAS CITY,DMX/DES MOINES,BOX/BOSTON,LBF/NORTH PLATTE,PQR/PORTLAND</backupCWAs>
<siteNode>OMA</siteNode>
<defaultTemplate>severethunderstorm</defaultTemplate>
<mainWarngenProducts>Flash Flood/ffw,Severe Thunderstorm/severethunderstorm,Tornado/tornado</mainWarngenProducts>
<otherWarngenProducts>Severe Weather Statement/SVS,Flash Flood Statement/ffs,non-convective FFW (Dam Break)/dambreak,non-convective Flash Flood Statement/dambreakffs,Areal Flood Warning/flw,Areal Flood Warning Followup/fls,Areal Flood Advisory/fla,Areal Flood Advisory Followup/flas,Special Marine Warning/smw,Marine Weather Statement (SMW Follow)/smws,Marine Weather Statement standalone/marinestatement,Short Term Forecast/shortterm,Special Weather Statement (zones)/sws</otherWarngenProducts>
<followupListRefreshDelay>5000</followupListRefreshDelay>
</configuration>