DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class LimitedRangePolicy

java.lang.Object
  extended by com.cosylab.gui.components.range2.RangedValuePolicy
      extended by com.cosylab.gui.components.range2.LimitedRangePolicy

public class LimitedRangePolicy
extends RangedValuePolicy

This is the implementation of RangedValuePolicy that allows values of RangedValue to be only within the specified range. This range is defined by allowedMinimum and allowedMaximum. These values are independent from minimum and maximum defined in RangedValue in that no value can be outside these bounds, including minimum and maximum, but will be cropped to these values.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
LimitedRangePolicy(double allowedMinimum, double allowedMaximum)
          Constructor for LimitedRangedValuePolicy.
 
Method Summary
 RangedValue validate(RangedValue params)
          Passes the value triplet params that may be modified by validate method.
 
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

LimitedRangePolicy

public LimitedRangePolicy(double allowedMinimum,
                          double allowedMaximum)
Constructor for LimitedRangedValuePolicy.

Parameters:
rangedValue -
Method Detail

validate

public RangedValue validate(RangedValue params)
Description copied from class: RangedValuePolicy
Passes the value triplet params that may be modified by validate method. Regardles of the changes made, all three values will still be made to comply with the basic definition of RangedValue.

Before or after this policy has been executed it must call protected method validatePeerPolicy(RangedValue).

Specified by:
validate in class RangedValuePolicy
Parameters:
params - Triplet of values to validate.
Returns:
if the validation require the change of value or bounds of the RangedValue a new RangedValue with appropriate values should be returned
See Also:
com.cosylab.gui.components.range.RangedValuePolicy#validate(RangedValueHolder)


Copyright © 2010. All Rights Reserved.