Merge "Issue #3145 - Fix Scan threat labels, dispose font" into omaha_14.3.1

Former-commit-id: e3c6407be3 [formerly 06b3cb4dd8f07600e6513a15a2495b485b0812b6]
Former-commit-id: 364f0d877a
This commit is contained in:
Lee Venable 2014-05-09 11:14:51 -05:00 committed by Gerrit Code Review
commit cd5956d21a
3 changed files with 18 additions and 4 deletions

View file

@ -58,6 +58,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 2307 dhladky Initial creation
* Apr 18, 2013 1916 njensen Bulk rendering
* May 09, 2014 3145 mpduff Fix threat report displays
*
*
* </pre>
@ -196,7 +197,8 @@ public class CWATLocalThreatResource extends CWATResource {
color);
ds.horizontalAlignment = HorizontalAlignment.CENTER;
ds.font = font;
ds.textStyle = TextStyle.BOXED;
ds.addTextStyle(TextStyle.BOXED);
ds.addTextStyle(TextStyle.BLANKED);
ds.verticallAlignment = VerticalAlignment.MIDDLE;
double[] center = descriptor.worldToPixel(new double[] {
loc.getLon(), loc.getLat() });

View file

@ -64,6 +64,7 @@ import com.vividsolutions.jts.geom.Point;
* ------------ ---------- ----------- --------------------------
* Oct 13, 2009 2307 dhladky Initial creation
* Apr 22, 2013 1926 njensen Faster rendering
* May 09, 2014 3145 mpduff Add getter for font so it can be disposed, javadoc fix
*
* </pre>
*
@ -85,7 +86,7 @@ public class ScanDrawer {
private RGB rscColor = null;
private GeometryFactory factory = new GeometryFactory();
private final GeometryFactory factory = new GeometryFactory();
// defaults
private double screenToWorldRatio = 0.0;
@ -668,14 +669,23 @@ public class ScanDrawer {
}
/**
* sets the screen to World ratio;
* Sets the font. The font must be disposed by class using this drawer
*
* @param screenToWorldRatio
* @param font
*/
public void setFont(IFont font) {
this.font = font;
}
/**
* Get the font
*
* @return font
*/
public IFont getFont() {
return font;
}
/**
* Sets the Cell drawing config up
*

View file

@ -85,6 +85,7 @@ import com.vividsolutions.jts.geom.Coordinate;
* Apr 02, 2013 1731 mpduff Fix problem with DMD updates.
* Apr 22, 2013 1926 njensen Faster rendering
* Mar 3, 2014 2804 mschenke Set back up clipping pane
* May 09, 2014 3145 mpduff Dispose the ScanDrawer font
* </pre>
*
* @author dhladky
@ -218,6 +219,7 @@ public class ScanResource extends
protected void disposeInternal() {
if (drawer != null) {
if (drawer.font != null) {
drawer.getFont().dispose();
drawer.setFont(null);
}
drawer = null;