ASM #18509 - Make WarnGen polygon extension area display a separate map background
Change-Id: I2a73e87c1398694e5c9c03590e481107a8143f1d Former-commit-id: 79863e66545307875eb84b5359302c13f2af8e7d
This commit is contained in:
parent
db746b7c13
commit
afe22917c6
6 changed files with 341 additions and 63 deletions
|
@ -0,0 +1,46 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
|
<!--
|
||||||
|
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.
|
||||||
|
-->
|
||||||
|
<bundle>
|
||||||
|
<displayList>
|
||||||
|
<displays xsi:type="mapRenderableDisplay"
|
||||||
|
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
|
||||||
|
<descriptor xsi:type="mapDescriptor">
|
||||||
|
<resource>
|
||||||
|
<loadProperties>
|
||||||
|
<capabilities>
|
||||||
|
<capability xsi:type="colorableCapability" colorAsString="#f08080" />
|
||||||
|
<capability xsi:type="shadeableCapability" opacity="0.4"/>
|
||||||
|
</capabilities>
|
||||||
|
<resourceType>PLAN_VIEW</resourceType>
|
||||||
|
</loadProperties>
|
||||||
|
<properties isSystemResource="false" isBlinking="false"
|
||||||
|
isMapLayer="true" isHoverOn="false" isVisible="true">
|
||||||
|
<pdProps maxDisplayWidth="100000000" minDisplayWidth="0" />
|
||||||
|
</properties>
|
||||||
|
<resourceData xsi:type="genericToolsResourceData">
|
||||||
|
<name>WarnGen Extension Area</name>
|
||||||
|
<classT>com.raytheon.viz.warngen.gui.WarngenExtensionAreaLayer</classT>
|
||||||
|
</resourceData>
|
||||||
|
</resource>
|
||||||
|
</descriptor>
|
||||||
|
</displays>
|
||||||
|
</displayList>
|
||||||
|
</bundle>
|
|
@ -29,6 +29,7 @@ import com.raytheon.viz.warngen.gui.WarngenLayer.ExtensionAreaOptions;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ------------ --------------------------
|
* ------------ ---------- ------------ --------------------------
|
||||||
* 12/21/2015 DCS 17942 D. Friedman Initial revision
|
* 12/21/2015 DCS 17942 D. Friedman Initial revision
|
||||||
|
* 03/10/2016 DCS 18509 D. Friedman Make extension area display a separate map background.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -104,7 +105,9 @@ public class PolygonOptionsComposite extends Composite {
|
||||||
warngenLayer.getObservableExtensionAreaVisible().addChangeListener(new IChangeListener() {
|
warngenLayer.getObservableExtensionAreaVisible().addChangeListener(new IChangeListener() {
|
||||||
@Override
|
@Override
|
||||||
public void handleChange(ChangeEvent event) {
|
public void handleChange(ChangeEvent event) {
|
||||||
visualizeExtensionButton.setSelection(warngenLayer.isExtensionAreaVisible());
|
if (!visualizeExtensionButton.isDisposed()) {
|
||||||
|
visualizeExtensionButton.setSelection(warngenLayer.isExtensionAreaVisible());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -16,6 +16,7 @@ import com.raytheon.viz.ui.cmenu.AbstractRightClickAction;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ------------ --------------------------
|
* ------------ ---------- ------------ --------------------------
|
||||||
* 12/21/2015 DCS 17942 D. Friedman Initial revision
|
* 12/21/2015 DCS 17942 D. Friedman Initial revision
|
||||||
|
* 03/10/2016 DCS 18509 D. Friedman Improve synchronization of state with display
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@ -37,9 +38,9 @@ public class ShowExtensionAreaToggleAction extends AbstractRightClickAction {
|
||||||
@Override
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
if (warngenLayer != null) {
|
if (warngenLayer != null) {
|
||||||
boolean checked = ! warngenLayer.isExtensionAreaVisible();
|
boolean visible = ! isChecked();
|
||||||
warngenLayer.setExtensionAreaVisualized(checked);
|
warngenLayer.setExtensionAreaVisualized(visible);
|
||||||
setChecked(checked);
|
setChecked(visible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,4 +54,9 @@ public class ShowExtensionAreaToggleAction extends AbstractRightClickAction {
|
||||||
return "Show Extension Area";
|
return "Show Extension Area";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isChecked() {
|
||||||
|
return warngenLayer.isExtensionAreaActuallyVisible();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,195 @@
|
||||||
|
package com.raytheon.viz.warngen.gui;
|
||||||
|
|
||||||
|
import org.eclipse.core.databinding.observable.ChangeEvent;
|
||||||
|
import org.eclipse.core.databinding.observable.IChangeListener;
|
||||||
|
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
|
import com.raytheon.uf.viz.core.VizApp;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.IShadedShape;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
|
import com.raytheon.uf.viz.core.exception.VizException;
|
||||||
|
import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||||
|
import com.raytheon.uf.viz.core.maps.rsc.StyledMapResource;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.IDisposeListener;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.capabilities.ShadeableCapability;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.tools.GenericToolsResourceData;
|
||||||
|
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
||||||
|
import com.vividsolutions.jts.geom.Geometry;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Displays the area the polygon is allowed to extend into beyond
|
||||||
|
* the hatched area.
|
||||||
|
*
|
||||||
|
* <pre>
|
||||||
|
*
|
||||||
|
* SOFTWARE HISTORY
|
||||||
|
*
|
||||||
|
* Date Ticket# Engineer Description
|
||||||
|
* ------------ ---------- ------------ --------------------------
|
||||||
|
* 03/10/2015 DCS 18509 D. Friedman Initial revision
|
||||||
|
* </pre>
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class WarngenExtensionAreaLayer extends
|
||||||
|
StyledMapResource<AbstractResourceData, MapDescriptor>
|
||||||
|
implements IDisposeListener, IChangeListener, AddListener {
|
||||||
|
|
||||||
|
private IShadedShape extensionAreaShadedShape = null;
|
||||||
|
private Geometry extensionAreaVis = null;
|
||||||
|
private boolean extensionAreaVisDirty = false;
|
||||||
|
|
||||||
|
public WarngenExtensionAreaLayer(GenericToolsResourceData<?> resourceData,
|
||||||
|
LoadProperties loadProperties, MapDescriptor descriptor) {
|
||||||
|
super(resourceData, loadProperties);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void resourceChanged(ChangeType type, Object object) {
|
||||||
|
super.resourceChanged(type, object);
|
||||||
|
if ((type == ChangeType.CAPABILITY)
|
||||||
|
&& (object instanceof ColorableCapability)) {
|
||||||
|
extensionAreaVisDirty = true;
|
||||||
|
issueRefresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void propertiesChanged(ResourceProperties updatedProps) {
|
||||||
|
super.propertiesChanged(updatedProps);
|
||||||
|
if (warngenLayer != null) {
|
||||||
|
warngenLayer.realizeExtensionAreaVisibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void project(CoordinateReferenceSystem crs) throws VizException {
|
||||||
|
super.project(crs);
|
||||||
|
|
||||||
|
if (extensionAreaShadedShape != null) {
|
||||||
|
extensionAreaVisDirty = true;
|
||||||
|
issueRefresh();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void disposeInternal() {
|
||||||
|
getDescriptor().getResourceList().removePostAddListener(this);
|
||||||
|
if (extensionAreaShadedShape != null) {
|
||||||
|
extensionAreaShadedShape.dispose();
|
||||||
|
}
|
||||||
|
extensionAreaVis = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void paintInternal(IGraphicsTarget target,
|
||||||
|
PaintProperties paintProps) throws VizException {
|
||||||
|
ColorableCapability coloring = getCapability(ColorableCapability.class);
|
||||||
|
ShadeableCapability shading = getCapability(ShadeableCapability.class);
|
||||||
|
if (extensionAreaVisDirty) {
|
||||||
|
extensionAreaShadedShape.reset();
|
||||||
|
if (extensionAreaVis != null) {
|
||||||
|
JTSCompiler comp = new JTSCompiler(extensionAreaShadedShape, null,
|
||||||
|
descriptor);
|
||||||
|
Geometry g = extensionAreaVis;
|
||||||
|
extensionAreaVisDirty = false;
|
||||||
|
if (g != null) {
|
||||||
|
comp.handle(g, coloring.getColor());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
target.drawShadedShape(extensionAreaShadedShape, shading.getOpacity());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||||
|
getDescriptor().getResourceList().addPostAddListener(this);
|
||||||
|
extensionAreaShadedShape = target.createShadedShape(true,
|
||||||
|
this.descriptor.getGridGeometry());
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
getWarngenLayer();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
private WarngenLayer warngenLayer;
|
||||||
|
|
||||||
|
protected WarngenLayer getWarngenLayer() {
|
||||||
|
if (warngenLayer != null) {
|
||||||
|
return warngenLayer;
|
||||||
|
}
|
||||||
|
|
||||||
|
synchronized (this) {
|
||||||
|
if (getDescriptor() != null) {
|
||||||
|
for (ResourcePair rp : getDescriptor().getResourceList()) {
|
||||||
|
if (rp.getResource() instanceof WarngenLayer) {
|
||||||
|
warngenLayer = (WarngenLayer) rp.getResource();
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (warngenLayer != null) {
|
||||||
|
warngenLayer.registerListener(this);
|
||||||
|
warngenLayer.getObservableExtensionAreaVis()
|
||||||
|
.addChangeListener(this);
|
||||||
|
handleChange(null);
|
||||||
|
}
|
||||||
|
|
||||||
|
return warngenLayer;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void disposed(AbstractVizResource<?, ?> rsc) {
|
||||||
|
synchronized (this) {
|
||||||
|
if (warngenLayer != null) {
|
||||||
|
warngenLayer.unregisterListener(this);
|
||||||
|
warngenLayer.getObservableExtensionAreaVis().removeChangeListener(
|
||||||
|
this);
|
||||||
|
warngenLayer = null;
|
||||||
|
extensionAreaShadedShape.reset();
|
||||||
|
extensionAreaVis = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleChange(ChangeEvent event) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
if (warngenLayer != null) {
|
||||||
|
extensionAreaVis = (Geometry) warngenLayer
|
||||||
|
.getObservableExtensionAreaVis().getValue();
|
||||||
|
} else {
|
||||||
|
extensionAreaVis = null;
|
||||||
|
}
|
||||||
|
extensionAreaVisDirty = true;
|
||||||
|
issueRefresh();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void notifyAdd(ResourcePair rp) throws VizException {
|
||||||
|
if (warngenLayer == null && rp.getResource() instanceof WarngenLayer) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
getWarngenLayer();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -121,7 +121,10 @@ import com.raytheon.uf.viz.core.map.MapDescriptor;
|
||||||
import com.raytheon.uf.viz.core.maps.MapManager;
|
import com.raytheon.uf.viz.core.maps.MapManager;
|
||||||
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
import com.raytheon.uf.viz.core.notification.jobs.NotificationManagerJob;
|
||||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.ResourceList.RemoveListener;
|
||||||
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.ResourceList.AddListener;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.EditableCapability;
|
||||||
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
import com.raytheon.uf.viz.core.rsc.capabilities.MagnificationCapability;
|
||||||
|
@ -262,6 +265,7 @@ import com.vividsolutions.jts.simplify.TopologyPreservingSimplifier;
|
||||||
* Show preview of redrawn polygon when developer mode property is set.
|
* Show preview of redrawn polygon when developer mode property is set.
|
||||||
* 01/06/2016 ASM #18453 D. Friedman Cache extension areas so they are not regenerated on Restart or (limited) template changes.
|
* 01/06/2016 ASM #18453 D. Friedman Cache extension areas so they are not regenerated on Restart or (limited) template changes.
|
||||||
* 02/23/2016 ASM #18669 D. Friedman Improve speed and reduce memory usage of extension area generation.
|
* 02/23/2016 ASM #18669 D. Friedman Improve speed and reduce memory usage of extension area generation.
|
||||||
|
* 03/10/2016 DCS 18509 D. Friedman Make extension area display a separate map background.
|
||||||
* 03/11/2016 ASM #18720 D. Friedman Improve warning message when extension area is not available.
|
* 03/11/2016 ASM #18720 D. Friedman Improve warning message when extension area is not available.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -279,6 +283,8 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
/*package*/ static final UnitConverter MILES_TO_METER = NonSI.MILE
|
/*package*/ static final UnitConverter MILES_TO_METER = NonSI.MILE
|
||||||
.getConverterTo(SI.METER);
|
.getConverterTo(SI.METER);
|
||||||
|
|
||||||
|
private static final String EXTENSION_AREA_MAP_NAME = "WarnGen Extension Area";
|
||||||
|
|
||||||
static String lastSelectedBackupSite;
|
static String lastSelectedBackupSite;
|
||||||
|
|
||||||
String uniqueFip = null;
|
String uniqueFip = null;
|
||||||
|
@ -875,11 +881,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
geometryFuture.cancel(true);
|
geometryFuture.cancel(true);
|
||||||
geometryFuture = null;
|
geometryFuture = null;
|
||||||
}
|
}
|
||||||
extensionAreaVis = null;
|
setExtensionAreaVis(null);
|
||||||
if (extensionAreaShadedShape != null) {
|
|
||||||
extensionAreaShadedShape.reset();
|
|
||||||
issueRefresh();
|
|
||||||
}
|
|
||||||
gda = null;
|
gda = null;
|
||||||
if (isExtensionAreaDefined() && checkExtensionAreaViable()) {
|
if (isExtensionAreaDefined() && checkExtensionAreaViable()) {
|
||||||
Exception error = null;
|
Exception error = null;
|
||||||
|
@ -932,7 +934,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
}
|
}
|
||||||
}, ear.geometry);
|
}, ear.geometry);
|
||||||
this.geometryFuture.run();
|
this.geometryFuture.run();
|
||||||
extensionAreaVis = ear.extensionAreaVis;
|
setExtensionAreaVis(ear.extensionAreaVis);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
|
@ -1087,7 +1089,7 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
Geometry vis = extensionGDA.buildArea(r, false);
|
Geometry vis = extensionGDA.buildArea(r, false);
|
||||||
perfLog.logDuration("Extension area", System.currentTimeMillis() - t0);
|
perfLog.logDuration("Extension area", System.currentTimeMillis() - t0);
|
||||||
extensionAreaManager.cacheArea(primaryGDA, extensionGDA, options, r, vis);
|
extensionAreaManager.cacheArea(primaryGDA, extensionGDA, options, r, vis);
|
||||||
extensionAreaVis = vis;
|
setExtensionAreaVis(vis);
|
||||||
issueRefresh();
|
issueRefresh();
|
||||||
return r;
|
return r;
|
||||||
}
|
}
|
||||||
|
@ -1453,6 +1455,11 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
protected void disposeInternal() {
|
protected void disposeInternal() {
|
||||||
customMaps.clearMaps();
|
customMaps.clearMaps();
|
||||||
|
|
||||||
|
if (loadedExtensionAreaMap) {
|
||||||
|
MapManager mapManager = MapManager.getInstance(getDescriptor());
|
||||||
|
mapManager.unloadMap(EXTENSION_AREA_MAP_NAME);
|
||||||
|
}
|
||||||
|
|
||||||
GeomMetaDataUpdateNotificationObserver.removeNotificationObserver();
|
GeomMetaDataUpdateNotificationObserver.removeNotificationObserver();
|
||||||
|
|
||||||
super.disposeInternal();
|
super.disposeInternal();
|
||||||
|
@ -1468,11 +1475,14 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
if (coveredAreaFrame != null) {
|
if (coveredAreaFrame != null) {
|
||||||
coveredAreaFrame.dispose();
|
coveredAreaFrame.dispose();
|
||||||
}
|
}
|
||||||
if (extensionAreaShadedShape != null) {
|
|
||||||
extensionAreaShadedShape.dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
manager.dispose();
|
manager.dispose();
|
||||||
|
|
||||||
|
if (extensionAreaLayerAddRemoveListener != null) {
|
||||||
|
ResourceList resourceList = getDescriptor().getResourceList();
|
||||||
|
resourceList.removePostAddListener(extensionAreaLayerAddRemoveListener);
|
||||||
|
resourceList.removePostRemoveListener(extensionAreaLayerAddRemoveListener);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1506,8 +1516,10 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
coveredAreaFrame = target.createWireframeShape(true, this.descriptor);
|
coveredAreaFrame = target.createWireframeShape(true, this.descriptor);
|
||||||
shadedCoveredArea = target.createShadedShape(true,
|
shadedCoveredArea = target.createShadedShape(true,
|
||||||
this.descriptor.getGridGeometry(), true);
|
this.descriptor.getGridGeometry(), true);
|
||||||
extensionAreaShadedShape = target.createShadedShape(true,
|
extensionAreaLayerAddRemoveListener = new ExtensionAreaLayerAddRemoveListener();
|
||||||
this.descriptor.getGridGeometry());
|
ResourceList resourceList = getDescriptor().getResourceList();
|
||||||
|
resourceList.addPostAddListener(extensionAreaLayerAddRemoveListener);
|
||||||
|
resourceList.addPostRemoveListener(extensionAreaLayerAddRemoveListener);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1585,20 +1597,6 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((Boolean) getObservableExtensionAreaVisible().getValue()) {
|
|
||||||
if (extensionAreaVis != null) {
|
|
||||||
extensionAreaShadedShape.reset();
|
|
||||||
JTSCompiler comp = new JTSCompiler(extensionAreaShadedShape, null, descriptor);
|
|
||||||
Geometry g = extensionAreaVis;
|
|
||||||
extensionAreaVis = null;
|
|
||||||
if (g != null) {
|
|
||||||
comp.handle(g, extensionAreaVisualizationColor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
target.drawShadedShape(extensionAreaShadedShape,
|
|
||||||
extensionAreaVisualizationAlpha);
|
|
||||||
}
|
|
||||||
|
|
||||||
lastMode = displayState.mode;
|
lastMode = displayState.mode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1776,25 +1774,18 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
target.drawStrings(strings);
|
target.drawStrings(strings);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Geometry extensionAreaVis;
|
private WritableValue observableExtensionAreaVis;
|
||||||
|
|
||||||
private WritableValue observableExtensionAreaVisible;
|
private WritableValue observableExtensionAreaVisible;
|
||||||
|
|
||||||
private RGB extensionAreaVisualizationColor = new RGB(240, 128, 128);
|
private boolean loadedExtensionAreaMap = false;
|
||||||
|
|
||||||
private float extensionAreaVisualizationAlpha = 0.4f;
|
private ExtensionAreaLayerAddRemoveListener extensionAreaLayerAddRemoveListener;
|
||||||
|
|
||||||
private IShadedShape extensionAreaShadedShape = null;
|
|
||||||
|
|
||||||
public WritableValue getObservableExtensionAreaVisible() {
|
public WritableValue getObservableExtensionAreaVisible() {
|
||||||
if (observableExtensionAreaVisible == null) {
|
if (observableExtensionAreaVisible == null) {
|
||||||
observableExtensionAreaVisible = new WritableValue(false, null);
|
observableExtensionAreaVisible = new WritableValue(
|
||||||
observableExtensionAreaVisible.addChangeListener(new IChangeListener() {
|
isExtensionAreaActuallyVisible(), null);
|
||||||
@Override
|
|
||||||
public void handleChange(ChangeEvent event) {
|
|
||||||
issueRefresh();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
return observableExtensionAreaVisible;
|
return observableExtensionAreaVisible;
|
||||||
}
|
}
|
||||||
|
@ -1803,31 +1794,40 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
return (Boolean) getObservableExtensionAreaVisible().getValue();
|
return (Boolean) getObservableExtensionAreaVisible().getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean isExtensionAreaActuallyVisible() {
|
||||||
|
boolean actuallyVisible = false;
|
||||||
|
MapManager mapManager = MapManager.getInstance(getDescriptor());
|
||||||
|
if (mapManager.isMapLoaded(EXTENSION_AREA_MAP_NAME)) {
|
||||||
|
ResourcePair rp = mapManager.loadMapByName(EXTENSION_AREA_MAP_NAME);
|
||||||
|
actuallyVisible = rp.getResource().getProperties().isVisible();
|
||||||
|
}
|
||||||
|
return actuallyVisible;
|
||||||
|
}
|
||||||
|
|
||||||
public void setExtensionAreaVisualized(boolean visible) {
|
public void setExtensionAreaVisualized(boolean visible) {
|
||||||
getObservableExtensionAreaVisible().setValue(visible);
|
getObservableExtensionAreaVisible().setValue(visible);
|
||||||
}
|
MapManager mapManager = MapManager.getInstance(getDescriptor());
|
||||||
|
if (! mapManager.isMapLoaded(EXTENSION_AREA_MAP_NAME)) {
|
||||||
public RGB getExtensionAreaVisualizationColor() {
|
loadedExtensionAreaMap = true;
|
||||||
return extensionAreaVisualizationColor;
|
}
|
||||||
}
|
ResourcePair rp = mapManager.loadMapByName(EXTENSION_AREA_MAP_NAME);
|
||||||
|
if (rp != null) {
|
||||||
public void setExtensionAreaVisualizationColor(
|
rp.getResource().getProperties().setVisible(visible);
|
||||||
RGB extensionAreaVisualizationColor) {
|
rp.getResource().issueRefresh();
|
||||||
if (extensionAreaVisualizationColor == null) {
|
|
||||||
throw new NullPointerException("extensionAreaVisualizationColor must be non-null");
|
|
||||||
}
|
}
|
||||||
this.extensionAreaVisualizationColor = extensionAreaVisualizationColor;
|
|
||||||
issueRefresh();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getExtensionAreaVisualizationAlpha() {
|
public void realizeExtensionAreaVisibility() {
|
||||||
return extensionAreaVisualizationAlpha;
|
VizApp.runAsync(new Runnable() {
|
||||||
}
|
@Override
|
||||||
|
public void run() {
|
||||||
public void setExtensionAreaVisualizationAlpha(
|
boolean actuallyVisible = isExtensionAreaActuallyVisible();
|
||||||
float extensionAreaVisualizationAlpha) {
|
if (actuallyVisible != isExtensionAreaVisible()) {
|
||||||
this.extensionAreaVisualizationAlpha = extensionAreaVisualizationAlpha;
|
observableExtensionAreaVisible
|
||||||
issueRefresh();
|
.setValue(isExtensionAreaActuallyVisible());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -4508,4 +4508,32 @@ public class WarngenLayer extends AbstractStormTrackResource {
|
||||||
return warngenDeveloperMode;
|
return warngenDeveloperMode;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public WritableValue getObservableExtensionAreaVis() {
|
||||||
|
if (observableExtensionAreaVis == null) {
|
||||||
|
observableExtensionAreaVis = new WritableValue();
|
||||||
|
}
|
||||||
|
return observableExtensionAreaVis;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void setExtensionAreaVis(final Geometry extensionAreaVis) {
|
||||||
|
VizApp.runAsync(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
getObservableExtensionAreaVis().setValue(extensionAreaVis);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected class ExtensionAreaLayerAddRemoveListener implements AddListener,
|
||||||
|
RemoveListener {
|
||||||
|
@Override
|
||||||
|
public void notifyRemove(ResourcePair rp) throws VizException {
|
||||||
|
realizeExtensionAreaVisibility();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void notifyAdd(ResourcePair rp) throws VizException {
|
||||||
|
realizeExtensionAreaVisibility();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ import javax.xml.bind.annotation.XmlAttribute;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Describes how polygon is allowed to extend into a site's marine areas
|
* Describes how polygon is allowed to extend into a site's marine areas
|
||||||
* (for land-based warnings) or onto land (for marine-based warnings.)
|
* (for land-based warnings) or onto land (for marine-based warnings).
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
|
|
Loading…
Add table
Reference in a new issue