org.argouml.uml.ui
Class UMLChangeDispatch

java.lang.Object
  |
  +--org.argouml.uml.ui.UMLChangeDispatch
All Implemented Interfaces:
java.util.EventListener, ru.novosoft.uml.MElementListener, java.lang.Runnable, UMLUserInterfaceComponent

public class UMLChangeDispatch
extends java.lang.Object
implements java.lang.Runnable, UMLUserInterfaceComponent

This class is used to dispatch a NSUML change event (which may occur on a non-UI) thread) to user interface components. The class is created in response to a NSUML change event being captures by a UMLUserInterfaceContainer and then is passed as an argument to InvokeLater to be run on the user interface thread.

This class is updated to cope with changes to the targetchanged mechanisme


Field Summary
static int DEFAULT
          Dispatch a default (target changed) event.
static int LIST_ROLE_ITEM_SET
          Dispatch a NSUML list role item set event.
static int PROPERTY_SET
          Dispatch a NSUML property set event.
static int RECOVERED
          Dispatch a NSUML recovered event.
static int REMOVED
          Dispatch a NSUML removed event.
static int ROLE_ADDED
          Dispatch a NSUML role added event.
static int ROLE_REMOVED
          Dispatch a NSUML role removed event.
static int TARGET_CHANGED
          Dispatch a target changed event.
static int TARGET_CHANGED_ADD
          Dispatch a target changed event and add a NSUML listener to the target afterwards.
static int TARGET_REASSERTED
          Dispatch a target reasserted event.
 
Constructor Summary
UMLChangeDispatch(java.awt.Container container, int eventType)
          Creates a UMLChangeDispatch. eventType is overriden if a call to one of the event functions is called.
 
Method Summary
 void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a listRoleItemSet event.
 void propertySet(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a propertySet event.
 void recovered(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a recovered event.
 void removed(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a removed event.
 void roleAdded(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a roleAdded event.
 void roleRemoved(ru.novosoft.uml.MElementEvent mee)
          configures this instance to dispatch a roleRemoved event.
 void run()
          Called by InvokeLater on user interface thread.
 void targetChanged()
          configures this instance to dispatch a targetChanged event.
 void targetReasserted()
          This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TARGET_CHANGED_ADD

public static final int TARGET_CHANGED_ADD

Dispatch a target changed event and add a NSUML listener to the target afterwards.


TARGET_CHANGED

public static final int TARGET_CHANGED

Dispatch a target changed event.


PROPERTY_SET

public static final int PROPERTY_SET

Dispatch a NSUML property set event.


LIST_ROLE_ITEM_SET

public static final int LIST_ROLE_ITEM_SET

Dispatch a NSUML list role item set event.


RECOVERED

public static final int RECOVERED

Dispatch a NSUML recovered event.


REMOVED

public static final int REMOVED

Dispatch a NSUML removed event.


ROLE_ADDED

public static final int ROLE_ADDED

Dispatch a NSUML role added event.


ROLE_REMOVED

public static final int ROLE_REMOVED

Dispatch a NSUML role removed event.


TARGET_REASSERTED

public static final int TARGET_REASSERTED

Dispatch a target reasserted event.


DEFAULT

public static final int DEFAULT

Dispatch a default (target changed) event.

Constructor Detail

UMLChangeDispatch

public UMLChangeDispatch(java.awt.Container container,
                         int eventType)
Creates a UMLChangeDispatch. eventType is overriden if a call to one of the event functions is called.
Parameters:
container - user interface container to which changes are dispatched.
eventType - -1 will add event listener to new target, 0 for default.
Method Detail

targetChanged

public void targetChanged()
configures this instance to dispatch a targetChanged event.
Specified by:
targetChanged in interface UMLUserInterfaceComponent

targetReasserted

public void targetReasserted()
Description copied from interface: UMLUserInterfaceComponent
This method is called when the navigation history has been changed (and navigation buttons may need to be updated). targetChanged implies navigationHistoryChanged, so this method will not be called after a targetChange.
Specified by:
targetReasserted in interface UMLUserInterfaceComponent

propertySet

public void propertySet(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a propertySet event.
Specified by:
propertySet in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event

listRoleItemSet

public void listRoleItemSet(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a listRoleItemSet event.
Specified by:
listRoleItemSet in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event

recovered

public void recovered(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a recovered event.
Specified by:
recovered in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event.

removed

public void removed(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a removed event.
Specified by:
removed in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event.

roleAdded

public void roleAdded(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a roleAdded event.
Specified by:
roleAdded in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event.

roleRemoved

public void roleRemoved(ru.novosoft.uml.MElementEvent mee)
configures this instance to dispatch a roleRemoved event.
Specified by:
roleRemoved in interface ru.novosoft.uml.MElementListener
Parameters:
mee - NSUML event

run

public void run()
Called by InvokeLater on user interface thread. Dispatches event to all contained objects implementing UMLUserInterfaceComponent. If event == -1, adds change listener to new target on completion of dispatch.
Specified by:
run in interface java.lang.Runnable


ArgoUML (c) 1996-2002
ArgoUML Project Home
ArgoUML Cookbook