Issue #3604 Fix NPE in Imaging Dialog.
Former-commit-id:15f35e6dcc
[formerly e2043fd8034dde47963a32108b1475ee7db1ea18] Former-commit-id:ed7b816989
This commit is contained in:
parent
c23122797d
commit
dca7627c1e
2 changed files with 38 additions and 14 deletions
|
@ -59,6 +59,7 @@ import com.raytheon.uf.viz.core.rsc.IRefreshListener;
|
|||
import com.raytheon.uf.viz.core.rsc.IResourceDataChanged;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.ResourceList;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorableCapability;
|
||||
import com.raytheon.viz.core.rsc.BestResResource;
|
||||
|
@ -82,6 +83,9 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jun 12, 2009 1937 askripsk Initial creation
|
||||
* May 21, 2009 6309 garmendariz Modified path for Geotools 2.6.4
|
||||
* May 01, 2014 3100 bsteffen perform time matching on data update.
|
||||
* Sep 10, 2014 3604 bsteffen Ensure capability changes propogate to
|
||||
* all resources/listeners.
|
||||
*
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
|
@ -123,7 +127,7 @@ public class RadarMosaicResource extends
|
|||
};
|
||||
|
||||
protected RadarMosaicResource(RadarMosaicResourceData rrd,
|
||||
LoadProperties loadProps) throws VizException {
|
||||
LoadProperties loadProps) {
|
||||
super(rrd, loadProps);
|
||||
timeUpdateJob.setSystem(true);
|
||||
rrd.addChangeListener(this);
|
||||
|
@ -230,12 +234,7 @@ public class RadarMosaicResource extends
|
|||
return maxSeverity;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @seecom.raytheon.viz.core.rsc.IVizResource#paint(com.raytheon.viz.core.
|
||||
* IGraphicsTarget, com.raytheon.viz.core.PixelExtent, double, float)
|
||||
*/
|
||||
@Override
|
||||
protected void paintInternal(IGraphicsTarget target,
|
||||
PaintProperties paintProps) throws VizException {
|
||||
DataTime[] frameTimes = paintProps.getFramesInfo().getTimeMap()
|
||||
|
@ -624,6 +623,17 @@ public class RadarMosaicResource extends
|
|||
}
|
||||
dataTimes.remove(time);
|
||||
break;
|
||||
case CAPABILITY:
|
||||
AbstractCapability cap = (AbstractCapability) object;
|
||||
/*
|
||||
* Since mosaic shares capabilities, need to make sure resourceData
|
||||
* is always set to the mosaic resource data so that all resources
|
||||
* are notified.
|
||||
*/
|
||||
if (cap.getResourceData() != resourceData) {
|
||||
cap.setResourceData(resourceData);
|
||||
resourceData.fireChangeListeners(type, object);
|
||||
}
|
||||
}
|
||||
synchronized (this) {
|
||||
force = true;
|
||||
|
@ -631,6 +641,16 @@ public class RadarMosaicResource extends
|
|||
issueRefresh();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void resourceDataChanged(ChangeType type, Object updateObject) {
|
||||
if (ChangeType.CAPABILITY == type) {
|
||||
for (ResourcePair rp : getResourceList()) {
|
||||
rp.getResourceData().fireChangeListeners(type, updateObject);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (groupName == null) {
|
||||
|
@ -651,6 +671,7 @@ public class RadarMosaicResource extends
|
|||
return groupName;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String[] getUpperText(DataTime time) {
|
||||
if (!getResourceData().getMergeUpperText()) {
|
||||
return null;
|
||||
|
|
|
@ -91,6 +91,7 @@ import com.raytheon.viz.ui.editor.IMultiPaneEditor;
|
|||
* ColorMapCapability is not present.
|
||||
* Apr 08, 2014 2905 bsteffen Add option to interpolate colors.
|
||||
* Apr 16, 2014 3037 lvenable Add dispose check in runAsync call.
|
||||
* Sep 10, 2014 3604 bsteffen Check for colormap before setting interpolation state.
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -771,26 +772,28 @@ public class ImagingDialog extends CaveSWTDialog implements
|
|||
if (topResource.hasCapability(ColorMapCapability.class)) {
|
||||
final ColorMapCapability cmcap = topResource
|
||||
.getCapability(ColorMapCapability.class);
|
||||
ColorMapParameters cmparms = cmcap.getColorMapParameters();
|
||||
String currentCMap = "Not Selected";
|
||||
if (cmcap.getColorMapParameters() != null
|
||||
&& cmcap.getColorMapParameters().getColorMap() != null) {
|
||||
currentCMap = cmcap.getColorMapParameters().getColorMap()
|
||||
.getName();
|
||||
if (cmparms != null && cmparms.getColorMap() != null) {
|
||||
currentCMap = cmparms.getColorMap().getName();
|
||||
if (currentCMap == null) {
|
||||
currentCMap = "";
|
||||
}
|
||||
}
|
||||
topColormapComp.setCap(cmcap);
|
||||
topColormapComp.setParams(cmcap.getColorMapParameters());
|
||||
topColormapComp.setParams(cmparms);
|
||||
if (currentCMap.isEmpty()) {
|
||||
currentCMap = UNSAVED_CMAP_DISPLAY_NAME;
|
||||
}
|
||||
topColormapComp.getCMapButton().setText(currentCMap);
|
||||
|
||||
topColorMapButton.setText("Edit " + topResourceName);
|
||||
|
||||
interpolateColorsCheckbox.setEnabled(true);
|
||||
interpolateColorsCheckbox.setSelection(cmcap
|
||||
.getColorMapParameters().isInterpolate());
|
||||
if (cmparms != null) {
|
||||
interpolateColorsCheckbox.setSelection(cmparms
|
||||
.isInterpolate());
|
||||
}
|
||||
} else {
|
||||
topColorMapButton.setText(topResourceName
|
||||
+ " is not color mapped.");
|
||||
|
|
Loading…
Add table
Reference in a new issue