Merge pull request #462 from srcarter3/unidata_18.2.1
Changes to the WWA layers
This commit is contained in:
commit
7f8f0b4f41
4 changed files with 292 additions and 99 deletions
|
@ -96,6 +96,7 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
||||||
* Aug 22, 2016 5842 dgilling Remove dependency on viz.texteditor plugin.
|
* Aug 22, 2016 5842 dgilling Remove dependency on viz.texteditor plugin.
|
||||||
* Dec 19, 2018 ---- mjames@ucar Added phensig color table lookup.
|
* Dec 19, 2018 ---- mjames@ucar Added phensig color table lookup.
|
||||||
* Mar 15, 2022 srcarter@ucar Add support for display settings for outline, fill, text and time displays
|
* Mar 15, 2022 srcarter@ucar Add support for display settings for outline, fill, text and time displays
|
||||||
|
* Jun 24, 2022 srcarter@ucar Add 'statement/other' display settings, set enabled for only relevant WWA types
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -161,6 +162,14 @@ public abstract class AbstractWWAResource extends
|
||||||
public static final boolean ADV_TEXT_DEFAULT = true;
|
public static final boolean ADV_TEXT_DEFAULT = true;
|
||||||
/** Whether to display advisory time by default */
|
/** Whether to display advisory time by default */
|
||||||
public static final boolean ADV_TIME_DEFAULT = true;
|
public static final boolean ADV_TIME_DEFAULT = true;
|
||||||
|
/** Whether to display statements/other outlines by default */
|
||||||
|
public static final boolean OTHER_OUTLINE_DEFAULT = true;
|
||||||
|
/** Whether to display statements/other fill by default */
|
||||||
|
public static final boolean OTHER_FILL_DEFAULT = true;
|
||||||
|
/** Whether to display statements/other text by default */
|
||||||
|
public static final boolean OTHER_TEXT_DEFAULT = true;
|
||||||
|
/** Whether to display statements/other time by default */
|
||||||
|
public static final boolean OTHER_TIME_DEFAULT = true;
|
||||||
//gui display variables
|
//gui display variables
|
||||||
private boolean warnOutline = WARN_OUTLINE_DEFAULT;
|
private boolean warnOutline = WARN_OUTLINE_DEFAULT;
|
||||||
private boolean warnFill = WARN_FILL_DEFAULT;
|
private boolean warnFill = WARN_FILL_DEFAULT;
|
||||||
|
@ -174,6 +183,19 @@ public abstract class AbstractWWAResource extends
|
||||||
private boolean advFill = ADV_FILL_DEFAULT;
|
private boolean advFill = ADV_FILL_DEFAULT;
|
||||||
private boolean advText = ADV_TEXT_DEFAULT;
|
private boolean advText = ADV_TEXT_DEFAULT;
|
||||||
private boolean advTime = ADV_TIME_DEFAULT;
|
private boolean advTime = ADV_TIME_DEFAULT;
|
||||||
|
private boolean otherOutline = OTHER_OUTLINE_DEFAULT;
|
||||||
|
private boolean otherFill = OTHER_FILL_DEFAULT;
|
||||||
|
private boolean otherText = OTHER_TEXT_DEFAULT;
|
||||||
|
private boolean otherTime = OTHER_TIME_DEFAULT;
|
||||||
|
private boolean enableWarnDisplay = false;
|
||||||
|
private boolean enableWatchDisplay = false;
|
||||||
|
private boolean enableAdvisoryDisplay = false;
|
||||||
|
private boolean enableOtherDisplay = false;
|
||||||
|
|
||||||
|
// The significance values for WWAs
|
||||||
|
private static final String WARN_SIG = "W";
|
||||||
|
private static final String WATCH_SIG = "A";
|
||||||
|
private static final String ADVISORY_SIG = "Y";
|
||||||
|
|
||||||
/** The dialog used to change display properties */
|
/** The dialog used to change display properties */
|
||||||
private DrawingPropertiesDialog drawingDialog;
|
private DrawingPropertiesDialog drawingDialog;
|
||||||
|
@ -414,32 +436,43 @@ public abstract class AbstractWWAResource extends
|
||||||
boolean drawText = true;
|
boolean drawText = true;
|
||||||
boolean drawTime = true;
|
boolean drawTime = true;
|
||||||
|
|
||||||
if(record != null && record.getSig() != null){
|
|
||||||
String sig = record.getSig();
|
String sig = record.getSig();
|
||||||
|
boolean sigRecognized = false;
|
||||||
|
if(record != null && record.getSig() != null){
|
||||||
|
|
||||||
//warning
|
//warning
|
||||||
if(sig.equalsIgnoreCase("W")){
|
if(sig.equalsIgnoreCase(WARN_SIG)){
|
||||||
drawShape = warnFill;
|
drawShape = warnFill;
|
||||||
drawOutline = warnOutline;
|
drawOutline = warnOutline;
|
||||||
drawText = warnText;
|
drawText = warnText;
|
||||||
drawTime = warnTime;
|
drawTime = warnTime;
|
||||||
|
sigRecognized = true;
|
||||||
}
|
}
|
||||||
//watch
|
//watch
|
||||||
else if(sig.equalsIgnoreCase("A")){
|
else if(sig.equalsIgnoreCase(WATCH_SIG)){
|
||||||
drawShape = watchFill;
|
drawShape = watchFill;
|
||||||
drawOutline = watchOutline;
|
drawOutline = watchOutline;
|
||||||
drawText = watchText;
|
drawText = watchText;
|
||||||
drawTime = watchTime;
|
drawTime = watchTime;
|
||||||
|
sigRecognized = true;
|
||||||
}
|
}
|
||||||
//advisory
|
//advisory
|
||||||
else if(sig.equals("Y")){
|
else if(sig.equals(ADVISORY_SIG)){
|
||||||
drawShape = advFill;
|
drawShape = advFill;
|
||||||
drawOutline = advOutline;
|
drawOutline = advOutline;
|
||||||
drawText = advText;
|
drawText = advText;
|
||||||
drawTime = advTime;
|
drawTime = advTime;
|
||||||
|
sigRecognized = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(sig == null || !sigRecognized){
|
||||||
|
drawShape = otherFill;
|
||||||
|
drawOutline = otherOutline;
|
||||||
|
drawText = otherText;
|
||||||
|
drawTime = otherTime;
|
||||||
|
}
|
||||||
|
|
||||||
// check shapes
|
// check shapes
|
||||||
if (entry.project) {
|
if (entry.project) {
|
||||||
initShape(target, entry.record);
|
initShape(target, entry.record);
|
||||||
|
@ -631,7 +664,33 @@ public abstract class AbstractWWAResource extends
|
||||||
if (!resourceData.getMetadataMap().containsKey("officeid")
|
if (!resourceData.getMetadataMap().containsKey("officeid")
|
||||||
|| resourceData.getMetadataMap().get("officeid")
|
|| resourceData.getMetadataMap().get("officeid")
|
||||||
.getConstraintValue().contains(officeid)) {
|
.getConstraintValue().contains(officeid)) {
|
||||||
this.recordsToLoad.add((AbstractWarningRecord) pdo);
|
|
||||||
|
AbstractWarningRecord rec = (AbstractWarningRecord) pdo;
|
||||||
|
this.recordsToLoad.add(rec);
|
||||||
|
|
||||||
|
//set the drawing display for the corresponding significance types
|
||||||
|
// if all settings are on, no need to keep doing it
|
||||||
|
if(rec !=null && (!enableWatchDisplay || !enableWarnDisplay || !enableAdvisoryDisplay || !enableOtherDisplay)){
|
||||||
|
String sig = rec.getSig();
|
||||||
|
boolean sigRecognized = false;
|
||||||
|
if(sig!=null){
|
||||||
|
if(sig.equals(WARN_SIG)){
|
||||||
|
enableWarnDisplay = true;
|
||||||
|
sigRecognized = true;
|
||||||
|
}
|
||||||
|
else if(sig.equals(WATCH_SIG)){
|
||||||
|
enableWatchDisplay = true;
|
||||||
|
sigRecognized = true;
|
||||||
|
}
|
||||||
|
else if(sig.equals(ADVISORY_SIG)){
|
||||||
|
enableAdvisoryDisplay = true;
|
||||||
|
sigRecognized = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(sig == null || !sigRecognized){
|
||||||
|
enableOtherDisplay = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -926,6 +985,41 @@ public abstract class AbstractWWAResource extends
|
||||||
public void setAdvisoryTimeDisplay(boolean advTime) {
|
public void setAdvisoryTimeDisplay(boolean advTime) {
|
||||||
this.advTime = advTime;
|
this.advTime = advTime;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* Set whether or not to display the outline for statements
|
||||||
|
* and other records
|
||||||
|
* @param advOutline If true, will draw the outline
|
||||||
|
*/
|
||||||
|
public void setOtherOutlineDisplay(boolean otherOutline) {
|
||||||
|
this.otherOutline = otherOutline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether or not to display the fill (shaded shape) for
|
||||||
|
* statements and other records
|
||||||
|
* @param otherFill If true, will draw the fill
|
||||||
|
*/
|
||||||
|
public void setOtherFillDisplay(boolean otherFill) {
|
||||||
|
this.otherFill = otherFill;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether or not to display the text for statements
|
||||||
|
* and other records
|
||||||
|
* @param otherText If true, will draw the title
|
||||||
|
*/
|
||||||
|
public void setOtherTextDisplay(boolean otherText) {
|
||||||
|
this.otherText = otherText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Set whether or not to display the time for statements
|
||||||
|
* and other records
|
||||||
|
* @param otherTime If true, will draw the time
|
||||||
|
*/
|
||||||
|
public void setOtherTimeDisplay(boolean otherTime) {
|
||||||
|
this.otherTime = otherTime;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return True if the warning outline is displayed
|
* @return True if the warning outline is displayed
|
||||||
|
@ -1011,6 +1105,66 @@ public abstract class AbstractWWAResource extends
|
||||||
return advTime;
|
return advTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the statement/other outline is displayed
|
||||||
|
*/
|
||||||
|
public boolean showOtherOutline(){
|
||||||
|
return otherOutline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the statement/other fill is displayed
|
||||||
|
*/
|
||||||
|
public boolean showOtherFill(){
|
||||||
|
return otherFill;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the statement/other text is displayed
|
||||||
|
*/
|
||||||
|
public boolean showOtherText(){
|
||||||
|
return otherText;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the statement/other time is displayed
|
||||||
|
*/
|
||||||
|
public boolean showOtherTime(){
|
||||||
|
return otherTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the warning display settings are to
|
||||||
|
* be enabled
|
||||||
|
*/
|
||||||
|
public boolean enableWarnDisplay() {
|
||||||
|
return enableWarnDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the watch display settings are to
|
||||||
|
* be enabled
|
||||||
|
*/
|
||||||
|
public boolean enableWatchDisplay() {
|
||||||
|
return enableWatchDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the advisory display settings are
|
||||||
|
* to be enabled
|
||||||
|
*/
|
||||||
|
public boolean enableAdvisoryDisplay() {
|
||||||
|
return enableAdvisoryDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return True if the warning statement/other settings
|
||||||
|
* are to be enabled
|
||||||
|
*/
|
||||||
|
public boolean enableOtherDisplay(){
|
||||||
|
return enableOtherDisplay;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set the associated DrawingPropertiesDialog
|
* Set the associated DrawingPropertiesDialog
|
||||||
* @param dialog
|
* @param dialog
|
||||||
|
|
|
@ -36,15 +36,15 @@ import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery;
|
||||||
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
import com.raytheon.uf.viz.core.catalog.DirectDbQuery.QueryLanguage;
|
||||||
import com.raytheon.uf.viz.core.drawables.FillPatterns;
|
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;
|
||||||
import com.raytheon.uf.viz.core.drawables.JTSCompiler.JTSGeometryData;
|
import com.raytheon.uf.viz.core.drawables.JTSCompiler.JTSGeometryData;
|
||||||
import com.raytheon.uf.viz.core.drawables.JTSCompiler.PointStyle;
|
import com.raytheon.uf.viz.core.drawables.JTSCompiler.PointStyle;
|
||||||
import com.raytheon.uf.viz.core.exception.VizException;
|
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
import com.vividsolutions.jts.geom.Geometry;
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
import com.vividsolutions.jts.geom.GeometryCollection;
|
import com.vividsolutions.jts.geom.GeometryCollection;
|
||||||
import com.vividsolutions.jts.geom.GeometryFactory;
|
import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
import com.vividsolutions.jts.io.ParseException;
|
|
||||||
import com.vividsolutions.jts.io.WKBReader;
|
import com.vividsolutions.jts.io.WKBReader;
|
||||||
import com.vividsolutions.jts.io.WKTReader;
|
import com.vividsolutions.jts.io.WKTReader;
|
||||||
|
|
||||||
|
@ -63,6 +63,7 @@ import com.vividsolutions.jts.io.WKTReader;
|
||||||
* Aug 01, 2014 3471 mapeters Updated deprecated createShadedShape() calls.
|
* Aug 01, 2014 3471 mapeters Updated deprecated createShadedShape() calls.
|
||||||
* Aug 22, 2016 5842 dgilling Remove dependency on viz.texteditor plugin.
|
* Aug 22, 2016 5842 dgilling Remove dependency on viz.texteditor plugin.
|
||||||
* Sep 14, 2016 3241 bsteffen Update deprecated JTSCompiler method calls
|
* Sep 14, 2016 3241 bsteffen Update deprecated JTSCompiler method calls
|
||||||
|
* Jun 24, 2022 srcarter@ucar Always create outline (wireshapes) and fill (shadedshapes)
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author rjpeter
|
* @author rjpeter
|
||||||
|
@ -188,21 +189,6 @@ public class CWASPSResource extends WatchesResource {
|
||||||
entryMap.put(record.getDataURI(), entry);
|
entryMap.put(record.getDataURI(), entry);
|
||||||
}
|
}
|
||||||
|
|
||||||
// default to a wireframe shape
|
|
||||||
boolean isShaded = false;
|
|
||||||
|
|
||||||
if (entry.shadedShape != null) {
|
|
||||||
// if the shape was in the shadedShape map then create a shaded
|
|
||||||
// shape
|
|
||||||
isShaded = true;
|
|
||||||
} else if ((entry.wireframeShape == null)
|
|
||||||
&& (record.getGeometry() == null)) {
|
|
||||||
// if it is not in the wireframeShape map and the geometry is null
|
|
||||||
// then create a shaded shape
|
|
||||||
isShaded = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (isShaded) {
|
|
||||||
if (!record.getUgcZones().isEmpty()) {
|
if (!record.getUgcZones().isEmpty()) {
|
||||||
// if the geometry is null get a geometry based on the county
|
// if the geometry is null get a geometry based on the county
|
||||||
// list
|
// list
|
||||||
|
@ -210,62 +196,42 @@ public class CWASPSResource extends WatchesResource {
|
||||||
record.setGeometry(getGeometry(record));
|
record.setGeometry(getGeometry(record));
|
||||||
}
|
}
|
||||||
if (record.getGeometry() != null) {
|
if (record.getGeometry() != null) {
|
||||||
|
|
||||||
// dispose old shape
|
|
||||||
if (entry.shadedShape != null) {
|
|
||||||
entry.shadedShape.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
entry.shadedShape = target.createShadedShape(false,
|
|
||||||
descriptor.getGridGeometry());
|
|
||||||
try {
|
try {
|
||||||
|
//give every entry a fill and outline
|
||||||
|
//add fill (shadedshape)
|
||||||
|
IShadedShape ss = target.createShadedShape(false, descriptor.getGridGeometry());
|
||||||
geo = wktr.read(record.getGeometry().toString());
|
geo = wktr.read(record.getGeometry().toString());
|
||||||
|
JTSCompiler jtsCompiler = new JTSCompiler(ss, null, this.descriptor);
|
||||||
|
JTSGeometryData geoData = jtsCompiler.createGeometryData();
|
||||||
|
geoData.setGeometryColor(color);
|
||||||
|
geoData.setPointStyle(PointStyle.CROSS);
|
||||||
|
jtsCompiler.handle(geo, geoData);
|
||||||
|
ss.setFillPattern(FillPatterns.getGLPattern("VERTICAL_DOTTED"));
|
||||||
|
ss.compile();
|
||||||
|
|
||||||
JTSCompiler jtsCompiler = new JTSCompiler(
|
entry.shadedShape = ss;
|
||||||
entry.shadedShape, null, this.descriptor);
|
|
||||||
JTSGeometryData jtsData = jtsCompiler
|
|
||||||
.createGeometryData();
|
|
||||||
jtsData.setPointStyle(PointStyle.CROSS);
|
|
||||||
jtsData.setGeometryColor(color);
|
|
||||||
try {
|
|
||||||
jtsCompiler.handle(geo, jtsData);
|
|
||||||
} catch (VizException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
e.getLocalizedMessage(), e);
|
|
||||||
entryMap.remove(entry.record.getDataURI());
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
entry.shadedShape.setFillPattern(FillPatterns
|
|
||||||
.getGLPattern("VERTICAL_DOTTED"));
|
|
||||||
entry.shadedShape.compile();
|
|
||||||
} catch (ParseException e) {
|
|
||||||
statusHandler.handle(Priority.PROBLEM,
|
|
||||||
e.getLocalizedMessage(), e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
|
|
||||||
try {
|
//add outline (wireshape)
|
||||||
// dispose old shape
|
IWireframeShape wfs = entry.wireframeShape;
|
||||||
if (entry.wireframeShape != null) {
|
|
||||||
entry.wireframeShape.dispose();
|
if (wfs != null) {
|
||||||
|
wfs.dispose();
|
||||||
}
|
}
|
||||||
|
|
||||||
entry.wireframeShape = target.createWireframeShape(false,
|
wfs = target.createWireframeShape(false, descriptor);
|
||||||
descriptor);
|
|
||||||
geo = wktr.read(record.getGeometry().toString());
|
|
||||||
|
|
||||||
JTSCompiler jtsCompiler = new JTSCompiler(null,
|
jtsCompiler = new JTSCompiler(null, wfs, descriptor);
|
||||||
entry.wireframeShape, descriptor);
|
|
||||||
jtsCompiler.handle(geo);
|
jtsCompiler.handle(geo);
|
||||||
entry.wireframeShape.compile();
|
wfs.compile();
|
||||||
|
entry.wireframeShape = wfs;
|
||||||
|
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
statusHandler.handle(Priority.ERROR,
|
statusHandler.handle(Priority.ERROR,
|
||||||
"Error creating wireframe", e);
|
"Error creating wireframe", e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* returns the text that should be printed in an array in reverse order
|
* returns the text that should be printed in an array in reverse order
|
||||||
|
|
|
@ -26,6 +26,7 @@ import com.raytheon.viz.warnings.rsc.AbstractWWAResource;
|
||||||
* ------------ ---------- ---------------- --------------------------
|
* ------------ ---------- ---------------- --------------------------
|
||||||
* Mar 15, 2022 srcarter@ucar Initial creation
|
* 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)
|
* 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
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -47,6 +48,10 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
private Button advFillChk;
|
private Button advFillChk;
|
||||||
private Button advTextChk;
|
private Button advTextChk;
|
||||||
private Button advTimeChk;
|
private Button advTimeChk;
|
||||||
|
private Button otherOutlineChk;
|
||||||
|
private Button otherFillChk;
|
||||||
|
private Button otherTextChk;
|
||||||
|
private Button otherTimeChk;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The WWA Resource associated with this properties dialog
|
* The WWA Resource associated with this properties dialog
|
||||||
|
@ -67,6 +72,8 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
// Create and initialize all gui components for controlling the drawing
|
||||||
|
// displays for the WWAs.
|
||||||
protected void initializeComponents(Shell shell) {
|
protected void initializeComponents(Shell shell) {
|
||||||
// --- Sub title ---
|
// --- Sub title ---
|
||||||
Composite subComp = new Composite(shell, SWT.NONE);
|
Composite subComp = new Composite(shell, SWT.NONE);
|
||||||
|
@ -75,21 +82,6 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
Label layerName = new Label(subComp, SWT.NONE);
|
Label layerName = new Label(subComp, SWT.NONE);
|
||||||
layerName.setText(myResource.getResourceData().getName());
|
layerName.setText(myResource.getResourceData().getName());
|
||||||
|
|
||||||
// --- 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");
|
|
||||||
|
|
||||||
// --- end Warnings ---
|
|
||||||
|
|
||||||
// --- Watches ---
|
// --- Watches ---
|
||||||
Group watchComp = new Group(shell, SWT.NONE);
|
Group watchComp = new Group(shell, SWT.NONE);
|
||||||
watchComp.setText("Watches");
|
watchComp.setText("Watches");
|
||||||
|
@ -106,6 +98,21 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
// --- end Watches ---
|
// --- 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");
|
||||||
|
|
||||||
|
// --- end Warnings ---
|
||||||
|
|
||||||
// --- Advisories ---
|
// --- Advisories ---
|
||||||
Group advComp = new Group(shell, SWT.NONE);
|
Group advComp = new Group(shell, SWT.NONE);
|
||||||
advComp.setText("Advisories");
|
advComp.setText("Advisories");
|
||||||
|
@ -122,6 +129,22 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
// --- end Advisories ---
|
// --- 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");
|
||||||
|
|
||||||
|
// --- end Other ---
|
||||||
|
|
||||||
// --- Bottom Buttons ---
|
// --- Bottom Buttons ---
|
||||||
Composite btnComp = new Composite(shell, SWT.NONE);
|
Composite btnComp = new Composite(shell, SWT.NONE);
|
||||||
btnComp.setLayout(new GridLayout(1, true));
|
btnComp.setLayout(new GridLayout(1, true));
|
||||||
|
@ -156,6 +179,40 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
|
|
||||||
//set all the values
|
//set all the values
|
||||||
setToCurrentValues();
|
setToCurrentValues();
|
||||||
|
|
||||||
|
//set visibility from resource
|
||||||
|
setWarningControlsEnabled(myResource.enableWarnDisplay());
|
||||||
|
setWatchControlsEnabled(myResource.enableWatchDisplay());
|
||||||
|
setAdvisoryControlsEnabled(myResource.enableAdvisoryDisplay());
|
||||||
|
setOtherControlsEnabled(myResource.enableOtherDisplay());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWarningControlsEnabled(boolean isEnabled){
|
||||||
|
warnOutlineChk.setEnabled(isEnabled);
|
||||||
|
warnFillChk.setEnabled(isEnabled);
|
||||||
|
warnTextChk.setEnabled(isEnabled);
|
||||||
|
warnTimeChk.setEnabled(isEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setWatchControlsEnabled(boolean isEnabled){
|
||||||
|
watchOutlineChk.setEnabled(isEnabled);
|
||||||
|
watchFillChk.setEnabled(isEnabled);
|
||||||
|
watchTextChk.setEnabled(isEnabled);
|
||||||
|
watchTimeChk.setEnabled(isEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setAdvisoryControlsEnabled(boolean isEnabled){
|
||||||
|
advOutlineChk.setEnabled(isEnabled);
|
||||||
|
advFillChk.setEnabled(isEnabled);
|
||||||
|
advTextChk.setEnabled(isEnabled);
|
||||||
|
advTimeChk.setEnabled(isEnabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setOtherControlsEnabled(boolean isEnabled){
|
||||||
|
otherOutlineChk.setEnabled(isEnabled);
|
||||||
|
otherFillChk.setEnabled(isEnabled);
|
||||||
|
otherTextChk.setEnabled(isEnabled);
|
||||||
|
otherTimeChk.setEnabled(isEnabled);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -205,6 +262,12 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
myResource.setAdvisoryFillDisplay(advFillChk.getSelection());
|
myResource.setAdvisoryFillDisplay(advFillChk.getSelection());
|
||||||
myResource.setAdvisoryTextDisplay(advTextChk.getSelection());
|
myResource.setAdvisoryTextDisplay(advTextChk.getSelection());
|
||||||
myResource.setAdvisoryTimeDisplay(advTimeChk.getSelection());
|
myResource.setAdvisoryTimeDisplay(advTimeChk.getSelection());
|
||||||
|
|
||||||
|
myResource.setOtherOutlineDisplay(otherOutlineChk.getSelection());
|
||||||
|
myResource.setOtherFillDisplay(otherFillChk.getSelection());
|
||||||
|
myResource.setOtherTextDisplay(otherTextChk.getSelection());
|
||||||
|
myResource.setOtherTimeDisplay(otherTimeChk.getSelection());
|
||||||
|
|
||||||
myResource.issueRefresh();
|
myResource.issueRefresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -227,7 +290,11 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
advFillChk.setSelection(AbstractWWAResource.ADV_FILL_DEFAULT);
|
advFillChk.setSelection(AbstractWWAResource.ADV_FILL_DEFAULT);
|
||||||
advTextChk.setSelection(AbstractWWAResource.ADV_TEXT_DEFAULT);
|
advTextChk.setSelection(AbstractWWAResource.ADV_TEXT_DEFAULT);
|
||||||
advTimeChk.setSelection(AbstractWWAResource.ADV_TIME_DEFAULT);
|
advTimeChk.setSelection(AbstractWWAResource.ADV_TIME_DEFAULT);
|
||||||
}
|
|
||||||
|
otherOutlineChk.setSelection(AbstractWWAResource.OTHER_OUTLINE_DEFAULT);
|
||||||
|
otherFillChk.setSelection(AbstractWWAResource.OTHER_FILL_DEFAULT);
|
||||||
|
otherTextChk.setSelection(AbstractWWAResource.OTHER_TEXT_DEFAULT);
|
||||||
|
otherTimeChk.setSelection(AbstractWWAResource.OTHER_TIME_DEFAULT); }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set all the GUI checkboxes to the current boolean values from
|
* Set all the GUI checkboxes to the current boolean values from
|
||||||
|
@ -248,5 +315,10 @@ public class DrawingPropertiesDialog extends CaveSWTDialog {
|
||||||
advFillChk.setSelection(myResource.showAdvisoryFill());
|
advFillChk.setSelection(myResource.showAdvisoryFill());
|
||||||
advTextChk.setSelection(myResource.showAdvisoryText());
|
advTextChk.setSelection(myResource.showAdvisoryText());
|
||||||
advTimeChk.setSelection(myResource.showAdvisoryTime());
|
advTimeChk.setSelection(myResource.showAdvisoryTime());
|
||||||
|
|
||||||
|
otherOutlineChk.setSelection(myResource.showOtherOutline());
|
||||||
|
otherFillChk.setSelection(myResource.showOtherFill());
|
||||||
|
otherTextChk.setSelection(myResource.showOtherText());
|
||||||
|
otherTimeChk.setSelection(myResource.showOtherTime());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,6 +22,7 @@ import com.raytheon.viz.warnings.rsc.WatchesResource;
|
||||||
* ------------ ---------- ---------------- --------------------------
|
* ------------ ---------- ---------------- --------------------------
|
||||||
* Mar 15, 2022 srcarter@ucar Initial creation
|
* Mar 15, 2022 srcarter@ucar Initial creation
|
||||||
* Mar 17, 2022 srcarter@ucar Small change to isHidden to only display for proper resources
|
* 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
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -65,7 +66,7 @@ public class WWADrawingPropertiesAction extends AbstractRightClickAction {
|
||||||
public boolean isHidden(){
|
public boolean isHidden(){
|
||||||
AbstractVizResource rsc = getSelectedRsc();
|
AbstractVizResource rsc = getSelectedRsc();
|
||||||
|
|
||||||
if((rsc instanceof WatchesResource || rsc instanceof WarningsResource) && !(rsc instanceof CWASPSResource)){
|
if(rsc instanceof WatchesResource || rsc instanceof WarningsResource){
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
Loading…
Add table
Reference in a new issue