public class BoundedIntervalDouble extends Object
BoundedValueDouble
minimum and maximum that can
span any interval in a given range. The UI can listen to changes by adding
listeners can attach to the
minimum and maximum
values and/or overriding the updateInterval(double, double)
method.Modifier and Type | Field and Description |
---|---|
protected double |
minIntervalSize
minimum interval size.
|
Constructor and Description |
---|
BoundedIntervalDouble(double rangeMin,
double rangeMax,
double initialMin,
double initialMax,
double minIntervalSize) |
Modifier and Type | Method and Description |
---|---|
BoundedValueDouble |
getMaxBoundedValue()
Get the current maximum of the interval.
|
BoundedValueDouble |
getMinBoundedValue()
Get the current minimum of the interval.
|
double |
getRangeMax()
Get the current maximum of the allowed range.
|
double |
getRangeMin()
Get the current minimum of the allowed range.
|
void |
setRange(double min,
double max)
Set the allowed range.
|
protected void |
updateInterval(double min,
double max)
|
protected final double minIntervalSize
max - min >= minIntervalSize
.public BoundedIntervalDouble(double rangeMin, double rangeMax, double initialMin, double initialMax, double minIntervalSize)
rangeMin
- lower bound of the allowed range. the interval minimum cannot
be lower than this.rangeMax
- upper bound of the allowed range. the interval maximum cannot
be lower than this.initialMin
- initial interval minimum.initialMax
- initial interval maximum.minIntervalSize
- interval is forced to have this size at least, i.e., max - min >= minIntervalSize
.protected void updateInterval(double min, double max)
min
or
max
values change. The default
implementation does nothing but derived classes can use it to trigger UI
updates, etc.min
- the new minimum of the intervalmax
- the new maximum of the intervalpublic BoundedValueDouble getMinBoundedValue()
public BoundedValueDouble getMaxBoundedValue()
public double getRangeMin()
getMinBoundedValue()
, getMaxBoundedValue()
) is be a
non-empty interval within the allowed range.)public double getRangeMax()
getMinBoundedValue()
, getMaxBoundedValue()
) is be a
non-empty interval within the allowed range.)public void setRange(double min, double max)
getMinBoundedValue()
,
getMaxBoundedValue()
) is enforced to be a non-empty interval
within the allowed range.min
- minimum of the allowed range.max
- maximum of the allowed range.Copyright © 2015–2021 Fiji. All rights reserved.