Omaha #3397 resource cleanup related to wireframe shape api changes
Change-Id: I8279178cd791efe91ed9e5b5b079e6495419dd9a Former-commit-id:b8fbc5a9b6
[formerlya8792047af
] [formerly69d0dc8e09
] [formerlyb8fbc5a9b6
[formerlya8792047af
] [formerly69d0dc8e09
] [formerly46d2bef33f
[formerly69d0dc8e09
[formerly 41e3e19e223d5af7f19221efe7ac9295fdfd6b48]]]] Former-commit-id:46d2bef33f
Former-commit-id:5203f4c731
[formerly976f56cd9e
] [formerly a9365911d4486ac356d58b00d17c2a6b08638a14 [formerlyeb9b525c08
]] Former-commit-id: 0536df8a1480c8439e1f6dbd90883a8bfe7eea8b [formerly0536942e50
] Former-commit-id:3bb8e173f9
This commit is contained in:
parent
e5c778806d
commit
388afffbc7
2 changed files with 17 additions and 44 deletions
|
@ -40,7 +40,6 @@ import com.raytheon.uf.common.util.FileUtil;
|
|||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget.HorizontalAlignment;
|
||||
import com.raytheon.uf.viz.core.IView;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.VizApp;
|
||||
import com.raytheon.uf.viz.core.datastructure.WireframeCache;
|
||||
import com.raytheon.uf.viz.core.drawables.IFont;
|
||||
|
@ -71,6 +70,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 1/10/08 562 bphillip Modified to handle .bcx files
|
||||
* 02/11/09 njensen Refactored to new rsc architecture
|
||||
* 07/31/12 DR 14935 D. Friedman Handle little-endian files
|
||||
* Jul 28, 2014 3397 bclement switched to non deprecated version of createWireframeShape()
|
||||
* now closes on FileInputStream instead of FileChannel in initInternal()
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -153,7 +154,7 @@ public class BCDResource extends
|
|||
@Override
|
||||
protected void initInternal(IGraphicsTarget target) throws VizException {
|
||||
super.initInternal(target);
|
||||
FileChannel fc = null;
|
||||
FileInputStream fis = null;
|
||||
try {
|
||||
|
||||
if (this.resourceData.getFilename().endsWith("bcx")) {
|
||||
|
@ -167,14 +168,7 @@ public class BCDResource extends
|
|||
|
||||
this.gridGeometry = descriptor.getGridGeometry();
|
||||
wireframeShape = target.createWireframeShape(true, descriptor,
|
||||
0.0f, true, new PixelExtent(descriptor
|
||||
.getGridGeometry().getGridRange().getLow(0),
|
||||
descriptor.getGridGeometry().getGridRange()
|
||||
.getHigh(0), descriptor
|
||||
.getGridGeometry().getGridRange()
|
||||
.getLow(1), descriptor
|
||||
.getGridGeometry().getGridRange()
|
||||
.getHigh(1)));
|
||||
0.0f);
|
||||
// wireframeShape = target.createWireframeShape(true,
|
||||
// mapDescriptor);
|
||||
File file = new File(resourceData.getFilename());
|
||||
|
@ -187,8 +181,8 @@ public class BCDResource extends
|
|||
throw new VizException("Could not find bcd file",
|
||||
new FileNotFoundException(String.valueOf(file)));
|
||||
}
|
||||
FileInputStream fis = new FileInputStream(file);
|
||||
fc = fis.getChannel();
|
||||
fis = new FileInputStream(file);
|
||||
FileChannel fc = fis.getChannel();
|
||||
|
||||
ByteBuffer buffer = fc.map(MapMode.READ_ONLY, 0, file.length());
|
||||
|
||||
|
@ -200,8 +194,6 @@ public class BCDResource extends
|
|||
buffer.order(ByteOrder.LITTLE_ENDIAN);
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
|
||||
double minLat = Double.MAX_VALUE;
|
||||
double minLon = Double.MAX_VALUE;
|
||||
double maxLat = Double.MIN_VALUE;
|
||||
|
@ -254,7 +246,6 @@ public class BCDResource extends
|
|||
labels.add(new BcxLabel(label, pts[0], descriptor));
|
||||
wireframeShape.addLabel(label, labelPixel);
|
||||
}
|
||||
i++;
|
||||
}
|
||||
|
||||
if (isBCX) {
|
||||
|
@ -285,8 +276,8 @@ public class BCDResource extends
|
|||
|
||||
} finally {
|
||||
try {
|
||||
if (fc != null) {
|
||||
fc.close();
|
||||
if (fis != null) {
|
||||
fis.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// ignore
|
||||
|
|
|
@ -1,25 +1,23 @@
|
|||
package gov.noaa.nws.ncep.viz.overlays.resources;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import gov.noaa.nws.ncep.viz.resources.INatlCntrsResource;
|
||||
|
||||
import org.opengis.referencing.crs.CoordinateReferenceSystem;
|
||||
|
||||
import com.raytheon.uf.viz.core.exception.VizException;
|
||||
import com.raytheon.uf.viz.core.IGraphicsTarget;
|
||||
import com.raytheon.uf.viz.core.PixelExtent;
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
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.uf.viz.core.map.IMapDescriptor;
|
||||
import com.raytheon.uf.viz.core.rsc.AbstractVizResource;
|
||||
|
||||
import com.raytheon.uf.viz.core.rsc.LoadProperties;
|
||||
import com.vividsolutions.jts.geom.Coordinate;
|
||||
|
||||
/**
|
||||
* Implements a drawing layer to draw lat/lon lines
|
||||
* Implements a drawing layer to draw lat/lon lines
|
||||
*
|
||||
* <pre>
|
||||
* SOFTWARE HISTORY
|
||||
|
@ -31,6 +29,8 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
* 11/18/09 Greg Hull Incorporate to11d6 changes
|
||||
* 11/04/13 #880 Xiaochuan set one wireframeShape for one lat or Lon lines.
|
||||
* Set spatialChopFlag to be false.
|
||||
* Jul 28, 2014 3397 bclement switched to non deprecated version of createWireframeShape()
|
||||
* removed unneeded clearCoodrinatePointArrayList() method
|
||||
* </pre>
|
||||
*
|
||||
* @author mgao
|
||||
|
@ -38,9 +38,6 @@ import com.vividsolutions.jts.geom.Coordinate;
|
|||
*/
|
||||
public class LatLonOverlayResource extends AbstractVizResource<LatLonOverlayResourceData, IMapDescriptor>
|
||||
implements INatlCntrsResource {
|
||||
|
||||
private final static org.apache.log4j.Logger log =
|
||||
org.apache.log4j.Logger.getLogger(LatLonOverlayResource.class);
|
||||
|
||||
private LatLonOverlayResourceData latLonOverlayResourceData;
|
||||
|
||||
|
@ -54,8 +51,6 @@ public class LatLonOverlayResource extends AbstractVizResource<LatLonOverlayReso
|
|||
|
||||
private List<Coordinate[]> longitudeCoordinatePointArrayList;
|
||||
|
||||
private double offset = 0; //50000;
|
||||
|
||||
private double mapMinX;
|
||||
private double mapMaxY;
|
||||
private double mapMinY;
|
||||
|
@ -118,15 +113,12 @@ public class LatLonOverlayResource extends AbstractVizResource<LatLonOverlayReso
|
|||
*/
|
||||
clearWireFrameShapeArray(wireframeShapeForLatLineArray);
|
||||
clearWireFrameShapeArray(wireframeShapeForLonLineArray);
|
||||
clearCoordinatePointArrayList(latitudeCoordinatePointArrayList);
|
||||
clearCoordinatePointArrayList(longitudeCoordinatePointArrayList);
|
||||
|
||||
latitudeCoordinatePointArrayList = new ArrayList<Coordinate[]>(latitudeDrawingLineNumber);
|
||||
longitudeCoordinatePointArrayList = new ArrayList<Coordinate[]>(longitudeDrawingLineNumber);
|
||||
|
||||
wireframeShapeForLatLineArray = target.createWireframeShape(false,
|
||||
descriptor, 4.0f, false, new PixelExtent(
|
||||
getViewMinX()+offset, getViewMaxX()-offset, getViewMinY()+offset, getViewMaxY()-offset));
|
||||
descriptor, 4.0f);
|
||||
|
||||
double latitudeValue = -90;
|
||||
for(int i=0; i<latitudeDrawingLineNumber && latitudeValue <= 90; i++) {
|
||||
|
@ -143,8 +135,7 @@ public class LatLonOverlayResource extends AbstractVizResource<LatLonOverlayReso
|
|||
wireframeShapeForLatLineArray.compile();
|
||||
|
||||
wireframeShapeForLonLineArray = target.createWireframeShape(false,
|
||||
descriptor, 4.0f, false, new PixelExtent(
|
||||
getViewMinX()+offset, getViewMaxX()-offset, getViewMinY()+offset, getViewMaxY()-offset));
|
||||
descriptor, 4.0f);
|
||||
|
||||
double longitudeValue = -180;
|
||||
for(int i=0; i<longitudeDrawingLineNumber && longitudeValue <= 180; i++) {
|
||||
|
@ -379,15 +370,6 @@ public class LatLonOverlayResource extends AbstractVizResource<LatLonOverlayReso
|
|||
wireframeShapeArray = null;
|
||||
}
|
||||
}
|
||||
|
||||
private void clearCoordinatePointArrayList(List<Coordinate[]> coordinatePointArrayList) {
|
||||
if(coordinatePointArrayList != null) {
|
||||
for(Coordinate[] eachCoordinateArray : coordinatePointArrayList) {
|
||||
eachCoordinateArray = null;
|
||||
}
|
||||
coordinatePointArrayList = null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* the getters for Map's Min and Max X and Y, View's Min and Max X and Y
|
||||
|
|
Loading…
Add table
Reference in a new issue