Merge "Omaha #3412 Replace drawCircle calls" into omaha_14.4.1
Former-commit-id:c47892bf95
[formerly 61846ea9ec93ae255bdc4be7332a63252012aa9f] Former-commit-id:25c79387ca
This commit is contained in:
commit
56d62848c6
4 changed files with 36 additions and 14 deletions
|
@ -28,6 +28,8 @@ import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.geotools.referencing.GeodeticCalculator;
|
import org.geotools.referencing.GeodeticCalculator;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.DrawableBasics;
|
||||||
|
import com.raytheon.uf.viz.core.DrawableCircle;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||||
|
@ -77,7 +79,7 @@ import com.vividsolutions.jts.geom.LineSegment;
|
||||||
* 06-09-10 #5620 bkowal The tool will load in an editable state by
|
* 06-09-10 #5620 bkowal The tool will load in an editable state by
|
||||||
* default now.
|
* default now.
|
||||||
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
||||||
*
|
* 07-21-14 #3412 mapeters Updated deprecated drawCircle call.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author ebabin
|
* @author ebabin
|
||||||
|
@ -161,12 +163,17 @@ public class DistanceBearingToolLayer extends
|
||||||
Coordinate[] ends = { line.p0, line.p1 };
|
Coordinate[] ends = { line.p0, line.p1 };
|
||||||
wireframeShape.addLineSegment(ends);
|
wireframeShape.addLineSegment(ends);
|
||||||
if (isEditable()) {
|
if (isEditable()) {
|
||||||
for (Coordinate vertex : ends) {
|
DrawableCircle circle0 = new DrawableCircle();
|
||||||
|
DrawableCircle circle1 = new DrawableCircle();
|
||||||
|
DrawableCircle[] circles = new DrawableCircle[] { circle0, circle1 };
|
||||||
|
for (int i = 0; i <= 1; i++) {
|
||||||
double[] center = descriptor.worldToPixel(new double[] {
|
double[] center = descriptor.worldToPixel(new double[] {
|
||||||
vertex.x, vertex.y });
|
ends[i].x, ends[i].y });
|
||||||
target.drawCircle(center[0], center[1], 0.0, radius, color, 1);
|
circles[i].radius = radius;
|
||||||
|
circles[i].basics.color = color;
|
||||||
|
circles[i].setCoordinates(center[0], center[1]);
|
||||||
}
|
}
|
||||||
|
target.drawCircle(circles);
|
||||||
}
|
}
|
||||||
String label = computeRangeAndAzimuth(line);
|
String label = computeRangeAndAzimuth(line);
|
||||||
// set font for magnification capability
|
// set font for magnification capability
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Arrays;
|
||||||
import org.eclipse.jface.action.IMenuManager;
|
import org.eclipse.jface.action.IMenuManager;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.DrawableCircle;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||||
|
@ -53,8 +54,8 @@ import com.vividsolutions.jts.geom.Envelope;
|
||||||
*
|
*
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
*
|
* bsteffen Intial creation.
|
||||||
*
|
* 07-21-14 #3412 mapeters Updated deprecated drawCircle call.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author bsteffen
|
* @author bsteffen
|
||||||
|
@ -165,7 +166,11 @@ public class LapsToolLayer extends AbstractMovableToolLayer<Coordinate>
|
||||||
double radius = (MAGIC_CIRCLE_RADIUS * paintProps.getZoomLevel());
|
double radius = (MAGIC_CIRCLE_RADIUS * paintProps.getZoomLevel());
|
||||||
double[] center = descriptor
|
double[] center = descriptor
|
||||||
.worldToPixel(new double[] { home.x, home.y });
|
.worldToPixel(new double[] { home.x, home.y });
|
||||||
target.drawCircle(center[0], center[1], 0, radius, color, 1);
|
DrawableCircle circle = new DrawableCircle();
|
||||||
|
circle.setCoordinates(center[0], center[1]);
|
||||||
|
circle.radius = radius;
|
||||||
|
circle.basics.color = color;
|
||||||
|
target.drawCircle(circle);
|
||||||
double labelLoc[] = target.getPointOnCircle(center[0], center[1], 0.0,
|
double labelLoc[] = target.getPointOnCircle(center[0], center[1], 0.0,
|
||||||
radius, 0);
|
radius, 0);
|
||||||
target.drawString(null, "center point", labelLoc[0], labelLoc[1], 0.0,
|
target.drawString(null, "center point", labelLoc[0], labelLoc[1], 0.0,
|
||||||
|
|
|
@ -35,6 +35,7 @@ import org.geotools.referencing.GeodeticCalculator;
|
||||||
import com.raytheon.uf.common.status.IUFStatusHandler;
|
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.viz.core.DrawableCircle;
|
||||||
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
import com.raytheon.uf.viz.core.IDisplayPaneContainer;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||||
|
@ -67,7 +68,7 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
||||||
import com.vividsolutions.jts.geom.Point;
|
import com.vividsolutions.jts.geom.Point;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* Layer for displaying a radar's range rings.
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
|
@ -75,7 +76,7 @@ import com.vividsolutions.jts.geom.Point;
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* 10-21-09 #717 bsteffen Refactor to common MovableTool model
|
* 10-21-09 #717 bsteffen Refactor to common MovableTool model
|
||||||
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
* 15Mar2013 15693 mgamazaychikov Added magnification capability.
|
||||||
*
|
* 07-21-14 #3412 mapeters Updated deprecated drawCircle call.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author ebabin
|
* @author ebabin
|
||||||
|
@ -225,8 +226,12 @@ public class RangeRingsLayer extends AbstractMovableToolLayer<RangeRing>
|
||||||
double radius = (MAGIC_CIRCLE_RADIUS * paintProps.getZoomLevel());
|
double radius = (MAGIC_CIRCLE_RADIUS * paintProps.getZoomLevel());
|
||||||
double[] centerPixel = descriptor.worldToPixel(new double[] {
|
double[] centerPixel = descriptor.worldToPixel(new double[] {
|
||||||
center.x, center.y });
|
center.x, center.y });
|
||||||
target.drawCircle(centerPixel[0], centerPixel[1], 0.0, radius,
|
DrawableCircle circle = new DrawableCircle();
|
||||||
color, 1);
|
circle.setCoordinates(centerPixel[0], centerPixel[1]);
|
||||||
|
circle.radius = radius;
|
||||||
|
circle.basics.color = color;
|
||||||
|
target.drawCircle(circle);
|
||||||
|
|
||||||
if (label.contains("C")) {
|
if (label.contains("C")) {
|
||||||
double labelLoc[] = target.getPointOnCircle(centerPixel[0],
|
double labelLoc[] = target.getPointOnCircle(centerPixel[0],
|
||||||
centerPixel[1], 0.0, radius, 0);
|
centerPixel[1], 0.0, radius, 0);
|
||||||
|
|
|
@ -26,6 +26,7 @@ import java.util.List;
|
||||||
import org.eclipse.swt.graphics.RGB;
|
import org.eclipse.swt.graphics.RGB;
|
||||||
import org.eclipse.swt.graphics.Rectangle;
|
import org.eclipse.swt.graphics.Rectangle;
|
||||||
|
|
||||||
|
import com.raytheon.uf.viz.core.DrawableCircle;
|
||||||
import com.raytheon.uf.viz.core.IExtent;
|
import com.raytheon.uf.viz.core.IExtent;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||||
|
@ -56,7 +57,7 @@ import com.raytheon.viz.radar.ui.xy.RadarGraphResource.GraphPosition;
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 8, 2009 askripsk Initial creation
|
* Apr 8, 2009 askripsk Initial creation
|
||||||
*
|
* 07-21-14 #3412 mapeters Updated deprecated drawCircle call.
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
* @author askripsk
|
* @author askripsk
|
||||||
|
@ -158,7 +159,11 @@ public class CellTrendGraph extends XYGraph {
|
||||||
private void drawPoint(IGraphicsTarget target, double x, double y,
|
private void drawPoint(IGraphicsTarget target, double x, double y,
|
||||||
PointType currPointType) throws VizException {
|
PointType currPointType) throws VizException {
|
||||||
if (currPointType.equals(PointType.CIRCLE)) {
|
if (currPointType.equals(PointType.CIRCLE)) {
|
||||||
target.drawCircle(x, y, 0, 3, colorCap.getColor(), 1);
|
DrawableCircle circle = new DrawableCircle();
|
||||||
|
circle.setCoordinates(x, y);
|
||||||
|
circle.radius = 3.0;
|
||||||
|
circle.basics.color = colorCap.getColor();
|
||||||
|
target.drawCircle(circle);
|
||||||
} else if (currPointType.equals(PointType.X)) {
|
} else if (currPointType.equals(PointType.X)) {
|
||||||
target.drawLine(x - 3, y - 3, 0.0, x + 3, y + 3, 0.0, colorCap
|
target.drawLine(x - 3, y - 3, 0.0, x + 3, y + 3, 0.0, colorCap
|
||||||
.getColor(), 1.0f);
|
.getColor(), 1.0f);
|
||||||
|
|
Loading…
Add table
Reference in a new issue