metadataMap = super.getMetadataMap();
-
- if (metadataMap.containsKey("pluginName")) {
- metadataMap = new HashMap<>(metadataMap);
- CAVEMode caveMode = CAVEMode.getMode();
- String pluginName = (CAVEMode.OPERATIONAL.equals(caveMode)
- || CAVEMode.TEST.equals(caveMode)) ? "warning"
- : "practicewarning";
- metadataMap.replace("pluginName",
- new RequestConstraint(pluginName));
- }
-
- return metadataMap;
+
+ /**
+ * @return The resource name (similar to what's displayed
+ * in the resource stack, except without the timestamp)
+ */
+ public String getName(){
+ return name;
}
}
diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java
index 3906a6a76e..76941580cb 100644
--- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java
+++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WarningsResource.java
@@ -37,6 +37,9 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.AbstractTimeMatcher;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.IDescriptor.FramesInfo;
+import com.raytheon.uf.viz.core.drawables.JTSCompiler.JTSGeometryData;
+import com.raytheon.uf.viz.core.drawables.FillPatterns;
+import com.raytheon.uf.viz.core.drawables.IShadedShape;
import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.JTSCompiler;
import com.raytheon.uf.viz.core.exception.VizException;
@@ -70,6 +73,9 @@ import org.locationtech.jts.geom.Geometry;
* Apr 14, 2014 DR 17257 D. Friedman Redo time matching on per-minute refresh.
* Apr 28, 2015 ASM #15008 D. Friedman Create polygon for EXTs even if original product is not found.
* Aug 22, 2016 #5842 dgilling Remove dependency on viz.texteditor plugin.
+ * Oct 21, 2021 srcarter modified initShape to set the shape on watches, and wireframe on warnings and advisories
+ * Mar 15, 2022 srcarter@ucar Change initshape() to add a shadedshape and wireframeshape to every entry
+ *
*
*
*
@@ -179,26 +185,38 @@ public class WarningsResource extends AbstractWWAResource {
entry.record = record;
entryMap.put(record.getDataURI(), entry);
}
+
+ WarningAction act = WarningAction.valueOf(record.getAct());
+
+ //give every entry a fill and outline
+ //add fill (shadedshape)
+ IShadedShape ss = target.createShadedShape(false, descriptor.getGridGeometry());
+ geo = record.getGeometry();
+ JTSCompiler jtsCompiler = new JTSCompiler(ss, null, this.descriptor);
+ JTSGeometryData geoData = jtsCompiler.createGeometryData();
+ geoData.setGeometryColor(color);
+ jtsCompiler.handle(geo, geoData);
+ ss.setFillPattern(FillPatterns.getGLPattern(record.getPhen()
+ .equals("TO") ? "VERTICAL" : "HORIZONTAL"));
+ ss.compile();
+
+ entry.shadedShape = ss;
+
+ //add outline (wireshape)
IWireframeShape wfs = entry.wireframeShape;
if (wfs != null) {
wfs.dispose();
}
- WarningAction act = WarningAction.valueOf(record.getAct());
- // Do not paint a wire frame shape for a CAN
- if (act != WarningAction.CAN) {
- wfs = target.createWireframeShape(false, descriptor);
- geo = record.getGeometry();
- JTSCompiler jtsCompiler = new JTSCompiler(null, wfs,
- descriptor);
- jtsCompiler.handle(geo);
- wfs.compile();
- entry.wireframeShape = wfs;
- } else {
- // Prevents sampling and a label to be painted
- entry.record.setGeometry(null);
- }
+ wfs = target.createWireframeShape(false, descriptor);
+ geo = record.getGeometry();
+
+ jtsCompiler = new JTSCompiler(null, wfs, descriptor);
+ jtsCompiler.handle(geo);
+ wfs.compile();
+ entry.wireframeShape = wfs;
+
} catch (Exception e) {
statusHandler.handle(Priority.ERROR,
"Error creating wireframe", e);
diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java
index 81a172ac62..ec7d17ed45 100644
--- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java
+++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WatchesResource.java
@@ -27,6 +27,7 @@ import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.FillPatterns;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
+import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.JTSCompiler;
import com.raytheon.uf.viz.core.drawables.JTSCompiler.JTSGeometryData;
import com.raytheon.uf.viz.core.exception.VizException;
@@ -56,6 +57,7 @@ import org.locationtech.jts.geom.GeometryFactory;
* Mar 04, 2014 2832 njensen Moved disposeInternal() to abstract class
* Apr 07, 2014 2959 njensen Correct handling of color change
* Jan 16, 2017 5976 bsteffen Update shaded shape constructor.
+ * Mar 15, 2022 srcarter@ucar Change initshape() to add a shadedshape and wireframeshape to every entry
*
*
*
@@ -169,11 +171,10 @@ public class WatchesResource extends AbstractWWAResource {
if (!record.getUgcZones().isEmpty()) {
setGeometry(record);
if ((record.getGeometry() != null) && (record.getPhen() != null)) {
- IShadedShape ss = target.createShadedShape(false,
- descriptor.getGridGeometry());
+ //add fill (shadedshape)
+ IShadedShape ss = target.createShadedShape(false, descriptor.getGridGeometry());
geo = record.getGeometry();
- JTSCompiler jtsCompiler = new JTSCompiler(ss, null,
- this.descriptor);
+ JTSCompiler jtsCompiler = new JTSCompiler(ss, null, this.descriptor);
JTSGeometryData geoData = jtsCompiler.createGeometryData();
geoData.setGeometryColor(color);
jtsCompiler.handle(geo, geoData);
@@ -187,6 +188,21 @@ public class WatchesResource extends AbstractWWAResource {
entryMap.put(record.getDataURI(), entry);
}
entry.shadedShape = ss;
+
+ //add outline (wireshape)
+ IWireframeShape wfs = entry.wireframeShape;
+
+ if (wfs != null) {
+ wfs.dispose();
+ }
+
+ wfs = target.createWireframeShape(false, descriptor);
+ geo = record.getGeometry();
+
+ jtsCompiler = new JTSCompiler(null, wfs, descriptor);
+ jtsCompiler.handle(geo);
+ wfs.compile();
+ entry.wireframeShape = wfs;
}
}
}
diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java
index 4bf15669f8..bc494907e5 100644
--- a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java
+++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/rsc/WouWcnWatchesResource.java
@@ -20,6 +20,7 @@ import com.raytheon.uf.common.time.SimulatedTime;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.FillPatterns;
import com.raytheon.uf.viz.core.drawables.IShadedShape;
+import com.raytheon.uf.viz.core.drawables.IWireframeShape;
import com.raytheon.uf.viz.core.drawables.JTSCompiler;
import com.raytheon.uf.viz.core.drawables.JTSCompiler.JTSGeometryData;
import com.raytheon.uf.viz.core.drawables.JTSCompiler.PointStyle;
@@ -38,6 +39,7 @@ import org.locationtech.jts.geom.Geometry;
* ------------ ---------- ----------- --------------------------
* 2014-08-28 ASM #15682 D. Friemdan Initial creation
* 2016-09-14 3241 bsteffen Update deprecated JTSCompiler method calls
+ * 2022-03-15 srcarter@ucar Changed initshape() to draw a shadedshape and wireframeshape for every entry
*
*
*/
@@ -242,11 +244,10 @@ public class WouWcnWatchesResource extends WatchesResource implements ISimulated
}
AbstractWarningRecord record = entry.record;
if (record.getGeometry() != null) {
- IShadedShape ss = target.createShadedShape(false,
- descriptor.getGridGeometry());
+ //added fill (shadedshape)
+ IShadedShape ss = target.createShadedShape(false, descriptor.getGridGeometry());
Geometry geo = (Geometry) record.getGeometry().clone();
- JTSCompiler jtsCompiler = new JTSCompiler(ss, null,
- this.descriptor);
+ JTSCompiler jtsCompiler = new JTSCompiler(ss, null, this.descriptor);
JTSGeometryData jtsData = jtsCompiler.createGeometryData();
jtsData.setPointStyle(PointStyle.CROSS);
jtsData.setGeometryColor(color);
@@ -255,6 +256,21 @@ public class WouWcnWatchesResource extends WatchesResource implements ISimulated
.equals("TO") ? "VERTICAL" : "HORIZONTAL"));
ss.compile();
entry.shadedShape = ss;
+
+ //added outline (wireshape)
+ IWireframeShape wfs = entry.wireframeShape;
+
+ if (wfs != null) {
+ wfs.dispose();
+ }
+
+ wfs = target.createWireframeShape(false, descriptor);
+ geo = record.getGeometry();
+
+ jtsCompiler = new JTSCompiler(null, wfs, descriptor);
+ jtsCompiler.handle(geo);
+ wfs.compile();
+ entry.wireframeShape = wfs;
}
}
diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/DrawingPropertiesDialog.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/DrawingPropertiesDialog.java
new file mode 100644
index 0000000000..a6420aebd6
--- /dev/null
+++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/DrawingPropertiesDialog.java
@@ -0,0 +1,364 @@
+package com.raytheon.viz.warnings.ui;
+
+import org.eclipse.swt.SWT;
+import org.eclipse.swt.events.SelectionAdapter;
+import org.eclipse.swt.events.SelectionEvent;
+import org.eclipse.swt.layout.GridData;
+import org.eclipse.swt.layout.GridLayout;
+import org.eclipse.swt.widgets.Button;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.Label;
+import org.eclipse.swt.widgets.Shell;
+
+import com.raytheon.viz.ui.dialogs.CaveSWTDialog;
+import com.raytheon.viz.warnings.rsc.AbstractWWAResource;
+
+/**
+ * Dialog with options for displaying the outline, fill, text, and time,
+ * individually, for each warnings, watches, and advisories.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ---------------- --------------------------
+ * Mar 15, 2022 srcarter@ucar Initial creation
+ * Mar 21, 2022 srcarter@ucar Set the current values every time initializeComponents is called (also called from .Open)
+ * Jun 24, 2022 srcarter@ucar Move Watches to top, add section for Other/Statement, add 'enabled' functionality
+ * Jun 28, 2022 srcarter@ucar Add 'Sampling' options
+ *
+ *
+ *
+ * @author srcarter
+ */
+
+public class DrawingPropertiesDialog extends CaveSWTDialog {
+
+ //gui components
+ private Button warnOutlineChk;
+ private Button warnFillChk;
+ private Button warnTextChk;
+ private Button warnTimeChk;
+ private Button warnSampleChk;
+ private Button watchOutlineChk;
+ private Button watchFillChk;
+ private Button watchTextChk;
+ private Button watchTimeChk;
+ private Button watchSampleChk;
+ private Button advOutlineChk;
+ private Button advFillChk;
+ private Button advTextChk;
+ private Button advTimeChk;
+ private Button advSampleChk;
+ private Button otherOutlineChk;
+ private Button otherFillChk;
+ private Button otherTextChk;
+ private Button otherTimeChk;
+ private Button otherSampleChk;
+
+ /**
+ * The WWA Resource associated with this properties dialog
+ */
+ private AbstractWWAResource myResource;
+
+
+ /**
+ * Creates a dialog with drawing options for all the warning, watches and
+ * advisories drawn in the resource
+ * @param parent The parent gui component to associate this dialog with
+ * @param rsc The WWA resource associated with this dialog
+ */
+ protected DrawingPropertiesDialog(Shell parent, AbstractWWAResource rsc) {
+ super(parent, SWT.RESIZE | SWT.CLOSE);
+ myResource = rsc;
+ setText("WWA Drawing Properties");
+ }
+
+ @Override
+ // Create and initialize all gui components for controlling the drawing
+ // displays for the WWAs.
+ protected void initializeComponents(Shell shell) {
+ // --- Sub title ---
+ Composite subComp = new Composite(shell, SWT.NONE);
+ subComp.setLayout(new GridLayout(1, true));
+ subComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+ Label layerName = new Label(subComp, SWT.NONE);
+ layerName.setText(myResource.getResourceData().getName());
+
+ // --- Watches ---
+ Group watchComp = new Group(shell, SWT.NONE);
+ watchComp.setText("Watches");
+ watchComp.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+ watchComp.setLayout(new GridLayout(2, true));
+
+ //outline and fill
+ watchOutlineChk = createButton(watchComp, "Show Outline");
+ watchFillChk = createButton(watchComp, "Thatched Fill");
+
+ //text and time
+ watchTextChk = createButton(watchComp, "Show Text");
+ watchTimeChk = createButton(watchComp, "Show Time");
+
+ //sample
+ watchSampleChk = createButton(watchComp, "Show Sampling");
+
+ // --- end Watches ---
+
+ // --- Warnings ---
+ Group warnComp = new Group(shell, SWT.NONE);
+ warnComp.setText("Warnings");
+ warnComp.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+ warnComp.setLayout(new GridLayout(2, true));
+
+ //outline and fill
+ warnOutlineChk = createButton(warnComp, "Show Outline");
+ warnFillChk = createButton(warnComp, "Thatched Fill");
+ //text and time
+ warnTextChk = createButton(warnComp, "Show Text");
+ warnTimeChk = createButton(warnComp, "Show Time");
+ //sample
+ warnSampleChk = createButton(warnComp, "Show Sampling");
+
+ // --- end Warnings ---
+
+ // --- Advisories ---
+ Group advComp = new Group(shell, SWT.NONE);
+ advComp.setText("Advisories");
+ advComp.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+ advComp.setLayout(new GridLayout(2, true));
+
+ //outline and fill
+ advOutlineChk = createButton(advComp, "Show Outline");
+ advFillChk = createButton(advComp, "Thatched Fill");
+
+ //text and time
+ advTextChk = createButton(advComp, "Show Text");
+ advTimeChk = createButton(advComp, "Show Time");
+
+ //sample
+ advSampleChk = createButton(advComp, "Show Sampling");
+
+ // --- end Advisories ---
+
+ // --- Other ---
+ Group otherComp = new Group(shell, SWT.NONE);
+ otherComp.setText("Statements/Other");
+ otherComp.setLayoutData(new GridData(SWT.CENTER, SWT.FILL, true, true));
+ otherComp.setLayout(new GridLayout(2, true));
+
+ //outline and fill
+ otherOutlineChk = createButton(otherComp, "Show Outline");
+ otherFillChk = createButton(otherComp, "Thatched Fill");
+
+ //text and time
+ otherTextChk = createButton(otherComp, "Show Text");
+ otherTimeChk = createButton(otherComp, "Show Time");
+
+ //sample
+ otherSampleChk = createButton(otherComp, "Show Sampling");
+
+ // --- end Other ---
+
+ // --- Bottom Buttons ---
+ Composite btnComp = new Composite(shell, SWT.NONE);
+ btnComp.setLayout(new GridLayout(1, true));
+ btnComp.setLayoutData(new GridData(SWT.FILL, SWT.FILL, true, false));
+
+ // Reset Button
+ Button resetBtn = new Button(btnComp, SWT.PUSH);
+ resetBtn.setText("Reset Defaults");
+ GridData gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
+ resetBtn.setLayoutData(gd);
+ resetBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event){
+ resetDefaults();
+ updateDisplay();
+ }
+ });
+
+ // Close Button
+ Button closeBtn = new Button(btnComp, SWT.PUSH);
+ closeBtn.setText("Close");
+ gd = new GridData(SWT.CENTER, SWT.DEFAULT, true, false);
+ gd.widthHint = 70;
+ closeBtn.setLayoutData(gd);
+ closeBtn.addSelectionListener(new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event) {
+ shell.setVisible(false);
+ }
+ });
+ // --- end Buttons ---
+
+ //set all the values
+ setToCurrentValues();
+
+ //set visibility from resource
+ setWarningControlsEnabled(myResource.enableWarnDisplay());
+ setWatchControlsEnabled(myResource.enableWatchDisplay());
+ setAdvisoryControlsEnabled(myResource.enableAdvisoryDisplay());
+ setOtherControlsEnabled(myResource.enableOtherDisplay());
+ }
+
+ public void updateControlsEnabled(boolean enableWatch, boolean enableWarn, boolean enableAdv, boolean enableOther){
+ setWatchControlsEnabled(enableWatch);
+ setWarningControlsEnabled(enableWarn);
+ setAdvisoryControlsEnabled(enableAdv);
+ setOtherControlsEnabled(enableOther);
+ }
+
+ private void setWarningControlsEnabled(boolean isEnabled){
+ warnOutlineChk.setEnabled(isEnabled);
+ warnFillChk.setEnabled(isEnabled);
+ warnTextChk.setEnabled(isEnabled);
+ warnTimeChk.setEnabled(isEnabled);
+ warnSampleChk.setEnabled(isEnabled);
+ }
+
+ private void setWatchControlsEnabled(boolean isEnabled){
+ watchOutlineChk.setEnabled(isEnabled);
+ watchFillChk.setEnabled(isEnabled);
+ watchTextChk.setEnabled(isEnabled);
+ watchTimeChk.setEnabled(isEnabled);
+ watchSampleChk.setEnabled(isEnabled);
+ }
+
+ private void setAdvisoryControlsEnabled(boolean isEnabled){
+ advOutlineChk.setEnabled(isEnabled);
+ advFillChk.setEnabled(isEnabled);
+ advTextChk.setEnabled(isEnabled);
+ advTimeChk.setEnabled(isEnabled);
+ advSampleChk.setEnabled(isEnabled);
+ }
+
+ private void setOtherControlsEnabled(boolean isEnabled){
+ otherOutlineChk.setEnabled(isEnabled);
+ otherFillChk.setEnabled(isEnabled);
+ otherTextChk.setEnabled(isEnabled);
+ otherTimeChk.setEnabled(isEnabled);
+ otherSampleChk.setEnabled(isEnabled);
+ }
+
+ /**
+ * Creates a checkbox button used for defining the display
+ * properties of a given option for the WWA resource. Adds
+ * the selection listener to the button so it functions
+ * properly as well.
+ * @param parent The parent gui component to associate this
+ * button with
+ * @param title The text displayed next to the checkbox
+ * @return A Checkbox style button
+ */
+ private Button createButton(Composite parent, String title){
+ Button btn = new Button(parent, SWT.CHECK);
+ btn.setText(title);
+ btn.addSelectionListener(checkboxListener);
+ return btn;
+ }
+
+ /**
+ * The listener used on all the display checkbox buttons
+ */
+ private SelectionAdapter checkboxListener = new SelectionAdapter() {
+ @Override
+ public void widgetSelected(SelectionEvent event){
+ updateDisplay();
+ }
+ };
+
+ /**
+ * Updates all the display settings on the resource based on the
+ * current button selections in this dialog. Then issues a
+ * refresh on the resource so it updates the display.
+ */
+ private void updateDisplay(){
+ myResource.setWarnOutlineDisplay(warnOutlineChk.getSelection());
+ myResource.setWarnFillDisplay(warnFillChk.getSelection());
+ myResource.setWarnTextDisplay(warnTextChk.getSelection());
+ myResource.setWarnTimeDisplay(warnTimeChk.getSelection());
+ myResource.setWarnSampleDisplay(warnSampleChk.getSelection());
+
+ myResource.setWatchOutlineDisplay(watchOutlineChk.getSelection());
+ myResource.setWatchFillDisplay(watchFillChk.getSelection());
+ myResource.setWatchTextDisplay(watchTextChk.getSelection());
+ myResource.setWatchTimeDisplay(watchTimeChk.getSelection());
+ myResource.setWatchSampleDisplay(watchSampleChk.getSelection());
+
+ myResource.setAdvisoryOutlineDisplay(advOutlineChk.getSelection());
+ myResource.setAdvisoryFillDisplay(advFillChk.getSelection());
+ myResource.setAdvisoryTextDisplay(advTextChk.getSelection());
+ myResource.setAdvisoryTimeDisplay(advTimeChk.getSelection());
+ myResource.setAdvisorySampleDisplay(advSampleChk.getSelection());
+
+ myResource.setOtherOutlineDisplay(otherOutlineChk.getSelection());
+ myResource.setOtherFillDisplay(otherFillChk.getSelection());
+ myResource.setOtherTextDisplay(otherTextChk.getSelection());
+ myResource.setOtherTimeDisplay(otherTimeChk.getSelection());
+ myResource.setOtherSampleDisplay(otherSampleChk.getSelection());
+
+ myResource.issueRefresh();
+ }
+
+ /**
+ * Reset all the button selections in this dialog to the default
+ * values defined in the @AbstractWWAResource class
+ */
+ private void resetDefaults(){
+ warnOutlineChk.setSelection(AbstractWWAResource.WARN_OUTLINE_DEFAULT);
+ warnFillChk.setSelection(AbstractWWAResource.WARN_FILL_DEFAULT);
+ warnTextChk.setSelection(AbstractWWAResource.WARN_TEXT_DEFAULT);
+ warnTimeChk.setSelection(AbstractWWAResource.WARN_TIME_DEFAULT);
+ warnSampleChk.setSelection(true);
+
+ watchOutlineChk.setSelection(AbstractWWAResource.WATCH_OUTLINE_DEFAULT);
+ watchFillChk.setSelection(AbstractWWAResource.WATCH_FILL_DEFAULT);
+ watchTextChk.setSelection(AbstractWWAResource.WATCH_TEXT_DEFAULT);
+ watchTimeChk.setSelection(AbstractWWAResource.WATCH_TIME_DEFAULT);
+ watchSampleChk.setSelection(true);
+
+ advOutlineChk.setSelection(AbstractWWAResource.ADV_OUTLINE_DEFAULT);
+ advFillChk.setSelection(AbstractWWAResource.ADV_FILL_DEFAULT);
+ advTextChk.setSelection(AbstractWWAResource.ADV_TEXT_DEFAULT);
+ advTimeChk.setSelection(AbstractWWAResource.ADV_TIME_DEFAULT);
+ advSampleChk.setSelection(true);
+
+ otherOutlineChk.setSelection(AbstractWWAResource.OTHER_OUTLINE_DEFAULT);
+ otherFillChk.setSelection(AbstractWWAResource.OTHER_FILL_DEFAULT);
+ otherTextChk.setSelection(AbstractWWAResource.OTHER_TEXT_DEFAULT);
+ otherTimeChk.setSelection(AbstractWWAResource.OTHER_TIME_DEFAULT);
+ otherSampleChk.setSelection(true);
+ }
+
+ /**
+ * Set all the GUI checkboxes to the current boolean values from
+ * the associated resource
+ */
+ protected void setToCurrentValues(){
+ warnOutlineChk.setSelection(myResource.showWarnOutline());
+ warnFillChk.setSelection(myResource.showWarnFill());
+ warnTextChk.setSelection(myResource.showWarnText());
+ warnTimeChk.setSelection(myResource.showWarnTime());
+ warnSampleChk.setSelection(myResource.showWarnSampling());
+
+ watchOutlineChk.setSelection(myResource.showWatchOutline());
+ watchFillChk.setSelection(myResource.showWatchFill());
+ watchTextChk.setSelection(myResource.showWatchText());
+ watchTimeChk.setSelection(myResource.showWatchTime());
+ watchSampleChk.setSelection(myResource.showWatchSampling());
+
+ advOutlineChk.setSelection(myResource.showAdvisoryOutline());
+ advFillChk.setSelection(myResource.showAdvisoryFill());
+ advTextChk.setSelection(myResource.showAdvisoryText());
+ advTimeChk.setSelection(myResource.showAdvisoryTime());
+ advSampleChk.setSelection(myResource.showAdvisorySampling());
+
+ otherOutlineChk.setSelection(myResource.showOtherOutline());
+ otherFillChk.setSelection(myResource.showOtherFill());
+ otherTextChk.setSelection(myResource.showOtherText());
+ otherTimeChk.setSelection(myResource.showOtherTime());
+ otherSampleChk.setSelection(myResource.showOtherSampling());
+ }
+}
diff --git a/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/WWADrawingPropertiesAction.java b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/WWADrawingPropertiesAction.java
new file mode 100644
index 0000000000..1d65cc0ba2
--- /dev/null
+++ b/cave/com.raytheon.viz.warnings/src/com/raytheon/viz/warnings/ui/WWADrawingPropertiesAction.java
@@ -0,0 +1,75 @@
+package com.raytheon.viz.warnings.ui;
+
+import org.eclipse.ui.PlatformUI;
+
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
+import com.raytheon.viz.warnings.rsc.AbstractWWAResource;
+import com.raytheon.viz.warnings.rsc.CWASPSResource;
+import com.raytheon.viz.warnings.rsc.WarningsResource;
+import com.raytheon.viz.warnings.rsc.WatchesResource;
+
+/**
+ * This action shows an option in the resource menu that opens a new
+ * dialog which allows the users to specify display properties for
+ * the WWA resource.
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------ ---------- ---------------- --------------------------
+ * Mar 15, 2022 srcarter@ucar Initial creation
+ * Mar 17, 2022 srcarter@ucar Small change to isHidden to only display for proper resources
+ * Jun 24, 2022 srcarter@ucar Enable for CWASPSResources as well
+ *
+ *
+ *
+ * @author srcarter
+ */
+
+public class WWADrawingPropertiesAction extends AbstractRightClickAction {
+
+ @Override
+ public String getText() {
+ return "Open Drawing Properties...";
+ }
+
+ /* (non-Javadoc)
+ * @see org.eclipse.jface.action.Action#run()
+ *
+ * Create and assign a new DrawingPropertiesDialog to the associated
+ * resource if it does not already have a dialog. If it has a dialog
+ * proceed with the existing one and show the dialog.
+ */
+ @Override
+ public void run() {
+ AbstractWWAResource rsc = (AbstractWWAResource)getSelectedRsc();
+
+ DrawingPropertiesDialog dialog = rsc.getDrawingDialog();
+
+ if(dialog == null){
+ dialog = new DrawingPropertiesDialog(PlatformUI.getWorkbench().getActiveWorkbenchWindow().getShell(), rsc);
+ rsc.setDrawingDialog(dialog);
+ }
+ dialog.open();
+ }
+
+ /* (non-Javadoc)
+ * @see com.raytheon.viz.ui.cmenu.AbstractRightClickAction#isHidden()
+ *
+ * Only display the drawing properties dialog for WarningsResource and
+ * WatchesResource, but not for a CWASPS resource.
+ */
+ @Override
+ public boolean isHidden(){
+ AbstractVizResource rsc = getSelectedRsc();
+
+ if(rsc instanceof WatchesResource || rsc instanceof WarningsResource){
+ return false;
+ }
+ return true;
+ }
+
+}
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarningLookups.java b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarningLookups.java
new file mode 100644
index 0000000000..ffdaad75dd
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/src/com/raytheon/uf/common/dataplugin/warning/util/WarningLookups.java
@@ -0,0 +1,139 @@
+package com.raytheon.uf.common.dataplugin.warning.util;
+
+import java.io.File;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import javax.xml.bind.JAXBContext;
+import javax.xml.bind.Unmarshaller;
+import javax.xml.bind.annotation.XmlAccessType;
+import javax.xml.bind.annotation.XmlAccessorType;
+import javax.xml.bind.annotation.XmlAttribute;
+import javax.xml.bind.annotation.XmlRootElement;
+
+import com.raytheon.uf.common.localization.IPathManager;
+import com.raytheon.uf.common.localization.LocalizationContext;
+import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
+import com.raytheon.uf.common.localization.PathManagerFactory;
+import com.raytheon.uf.common.status.IUFStatusHandler;
+import com.raytheon.uf.common.status.UFStatus;
+
+/**
+ * Class for looking up phensig info for warnings/advisories.
+ *
+ *
+ *
+ *
+ * SOFTWARE HISTORY
+ *
+ * Date Ticket# Engineer Description
+ * ------------- -------- --------- --------------------------------------------
+ * Dec 19, 2018 mjames Initial creation
+ *
+ *
+ *
+ * @author mjames
+ */
+public class WarningLookups {
+ private static final IUFStatusHandler theHandler = UFStatus.getHandler(WarningLookups.class);
+
+ private static final String LOOKUP_DIR = "warngen";
+
+ public static class PhensigValue {
+ public PhensigValue() {}
+
+ public PhensigValue(String name, String color) {
+ this.name = name;
+ this.color = color;
+ }
+
+ @XmlAttribute
+ public String name;
+
+ @XmlAttribute
+ public String color;
+ }
+
+ @XmlAccessorType(XmlAccessType.NONE)
+ public static abstract class AbstractLookup {
+ public abstract Map getMap();
+ }
+
+ @XmlRootElement
+ @XmlAccessorType(XmlAccessType.FIELD)
+ public static class PhensigColors extends
+ AbstractLookup {
+ public HashMap map = new HashMap<>();
+
+ @Override
+ public Map getMap() {
+ return map;
+ }
+ }
+
+ private PhensigColors phensigColorLookup;
+
+ public WarningLookups() {
+ try {
+ init();
+ } catch (Exception e) {
+ theHandler.error("Failed to initialize lookups", e);
+ }
+ }
+
+ private void init() throws Exception {
+ JAXBContext context = JAXBContext.newInstance(PhensigColors.class);
+ Unmarshaller u = context.createUnmarshaller();
+ phensigColorLookup = load(new PhensigColors(), "phensigColors.xml", u);
+ }
+
+ private static , K, V> T load(
+ T combinedLookup, String fileName, Unmarshaller u) {
+
+ IPathManager pm = PathManagerFactory.getPathManager();
+
+ List contexts = Arrays.asList(pm
+ .getLocalSearchHierarchy(LocalizationType.COMMON_STATIC));
+ Collections.reverse(contexts);
+
+ for (LocalizationContext ctx : contexts) {
+ File f = pm.getFile(ctx, LOOKUP_DIR + IPathManager.SEPARATOR + fileName);
+ if (f != null && f.isFile()) {
+ try {
+ @SuppressWarnings("unchecked")
+ T lookup = (T) u.unmarshal(f);
+ if (!combinedLookup.getClass().isAssignableFrom(
+ lookup.getClass())) {
+ throw new Exception(String.format(
+ "file contains %s' expected %s",
+ lookup.getClass(), combinedLookup.getClass()));
+ }
+ combinedLookup.getMap().putAll(lookup.getMap());
+ } catch (Exception e) {
+ theHandler.error(
+ String.format("%s: %s", f, e.getMessage()), e);
+ }
+ }
+ }
+ return combinedLookup;
+ }
+
+ public PhensigValue getPhensig(String phensigCode) {
+ return phensigColorLookup.map.get(phensigCode);
+ }
+
+ private static WarningLookups instance;
+
+ public static synchronized WarningLookups getInstance() {
+ if (instance == null)
+ instance = new WarningLookups();
+ return instance;
+ }
+
+ public static synchronized void reload() {
+ instance = new WarningLookups();
+ }
+}
\ No newline at end of file
diff --git a/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/phensigColors.xml b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/phensigColors.xml
new file mode 100644
index 0000000000..849f301767
--- /dev/null
+++ b/edexOsgi/com.raytheon.uf.common.dataplugin.warning/utility/common_static/base/warngen/phensigColors.xml
@@ -0,0 +1,109 @@
+
+
+
+