DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class TrimValuePolicy

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

public final class TrimValuePolicy
extends RangedValuePolicy

Ensures that value will never be outside the bounds. Bounds will never be adjusted, only the value will be trimmed to minimum and maximum. If values are changed, value will be adjusted accordingly.

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
TrimValuePolicy()
           
 
Method Summary
static RangedValue trim(RangedValue params)
          Trims value to bounds.
 RangedValue validate(RangedValue params)
          Trims value to bounds.
 
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

TrimValuePolicy

public TrimValuePolicy()
Method Detail

trim

public static RangedValue trim(RangedValue params)
Trims value to bounds.


validate

public RangedValue validate(RangedValue params)
Trims value to bounds.

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.