Issue #228 change plots, grid icons, and radar icons
to use a new PointImageExtension which provides an interface for drawing images at a single point, which kml can use to extract plot images. Change-Id: I29b07ed4f9e8ea95ed131ab1eb3ca27efadaf0e2 Former-commit-id:19a8811501
[formerly0fe5fe9c99
] [formerly792dc75f4d
] [formerly792dc75f4d
[formerlyd976603262
]] [formerly13a99abe7b
[formerly792dc75f4d
[formerlyd976603262
] [formerly13a99abe7b
[formerly 0f56c76ab830ef088a9576301c795dca7c855033]]]] Former-commit-id:13a99abe7b
Former-commit-id: cde17e170c426efc58dbda6513b2fe87ef0a09b0 [formerly 74f934c8254e91895c63256920cd1aef0bf21fd8] [formerlyec90cad810
[formerly63ef103145
]] Former-commit-id:ec90cad810
Former-commit-id:7c0e0c0365
This commit is contained in:
parent
fb1ca3dfa0
commit
276f061471
13 changed files with 378 additions and 113 deletions
|
@ -5,8 +5,8 @@ overflow="visible"
|
|||
xmlns="http://www.w3.org/2000/svg"
|
||||
xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<defs>
|
||||
<font id="LargeSpecialSymbols" horiz-adv-x="1536"><font-face
|
||||
font-family="LargeSpecialSymbolFont"
|
||||
<font id="LrgSpecialSymbols" horiz-adv-x="7"><font-face
|
||||
font-family="LrgSpecialSymbolFont"
|
||||
units-per-em="12"
|
||||
alphabetic="0" />
|
||||
<glyph unicode="199" glyph-name="199" d="M-4 6H2L-1 3L2 0L-1 -3V-2M-1 -3H0M-3 -3V6M-2 7H0L-1 9L-2 7" />
|
||||
|
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 18 KiB |
|
@ -8,7 +8,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255, 255, 255);">
|
|||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family: "LargeSpecialSymbolFont";
|
||||
src: url(LargeSpecialSymbols.svg#LargeSpecialSymbols); }
|
||||
src: url(LargeSpecialSymbols.svg#LrgSpecialSymbols); }
|
||||
|
||||
text.special
|
||||
{
|
||||
|
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
@ -8,7 +8,7 @@ xmlns:xlink="http://www.w3.org/1999/xlink" style="stroke: rgb(255, 255, 255);">
|
|||
<style type="text/css">
|
||||
<![CDATA[
|
||||
@font-face { font-family: "LrgSpecialSymbolFont";
|
||||
src: url(LargeSpecialSymbols.svg#LargeSpecialSymbols); }
|
||||
src: url(LargeSpecialSymbols.svg#LrgSpecialSymbols); }
|
||||
|
||||
text.special
|
||||
{
|
||||
|
|
Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB |
|
@ -29,8 +29,6 @@ import java.util.Map;
|
|||
import org.eclipse.swt.graphics.RGB;
|
||||
import org.geotools.coverage.grid.GeneralGridGeometry;
|
||||
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
import com.raytheon.uf.viz.core.data.prep.IODataPreparer;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
|
@ -38,6 +36,8 @@ import com.raytheon.uf.viz.core.exception.VizException;
|
|||
import com.raytheon.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.viz.core.contours.rsc.displays.AbstractGriddedDisplay;
|
||||
import com.raytheon.viz.pointdata.PointIconFactory;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension.PointImage;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
|
@ -160,17 +160,18 @@ public class GriddedIconDisplay extends AbstractGriddedDisplay<IImage> {
|
|||
@Override
|
||||
protected void paint(PaintProperties paintProps,
|
||||
Collection<GridCellRenderable> renderables) throws VizException {
|
||||
List<DrawableImage> images = new ArrayList<DrawableImage>();
|
||||
List<PointImage> images = new ArrayList<PointImage>();
|
||||
for (GridCellRenderable renderable : renderables) {
|
||||
if (renderable.resource != empty) {
|
||||
images.add(new DrawableImage(renderable.resource,
|
||||
new PixelCoverage(renderable.plotLocation,
|
||||
renderable.adjustedSize,
|
||||
renderable.adjustedSize)));
|
||||
PointImage image = new PointImage(renderable.resource,
|
||||
renderable.plotLocation);
|
||||
image.setHeight((double) size * magnification);
|
||||
image.setWidth((double) size * magnification);
|
||||
images.add(image);
|
||||
}
|
||||
}
|
||||
target.drawRasters(paintProps,
|
||||
images.toArray(new DrawableImage[images.size()]));
|
||||
target.getExtension(IPointImageExtension.class).drawPointImages(
|
||||
paintProps, images);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ Require-Bundle: org.apache.batik,
|
|||
com.raytheon.uf.common.pointdata;bundle-version="1.12.1174"
|
||||
Bundle-ActivationPolicy: lazy
|
||||
Export-Package: com.raytheon.viz.pointdata,
|
||||
com.raytheon.viz.pointdata.drawables,
|
||||
com.raytheon.viz.pointdata.rsc,
|
||||
com.raytheon.viz.pointdata.rsc.retrieve,
|
||||
com.raytheon.viz.pointdata.util
|
||||
|
|
|
@ -1,20 +1,20 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!--
|
||||
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
|
||||
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
|
||||
|
||||
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.
|
||||
-->
|
||||
|
@ -152,4 +152,10 @@
|
|||
name="Plot Models"
|
||||
category="com.raytheon.uf.viz.productbrowser.productbrowserpreferencespage"/>
|
||||
</extension>
|
||||
<extension
|
||||
point="com.raytheon.uf.viz.core.graphicsExtension">
|
||||
<graphicsExtension
|
||||
class="com.raytheon.viz.pointdata.drawables.GeneralPointImageExtension">
|
||||
</graphicsExtension>
|
||||
</extension>
|
||||
</plugin>
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
/**
|
||||
* 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.viz.pointdata.drawables;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.drawables.ext.GraphicsExtension;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 7, 2011 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public class GeneralPointImageExtension extends
|
||||
GraphicsExtension<IGraphicsTarget> implements IPointImageExtension {
|
||||
|
||||
@Override
|
||||
public void drawPointImages(PaintProperties paintProps,
|
||||
PointImage... images) throws VizException {
|
||||
drawPointImages(paintProps, Arrays.asList(images));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCompatibilityValue(IGraphicsTarget target) {
|
||||
return Compatibilty.GENERIC.value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawPointImages(PaintProperties paintProps,
|
||||
Collection<PointImage> images) throws VizException {
|
||||
List<DrawableImage> drawableImages = new ArrayList<DrawableImage>(
|
||||
images.size());
|
||||
double xScale = paintProps.getView().getExtent().getWidth()
|
||||
/ paintProps.getCanvasBounds().width;
|
||||
double yScale = paintProps.getView().getExtent().getHeight()
|
||||
/ paintProps.getCanvasBounds().height;
|
||||
|
||||
for (PointImage image : images) {
|
||||
Double width = image.getWidth();
|
||||
Double height = image.getHeight();
|
||||
if (width == null) {
|
||||
width = (double) image.getImage().getWidth();
|
||||
}
|
||||
if (height == null) {
|
||||
height = (double) image.getImage().getHeight();
|
||||
}
|
||||
width = width * xScale;
|
||||
height = height * yScale;
|
||||
Coordinate center = new Coordinate(image.getX(), image.getY());
|
||||
if (image.getHorizontalAlignment().equals(HorizontalAlignment.LEFT)) {
|
||||
center.x += width / 2;
|
||||
} else if (image.getHorizontalAlignment().equals(
|
||||
HorizontalAlignment.RIGHT)) {
|
||||
center.x -= width / 2;
|
||||
}
|
||||
if (image.getVerticalAlignment().equals(VerticalAlignment.TOP)) {
|
||||
center.y += height / 2;
|
||||
} else if (image.getVerticalAlignment().equals(
|
||||
VerticalAlignment.BOTTOM)) {
|
||||
center.y -= height / 2;
|
||||
}
|
||||
PixelCoverage coverage = new PixelCoverage(center, width, height);
|
||||
DrawableImage drawableImage = new DrawableImage(image.getImage(),
|
||||
coverage);
|
||||
drawableImages.add(drawableImage);
|
||||
}
|
||||
|
||||
target.drawRasters(paintProps,
|
||||
drawableImages.toArray(new DrawableImage[0]));
|
||||
}
|
||||
}
|
|
@ -0,0 +1,181 @@
|
|||
/**
|
||||
* 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.viz.pointdata.drawables;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* An Extension for drawing images at a single point with a constant screen size
|
||||
* that is independent of the zoom level.
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
* SOFTWARE HISTORY
|
||||
*
|
||||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Dec 7, 2011 bsteffen Initial creation
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author bsteffen
|
||||
* @version 1.0
|
||||
*/
|
||||
|
||||
public interface IPointImageExtension {
|
||||
|
||||
public static class PointImage {
|
||||
|
||||
// The image to draw at this point
|
||||
private IImage image;
|
||||
|
||||
// anchor position x in target coordinates
|
||||
private double x;
|
||||
|
||||
// anchor position y in target coordinates
|
||||
private double y;
|
||||
|
||||
// height in screen pixels, if this is not provided the image height is
|
||||
// used
|
||||
private Double height = null;
|
||||
|
||||
// width in screen pixels, if this is not provided the image width is
|
||||
// used
|
||||
private Double width = null;
|
||||
|
||||
// The alignment relative to x,y
|
||||
private HorizontalAlignment horizontalAlignment = HorizontalAlignment.CENTER;
|
||||
|
||||
// The alignment relative to x,y
|
||||
private VerticalAlignment verticalAlignment = VerticalAlignment.MIDDLE;
|
||||
|
||||
// optional field, used to make prettier dispalys in some targets(kml)
|
||||
private String siteId = null;
|
||||
|
||||
public PointImage() {
|
||||
|
||||
}
|
||||
|
||||
public PointImage(IImage image, double x, double y) {
|
||||
this.image = image;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public PointImage(IImage image, Coordinate c) {
|
||||
this.image = image;
|
||||
this.x = c.x;
|
||||
this.y = c.y;
|
||||
}
|
||||
|
||||
public Double getHeight() {
|
||||
return height;
|
||||
}
|
||||
|
||||
public void setHeight(Double height) {
|
||||
this.height = height;
|
||||
}
|
||||
|
||||
public Double getWidth() {
|
||||
return width;
|
||||
}
|
||||
|
||||
public void setWidth(Double width) {
|
||||
this.width = width;
|
||||
}
|
||||
|
||||
public HorizontalAlignment getHorizontalAlignment() {
|
||||
return horizontalAlignment;
|
||||
}
|
||||
|
||||
public void setHorizontalAlignment(
|
||||
HorizontalAlignment horizontalAlignment) {
|
||||
this.horizontalAlignment = horizontalAlignment;
|
||||
}
|
||||
|
||||
public VerticalAlignment getVerticalAlignment() {
|
||||
return verticalAlignment;
|
||||
}
|
||||
|
||||
public void setVerticalAlignment(VerticalAlignment verticalAlignment) {
|
||||
this.verticalAlignment = verticalAlignment;
|
||||
}
|
||||
|
||||
public IImage getImage() {
|
||||
return image;
|
||||
}
|
||||
|
||||
public void setImage(IImage image) {
|
||||
this.image = image;
|
||||
}
|
||||
|
||||
public double getX() {
|
||||
return x;
|
||||
}
|
||||
|
||||
public void setX(double x) {
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
public double getY() {
|
||||
return y;
|
||||
}
|
||||
|
||||
public void setY(double y) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public void setLocation(Coordinate c) {
|
||||
this.x = c.x;
|
||||
this.y = c.y;
|
||||
}
|
||||
|
||||
public void setLocation(double x, double y) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
public String getSiteId() {
|
||||
return siteId;
|
||||
}
|
||||
|
||||
public void setSiteId(String siteId) {
|
||||
this.siteId = siteId;
|
||||
}
|
||||
|
||||
public boolean hasSiteId() {
|
||||
return siteId != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void drawPointImages(PaintProperties paintProps,
|
||||
PointImage... images) throws VizException;
|
||||
|
||||
public void drawPointImages(PaintProperties paintProps,
|
||||
Collection<PointImage> images) throws VizException;
|
||||
}
|
|
@ -46,8 +46,6 @@ import com.raytheon.uf.common.time.DataTime;
|
|||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.viz.core.IExtent;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.RasterMode;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.catalog.CatalogQuery;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
|
@ -65,6 +63,8 @@ import com.raytheon.uf.viz.core.rsc.capabilities.OutlineCapability;
|
|||
import com.raytheon.viz.pointdata.PlotModelGenerator;
|
||||
import com.raytheon.viz.pointdata.StaticPlotInfoPV;
|
||||
import com.raytheon.viz.pointdata.StaticPlotInfoPV.SPIEntry;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension.PointImage;
|
||||
import com.raytheon.viz.pointdata.units.PlotUnits;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
import com.vividsolutions.jts.geom.Envelope;
|
||||
|
@ -328,33 +328,14 @@ public class PlotResource extends
|
|||
}
|
||||
continue;
|
||||
}
|
||||
this.screenToWorldRatio = paintProps.getCanvasBounds().width
|
||||
/ paintProps.getView().getExtent().getWidth();
|
||||
double scaleValue = (this.plotWidth / 2.0)
|
||||
/ screenToWorldRatio;
|
||||
double[] ul = new double[] {
|
||||
stationPixelLocation[0] - scaleValue,
|
||||
stationPixelLocation[1] - scaleValue, 0 };
|
||||
|
||||
double[] ur = new double[] {
|
||||
stationPixelLocation[0] + scaleValue,
|
||||
stationPixelLocation[1] - scaleValue, 0 };
|
||||
|
||||
double[] lr = new double[] {
|
||||
stationPixelLocation[0] + scaleValue,
|
||||
stationPixelLocation[1] + scaleValue, 0 };
|
||||
|
||||
double[] ll = new double[] {
|
||||
stationPixelLocation[0] - scaleValue,
|
||||
stationPixelLocation[1] + scaleValue, 0 };
|
||||
|
||||
PixelCoverage pc = new PixelCoverage(new Coordinate(ul[0],
|
||||
ul[1], ul[2]), new Coordinate(ur[0], ur[1], ur[2]),
|
||||
new Coordinate(lr[0], lr[1], lr[2]),
|
||||
new Coordinate(ll[0], ll[1], ll[2]));
|
||||
|
||||
aTarget.drawRaster(generator.getStation(currentDataUri),
|
||||
pc, paintProps, RasterMode.SYNCHRONOUS);
|
||||
PointImage image = new PointImage(
|
||||
generator.getStation(currentDataUri),
|
||||
stationPixelLocation[0], stationPixelLocation[1]);
|
||||
image.setHeight(this.plotWidth);
|
||||
image.setWidth(this.plotWidth);
|
||||
aTarget.getExtension(IPointImageExtension.class)
|
||||
.drawPointImages(paintProps, image);
|
||||
}
|
||||
if (newStations.size() > 0) {
|
||||
generator.queueStations(newStations, paintProps
|
||||
|
|
|
@ -44,9 +44,7 @@ import com.raytheon.uf.common.status.UFStatus.Priority;
|
|||
import com.raytheon.uf.common.time.BinOffset;
|
||||
import com.raytheon.uf.common.time.DataTime;
|
||||
import com.raytheon.uf.common.time.TimeRange;
|
||||
import com.raytheon.uf.viz.core.DrawableImage;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.drawables.IImage;
|
||||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
|
@ -65,6 +63,8 @@ import com.raytheon.viz.pointdata.IPlotModelGeneratorCaller;
|
|||
import com.raytheon.viz.pointdata.PlotAlertParser;
|
||||
import com.raytheon.viz.pointdata.PlotDataThreadPool;
|
||||
import com.raytheon.viz.pointdata.PlotInfo;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension.PointImage;
|
||||
import com.raytheon.viz.pointdata.rsc.progdisc.AbstractProgDisclosure;
|
||||
import com.raytheon.viz.pointdata.rsc.progdisc.AbstractProgDisclosure.IProgDiscListener;
|
||||
import com.raytheon.viz.pointdata.rsc.progdisc.DynamicProgDisclosure;
|
||||
|
@ -145,7 +145,7 @@ public class PlotResource2 extends
|
|||
public static class Station {
|
||||
public PlotInfo[] info;
|
||||
|
||||
public DrawableImage plotImage;
|
||||
public PointImage plotImage;
|
||||
|
||||
public Object progDiscInfo;
|
||||
|
||||
|
@ -216,26 +216,19 @@ public class PlotResource2 extends
|
|||
return;
|
||||
}
|
||||
|
||||
double screenToWorldRatio = progressiveDisclosure
|
||||
.getScreenToWorldRatio();
|
||||
double scaleValue = (this.plotWidth) / screenToWorldRatio;
|
||||
|
||||
List<DrawableImage> images = new ArrayList<DrawableImage>(
|
||||
stationList.size());
|
||||
List<PointImage> images = new ArrayList<PointImage>(stationList.size());
|
||||
for (Station station : stationList) {
|
||||
if (station.plotImage == null) {
|
||||
continue;
|
||||
}
|
||||
station.plotImage.setCoverage(new PixelCoverage(
|
||||
station.pixelLocation, scaleValue, scaleValue));
|
||||
// set image color so shader can draw in appropriate color
|
||||
((SingleColorImage) station.plotImage.getImage())
|
||||
.setColor(imageColor);
|
||||
images.add(station.plotImage);
|
||||
}
|
||||
|
||||
aTarget.drawRasters(paintProps,
|
||||
images.toArray(new DrawableImage[images.size()]));
|
||||
aTarget.getExtension(IPointImageExtension.class).drawPointImages(
|
||||
paintProps, images);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -337,7 +330,7 @@ public class PlotResource2 extends
|
|||
if (stationMap.containsKey(plot.stationId)) {
|
||||
Station existingStation = stationMap.get(plot.stationId);
|
||||
if (existingStation.plotImage != null) {
|
||||
existingStation.plotImage.dispose();
|
||||
existingStation.plotImage.getImage().dispose();
|
||||
existingStation.plotImage = null;
|
||||
}
|
||||
boolean dup = false;
|
||||
|
@ -624,7 +617,7 @@ public class PlotResource2 extends
|
|||
FrameInformation frameInfo = entry.getValue();
|
||||
for (Station station : frameInfo.stationMap.values()) {
|
||||
if (station.plotImage != null) {
|
||||
station.plotImage.dispose();
|
||||
station.plotImage.getImage().dispose();
|
||||
station.plotImage = null;
|
||||
|
||||
if (station.info != null) {
|
||||
|
@ -647,7 +640,8 @@ public class PlotResource2 extends
|
|||
if (s != null) {
|
||||
if (image != null) {
|
||||
SingleColorImage si = new SingleColorImage(image);
|
||||
s.plotImage = new DrawableImage(si, null);
|
||||
s.plotImage = new PointImage(si, s.pixelLocation);
|
||||
s.plotImage.setSiteId(s.info[0].stationId);
|
||||
si.setColor(imageColor);
|
||||
} else {
|
||||
frameInfo.stationMap.remove(key[0].stationId);
|
||||
|
@ -670,7 +664,7 @@ public class PlotResource2 extends
|
|||
if (frameInfo != null) {
|
||||
for (Station s : frameInfo.stationMap.values()) {
|
||||
if (s != null && s.plotImage != null) {
|
||||
s.plotImage.dispose();
|
||||
s.plotImage.getImage().dispose();
|
||||
s.plotImage = null;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -847,7 +847,7 @@ public class RadarGraphicFunctions {
|
|||
|
||||
private static Document loadSVG(String plotModelFile) throws VizException {
|
||||
Document document = null;
|
||||
document = docMap.get(plotModelFile);
|
||||
// document = docMap.get(plotModelFile);
|
||||
if (document == null) {
|
||||
|
||||
String parser = XMLResourceDescriptor.getXMLParserClassName();
|
||||
|
|
|
@ -72,11 +72,10 @@ import com.raytheon.uf.common.geospatial.ReferencedCoordinate;
|
|||
import com.raytheon.uf.common.geospatial.ReferencedGeometry;
|
||||
import com.raytheon.uf.common.geospatial.ReferencedObject.Type;
|
||||
import com.raytheon.uf.common.localization.PathManagerFactory;
|
||||
import com.raytheon.uf.viz.core.DrawableLine;
|
||||
import com.raytheon.uf.viz.core.DrawableString;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.TextStyle;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.VerticalAlignment;
|
||||
import com.raytheon.uf.viz.core.PixelCoverage;
|
||||
import com.raytheon.uf.viz.core.drawables.IDescriptor;
|
||||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
import com.raytheon.uf.viz.core.drawables.IRenderable;
|
||||
|
@ -84,6 +83,8 @@ import com.raytheon.uf.viz.core.drawables.IWireframeShape;
|
|||
import com.raytheon.uf.viz.core.drawables.PaintProperties;
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.viz.core.rsc.jts.JTSCompiler;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension;
|
||||
import com.raytheon.viz.pointdata.drawables.IPointImageExtension.PointImage;
|
||||
import com.raytheon.viz.radar.RadarHelper;
|
||||
import com.raytheon.viz.radar.rsc.graphic.RadarGraphicFunctions.MesocycloneType;
|
||||
import com.raytheon.viz.radar.rsc.graphic.RadarGraphicFunctions.PlotObject;
|
||||
|
@ -981,23 +982,6 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
return images;
|
||||
}
|
||||
|
||||
public PixelCoverage getPixelCoverage(Coordinate c) {
|
||||
int scaleWidth = 3;
|
||||
|
||||
double[] centerpixels = this.descriptor.worldToPixel(new double[] {
|
||||
c.x, c.y });
|
||||
Coordinate ul = new Coordinate(centerpixels[0] - scaleWidth,
|
||||
centerpixels[1] - scaleWidth);
|
||||
Coordinate ur = new Coordinate(centerpixels[0] + scaleWidth,
|
||||
centerpixels[1] - scaleWidth);
|
||||
Coordinate lr = new Coordinate(centerpixels[0] + scaleWidth,
|
||||
centerpixels[1] + scaleWidth);
|
||||
Coordinate ll = new Coordinate(centerpixels[0] - scaleWidth,
|
||||
centerpixels[1] + scaleWidth);
|
||||
|
||||
return new PixelCoverage(ul, ur, lr, ll);
|
||||
}
|
||||
|
||||
public static Coordinate rectifyCoordinate(Coordinate c) {
|
||||
c.x += RadarGraphicsDisplay.X_OFFSET;
|
||||
c.y += RadarGraphicsDisplay.Y_OFFSET;
|
||||
|
@ -1067,9 +1051,10 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
// Paint map-relative text
|
||||
for (Coordinate c : this.localStringMap.keySet()) {
|
||||
String str = this.localStringMap.get(c);
|
||||
|
||||
target.drawString(this.font, str, c.x, c.y, 0.0, TextStyle.NORMAL,
|
||||
this.color, HorizontalAlignment.LEFT, null);
|
||||
DrawableString string = new DrawableString(str, this.color);
|
||||
string.font = this.font;
|
||||
string.setCoordinates(c.x, c.y);
|
||||
target.drawStrings(string);
|
||||
}
|
||||
|
||||
// Paint screen-relative text
|
||||
|
@ -1096,7 +1081,9 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
|
||||
// the target may have messes with our magnification value,
|
||||
// especially in smaller panes.
|
||||
magnification = target.getStringBounds(font, "Hy").getHeight() / 14;
|
||||
DrawableString testString = new DrawableString("hy", this.color);
|
||||
testString.font = this.font;
|
||||
magnification = target.getStringsBounds(testString).getHeight() / 14;
|
||||
double width = (maxx - minx) * magnification;
|
||||
// If the table wider than our canvas then shrink it
|
||||
if (width > paintProps.getCanvasBounds().width) {
|
||||
|
@ -1104,7 +1091,7 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
* paintProps.getCanvasBounds().width
|
||||
/ (width + xOffset * 2);
|
||||
font.setMagnification((float) magnification, false);
|
||||
magnification = target.getStringBounds(font, "Hy").getHeight() / 14;
|
||||
magnification = target.getStringsBounds(testString).getHeight() / 14;
|
||||
width = (maxx - minx) * magnification;
|
||||
}
|
||||
xOffset = (paintProps.getCanvasBounds().width - width) / 2;
|
||||
|
@ -1123,9 +1110,11 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
new double[] { x1, y1 }, target);
|
||||
double[] pts2 = paintProps.getView().getDisplayCoords(
|
||||
new double[] { x2, y2 }, target);
|
||||
|
||||
target.drawLine(pts1[0], pts1[1], 0, pts2[0], pts2[1], 0,
|
||||
color, 1.0f);
|
||||
DrawableLine line = new DrawableLine();
|
||||
line.addPoint(pts1[0], pts1[1]);
|
||||
line.addPoint(pts2[0], pts2[1]);
|
||||
line.basics.color = this.color;
|
||||
target.drawLine(line);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1145,9 +1134,11 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
// }
|
||||
double[] pts = paintProps.getView().getDisplayCoords(
|
||||
new double[] { x, y }, target);
|
||||
target.drawString(this.font, str, pts[0], pts[1], 0.0,
|
||||
TextStyle.NORMAL, color, HorizontalAlignment.LEFT,
|
||||
VerticalAlignment.TOP, null);
|
||||
DrawableString string = new DrawableString(str, this.color);
|
||||
string.font = this.font;
|
||||
string.setCoordinates(pts[0], pts[1]);
|
||||
string.verticallAlignment = VerticalAlignment.TOP;
|
||||
target.drawStrings(string);
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -1160,24 +1151,30 @@ public class RadarGraphicsPage implements IRenderable {
|
|||
// paint symbols on screen
|
||||
double ratio = (paintProps.getView().getExtent().getWidth() / paintProps
|
||||
.getCanvasBounds().width);
|
||||
double pixels = 90 * ratio * magnification;
|
||||
double pixels = 90 * magnification;
|
||||
|
||||
for (PlotObject po : this.plotObjects) {
|
||||
Coordinate adjustedCoord = (Coordinate) po.coord.clone();
|
||||
|
||||
adjustedCoord.x += po.pixelOffset[0] * ratio * magnification;
|
||||
adjustedCoord.y += po.pixelOffset[1] * ratio * magnification;
|
||||
target.drawRaster(po.image, new PixelCoverage(adjustedCoord,
|
||||
pixels, pixels), paintProps);
|
||||
PointImage image = new PointImage(po.image, adjustedCoord);
|
||||
image.setHeight(pixels);
|
||||
image.setWidth(pixels);
|
||||
|
||||
if (po.label != null) {
|
||||
image.setSiteId(po.label);
|
||||
// Place the label next to the image
|
||||
adjustedCoord.x += pixels / 20;
|
||||
target.drawString(this.font, po.label, adjustedCoord.x,
|
||||
adjustedCoord.y, 0.0, TextStyle.NORMAL, this.color,
|
||||
HorizontalAlignment.LEFT, VerticalAlignment.BOTTOM,
|
||||
null);
|
||||
DrawableString string = new DrawableString(po.label, this.color);
|
||||
string.font = this.font;
|
||||
string.setCoordinates(adjustedCoord.x, adjustedCoord.y);
|
||||
target.drawStrings(string);
|
||||
|
||||
}
|
||||
target.getExtension(IPointImageExtension.class).drawPointImages(
|
||||
paintProps, image);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,8 +1 @@
|
|||
This is a testfile
|
||||
Deleted two lines and added this
|
||||
adding this line
|
||||
One more line
|
||||
Testing again
|
||||
int commit test
|
||||
and again
|
||||
Test ticket 10955 commit
|
||||
|
|
Loading…
Add table
Reference in a new issue