Omaha #3242 clean up more graphs

Change-Id: I2440877381afc684cb2a3b02cbdbe36905643de4

Former-commit-id: aca7b46243 [formerly aca7b46243 [formerly 667817cf9473889f8c5cc39dd71814f1181a3805]]
Former-commit-id: 7bb2aebd59
Former-commit-id: 33f36374d0
This commit is contained in:
Nate Jensen 2014-06-18 18:23:36 -05:00
parent c02a5a88eb
commit a1467e4361
14 changed files with 82 additions and 189 deletions

View file

@ -1,8 +0,0 @@
#Tue Oct 19 10:38:18 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -4,7 +4,7 @@ Bundle-Name: Timeheight
Bundle-SymbolicName: com.raytheon.uf.viz.xy.timeheight;singleton:=true
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Require-Bundle: com.raytheon.uf.common.colormap,
com.raytheon.uf.common.dataplugin,

View file

@ -45,14 +45,15 @@ import com.vividsolutions.jts.geom.Coordinate;
/**
*
* TODO Add Description
* The background graph for a time height display
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 3, 2010 bsteffen Initial creation
* Jul 03, 2010 bsteffen Initial creation
* Jun 18, 2014 3242 njensen Null safety checks
*
* </pre>
*
@ -134,11 +135,14 @@ public class TimeHeightGraph extends AbstractGraph {
*/
@Override
protected void createAxes() {
if (yAxisPlacer != null && xAxisPlacer != null) {
yAxisPlacer.setPixelWidth(graphExtent.getWidth());
createHeightAxis(((TimeHeightDescriptor) descriptor).getHeightScale(),
createHeightAxis(
((TimeHeightDescriptor) descriptor).getHeightScale(),
zoomLevel);
}
}
@Override
public void paint(IGraphicsTarget target, PaintProperties paintProps)

View file

@ -42,6 +42,7 @@ import com.raytheon.uf.common.style.StyleException;
import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
@ -59,7 +60,6 @@ import com.raytheon.uf.viz.xy.graph.labeling.DoubleLabel;
import com.raytheon.uf.viz.xy.graph.labeling.IGraphLabel;
import com.raytheon.uf.viz.xy.map.rsc.IGraphableResource;
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
import com.raytheon.uf.viz.xy.map.rsc.PointRenderable;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor;
import com.raytheon.uf.viz.xy.timeheight.display.TimeHeightDescriptor.TimeDirection;
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
@ -69,6 +69,7 @@ import com.raytheon.viz.core.map.GeoUtil;
import com.raytheon.viz.core.rsc.ICombinedResourceData;
import com.raytheon.viz.core.rsc.ICombinedResourceData.CombineOperation;
import com.raytheon.viz.core.slice.request.HeightScale;
import com.vividsolutions.jts.geom.Coordinate;
import com.vividsolutions.jts.geom.Geometry;
/**
@ -84,6 +85,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Feb 20, 2009 njensen Refactored to new rsc architecture
* Feb 14, 2011 8244 bkowal enabled magnification capability to
* adjust magnification of x-axis.
* Jun 18, 2014 3242 njensen Replaced deprecated calls
*
*
* </pre>
@ -100,8 +102,6 @@ public abstract class AbstractTimeHeightResource extends
protected static final float DEFAULT_INTERPOLATION = 1.0f;
protected PointRenderable point = null;
protected AbstractVarHeightAdapter<?> adapter;
protected AbstractStylePreferences prefs;
@ -306,13 +306,12 @@ public abstract class AbstractTimeHeightResource extends
PaintProperties paintProps, MapDescriptor insetMapDescriptor)
throws VizException {
// paint a point
if (point == null) {
point = new PointRenderable(resourceData.getPoint(), getCapability(
ColorableCapability.class).getColor(), insetMapDescriptor);
} else {
point.setColor(getCapability(ColorableCapability.class).getColor());
}
point.paint(target, paintProps);
Coordinate point = resourceData.getPoint();
double[] pixels = insetMapDescriptor.worldToPixel(new double[] {
point.x, point.y });
target.drawPoint(pixels[0], pixels[1], 0.0,
getCapability(ColorableCapability.class).getColor(),
PointStyle.STAR);
}
public String getUnitString() {

View file

@ -53,6 +53,7 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.PixelExtent;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
@ -72,7 +73,6 @@ import com.raytheon.uf.viz.xy.graph.labeling.DoubleLabel;
import com.raytheon.uf.viz.xy.graph.labeling.IGraphLabel;
import com.raytheon.uf.viz.xy.map.rsc.IGraphableResource;
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
import com.raytheon.uf.viz.xy.map.rsc.PointRenderable;
import com.raytheon.uf.viz.xy.timeseries.adapter.AbstractTimeSeriesAdapter;
import com.raytheon.uf.viz.xy.timeseries.display.TimeSeriesDescriptor;
import com.raytheon.viz.core.graphing.util.GraphPrefsFactory;
@ -115,9 +115,6 @@ public class TimeSeriesResource extends
private final SimpleDateFormat timeSampleFormat = new SimpleDateFormat(
"HH:mm'Z' EEE");
/** Inset map point */
protected PointRenderable point = null;
/** The graph preferences */
protected GraphPreferences prefs;
@ -625,14 +622,12 @@ public class TimeSeriesResource extends
PaintProperties paintProps, MapDescriptor insetMapDescriptor)
throws VizException {
// paint a point
if (point == null) {
point = new PointRenderable(resourceData.getCoordinate(),
Coordinate point = resourceData.getCoordinate();
double[] pixels = insetMapDescriptor.worldToPixel(new double[] {
point.x, point.y });
target.drawPoint(pixels[0], pixels[1], 0.0,
getCapability(ColorableCapability.class).getColor(),
insetMapDescriptor);
} else {
point.setColor(getCapability(ColorableCapability.class).getColor());
}
point.paint(target, paintProps);
PointStyle.STAR);
}
public String[] getTitles() {

View file

@ -189,16 +189,4 @@ public class TimeSeriesZoomHandler extends AbstractGraphInputHandler {
return grid;
}
/**
* Checks whether or not the coordinate is in the extent of a graph
*
* @param graph
* @param coord
* @return
*/
private boolean graphContainsCoordinate(IGraph graph, Coordinate coord) {
return (graph != null && graph.getExtent() != null && graph.getExtent()
.contains(new double[] { coord.x, coord.y }));
}
}

View file

@ -1,7 +0,0 @@
#Mon Jun 28 10:56:58 CDT 2010
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
org.eclipse.jdt.core.compiler.compliance=1.6
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.source=1.6

View file

@ -2,9 +2,9 @@ Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Varheight Plug-in
Bundle-SymbolicName: com.raytheon.uf.viz.xy.varheight;singleton:=true
Bundle-Version: 1.13.0.qualifier
Bundle-Version: 1.14.0.qualifier
Bundle-Vendor: RAYTHEON
Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Bundle-ActivationPolicy: lazy
Require-Bundle: com.raytheon.uf.common.dataplugin,
com.raytheon.uf.common.geospatial,
@ -17,9 +17,7 @@ Require-Bundle: com.raytheon.uf.common.dataplugin,
com.raytheon.viz.core.graphing,
com.raytheon.viz.ui,
javax.measure,
org.eclipse.core.runtime,
org.eclipse.ui,
org.geotools
org.eclipse.core.runtime
Import-Package: com.raytheon.viz.core.map,
com.raytheon.viz.core.rsc
Export-Package: com.raytheon.uf.viz.xy.varheight,

View file

@ -32,9 +32,7 @@ import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.rsc.LoadProperties;
import com.raytheon.uf.viz.core.rsc.ResourceList;
import com.raytheon.uf.viz.core.rsc.ResourceProperties;
import com.raytheon.uf.viz.core.status.StatusConstants;
import com.raytheon.uf.viz.d2d.ui.AbstractHeightDisplay;
import com.raytheon.uf.viz.d2d.ui.Activator;
import com.raytheon.uf.viz.xy.map.rsc.GraphResource;
import com.raytheon.uf.viz.xy.map.rsc.GraphResourceData;
import com.raytheon.uf.viz.xy.map.rsc.GraphResourceData.OverlayMode;
@ -42,7 +40,7 @@ import com.raytheon.viz.core.slice.request.HeightScale;
import com.raytheon.viz.core.slice.request.HeightScales;
/**
* TODO Add Description
* Renderable display for var height
*
* <pre>
*
@ -50,6 +48,7 @@ import com.raytheon.viz.core.slice.request.HeightScales;
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jun 28, 2010 bsteffen Initial creation
* Jun 18, 2014 3242 njensen Removed unused imports
*
* </pre>
*
@ -60,7 +59,8 @@ import com.raytheon.viz.core.slice.request.HeightScales;
@XmlAccessorType(XmlAccessType.NONE)
@XmlRootElement
public class VarHeightRenderableDisplay extends AbstractHeightDisplay {
private static final transient IUFStatusHandler statusHandler = UFStatus.getHandler(VarHeightRenderableDisplay.class);
private static final transient IUFStatusHandler statusHandler = UFStatus
.getHandler(VarHeightRenderableDisplay.class);
public VarHeightRenderableDisplay() {
this(new PixelExtent(0, 1000, 0, 1000));

View file

@ -55,16 +55,17 @@ import com.vividsolutions.jts.geom.Coordinate;
/**
*
* TODO Add Description
* The background graph for a var height display
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Jul 3, 2010 bsteffen Initial creation
* Jul 03, 2010 bsteffen Initial creation
* Feb 10, 2011 8244 bkowal replaced deprecrated method calls;
* magnitude influences axis label font.
* Jun 18, 2014 3242 njensen Replaced deprecated calls
*
* </pre>
*
@ -248,7 +249,7 @@ public class VarHeightGraph extends AbstractGraph {
}
DrawableString parameters = new DrawableString("", rcsColor);
parameters.font = unitsFont;
parameters.textStyle = TextStyle.DROP_SHADOW;
parameters.addTextStyle(TextStyle.DROP_SHADOW);
parameters.horizontalAlignment = HorizontalAlignment.CENTER;
parameters.verticallAlignment = VerticalAlignment.TOP;
parameters.magnification = this.currentMagnification;

View file

@ -37,6 +37,7 @@ import com.raytheon.uf.common.time.DataTime;
import com.raytheon.uf.viz.core.DrawableLine;
import com.raytheon.uf.viz.core.IExtent;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.IGraphicsTarget.PointStyle;
import com.raytheon.uf.viz.core.PixelCoverage;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
@ -54,7 +55,6 @@ import com.raytheon.uf.viz.xy.hodo.HodographDescriptor;
import com.raytheon.uf.viz.xy.hodo.IHodographResource;
import com.raytheon.uf.viz.xy.map.rsc.IGraphableResource;
import com.raytheon.uf.viz.xy.map.rsc.IInsetMapResource;
import com.raytheon.uf.viz.xy.map.rsc.PointRenderable;
import com.raytheon.uf.viz.xy.varheight.adapter.AbstractVarHeightAdapter;
import com.raytheon.uf.viz.xy.varheight.display.VarHeightDescriptor;
import com.raytheon.viz.core.contours.util.VectorGraphicsConfig;
@ -82,6 +82,7 @@ import com.vividsolutions.jts.geom.Geometry;
* Feb 10, 2011 8344 bkowal enabled the magnification capability.
* Sep 23, 2013 2363 bsteffen Add more vector configuration options.
* Dec 19, 2013 DR 16795 D. Friedman Transform pixel coordinate in inspect
* Jun 18, 2014 3242 njensen Replaced deprecated calls
*
* </pre>
*
@ -104,8 +105,6 @@ public class VarHeightResource extends
protected int displayedIndex = 0;
protected PointRenderable pointR = null;
protected VarHeightResource secondaryResource;
protected CombineOperation combineOperation;
@ -338,7 +337,6 @@ public class VarHeightResource extends
double screenX = screenLoc[0];
double screenY = screenLoc[1];
IExtent graphExtent = descriptor.getGraph(this).getExtent();
if (d instanceof XYWindImageData) {
@ -353,8 +351,8 @@ public class VarHeightResource extends
}
if (withinBounds) {
vgr.paintBarb(plotLoc, dd.getWindSpd(),
dd.getWindDir() * DEGREE_TO_RADIAN);
vgr.paintBarb(plotLoc, dd.getWindSpd(), dd.getWindDir()
* DEGREE_TO_RADIAN);
vgr.setColor(color);
vgr.setLineWidth(getCapability(OutlineCapability.class)
.getOutlineWidth());
@ -395,9 +393,13 @@ public class VarHeightResource extends
if (previousScreenX != 0.0) {
OutlineCapability lineCap = getCapability(OutlineCapability.class);
if (combineOperation != CombineOperation.NONE) {
target.drawLine(screenX, screenY, 0.0, previousScreenX,
previousScreenY, 0.0, color,
lineCap.getOutlineWidth(), lineCap.getLineStyle());
DrawableLine line = new DrawableLine();
line.basics.color = color;
line.width = lineCap.getOutlineWidth();
line.lineStyle = lineCap.getLineStyle();
line.addPoint(screenX, screenY);
line.addPoint(previousScreenX, previousScreenY);
target.drawLine(line);
}
}
previousScreenY = screenY;
@ -435,14 +437,12 @@ public class VarHeightResource extends
PaintProperties paintProps, MapDescriptor insetMapDescriptor)
throws VizException {
// paint a point
if (pointR == null) {
pointR = new PointRenderable(resourceData.getPoint(),
Coordinate point = resourceData.getPoint();
double[] pixels = insetMapDescriptor.worldToPixel(new double[] {
point.x, point.y });
target.drawPoint(pixels[0], pixels[1], 0.0,
getCapability(ColorableCapability.class).getColor(),
insetMapDescriptor);
} else {
pointR.setColor(getCapability(ColorableCapability.class).getColor());
}
pointR.paint(target, paintProps);
PointStyle.STAR);
}
public void addRecord(PluginDataObject pdo) {
@ -551,8 +551,8 @@ public class VarHeightResource extends
@Override
public String inspect(ReferencedCoordinate coord) throws VizException {
Coordinate object = coord.getObject();
double[] worldCoord = descriptor.pixelToWorld(
new double[] { object.x, object.y });
double[] worldCoord = descriptor.pixelToWorld(new double[] { object.x,
object.y });
Coordinate c = new Coordinate(worldCoord[0], worldCoord[1]);
c = descriptor.getGraphCoordiante(this, c);

View file

@ -40,7 +40,7 @@ import com.vividsolutions.jts.geom.Coordinate;
/**
*
* TODO Add Description
* Zoom handler for var height displays
*
* <pre>
*
@ -49,6 +49,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* Jul 3, 2010 bsteffen Initial creation
* Dec 11, 2013 DR 16795 D. Friedman Transform pixel coordinate for zoom
* Jun 18, 2014 3242 njensen Null safety checks
*
* </pre>
*
@ -122,7 +123,8 @@ public class VarHeightZoomHandler extends AbstractGraphInputHandler {
zoomIndex += 1;
}
/* Convert from the overall display coordinate space to the coordinate
/*
* Convert from the overall display coordinate space to the coordinate
* space for our resource.
*/
DirectPosition2D dp = new DirectPosition2D(grid.x, grid.y);
@ -137,8 +139,9 @@ public class VarHeightZoomHandler extends AbstractGraphInputHandler {
if (rsc.getResource() instanceof IGraphableResource<?, ?>) {
IGraph graph = desc.getGraph((IGraphableResource<?, ?>) rsc
.getResource());
if (graph.getExtent().contains(new double[] { dp.x, dp.y })) {
graph.zoom((int) Math.pow(2, zoomIndex), new Coordinate(dp.x, dp.y));
Coordinate c = new Coordinate(dp.x, dp.y);
if (graphContainsCoordinate(graph, c)) {
graph.zoom((int) Math.pow(2, zoomIndex), c);
}
}

View file

@ -20,7 +20,9 @@
package com.raytheon.uf.viz.xy;
import com.raytheon.uf.viz.core.drawables.IRenderableDisplay;
import com.raytheon.uf.viz.xy.graph.IGraph;
import com.raytheon.viz.ui.input.InputAdapter;
import com.vividsolutions.jts.geom.Coordinate;
/**
* Abstract class for graph input handlers, get constructed at the editor level
@ -31,7 +33,8 @@ import com.raytheon.viz.ui.input.InputAdapter;
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 1, 2009 mschenke Initial creation
* Oct 01, 2009 mschenke Initial creation
* Jun 14, 2014 3242 njensen Added graphContainsCoordinate()
*
* </pre>
*
@ -54,4 +57,16 @@ public abstract class AbstractGraphInputHandler extends InputAdapter {
public void setRenderableDisplay(IRenderableDisplay display) {
this.display = display;
}
/**
* Checks whether or not the coordinate is in the extent of a graph
*
* @param graph
* @param coord
* @return
*/
protected boolean graphContainsCoordinate(IGraph graph, Coordinate coord) {
return (graph != null && graph.getExtent() != null && graph.getExtent()
.contains(new double[] { coord.x, coord.y }));
}
}

View file

@ -1,95 +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.
**/
package com.raytheon.uf.viz.xy.map.rsc;
import org.eclipse.swt.graphics.RGB;
import com.raytheon.uf.viz.core.IGraphicsTarget;
import com.raytheon.uf.viz.core.drawables.IRenderable;
import com.raytheon.uf.viz.core.drawables.PaintProperties;
import com.raytheon.uf.viz.core.exception.VizException;
import com.raytheon.uf.viz.core.map.MapDescriptor;
import com.vividsolutions.jts.geom.Coordinate;
/**
* TODO: This class was made OBE by IGraphicsTarget.drawPoint(...) Simple class
* for drawing a star-like point at a given lat/lon
*
* <pre>
*
* SOFTWARE HISTORY
* Date Ticket# Engineer Description
* ------------ ---------- ----------- --------------------------
* Oct 6, 2009 mschenke Initial creation
*
* </pre>
*
* @author mschenke
* @version 1.0
*/
public class PointRenderable implements IRenderable {
private Coordinate location;
private RGB color;
private MapDescriptor descriptor;
private static final int LENGTH = 5;
private static final int LONG_LENGTH = 7;
public PointRenderable(Coordinate location, RGB color,
MapDescriptor descriptor) {
this.location = location;
this.color = color;
this.descriptor = descriptor;
}
public void setColor(RGB color) {
this.color = color;
}
/*
* (non-Javadoc)
*
* @see
* com.raytheon.uf.viz.core.drawables.IRenderable#paint(com.raytheon.uf.
* viz.core.IGraphicsTarget,
* com.raytheon.uf.viz.core.drawables.PaintProperties)
*/
@Override
public void paint(IGraphicsTarget target, PaintProperties paintProps)
throws VizException {
double[] pixels = descriptor.worldToPixel(new double[] { location.x,
location.y });
double ratio = paintProps.getCanvasBounds().width
/ paintProps.getView().getExtent().getWidth();
double val = LENGTH / ratio;
target.drawLine(pixels[0] + val, pixels[1] + val, 0.0, pixels[0] - val,
pixels[1] - val, 0.0, color, 2.0f);
target.drawLine(pixels[0] - val, pixels[1] + val, 0.0, pixels[0] + val,
pixels[1] - val, 0.0, color, 2.0f);
val = (LONG_LENGTH / ratio);
target.drawLine(pixels[0], pixels[1] - val, 0.0, pixels[0], pixels[1]
+ val, 0.0, color, 2.0f);
}
}