|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.cosylab.gui.components.range2.RangedValuePolicy com.cosylab.gui.components.range2.RescalingValuePolicy
public class RescalingValuePolicy
Implementation of RangedValuePolicy
that resizes the range
based on the value parameter.
Whenever the value is set below minimum, minimum will be changed to the the value, decreased by factor (maximum - minimum). Same rule applies for maximum.
This policy is value dominant i.e., bounds will be adjusted to ensure that value is always valid. If either bound is set incorrectly, it will be adjusted to conform with this condition.Rule for adjusting bounds is as follows. Whenever value is either below minimum ore above maximum, the corresponding bound will be adjusted using value - range * factor or value + range * factor for minimum and maximum respectively, where range is maximum - minimum.
Constructor Summary | |
---|---|
RescalingValuePolicy()
Default constructor for RescalingValuePolicy. |
|
RescalingValuePolicy(double factor)
Constructor for RescalingValuePolicy. |
Method Summary | |
---|---|
double |
getFactor()
Returns rescaling factor. |
void |
setFactor(double factor)
Sets new rescaling factor. |
RangedValue |
validate(RangedValue params)
Adjusts bounds as specified in class JavaDoc. |
Methods inherited from class com.cosylab.gui.components.range2.RangedValuePolicy |
---|
addPeerPolicy, getPeerPolicy, insertPeerPolicy, removePeerPolicy, removePeerPolicyByType, validatePeerPolicy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RescalingValuePolicy()
public RescalingValuePolicy(double factor)
factor
- by which the range will be resized.Method Detail |
---|
public RangedValue validate(RangedValue params)
validate
in class RangedValuePolicy
params
- RangedValueHolder
com.cosylab.gui.components.range.RangedValuePolicy#validate(RangedValueHolder)
public double getFactor()
public void setFactor(double factor)
factor
- new rescaling factor.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |