Merge "Issue #1328 Fixed bug in GFE time matcher when no grids are available for discrete type" into development
Former-commit-id:7cbca57715
[formerly408c47019e
] [formerlyf85dcb12c5
] [formerly7cbca57715
[formerly408c47019e
] [formerlyf85dcb12c5
] [formerlyab1822c6a2
[formerlyf85dcb12c5
[formerly f281a810241140999419bc27560d6418d3b2bcc8]]]] Former-commit-id:ab1822c6a2
Former-commit-id:d992c38c7f
[formerly12232c7975
] [formerly 01efdd1a5b79b07250418da775fd59e16cc7cce7 [formerlyd3f595a6aa
]] Former-commit-id: 7d7673360bb17a89a502e28480adb352057f2ab1 [formerlyd37b8616e2
] Former-commit-id:f5faab1dd3
This commit is contained in:
commit
7a124883c5
6 changed files with 28 additions and 82 deletions
|
@ -180,6 +180,13 @@ public class GFETimeMatcher extends AbstractTimeMatcher {
|
||||||
// Fix Arrays.binarySearch returning -insertionIndex-1
|
// Fix Arrays.binarySearch returning -insertionIndex-1
|
||||||
currIdx = -currIdx - 1;
|
currIdx = -currIdx - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Cap index to ensure within bounds of times
|
||||||
|
if (currIdx < 0) {
|
||||||
|
currIdx = 0;
|
||||||
|
} else if (currIdx >= descriptorTimes.length) {
|
||||||
|
currIdx = descriptorTimes.length - 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
currIdx = 0;
|
currIdx = 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,28 +194,6 @@ public interface ISpatialDisplayManager {
|
||||||
public void removeSpatialEditorTimeChangedListener(
|
public void removeSpatialEditorTimeChangedListener(
|
||||||
ISpatialEditorTimeChangedListener listener);
|
ISpatialEditorTimeChangedListener listener);
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE: This only works for continuous colormaps--otherwise returns null
|
|
||||||
*
|
|
||||||
* @param p
|
|
||||||
* the parm to check
|
|
||||||
* @return the color map parameters
|
|
||||||
*/
|
|
||||||
public ColorMapParameters getColorMapParameters(Parm p)
|
|
||||||
throws GFEOperationFailedException;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* NOTE: This only works for continuous colormaps--otherwise returns null
|
|
||||||
*
|
|
||||||
* @param p
|
|
||||||
* the parm to check
|
|
||||||
* @param descriptor
|
|
||||||
* TODO
|
|
||||||
* @return the color map parameters
|
|
||||||
*/
|
|
||||||
public ColorMapParameters getColorMapParameters(Parm p,
|
|
||||||
IDescriptor descriptor) throws GFEOperationFailedException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add an edit tool to the display
|
* Add an edit tool to the display
|
||||||
*
|
*
|
||||||
|
|
|
@ -349,48 +349,6 @@ public abstract class AbstractSpatialDisplayManager implements
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.viz.gfe.core.ISpatialDisplayManager#getColorMapParameters
|
|
||||||
* (com.raytheon.viz.gfe.core.parm.Parm)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ColorMapParameters getColorMapParameters(Parm p)
|
|
||||||
throws GFEOperationFailedException {
|
|
||||||
for (IDescriptor descriptor : getDescriptors()) {
|
|
||||||
ColorMapParameters cmap = getColorMapParameters(p, descriptor);
|
|
||||||
if (cmap != null) {
|
|
||||||
return cmap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see
|
|
||||||
* com.raytheon.viz.gfe.core.ISpatialDisplayManager#getColorMapParameters
|
|
||||||
* (com.raytheon .viz.gfe.core.parm.Parm)
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
public ColorMapParameters getColorMapParameters(Parm p,
|
|
||||||
IDescriptor descriptor) throws GFEOperationFailedException {
|
|
||||||
List<GFEResource> resourceList = descriptor.getResourceList()
|
|
||||||
.getResourcesByTypeAsType(GFEResource.class);
|
|
||||||
for (GFEResource gfeRsc : resourceList) {
|
|
||||||
if (gfeRsc.getParm().equals(p)) {
|
|
||||||
return gfeRsc.getCapability(ColorMapCapability.class)
|
|
||||||
.getColorMapParameters();
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
*
|
*
|
||||||
|
|
|
@ -119,15 +119,11 @@ public class ContinuousColorbar implements IColorBarDisplay {
|
||||||
|
|
||||||
ISpatialDisplayManager spatialDisplayManager = dManager
|
ISpatialDisplayManager spatialDisplayManager = dManager
|
||||||
.getSpatialDisplayManager();
|
.getSpatialDisplayManager();
|
||||||
ColorMapParameters cmap = null;
|
|
||||||
try {
|
ResourcePair parmRsc = spatialDisplayManager.getResourcePair(parm);
|
||||||
cmap = spatialDisplayManager.getColorMapParameters(parm,
|
ColorMapParameters cmap = parmRsc.getResource()
|
||||||
colorbarResource.getDescriptor());
|
.getCapability(ColorMapCapability.class)
|
||||||
} catch (GFEOperationFailedException e) {
|
.getColorMapParameters();
|
||||||
// spatial display manager may not be active.
|
|
||||||
// Log the exception in case it's something else
|
|
||||||
log.handle(Priority.DEBUG, "Error obtaining color map", e);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (cmap == null) {
|
if (cmap == null) {
|
||||||
log.debug("Cannot obtain color map, exiting paint()");
|
log.debug("Cannot obtain color map, exiting paint()");
|
||||||
|
|
|
@ -179,12 +179,11 @@ public class DiscreteColorbar implements IColorBarDisplay,
|
||||||
@Override
|
@Override
|
||||||
public void paint(IGraphicsTarget target, PaintProperties paintProps)
|
public void paint(IGraphicsTarget target, PaintProperties paintProps)
|
||||||
throws VizException {
|
throws VizException {
|
||||||
|
DataTime currentTime = paintProps.getDataTime();
|
||||||
if (parm == null) {
|
if (parm == null || currentTime == null) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
DataTime currentTime = paintProps.getDataTime();
|
|
||||||
IGridData gridData = parm.overlappingGrid(currentTime.getRefTime());
|
IGridData gridData = parm.overlappingGrid(currentTime.getRefTime());
|
||||||
boolean currentIscMode = parm.getDataManager().getParmManager()
|
boolean currentIscMode = parm.getDataManager().getParmManager()
|
||||||
.iscMode();
|
.iscMode();
|
||||||
|
|
|
@ -49,8 +49,11 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||||
import com.raytheon.uf.common.status.UFStatus;
|
import com.raytheon.uf.common.status.UFStatus;
|
||||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||||
import com.raytheon.uf.common.time.TimeRange;
|
import com.raytheon.uf.common.time.TimeRange;
|
||||||
|
import com.raytheon.uf.viz.core.drawables.ResourcePair;
|
||||||
|
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||||
import com.raytheon.viz.gfe.GFEOperationFailedException;
|
import com.raytheon.viz.gfe.GFEOperationFailedException;
|
||||||
import com.raytheon.viz.gfe.core.DataManager;
|
import com.raytheon.viz.gfe.core.DataManager;
|
||||||
|
import com.raytheon.viz.gfe.core.DataManagerUIFactory;
|
||||||
import com.raytheon.viz.gfe.core.griddata.IGridData;
|
import com.raytheon.viz.gfe.core.griddata.IGridData;
|
||||||
import com.raytheon.viz.gfe.core.msgs.Message;
|
import com.raytheon.viz.gfe.core.msgs.Message;
|
||||||
import com.raytheon.viz.gfe.core.msgs.Message.IMessageClient;
|
import com.raytheon.viz.gfe.core.msgs.Message.IMessageClient;
|
||||||
|
@ -191,10 +194,15 @@ public class TemporalEditorNumericBar extends AbstractTemporalEditorBar
|
||||||
if (!parmList.contains(parm)) {
|
if (!parmList.contains(parm)) {
|
||||||
super.addParm(parm, ts);
|
super.addParm(parm, ts);
|
||||||
|
|
||||||
try {
|
IColorMap colorMap = null;
|
||||||
IColorMap colorMap = DataManager.getCurrentInstance()
|
ResourcePair rsc = DataManagerUIFactory.getCurrentInstance()
|
||||||
.getSpatialDisplayManager().getColorMapParameters(parm)
|
.getSpatialDisplayManager().getResourcePair(parm);
|
||||||
.getColorMap();
|
if (rsc != null) {
|
||||||
|
colorMap = rsc.getResource()
|
||||||
|
.getCapability(ColorMapCapability.class)
|
||||||
|
.getColorMapParameters().getColorMap();
|
||||||
|
}
|
||||||
|
if (colorMap != null) {
|
||||||
List<Color> colorList = new ArrayList<Color>();
|
List<Color> colorList = new ArrayList<Color>();
|
||||||
Display display = Display.getCurrent();
|
Display display = Display.getCurrent();
|
||||||
|
|
||||||
|
@ -207,11 +215,11 @@ public class TemporalEditorNumericBar extends AbstractTemporalEditorBar
|
||||||
}
|
}
|
||||||
|
|
||||||
parmColorMap.put(parm, colorList);
|
parmColorMap.put(parm, colorList);
|
||||||
} catch (GFEOperationFailedException e) {
|
} else {
|
||||||
statusHandler.handle(
|
statusHandler.handle(
|
||||||
Priority.PROBLEM,
|
Priority.PROBLEM,
|
||||||
"Could not determine colormap for Parm["
|
"Could not determine colormap for Parm["
|
||||||
+ parm.getFormattedString() + "]", e);
|
+ parm.getFormattedString() + "]");
|
||||||
}
|
}
|
||||||
|
|
||||||
scaleVisual.setParms(parmList);
|
scaleVisual.setParms(parmList);
|
||||||
|
|
Loading…
Add table
Reference in a new issue