Merge "Issue #2792 enforce getDensity() will not return above max" into development
Former-commit-id:2009972a2c
[formerly 7c04864c902d3928165ea0bc107902b094209ed6] Former-commit-id:bb9993e580
This commit is contained in:
commit
f38b4e42ba
1 changed files with 11 additions and 4 deletions
|
@ -27,7 +27,7 @@ import com.raytheon.uf.viz.core.VizConstants;
|
|||
import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
||||
|
||||
/**
|
||||
* TODO Add Description
|
||||
* A capability representing density of displayed items
|
||||
*
|
||||
* <pre>
|
||||
*
|
||||
|
@ -35,6 +35,9 @@ import com.raytheon.uf.viz.core.globals.VizGlobalsManager;
|
|||
* Date Ticket# Engineer Description
|
||||
* ------------ ---------- ----------- --------------------------
|
||||
* Apr 26, 2010 bsteffen Initial creation
|
||||
* Mar 03, 2014 2792 njensen Enforce getDensity() will never return
|
||||
* above MAX
|
||||
*
|
||||
*
|
||||
* </pre>
|
||||
*
|
||||
|
@ -83,7 +86,11 @@ public class DensityCapability extends AbstractCapability {
|
|||
* @return the density
|
||||
*/
|
||||
public Double getDensity() {
|
||||
if (density < MAX_THRESHOLD) {
|
||||
return density;
|
||||
} else {
|
||||
return MAX_THRESHOLD;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -91,7 +98,7 @@ public class DensityCapability extends AbstractCapability {
|
|||
* the density to set
|
||||
*/
|
||||
public void setDensity(Double density) {
|
||||
if (this.density != density) {
|
||||
if (!this.density.equals(density)) {
|
||||
this.density = density;
|
||||
this.capabilityChanged();
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue