Issue #2792 enforce getDensity() will not return above max
Change-Id: I3d9f8587f73f50083436900b9f8d058bfdc20af1 Former-commit-id:7f31e34dc9
[formerly384b531d26
] [formerly22153d43bb
[formerly a502a64219e869401b1bff82fbb73e67565a6dae]] Former-commit-id:22153d43bb
Former-commit-id:58c9dc0c69
This commit is contained in:
parent
bf4c119278
commit
e40fbf0ba0
1 changed files with 11 additions and 4 deletions
|
@ -27,14 +27,17 @@ import com.raytheon.uf.viz.core.VizConstants;
|
||||||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO Add Description
|
* A capability representing density of displayed items
|
||||||
*
|
*
|
||||||
* <pre>
|
* <pre>
|
||||||
*
|
*
|
||||||
* SOFTWARE HISTORY
|
* SOFTWARE HISTORY
|
||||||
* Date Ticket# Engineer Description
|
* Date Ticket# Engineer Description
|
||||||
* ------------ ---------- ----------- --------------------------
|
* ------------ ---------- ----------- --------------------------
|
||||||
* Apr 26, 2010 bsteffen Initial creation
|
* Apr 26, 2010 bsteffen Initial creation
|
||||||
|
* Mar 03, 2014 2792 njensen Enforce getDensity() will never return
|
||||||
|
* above MAX
|
||||||
|
*
|
||||||
*
|
*
|
||||||
* </pre>
|
* </pre>
|
||||||
*
|
*
|
||||||
|
@ -83,7 +86,11 @@ public class DensityCapability extends AbstractCapability {
|
||||||
* @return the density
|
* @return the density
|
||||||
*/
|
*/
|
||||||
public Double getDensity() {
|
public Double getDensity() {
|
||||||
return density;
|
if (density < MAX_THRESHOLD) {
|
||||||
|
return density;
|
||||||
|
} else {
|
||||||
|
return MAX_THRESHOLD;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -91,7 +98,7 @@ public class DensityCapability extends AbstractCapability {
|
||||||
* the density to set
|
* the density to set
|
||||||
*/
|
*/
|
||||||
public void setDensity(Double density) {
|
public void setDensity(Double density) {
|
||||||
if (this.density != density) {
|
if (!this.density.equals(density)) {
|
||||||
this.density = density;
|
this.density = density;
|
||||||
this.capabilityChanged();
|
this.capabilityChanged();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue