Issue #2404 Moved colormap parameter factory to common
moved grid level translator from viz to common updated references to moved classes created grid style util for common styling code updated style manager to look in common for files moved data plugin style rules to common Former-commit-id:75448f8a42
[formerly2f25116c10
[formerly 7cdff04cc4d60b50a2a2c08499ee329586031e0f]] Former-commit-id:2f25116c10
Former-commit-id:4c5d2b051d
This commit is contained in:
parent
d229a9e02f
commit
75f633875a
44 changed files with 220 additions and 205 deletions
|
@ -78,7 +78,7 @@
|
|||
point="com.raytheon.uf.viz.localization.localizationpath">
|
||||
<path
|
||||
application="CAVE"
|
||||
localizationType="CAVE_STATIC"
|
||||
localizationType="COMMON_STATIC"
|
||||
name="Style Rules"
|
||||
value="styleRules"
|
||||
recursive="true">
|
||||
|
|
|
@ -22,6 +22,7 @@ Require-Bundle: org.eclipse.core.runtime,
|
|||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
Import-Package: com.raytheon.uf.common.dataplugin,
|
||||
com.raytheon.uf.common.dataplugin.grid,
|
||||
com.raytheon.uf.common.dataplugin.grid.util,
|
||||
com.raytheon.uf.common.dataplugin.radar,
|
||||
com.raytheon.uf.common.dataplugin.radar.util,
|
||||
com.raytheon.uf.common.dataquery.requests,
|
||||
|
|
|
@ -33,6 +33,7 @@ import javax.measure.unit.Unit;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.grid.util.GridLevelTranslator;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
|
@ -53,7 +54,6 @@ import com.raytheon.viz.core.graphing.xy.XYData;
|
|||
import com.raytheon.viz.core.graphing.xy.XYDataList;
|
||||
import com.raytheon.viz.core.graphing.xy.XYIconImageData;
|
||||
import com.raytheon.viz.core.graphing.xy.XYWindImageData;
|
||||
import com.raytheon.viz.grid.GridLevelTranslator;
|
||||
|
||||
/**
|
||||
* Adapter providing a TimeSeries view of GridData.
|
||||
|
|
|
@ -50,9 +50,11 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
|
@ -80,10 +82,8 @@ import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
|||
import com.raytheon.viz.core.contours.rsc.displays.GriddedContourDisplay;
|
||||
import com.raytheon.viz.core.contours.rsc.displays.GriddedVectorDisplay;
|
||||
import com.raytheon.viz.core.contours.util.VectorGraphicsRenderableFactory;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay.GriddedImagePaintProperties;
|
||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
|
|
@ -28,12 +28,12 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.uf.common.style.arrow,
|
||||
com.raytheon.uf.common.style.contour,
|
||||
com.raytheon.uf.common.style.graph,
|
||||
com.raytheon.uf.common.style.image,
|
||||
com.raytheon.uf.common.style.level,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.common.topo,
|
||||
com.raytheon.uf.viz.d2d.core.map,
|
||||
com.raytheon.uf.viz.d2d.ui,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.core.imagery,
|
||||
com.raytheon.viz.core.map,
|
||||
com.raytheon.viz.core.rsc,
|
||||
|
|
|
@ -40,9 +40,10 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.IExtent;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
|
@ -59,7 +60,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||
import com.raytheon.uf.viz.xy.crosssection.adapter.AbstractCrossSectionAdapter;
|
||||
import com.raytheon.uf.viz.xy.crosssection.display.CrossSectionDescriptor;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -152,8 +152,13 @@ public class CrossSectionImageResource extends AbstractCrossSectionResource
|
|||
// change
|
||||
ColorMapParameters prevParams = getCapability(ColorMapCapability.class)
|
||||
.getColorMapParameters();
|
||||
ColorMapParameters colorMapParams = ColorMapParameterFactory.build(
|
||||
floatData, resourceData.getParameter(), getUnit(), null);
|
||||
ColorMapParameters colorMapParams;
|
||||
try {
|
||||
colorMapParams = ColorMapParameterFactory.build(floatData,
|
||||
resourceData.getParameter(), getUnit(), null);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
if (prevParams != null) {
|
||||
colorMapParams.setColorMap(prevParams.getColorMap());
|
||||
colorMapParams.setColorMapName(prevParams.getColorMapName());
|
||||
|
|
|
@ -21,6 +21,7 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.uf.common.style,
|
||||
com.raytheon.uf.common.style.arrow,
|
||||
com.raytheon.uf.common.style.contour,
|
||||
com.raytheon.uf.common.style.image,
|
||||
com.raytheon.uf.common.time,
|
||||
com.raytheon.uf.viz.core,
|
||||
com.raytheon.uf.viz.core.data,
|
||||
|
@ -44,7 +45,6 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.uf.viz.xy.varheight.rsc,
|
||||
com.raytheon.viz.core.contours,
|
||||
com.raytheon.viz.core.contours.util,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.core.graphing.util,
|
||||
com.raytheon.viz.core.graphing.xy,
|
||||
com.raytheon.viz.core.imagery,
|
||||
|
|
|
@ -32,9 +32,10 @@ import com.raytheon.uf.common.geospatial.interpolation.GridReprojection;
|
|||
import com.raytheon.uf.common.geospatial.interpolation.GridSampler;
|
||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatArrayWrapper;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.viz.core.IExtent;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
|
@ -49,7 +50,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
||||
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
|
||||
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
|
@ -153,9 +153,14 @@ public class TimeHeightImageResource extends AbstractTimeHeightResource
|
|||
// change
|
||||
ColorMapParameters prevParams = getCapability(
|
||||
ColorMapCapability.class).getColorMapParameters();
|
||||
ColorMapParameters colorMapParams = ColorMapParameterFactory.build(
|
||||
interpolatedData, resourceData.getParameter(), getUnit(),
|
||||
null);
|
||||
ColorMapParameters colorMapParams;
|
||||
try {
|
||||
colorMapParams = ColorMapParameterFactory.build(
|
||||
interpolatedData, resourceData.getParameter(),
|
||||
getUnit(), null);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
if (prevParams != null) {
|
||||
colorMapParams.setColorMap(prevParams.getColorMap());
|
||||
colorMapParams.setColorMapName(prevParams.getColorMapName());
|
||||
|
|
|
@ -34,7 +34,6 @@ Eclipse-BuddyPolicy: ext, registered, global
|
|||
Eclipse-RegisterBuddy: org.apache.velocity, com.raytheon.uf.common.geospatial, com.raytheon.uf.common.serialization, com.raytheon.uf.common.status
|
||||
Export-Package:
|
||||
com.raytheon.viz.core,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.core.imagery,
|
||||
com.raytheon.viz.core.interval,
|
||||
com.raytheon.viz.core.map,
|
||||
|
|
|
@ -1,23 +0,0 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
/**
|
||||
* Describes items that are drawable (images, lines, shaded polygons, etc.)
|
||||
*/
|
||||
package com.raytheon.viz.core.drawables;
|
|
@ -34,8 +34,10 @@ import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
|||
import com.raytheon.uf.common.dataaccess.grid.IGridData;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
||||
import com.raytheon.uf.common.geospatial.interpolation.data.FloatBufferWrapper;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.level.Level.LevelType;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.drawables.ColorMapLoader;
|
||||
|
@ -43,7 +45,6 @@ import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
|||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay2;
|
||||
import com.raytheon.viz.dataaccess.rsc.AbstractDataAccessResource;
|
||||
|
||||
|
@ -123,9 +124,14 @@ public class GenericGridResource extends
|
|||
}
|
||||
singleLevel.setValue(gridData.getLevel().getLevelonevalue());
|
||||
}
|
||||
ColorMapParameters newCmp = ColorMapParameterFactory
|
||||
.build(buffer.array(), gridData.getParameter(),
|
||||
gridData.getUnit(), singleLevel);
|
||||
ColorMapParameters newCmp;
|
||||
try {
|
||||
newCmp = ColorMapParameterFactory.build(buffer.array(),
|
||||
gridData.getParameter(), gridData.getUnit(),
|
||||
singleLevel);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException("Unable to build colormap parameters", e);
|
||||
}
|
||||
if (colorMapParameters != null) {
|
||||
// This means the capability was serialized so preserve
|
||||
// serialized fields.
|
||||
|
|
|
@ -49,7 +49,6 @@ Import-Package: com.raytheon.uf.common.comm,
|
|||
com.raytheon.uf.viz.d2d.core.map,
|
||||
com.raytheon.viz.alerts,
|
||||
com.raytheon.viz.alerts.observers,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.core.rsc,
|
||||
com.raytheon.viz.core.rsc.displays
|
||||
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
|
||||
|
|
|
@ -51,15 +51,14 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.style.AbstractStylePreferences;
|
||||
import com.raytheon.uf.common.style.MatchCriteria;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleManager.StyleType;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.arrow.ArrowPreferences;
|
||||
import com.raytheon.uf.common.style.contour.ContourPreferences;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.image.ImagePreferences;
|
||||
import com.raytheon.uf.common.style.level.Level;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
|
@ -91,7 +90,6 @@ import com.raytheon.viz.core.contours.rsc.displays.GriddedContourDisplay;
|
|||
import com.raytheon.viz.core.contours.rsc.displays.GriddedStreamlineDisplay;
|
||||
import com.raytheon.viz.core.contours.rsc.displays.GriddedVectorDisplay;
|
||||
import com.raytheon.viz.core.contours.util.VectorGraphicsRenderableFactory;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.core.rsc.displays.GriddedImageDisplay2;
|
||||
import com.raytheon.viz.grid.rsc.GriddedIconDisplay;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
@ -114,6 +112,7 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* Jul 15, 2013 2107 bsteffen Fix sampling of grid vector arrows.
|
||||
* Aug 27, 2013 2287 randerso Added new parameters required by GriddedVectorDisplay
|
||||
* and GriddedIconDisplay
|
||||
* Sep 24, 2013 2404 bclement colormap params now created using match criteria
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -581,27 +580,13 @@ public abstract class AbstractGridResource<T extends AbstractResourceData>
|
|||
protected ColorMapParameters createColorMapParameters(GeneralGridData data)
|
||||
throws VizException {
|
||||
ParamLevelMatchCriteria criteria = getMatchCriteria();
|
||||
String parameter = null;
|
||||
Unit<?> parameterUnits = data.getDataUnit();
|
||||
SingleLevel level = null;
|
||||
String creatingEntity = null;
|
||||
if (criteria.getParameterNames() != null
|
||||
&& !criteria.getParameterNames().isEmpty()) {
|
||||
parameter = criteria.getParameterNames().get(0);
|
||||
ColorMapParameters newParameters;
|
||||
try {
|
||||
newParameters = ColorMapParameterFactory.build(data.getScalarData()
|
||||
.array(), data.getDataUnit(), criteria);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException("Unable to build colormap parameters", e);
|
||||
}
|
||||
if (criteria.getLevels() != null && !criteria.getLevels().isEmpty()) {
|
||||
Level styleLevel = criteria.getLevels().get(0);
|
||||
if (styleLevel instanceof SingleLevel) {
|
||||
level = (SingleLevel) styleLevel;
|
||||
}
|
||||
}
|
||||
if (criteria.getCreatingEntityNames() != null
|
||||
&& !criteria.getCreatingEntityNames().isEmpty()) {
|
||||
creatingEntity = criteria.getCreatingEntityNames().get(0);
|
||||
}
|
||||
ColorMapParameters newParameters = ColorMapParameterFactory.build(data
|
||||
.getScalarData().array(), parameter, parameterUnits, level,
|
||||
creatingEntity);
|
||||
ColorMapParameters oldParameters = this.getCapability(
|
||||
ColorMapCapability.class).getColorMapParameters();
|
||||
if (oldParameters != null
|
||||
|
|
|
@ -30,17 +30,15 @@ import org.geotools.coverage.grid.GeneralGridGeometry;
|
|||
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.dataplugin.grid.util.GridStyleUtil;
|
||||
import com.raytheon.uf.common.datastorage.records.FloatDataRecord;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.level.Level;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractResourceData;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.raytheon.viz.grid.GridLevelTranslator;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -53,6 +51,7 @@ import com.raytheon.viz.grid.GridLevelTranslator;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Mar 9, 2011 bsteffen Initial creation
|
||||
* Sep 24, 2013 2404 bclement match criteria built using GridStyleUtil
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -138,24 +137,7 @@ public class GridResource<T extends AbstractResourceData> extends
|
|||
if (record == null) {
|
||||
return null;
|
||||
}
|
||||
ParamLevelMatchCriteria matchCriteria = new ParamLevelMatchCriteria();
|
||||
matchCriteria.setParameterName(new ArrayList<String>());
|
||||
matchCriteria.setLevels(new ArrayList<Level>());
|
||||
matchCriteria.setCreatingEntityNames(new ArrayList<String>());
|
||||
String parameter = record.getParameter().getAbbreviation();
|
||||
SingleLevel level = GridLevelTranslator.constructMatching(record
|
||||
.getLevel());
|
||||
String creatingEntity = record.getDatasetId();
|
||||
if (!matchCriteria.getParameterNames().contains(parameter)) {
|
||||
matchCriteria.getParameterNames().add(parameter);
|
||||
}
|
||||
if (!matchCriteria.getLevels().contains(level)) {
|
||||
matchCriteria.getLevels().add(level);
|
||||
}
|
||||
if (!matchCriteria.getCreatingEntityNames().contains(creatingEntity)) {
|
||||
matchCriteria.getCreatingEntityNames().add(creatingEntity);
|
||||
}
|
||||
return matchCriteria;
|
||||
return GridStyleUtil.getMatchCriteria(record);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,8 +54,10 @@ import com.raytheon.uf.common.gridcoverage.lookup.GridCoverageLookup;
|
|||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.level.Level.LevelType;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
@ -65,7 +67,6 @@ import com.raytheon.uf.viz.derivparam.library.DerivParamMethod;
|
|||
import com.raytheon.uf.viz.derivparam.tree.AbstractRequestableNode;
|
||||
import com.raytheon.uf.viz.derivparam.tree.OrLevelNode;
|
||||
import com.raytheon.uf.viz.derivparam.tree.StaticDataLevelNode;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.grid.data.TopoRequestableData;
|
||||
import com.raytheon.viz.grid.inv.RadarRequestableLevelNode;
|
||||
import com.raytheon.viz.grid.inv.RadarUpdater;
|
||||
|
@ -384,8 +385,13 @@ public class RadarAdapter {
|
|||
throws VizException {
|
||||
SingleLevel level = new SingleLevel(LevelType.TILT);
|
||||
level.setValue(radar.getPrimaryElevationAngle());
|
||||
ColorMapParameters rval = ColorMapParameterFactory.build(null, radar
|
||||
.getProductCode().toString(), radar.getUnitObject(), level);
|
||||
ColorMapParameters rval;
|
||||
try {
|
||||
rval = ColorMapParameterFactory.build(null, radar.getProductCode()
|
||||
.toString(), radar.getUnitObject(), level);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
|
||||
rval.setColorMapMax(255);
|
||||
rval.setColorMapMin(0);
|
||||
|
|
|
@ -47,6 +47,5 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="3.8.0",
|
|||
com.raytheon.uf.common.wxmath,
|
||||
com.raytheon.uf.common.style;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.viz.core.contours.util,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.core.rsc,
|
||||
com.raytheon.viz.core.rsc.jts
|
||||
|
|
|
@ -49,6 +49,8 @@ import com.raytheon.uf.common.geospatial.MapUtil;
|
|||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
|
@ -71,7 +73,6 @@ import com.raytheon.uf.viz.core.rsc.capabilities.ImagingCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.hdf5.ImageTile;
|
||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.radar.VizRadarRecord;
|
||||
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
|
||||
import com.raytheon.viz.radar.util.DataUtilities;
|
||||
|
@ -226,8 +227,12 @@ public class RadarImageResource<D extends IDescriptor> extends
|
|||
int prodCode = record.getProductCode();
|
||||
Unit<?> dataUnit = record.getDataUnit();
|
||||
|
||||
params = ColorMapParameterFactory.build((Object) null, "" + prodCode,
|
||||
dataUnit, null, resourceData.mode);
|
||||
try {
|
||||
params = ColorMapParameterFactory.build((Object) null, ""
|
||||
+ prodCode, dataUnit, null, resourceData.mode);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
if (params.getDisplayUnit() == null) {
|
||||
params.setDisplayUnit(record.getUnitObject());
|
||||
}
|
||||
|
|
|
@ -48,9 +48,10 @@ import com.raytheon.uf.common.status.IUFStatusHandler;
|
|||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.image.ImagePreferences;
|
||||
import com.raytheon.uf.common.style.image.SamplePreferences;
|
||||
import com.raytheon.uf.common.style.level.Level;
|
||||
|
@ -68,7 +69,6 @@ import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
|||
import com.raytheon.uf.viz.core.rsc.capabilities.AbstractCapability;
|
||||
import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
|
||||
import com.raytheon.uf.viz.derivparam.library.DerivedParameterRequest;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.viz.satellite.SatelliteConstants;
|
||||
import com.raytheon.viz.satellite.tileset.SatDataRetriever;
|
||||
import com.raytheon.viz.satellite.tileset.SatTileSetRenderable;
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.Set;
|
|||
import java.util.regex.Pattern;
|
||||
|
||||
import com.raytheon.uf.common.comm.CommunicationException;
|
||||
import com.raytheon.uf.common.dataplugin.grid.util.GridLevelTranslator;
|
||||
import com.raytheon.uf.common.dataplugin.level.Level;
|
||||
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMapping;
|
||||
import com.raytheon.uf.common.dataplugin.level.mapping.LevelMappingFactory;
|
||||
|
@ -58,7 +59,6 @@ import com.raytheon.uf.viz.xy.timeseries.rsc.TimeSeriesResourceData.AxisParamete
|
|||
import com.raytheon.uf.viz.xy.varheight.rsc.VarHeightResourceData;
|
||||
import com.raytheon.viz.awipstools.ToolsDataManager;
|
||||
import com.raytheon.viz.core.graphing.util.GraphPrefsFactory;
|
||||
import com.raytheon.viz.grid.GridLevelTranslator;
|
||||
import com.raytheon.viz.grid.rsc.GridLoadProperties;
|
||||
import com.raytheon.viz.volumebrowser.vbui.VBMenuBarItemsMgr.ViewMenu;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
|
|
@ -31,3 +31,5 @@ Require-Bundle: com.raytheon.uf.common.dataplugin;bundle-version="1.12.1174",
|
|||
javax.measure,
|
||||
javax.persistence;bundle-version="1.0.0",
|
||||
org.hibernate;bundle-version="1.0.0"
|
||||
Import-Package: com.raytheon.uf.common.style,
|
||||
com.raytheon.uf.common.style.level
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.grid;
|
||||
package com.raytheon.uf.common.dataplugin.grid.util;
|
||||
|
||||
import javax.measure.converter.UnitConverter;
|
||||
import javax.measure.unit.NonSI;
|
|
@ -0,0 +1,75 @@
|
|||
/**
|
||||
* 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.
|
||||
**/
|
||||
package com.raytheon.uf.common.dataplugin.grid.util;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.raytheon.uf.common.dataplugin.grid.GridRecord;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.level.Level;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
|
||||
|
||||
/**
|
||||
* Styling utility for grid.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Jul 1, 2013 bclement Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bclement
|
||||
* @version 1.0
|
||||
*/
|
||||
public class GridStyleUtil {
|
||||
|
||||
/**
|
||||
* Create a style rule match criteria from grid metadata
|
||||
*
|
||||
* @param record
|
||||
* @return
|
||||
*/
|
||||
public static ParamLevelMatchCriteria getMatchCriteria(GridRecord record) {
|
||||
ParamLevelMatchCriteria matchCriteria = new ParamLevelMatchCriteria();
|
||||
matchCriteria.setParameterName(new ArrayList<String>());
|
||||
matchCriteria.setLevels(new ArrayList<Level>());
|
||||
matchCriteria.setCreatingEntityNames(new ArrayList<String>());
|
||||
String parameter = record.getParameter().getAbbreviation();
|
||||
SingleLevel level = GridLevelTranslator.constructMatching(record
|
||||
.getLevel());
|
||||
String creatingEntity = record.getDatasetId();
|
||||
if (!matchCriteria.getParameterNames().contains(parameter)) {
|
||||
matchCriteria.getParameterNames().add(parameter);
|
||||
}
|
||||
if (!matchCriteria.getLevels().contains(level)) {
|
||||
matchCriteria.getLevels().add(level);
|
||||
}
|
||||
if (!matchCriteria.getCreatingEntityNames().contains(creatingEntity)) {
|
||||
matchCriteria.getCreatingEntityNames().add(creatingEntity);
|
||||
}
|
||||
return matchCriteria;
|
||||
}
|
||||
|
||||
}
|
|
@ -17,3 +17,5 @@ Require-Bundle: com.raytheon.uf.common.colormap;bundle-version="1.12.1174",
|
|||
javax.measure;bundle-version="1.0.0",
|
||||
com.raytheon.uf.common.status;bundle-version="1.12.1174",
|
||||
com.raytheon.uf.common.localization;bundle-version="1.12.1174"
|
||||
Import-Package: com.raytheon.uf.common.util,
|
||||
org.apache.commons.lang
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.raytheon.uf.common.localization.IPathManager;
|
|||
import com.raytheon.uf.common.localization.LocalizationContext.LocalizationType;
|
||||
import com.raytheon.uf.common.localization.LocalizationFile;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.common.serialization.SerializationException;
|
||||
import com.raytheon.uf.common.serialization.SerializationUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
|
@ -43,6 +44,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
* Sep 24, 2007 njensen Initial creation
|
||||
* May 21, 2012 DR 14833 gzhang Adding a getter for StyleRuleset
|
||||
* Sep 06, 2013 2251 mnash Add ability to plug in new style types
|
||||
* Sep 24, 2013 2404 bclement changed to look in common for files
|
||||
* </pre>
|
||||
*
|
||||
* @author njensen
|
||||
|
@ -86,14 +88,11 @@ public class StyleManager {
|
|||
private void loadRules(IStyleType aType) {
|
||||
try {
|
||||
IPathManager pathMgr = PathManagerFactory.getPathManager();
|
||||
LocalizationFile[] files = pathMgr.listFiles(pathMgr
|
||||
.getLocalSearchHierarchy(LocalizationType.CAVE_STATIC),
|
||||
LocalizationFile[] commonFiles = pathMgr.listFiles(pathMgr
|
||||
.getLocalSearchHierarchy(LocalizationType.COMMON_STATIC),
|
||||
"styleRules", aType.getExtensions(), true, true);
|
||||
StyleRuleset rules = new StyleRuleset();
|
||||
for (LocalizationFile lf : files) {
|
||||
rules.addStyleRules(SerializationUtil.jaxbUnmarshalFromXmlFile(
|
||||
StyleRuleset.class, lf.getFile().getPath()));
|
||||
}
|
||||
addRules(commonFiles, rules);
|
||||
this.rules.put(aType, rules);
|
||||
} catch (Exception e) {
|
||||
statusHandler.handle(Priority.PROBLEM, "Error loading style rules",
|
||||
|
@ -101,6 +100,25 @@ public class StyleManager {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Add style rules from jaxb files to rule set
|
||||
*
|
||||
* @param files
|
||||
* @param rules
|
||||
* @throws SerializationException
|
||||
*/
|
||||
private void addRules(LocalizationFile[] files, StyleRuleset rules)
|
||||
throws SerializationException {
|
||||
if (files == null) {
|
||||
return;
|
||||
}
|
||||
for (LocalizationFile lf : files) {
|
||||
rules.addStyleRules((StyleRuleset) SerializationUtil
|
||||
.jaxbUnmarshalFromXmlFile(StyleRuleset.class, lf.getFile()
|
||||
.getPath()));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the best matching style rule for a particular match criteria
|
||||
*
|
||||
|
|
|
@ -17,9 +17,8 @@
|
|||
* See the AWIPS II Master Rights File ("Master Rights File.pdf") for
|
||||
* further licensing information.
|
||||
**/
|
||||
package com.raytheon.viz.core.drawables;
|
||||
package com.raytheon.uf.common.style.image;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -29,27 +28,20 @@ import javax.measure.unit.Unit;
|
|||
import org.apache.commons.lang.ArrayUtils;
|
||||
|
||||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.Request;
|
||||
import com.raytheon.uf.common.datastorage.records.IDataRecord;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.LabelingPreferences;
|
||||
import com.raytheon.uf.common.style.ParamLevelMatchCriteria;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.StyleManager;
|
||||
import com.raytheon.uf.common.style.StyleRule;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.DataScale;
|
||||
import com.raytheon.uf.common.style.image.DataScale.Type;
|
||||
import com.raytheon.uf.common.style.image.ImagePreferences;
|
||||
import com.raytheon.uf.common.style.level.Level;
|
||||
import com.raytheon.uf.common.style.level.RangeLevel;
|
||||
import com.raytheon.uf.common.style.level.SingleLevel;
|
||||
import com.raytheon.uf.common.util.GridUtil;
|
||||
import com.raytheon.uf.viz.core.datastructure.DataCubeContainer;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
|
||||
|
||||
/**
|
||||
* ColorMapParameterFactory
|
||||
|
@ -64,6 +56,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
* Mar 26, 2009 2086 jsanchez Added a entityList to the match criteria.
|
||||
* Feb 15, 2013 1638 mschenke Moved GRID_FILL_VALUE from edex.common Util into GridUtil
|
||||
* Jun 24, 2013 2122 mschenke Added method for constructing {@link ColorMapParameters} from {@link StyleRule}
|
||||
* Sep 24, 2013 2404 bclement moved to common.style from viz.core, added build method that takes ParamLevelMatchCriteria, removed unused methods
|
||||
* </pre>
|
||||
*
|
||||
* @author chammack
|
||||
|
@ -79,7 +72,7 @@ public class ColorMapParameterFactory {
|
|||
|
||||
public static ColorMapParameters build(Object data, String parameter,
|
||||
Unit<?> parameterUnits, SingleLevel level, String entity)
|
||||
throws VizException {
|
||||
throws StyleException {
|
||||
|
||||
// StyleRule sr = StyleLoader.getInstance()
|
||||
// .getStyleRule(parameter, levels);
|
||||
|
@ -93,17 +86,36 @@ public class ColorMapParameterFactory {
|
|||
entityList.add(entity);
|
||||
match.setCreatingEntityNames(entityList);
|
||||
}
|
||||
StyleRule sr;
|
||||
try {
|
||||
sr = StyleManager.getInstance().getStyleRule(
|
||||
StyleManager.StyleType.IMAGERY, match);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
StyleRule sr = StyleManager.getInstance().getStyleRule(
|
||||
StyleManager.StyleType.IMAGERY, match);
|
||||
|
||||
return build(sr, data, level, parameterUnits);
|
||||
}
|
||||
|
||||
/**
|
||||
* Find style rules for match and construct colormap parameters for data
|
||||
*
|
||||
* @param data
|
||||
* primitive number array
|
||||
* @param parameterUnits
|
||||
* @param match
|
||||
* @return
|
||||
* @throws StyleException
|
||||
*/
|
||||
public static ColorMapParameters build(Object data, Unit<?> parameterUnits,
|
||||
ParamLevelMatchCriteria match) throws StyleException {
|
||||
StyleRule sr = StyleManager.getInstance().getStyleRule(
|
||||
StyleManager.StyleType.IMAGERY, match);
|
||||
SingleLevel level = null;
|
||||
if (match.getLevels() != null && !match.getLevels().isEmpty()) {
|
||||
Level styleLevel = match.getLevels().get(0);
|
||||
if (styleLevel instanceof SingleLevel) {
|
||||
level = (SingleLevel) styleLevel;
|
||||
}
|
||||
}
|
||||
return build(sr, data, level, parameterUnits);
|
||||
}
|
||||
|
||||
public static ColorMapParameters build(StyleRule sr, Object data,
|
||||
SingleLevel level, Unit<?> parameterUnits) {
|
||||
|
||||
|
@ -359,69 +371,10 @@ public class ColorMapParameterFactory {
|
|||
}
|
||||
|
||||
public static ColorMapParameters build(Object data, String parameter,
|
||||
Unit<?> parameterUnits, SingleLevel level) throws VizException {
|
||||
Unit<?> parameterUnits, SingleLevel level) throws StyleException {
|
||||
return build(data, parameter, parameterUnits, level, null);
|
||||
}
|
||||
|
||||
public static ColorMapParameters build(File file, String dataURI,
|
||||
String parameter, Unit<?> parameterUnits, SingleLevel level,
|
||||
String entity) throws VizException {
|
||||
ColorMapParameters params = null;
|
||||
if (file != null) {
|
||||
IDataRecord rec = null;
|
||||
try {
|
||||
IDataStore ds = DataStoreFactory.getDataStore(file);
|
||||
rec = ds.retrieve("", dataURI, Request.ALL);
|
||||
} catch (Exception e) {
|
||||
throw new VizException("Unable to read file (File: " + file
|
||||
+ ") (DataSet: " + dataURI + ")", e);
|
||||
}
|
||||
|
||||
if (rec != null) {
|
||||
Object data = rec.getDataObject();
|
||||
params = build(data, parameter, parameterUnits, level, entity);
|
||||
}
|
||||
} else {
|
||||
params = build(null, parameter, parameterUnits, level, entity);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
public static ColorMapParameters build(File file, String dataURI,
|
||||
String parameter, Unit<?> parameterUnits, SingleLevel level)
|
||||
throws VizException {
|
||||
return build(file, dataURI, parameter, parameterUnits, level, null);
|
||||
}
|
||||
|
||||
public static ColorMapParameters build(PluginDataObject record,
|
||||
String parameter, Unit<?> parameterUnits, SingleLevel level,
|
||||
String entity) throws VizException {
|
||||
ColorMapParameters params = null;
|
||||
if (record != null) {
|
||||
IDataRecord rec = null;
|
||||
IDataRecord[] records = DataCubeContainer.getDataRecord(record);
|
||||
if (records != null && records.length > 0) {
|
||||
rec = records[0];
|
||||
}
|
||||
if (rec != null) {
|
||||
Object data = rec.getDataObject();
|
||||
params = build(data, parameter, parameterUnits, level, entity);
|
||||
}
|
||||
} else {
|
||||
params = build((Object) null, parameter, parameterUnits, level,
|
||||
entity);
|
||||
}
|
||||
|
||||
return params;
|
||||
}
|
||||
|
||||
public static ColorMapParameters build(PluginDataObject record,
|
||||
String parameter, Unit<?> parameterUnits, SingleLevel level)
|
||||
throws VizException {
|
||||
return build(record, parameter, parameterUnits, level, null);
|
||||
}
|
||||
|
||||
private static void extractLabelValues(StyleRule sr, float max, float min,
|
||||
ColorMapParameters parameters) {
|
||||
if (sr != null) {
|
|
@ -34,7 +34,6 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.viz.awipstools.capabilities,
|
||||
com.raytheon.viz.awipstools.capabilityInterfaces,
|
||||
com.raytheon.viz.awipstools.common,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.radar,
|
||||
com.raytheon.viz.ui.editor,
|
||||
gov.noaa.nws.ncep.viz.common.ui,
|
||||
|
|
|
@ -40,7 +40,6 @@ Import-Package: com.raytheon.uf.common.dataplugin,
|
|||
com.raytheon.viz.awipstools.capabilities,
|
||||
com.raytheon.viz.awipstools.capabilityInterfaces,
|
||||
com.raytheon.viz.awipstools.common,
|
||||
com.raytheon.viz.core.drawables,
|
||||
com.raytheon.viz.pointdata,
|
||||
com.raytheon.viz.pointdata.util,
|
||||
com.raytheon.viz.radar,
|
||||
|
|
|
@ -11,12 +11,9 @@ package gov.noaa.nws.ncep.viz.rsc.ncradar.rsc;
|
|||
import gov.noaa.nws.ncep.viz.common.ColorMapUtil;
|
||||
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarResource;
|
||||
import gov.noaa.nws.ncep.viz.resources.colorBar.ColorBarResourceData;
|
||||
import com.raytheon.viz.radar.DefaultVizRadarRecord;
|
||||
import com.raytheon.viz.radar.VizRadarRecord;
|
||||
import gov.noaa.nws.ncep.viz.ui.display.ColorBarFromColormap;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.IOException;
|
||||
import java.nio.ByteBuffer;
|
||||
|
@ -47,21 +44,20 @@ import com.raytheon.uf.common.colormap.image.ColorMapData;
|
|||
import com.raytheon.uf.common.colormap.prefs.ColorMapParameters;
|
||||
import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences;
|
||||
import com.raytheon.uf.common.colormap.prefs.DataMappingPreferences.DataMappingEntry;
|
||||
import com.raytheon.uf.common.dataplugin.PluginDataObject;
|
||||
import com.raytheon.uf.common.dataplugin.radar.RadarRecord;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarDataRetriever;
|
||||
import com.raytheon.uf.common.dataplugin.radar.util.RadarUtil;
|
||||
import com.raytheon.uf.common.datastorage.DataStoreFactory;
|
||||
import com.raytheon.uf.common.datastorage.IDataStore;
|
||||
import com.raytheon.uf.common.datastorage.StorageException;
|
||||
import com.raytheon.uf.common.geospatial.MapUtil;
|
||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
||||
import com.raytheon.uf.common.status.UFStatus;
|
||||
import com.raytheon.uf.common.status.UFStatus.Priority;
|
||||
import com.raytheon.uf.common.style.StyleException;
|
||||
import com.raytheon.uf.common.style.image.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.image.ImagePreferences;
|
||||
import com.raytheon.uf.common.style.image.SamplePreferences;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.units.PiecewisePixel;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.HDF5Util;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IMesh;
|
||||
import com.raytheon.uf.viz.core.IMeshCallback;
|
||||
|
@ -83,10 +79,7 @@ import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
|||
import com.raytheon.uf.viz.core.rsc.hdf5.ImageTile;
|
||||
import com.raytheon.viz.awipstools.capabilities.RangeRingsOverlayCapability;
|
||||
import com.raytheon.viz.awipstools.capabilityInterfaces.IRangeableResource;
|
||||
import com.raytheon.viz.core.drawables.ColorMapParameterFactory;
|
||||
import com.raytheon.uf.common.style.image.ImagePreferences;
|
||||
import com.raytheon.uf.common.style.image.SamplePreferences;
|
||||
import com.raytheon.viz.radar.interrogators.IRadarInterrogator;
|
||||
import com.raytheon.viz.radar.VizRadarRecord;
|
||||
import com.raytheon.viz.radar.util.DataUtilities;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
|
@ -411,8 +404,13 @@ public abstract class RadarImageResource<D extends IDescriptor> extends
|
|||
int prodCode = record.getProductCode();
|
||||
Unit<?> dataUnit = DataUtilities.getDataUnit(record);
|
||||
|
||||
params = ColorMapParameterFactory.build((Object) null, "" + prodCode,
|
||||
dataUnit, null, ((RadarResourceData)resourceData).mode);
|
||||
try {
|
||||
params = ColorMapParameterFactory.build((Object) null, ""
|
||||
+ prodCode, dataUnit, null,
|
||||
((RadarResourceData) resourceData).mode);
|
||||
} catch (StyleException e) {
|
||||
throw new VizException(e.getLocalizedMessage(), e);
|
||||
}
|
||||
if (params.getDisplayUnit() == null) {
|
||||
params.setDisplayUnit(record.getUnitObject());
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue