getFillAttributes(WxValue wxValue) {
if (wxValue instanceof WeatherWxValue) {
@@ -275,7 +272,6 @@ public class DiscreteDisplayUtil {
ColorMapParameters params = resource.getCapability(
ColorMapCapability.class).getColorMapParameters();
IColorMap colorMap = params.getColorMap();
-
colorTable = new DiscreteColorTable(parm, colorMap);
discreteColorTable.put(compName, colorTable);
}
diff --git a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java
index 567e632959..bbcdf39f48 100644
--- a/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java
+++ b/cave/com.raytheon.viz.gfe/src/com/raytheon/viz/gfe/rsc/colorbar/DiscreteColorbar.java
@@ -1,26 +1,26 @@
/**
* 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.
**/
/**
- * This package is associated with the classes that describe the Color bar at the
- * top of the Spatial Editor window.
+ * This package is associated with the classes that describe the Color bar at the
+ * top of the Spatial Editor window.
*/
package com.raytheon.viz.gfe.rsc.colorbar;
@@ -53,13 +53,20 @@ import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.RGBColors;
+import com.raytheon.uf.viz.core.drawables.ColorMapParameters;
import com.raytheon.uf.viz.core.drawables.FillPatterns;
+import com.raytheon.uf.viz.core.drawables.IColorMapParametersListener;
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.IMapDescriptor;
+import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
+import com.raytheon.uf.viz.core.rsc.capabilities.ColorMapCapability;
import com.raytheon.viz.gfe.Activator;
import com.raytheon.viz.gfe.colortable.ColorEntry;
import com.raytheon.viz.gfe.colortable.ColorTable.ImageAttr;
+import com.raytheon.viz.gfe.core.DataManager;
+import com.raytheon.viz.gfe.core.ISpatialDisplayManager;
import com.raytheon.viz.gfe.core.griddata.DiscreteGridData;
import com.raytheon.viz.gfe.core.griddata.IGridData;
import com.raytheon.viz.gfe.core.griddata.WeatherGridData;
@@ -75,7 +82,7 @@ import com.vividsolutions.jts.geom.Coordinate;
/**
* Implements a colorbar for continuous (scalar and vector) elements
- *
+ *
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
@@ -84,14 +91,16 @@ import com.vividsolutions.jts.geom.Coordinate;
* Aug 20, 2008 dglazesk Updated for the new ColorMap interface
* Aug 20, 2012 1079 randerso Changed to display all discrete values for
* non-overlapping discretes
- *
+ * Jan 9, 2013 15661 ryu Set font for drawing regular Wx/discrete parm labels.
+ * Jan 10, 2013 15548 ryu Update colorbar when new discrete colormap is selected
+ *
*
- *
+ *
* @author chammack
* @version 1.0
*/
public class DiscreteColorbar implements IColorBarDisplay,
- IGridDataChangedListener {
+ IGridDataChangedListener, IColorMapParametersListener {
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(DiscreteColorbar.class);
@@ -126,9 +135,11 @@ public class DiscreteColorbar implements IColorBarDisplay,
private boolean lastIscMode;
+ private ColorMapParameters cmParams;
+
/**
* Constructor for the Discrete Color Bar
- *
+ *
* @param parm
* The parm
* @param colorbarResource
@@ -143,16 +154,31 @@ public class DiscreteColorbar implements IColorBarDisplay,
this.lastIscMode = parm.getDataManager().getParmManager().iscMode();
parm.getListeners().addGridChangedListener(this);
+ cmParams = getColorMapParameters();
+ cmParams.addListener(this);
+ }
+
+ private ColorMapParameters getColorMapParameters() {
+ DataManager dataManager = parm.getDataManager();
+ ISpatialDisplayManager spatialDisplayManager = dataManager
+ .getSpatialDisplayManager();
+ ResourcePair resourcePair = spatialDisplayManager
+ .getResourcePair(parm);
+ AbstractVizResource, ?> resource = resourcePair.getResource();
+ ColorMapParameters params = resource.getCapability(
+ ColorMapCapability.class).getColorMapParameters();
+ return params;
}
/*
* (non-Javadoc)
- *
+ *
* @see com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#dispose()
*/
@Override
public void dispose() {
parm.getListeners().removeGridChangedListener(this);
+ cmParams.removeListener(this);
}
@Override
@@ -160,9 +186,14 @@ public class DiscreteColorbar implements IColorBarDisplay,
lastTime = null;
}
+ @Override
+ public void colorMapChanged() {
+ lastTime = null;
+ }
+
/**
* Gets the Discrete Color map.
- *
+ *
* @return Returns the color map used for the discrete data.
*/
public static ColorMap getFallbackColorMap() {
@@ -171,7 +202,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
/*
* (non-Javadoc)
- *
+ *
* @see
* com.raytheon.viz.core.drawables.IRenderable#paint(com.raytheon.viz.core
* .IGraphicsTarget, com.raytheon.viz.core.drawables.PaintProperties)
@@ -396,7 +427,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
* Labels that do not fit their designated band on the bar will be
* truncated. Pickup value text will always be displayed in full, so any
* text it overlaps will not be drawn.
- *
+ *
* @param target
* The graphics target on which to draw
* @param colorTable
@@ -517,6 +548,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
true);
dstring.setText(truncatedLabel, seColorBarTextColor);
dstring.setCoordinates(labelLoc, center);
+ dstring.font = colorbarResource.getColorbarWxLabelFont();
target.drawStrings(dstring);
}
}
@@ -526,7 +558,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
/**
* Draws the colorbar once colors and patterns have been decided.
- *
+ *
* @param target
* The graphics target on which to draw.
* @param pixelExtent
@@ -626,7 +658,7 @@ public class DiscreteColorbar implements IColorBarDisplay,
/*
* (non-Javadoc)
- *
+ *
* @see
* com.raytheon.viz.gfe.rsc.colorbar.IColorBarDisplay#getValueAt(double[],
* int)
diff --git a/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml b/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml
index 0c51ac0cf1..5a71b3e87d 100644
--- a/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml
+++ b/cave/com.raytheon.viz.hydro/localization/bundles/hydro/zeroToThreeHourRadarQPF.xml
@@ -35,7 +35,7 @@
-
+
diff --git a/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml b/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml
index 9665c2e9b6..5f6935893b 100644
--- a/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml
+++ b/cave/com.raytheon.viz.hydro/localization/menus/hydro/baseHPCStation.xml
@@ -37,26 +37,32 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java
index f84e2505e8..d1f9825d8f 100644
--- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java
+++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/TimeSeriesDisplayCanvas.java
@@ -132,7 +132,8 @@ import com.raytheon.viz.hydrocommon.util.DbUtils;
* to display stage value, also added checking for rating curve for both
* stage and discharge.
* 13 Nov 2012 15416 lbousaidi added a check when the colorname is null and a call to
- * getGroupModeColor
+ * getGroupModeColor
+ * 09 Jan 2012 15493 lbousaidi added code to delete data while zooming when you draw a box
* @author lvenable
* @version 1.0
*
@@ -1714,7 +1715,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
}
}
}
- } else if (dialog.isDelete()) {
+ } else if ( traceSelected && dialog.isDelete()) {
if (mouseDown) {
int deleteX1 = selectedX;
int deleteY1 = selectedY;
@@ -2111,8 +2112,13 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
getAgain = false;
} else if (traceSelected && dialog.isDelete() && (deleteRect != null)) {
TraceData td = graphData.getTraces().get(selectedTraceId);
+ TimeSeriesPoint[] pointArray= null;
+ if (!zoomed ){
+ pointArray = td.getTsData();
+ } else {
+ pointArray = td.getZoomedTsData();
+ }
- TimeSeriesPoint[] pointArray = td.getTsData();
for (int i = 0; i < pointArray.length; i++) {
if (deleteRect.contains(pointArray[i].getPixelX(),
pointArray[i].getPixelY())) {
@@ -2345,6 +2351,7 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
int[] dataPts = new int[pointArray.length * 2];
ArrayList dataPtList = new ArrayList();
int dataIndex = 0;
+ int zoomDataIndex=0;
ArrayList al = new ArrayList();
for (int i = 0; i < pointArray.length; i++) {
if (pointArray[i].getY() != HydroConstants.MISSING_VALUE) {
@@ -2378,11 +2385,15 @@ public class TimeSeriesDisplayCanvas extends TimeSeriesGraphCanvas implements
al.add(GRAPHBORDER_LEFT
+ x2pixel(graphData, pointArray[i].getX()
.getTime()));
+ pointArray[i].setPixelX(al.get(zoomDataIndex));
+ zoomDataIndex++;
al.add(GRAPHBORDER
* 2
+ graphAreaHeight
- (lowerAxis - y2pixel(graphData,
pointArray[i].getY())));
+ pointArray[i].setPixely(al.get(zoomDataIndex));
+ zoomDataIndex++;
}
int[] pts = new int[al.size()];
for (int j = 0; j < al.size(); j++) {
diff --git a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java
index 00829426fd..61730984e3 100644
--- a/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java
+++ b/cave/com.raytheon.viz.hydro/src/com/raytheon/viz/hydro/timeseries/util/StageDischargeUtils.java
@@ -38,6 +38,7 @@ import com.raytheon.viz.hydrocommon.HydroConstants;
* Jul 7, 2008 1194 mpduff Initial creation
* May 11,2011 9281 lbousaid nothing get display in right y-axis when
* there is no rating curve
+ * Jan 03,2013 15652 wkwock Fix stage to discharge
*
*
*
@@ -52,8 +53,10 @@ public class StageDischargeUtils {
private static String RATING_QUERY = "select lid,stage,discharge from rating where lid=':lid' order by stage asc";
- private static String RATING_SHIFT_QUERY = "select lid,date,shift_amount from ratingshift where lid = ':lid' and active='T' order by date asc";
-
+ private static String RATING_SHIFT_QUERY = "select lid,date,shift_amount from ratingshift where lid = ':lid' and active='T' order by date desc";
+
+ private static boolean needToFindShiftAmount = false;
+
/**
* Returns the corresponding stage value for the discharge value passed in.
*
@@ -78,7 +81,8 @@ public class StageDischargeUtils {
try {
if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) {
ratingData = queryRatingData(lid);
- /* Check the Rating object for data and return true if data are available*/
+ needToFindShiftAmount = true;
+ /* Check the Rating object for data and return true if data are available*/
if (ratingData.getStage().size() > 2) {
retVal = true;
}
@@ -88,7 +92,8 @@ public class StageDischargeUtils {
}
} else {
if (ratingData.getLid().equalsIgnoreCase(lid)) {
- ratingData = queryRatingData(lid);
+ ratingData = queryRatingData(lid);
+ needToFindShiftAmount = true;
if (ratingData.getStage().size() > 2) {
retVal = true;
} else {
@@ -125,7 +130,6 @@ public class StageDischargeUtils {
}
double discharge = HydroConstants.MISSING_VALUE;
- boolean needToFindShiftAmount = false;
/*
* If the lid passed in is NOT the same as the previous lid
@@ -133,11 +137,11 @@ public class StageDischargeUtils {
*/
if (!lid.equals(previousLid)) {
previousLid = lid;
- needToFindShiftAmount = true;
try {
if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) {
- ratingData = queryRatingData(lid);
+ needToFindShiftAmount = true;
+ ratingData = queryRatingData(lid);
}
} catch (VizException e) {
// TODO Auto-generated catch block
@@ -188,7 +192,8 @@ public class StageDischargeUtils {
stageRatingCurve.set(i, d);
}
ratingData.setStage(stageRatingCurve);
- }
+ needToFindShiftAmount = false;
+ }
}
ArrayList dischargeList = ratingData.getDischarge();
@@ -291,6 +296,7 @@ public class StageDischargeUtils {
try {
if ((ratingData == null) || !ratingData.getLid().equalsIgnoreCase(lid)) {
ratingData = queryRatingData(lid);
+ needToFindShiftAmount = true;
}
} catch (VizException e) {
// TODO Auto-generated catch block
@@ -422,10 +428,12 @@ public class StageDischargeUtils {
List