DESY ACOP Beans Home

com.cosylab.gui.components.range2
Class RangedValuePolicy

java.lang.Object
  extended by com.cosylab.gui.components.range2.RangedValuePolicy
Direct Known Subclasses:
IntegerValuePolicy, LimitedRangePolicy, ProperOrderPolicy, RescalingValuePolicy, ShiftValuePolicy, TrimValuePolicy

public abstract class RangedValuePolicy
extends java.lang.Object

This class represents adjustable policies for RangedValue. Whenever a change any of the values (minimum, maximum or value) is made in RangedValue validate method will be called giving the implementor of this interface the chance to adjust the values before they are set and property change events invoked.
Note: Regardles of the changes proposed by validate method, RangedValue will always ensure the proper relation between the values: values must always form increasing order (minimum, value, maximum).

Version:
$id$
Author:
Ales Pucelj

Constructor Summary
RangedValuePolicy()
           
 
Method Summary
 void addPeerPolicy(RangedValuePolicy p)
          Adds provided policy to the end of the chin
 RangedValuePolicy getPeerPolicy()
          Returns the peer policy.
 RangedValuePolicy insertPeerPolicy(RangedValuePolicy p)
          Inserts provided polici as first policy in chain, here next peer policy is this policy.
 RangedValuePolicy removePeerPolicy(RangedValuePolicy p)
          Removes provided policy from the chain, and returnes first policy in chain.
 RangedValuePolicy removePeerPolicyByType(java.lang.Class<? extends RangedValuePolicy> c)
          Removes provided policy from the chain, and returnes first policy in chain.
abstract  RangedValue validate(RangedValue params)
          Passes the value triplet params that may be modified by validate method.
protected  RangedValue validatePeerPolicy(RangedValue p)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RangedValuePolicy

public RangedValuePolicy()
Method Detail

validate

public abstract RangedValue validate(RangedValue params)
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).

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

insertPeerPolicy

public RangedValuePolicy insertPeerPolicy(RangedValuePolicy p)
Inserts provided polici as first policy in chain, here next peer policy is this policy.

Parameters:
p - new first policy in chain
Returns:
returns new first policy in chain, the p parameter.

addPeerPolicy

public void addPeerPolicy(RangedValuePolicy p)
Adds provided policy to the end of the chin

Parameters:
p -

getPeerPolicy

public RangedValuePolicy getPeerPolicy()
Returns the peer policy.

Returns:

removePeerPolicy

public RangedValuePolicy removePeerPolicy(RangedValuePolicy p)
Removes provided policy from the chain, and returnes first policy in chain.

Parameters:
p - policy to be removed from chain
Returns:
returns new first policy in chain, this or peer policy

removePeerPolicyByType

public RangedValuePolicy removePeerPolicyByType(java.lang.Class<? extends RangedValuePolicy> c)
Removes provided policy from the chain, and returnes first policy in chain.

Parameters:
p - policy to be removed from chain
Returns:
returns new first policy in chain, this or peer policy

validatePeerPolicy

protected RangedValue validatePeerPolicy(RangedValue p)


Copyright © 2010. All Rights Reserved.