com.miginfocom.calendar.activity
Class ActivityStatePropagator

java.lang.Object
  extended by com.miginfocom.calendar.activity.ActivityStatePropagator
All Implemented Interfaces:
StatePropagator

public class ActivityStatePropagator
extends java.lang.Object
implements StatePropagator

A state propagator that propagates states between Activitys.


Constructor Summary
ActivityStatePropagator()
           
 
Method Summary
 boolean propagateStates(StateObservable source, int states, boolean b, StateObservable target, java.lang.Boolean multiSelectHint)
          Returns if state should be cleared or set for other.
protected  boolean propagateStatesImpl(StateObservable source, int state, boolean b, StateObservable target, java.lang.Boolean multiSelectHint)
          Returns if state should be cleared or set for other.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ActivityStatePropagator

public ActivityStatePropagator()
Method Detail

propagateStates

public boolean propagateStates(StateObservable source,
                               int states,
                               boolean b,
                               StateObservable target,
                               java.lang.Boolean multiSelectHint)
Description copied from interface: StatePropagator
Returns if state should be cleared or set for other.

Specified by:
propagateStates in interface StatePropagator
Parameters:
source - The source that just gotten, or is going to get a new state. Can be null, for instance when "nothing" is selected by pressing a point where nothing resides.
Note! The state may or may not already be set on this object, that is undefined. Get that from b.
states - The state (or states) that just got set or unset. E.g. GenericStates.SELECTED_BIT.
b - Whether state is, or was, set or unset.
target - The object to possibly change state for. Not null. Can be same as source, so that states within the same object can interact. This shouldn't be used as a veto function though, since it is not defined whether source has got its new state yet, or if it will get it after this method is called.
multiSelectHint - If != null it's a hint whether to select more (true) or deselect others. If null the implementation decides entierly.
Returns:
If some state was changed true is returned

propagateStatesImpl

protected boolean propagateStatesImpl(StateObservable source,
                                      int state,
                                      boolean b,
                                      StateObservable target,
                                      java.lang.Boolean multiSelectHint)
Returns if state should be cleared or set for other. This is an implementation of the same method that can take many states at at time.

Parameters:
source - The source that just gotten, or is going to get a new state. Can be null, for instance when "nothing" is selected by pressing a point where nothing resides.
Note! The state may or may not already be set on this object, that is undefined. Get that from b.
state - The state (Not more than one) that just got set or unset. E.g. GenericStates.SELECTED_BIT.
b - Whether state is, or was, set or unset.
target - The object to possibly change state for. Not null. Can be same as source, so that states within the same object can interact. This shouldn't be used as a veto function though, since it is not defined whether source has got its new state yet, or if it will get it after this method is called.
multiSelectHint - If != null it's a hint whether to select more (true) or deselect others. If null the implementation decides entierly.
Returns:
If some state was changed true is returned


Copyright © 2009 MiG InfoCom AB. All Rights Reserved.