com.swfm.mica.events
Class MiDelegateEvents

java.lang.Object
  extended bycom.swfm.mica.events.MiEventHandler
      extended bycom.swfm.mica.events.MiDelegateEvents
All Implemented Interfaces:
MiiCommandNames, MiiEventHandler, MiiEventTypes

public class MiDelegateEvents
extends MiEventHandler

Version:
%I% %G%
Author:
Michael L. Davis

Field Summary
     
Constructor Summary
MiDelegateEvents()
          Constructs a new MiDelegateEvents.
MiDelegateEvents(MiPart delegatee)
          Constructs a new MiDelegateEvents.
MiDelegateEvents(MiPart delegatee, int delegateOnlyThisEventType)
          Constructs a new MiDelegateEvents.
 
Method Summary
 MiPart getDelegatee()
          Returns the MiPart to delegate events to.
 int processEvent(MiEvent event)
          Processes the given event.
 void setDelegatee(MiPart delegatee)
          Specifies the MiPart to delegate events to.
 
Methods inherited from class com.swfm.mica.events.MiEventHandler
addEventToCommandTranslation, addEventToCommandTranslation, addEventToCommandTranslation, copy, getAlwaysConsumeTriggerEvents, getCommand, getEvent, getEventToCommandTranslation, getName, getNameForType, getObject, getRequestedCommands, getRequestedEvents, getTarget, getType, isCommand, isEnabled, isPositionDependent, isSingleton, isType, processCommand, processCommand, removeAllEventToCommandTranslations, removeEventToCommandTranslation, removeEventToCommandTranslation, removeEventToCommandTranslation, removeEventToCommandTranslation, setAlwaysConsumeTriggerEvents, setCommand, setEnabled, setEventToCommandTranslation, setEventToCommandTranslation, setEventToCommandTranslation, setIsSingleton, setName, setObject, setPositionDependent, setPropertyValue, setTarget, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MiDelegateEvents

public MiDelegateEvents()
Constructs a new MiDelegateEvents. This event handler, when assigned to a MiPart, forwards all events encountered to the delegatee MiPart.

See Also:
setDelegatee(com.swfm.mica.core.MiPart)

MiDelegateEvents

public MiDelegateEvents(MiPart delegatee)
Constructs a new MiDelegateEvents. This event handler, when assigned to a MiPart, forwards all events encountered to the delegatee MiPart.

Parameters:
delegatee - the part to forward events to.

MiDelegateEvents

public MiDelegateEvents(MiPart delegatee,
                        int delegateOnlyThisEventType)
Constructs a new MiDelegateEvents. This event handler, when assigned to a MiPart, forwards all events encountered to the delegatee MiPart.

Parameters:
delegatee - the part to forward events to.
delegateOnlyThisEventType - the type of the events to delegate (default value is Mi_ALL_EVENT_TYPES).
Method Detail

setDelegatee

public void setDelegatee(MiPart delegatee)
Specifies the MiPart to delegate events to.

Parameters:
delegatee - the part to foward events to

getDelegatee

public MiPart getDelegatee()
Returns the MiPart to delegate events to.

Returns:
the part to foward events to

processEvent

public int processEvent(MiEvent event)
Processes the given event. The event is forwarded to the delegatee and the status returned by the delegatee is in turn returned from this method.

Specified by:
processEvent in interface MiiEventHandler
Overrides:
processEvent in class MiEventHandler
Parameters:
event - The event to process
Returns:
Mi_CONSUME_EVENT if no other event handlers should see the event that generated the command Mi_PROPOGATE_EVENT if other event handlers can also see the event that generated the command