Issue #2832 consolidate watch and warning recycle logic
Change-Id: I9d7e284bafbe8073ac99eb3ce0e7fbd81f3ff889 Former-commit-id:057f7671a0
[formerly057f7671a0
[formerly 814d21d0a5b58c95f6339e1816788953692f5e95]] Former-commit-id:8cd98e0b9f
Former-commit-id:1646574f5a
This commit is contained in:
parent
ea372042a5
commit
33d7e39376
3 changed files with 38 additions and 47 deletions
|
@ -84,6 +84,8 @@ import com.vividsolutions.jts.geom.prep.PreparedGeometryFactory;
|
|||
* Sep 4, 2013 2176 jsanchez Made the polygon line width thicker and made regular text not bold.
|
||||
* Nov 11, 2013 2439 rferrel Changes to prevent getting future warning when in DRT mode.
|
||||
* Dec 3, 2013 2576 jsanchez Increased the font size of EMER.
|
||||
* Mar 10, 2014 2832 njensen Moved duplicated subclass's disposeInternal() logic here
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jsanchez
|
||||
|
@ -695,4 +697,34 @@ public abstract class AbstractWWAResource extends
|
|||
}
|
||||
return timeRange;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void disposeInternal() {
|
||||
for (WarningEntry entry : entryMap.values()) {
|
||||
if (entry.shadedShape != null) {
|
||||
entry.shadedShape.dispose();
|
||||
}
|
||||
if (entry.wireframeShape != null) {
|
||||
entry.wireframeShape.dispose();
|
||||
}
|
||||
|
||||
/*
|
||||
* we set this to true and keep the entries around solely in case
|
||||
* this resource is being recycled
|
||||
*/
|
||||
entry.project = true;
|
||||
}
|
||||
|
||||
if (warningsFont != null) {
|
||||
warningsFont.dispose();
|
||||
// set font to null for recycle safety
|
||||
warningsFont = null;
|
||||
}
|
||||
|
||||
if (emergencyFont != null) {
|
||||
emergencyFont.dispose();
|
||||
// set font to null for recylcle safety
|
||||
emergencyFont = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -63,8 +63,8 @@ import com.vividsolutions.jts.geom.Geometry;
|
|||
* Jul 24, 2013 DR16350 mgamazaychikov Fix the problem with plotting EXP warning
|
||||
* Sep 5, 2013 2176 jsanchez Disposed the emergency font.
|
||||
* Feb 19, 2014 2819 randerso Removed unnecessary .clone() call
|
||||
* Mar 04, 2014 2832 njensen Set fonts to null in disposeInternal() so recycle works
|
||||
* Set entry.project to true for recycle
|
||||
* Mar 04, 2014 2832 njensen Moved disposeInternal() to abstract class
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jsanchez
|
||||
|
@ -134,30 +134,7 @@ public class WarningsResource extends AbstractWWAResource {
|
|||
@Override
|
||||
protected void disposeInternal() {
|
||||
cancelRefreshTask(this);
|
||||
for (WarningEntry entry : entryMap.values()) {
|
||||
if (entry.shadedShape != null) {
|
||||
entry.shadedShape.dispose();
|
||||
}
|
||||
if (entry.wireframeShape != null) {
|
||||
entry.wireframeShape.dispose();
|
||||
}
|
||||
|
||||
/*
|
||||
* we set this to true and keep the entries around solely in case
|
||||
* this resource is being recycled
|
||||
*/
|
||||
entry.project = true;
|
||||
}
|
||||
|
||||
if (warningsFont != null) {
|
||||
warningsFont.dispose();
|
||||
warningsFont = null;
|
||||
}
|
||||
|
||||
if (emergencyFont != null) {
|
||||
emergencyFont.dispose();
|
||||
emergencyFont = null;
|
||||
}
|
||||
super.disposeInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,7 +53,8 @@ import com.vividsolutions.jts.geom.GeometryFactory;
|
|||
* Nov 8, 2013 16758 mgamazaychikov Changed access modifier of mergeWatches to protected
|
||||
* so a child class can override the implementation.
|
||||
* Feb 19, 2014 2819 randerso Removed unnecessary .clone() call
|
||||
* Mar 04, 2014 2832 njensen Set fonts to null in disposeInternal() so recycle works
|
||||
* Mar 04, 2014 2832 njensen Moved disposeInternal() to abstract class
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
* @author jsanchez
|
||||
|
@ -131,26 +132,7 @@ public class WatchesResource extends AbstractWWAResource {
|
|||
@Override
|
||||
protected void disposeInternal() {
|
||||
timer.cancel();
|
||||
|
||||
for (WarningEntry entry : entryMap.values()) {
|
||||
if (entry.shadedShape != null) {
|
||||
entry.shadedShape.dispose();
|
||||
}
|
||||
if (entry.wireframeShape != null) {
|
||||
entry.wireframeShape.dispose();
|
||||
}
|
||||
}
|
||||
|
||||
entryMap.clear();
|
||||
if (warningsFont != null) {
|
||||
warningsFont.dispose();
|
||||
warningsFont = null;
|
||||
}
|
||||
|
||||
if (emergencyFont != null) {
|
||||
emergencyFont.dispose();
|
||||
emergencyFont = null;
|
||||
}
|
||||
super.disposeInternal();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Add table
Reference in a new issue