org.argouml.uml.ui
Class UMLChangeDispatch

java.lang.Object
  extended byorg.argouml.uml.ui.UMLChangeDispatch
All Implemented Interfaces:
Runnable, UMLUserInterfaceComponent

public class UMLChangeDispatch
extends Object
implements Runnable, UMLUserInterfaceComponent

This class is used to dispatch a UML model change event (which may occur on a non-UI) thread) to user interface components. The class is created in response to a UML Model change event being captured 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 mechanism.


Field Summary
private  Container container
           
private  int eventType
           
private  Object target
          The target of the proppanel that constructs this umlchangedispatch.
static int TARGET_CHANGED
          Dispatch a target changed event.
static int TARGET_CHANGED_ADD
          Dispatch a target changed event
static int TARGET_REASSERTED
          Dispatch a target reasserted event.
 
Constructor Summary
UMLChangeDispatch(Container uic, int et)
          Creates a UMLChangeDispatch.
 
Method Summary
private  void dispatch(Container theAWTContainer)
          Iterates through all children of this container.
 void run()
          Called by InvokeLater on user interface thread.
private  void synchronizedDispatch(Container cont)
           
 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).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

eventType

private int eventType

container

private Container container

target

private Object target
The target of the proppanel that constructs this umlchangedispatch.


TARGET_CHANGED_ADD

public static final int TARGET_CHANGED_ADD
Dispatch a target changed event

See Also:
Constant Field Values

TARGET_CHANGED

public static final int TARGET_CHANGED
Dispatch a target changed event.

See Also:
Constant Field Values

TARGET_REASSERTED

public static final int TARGET_REASSERTED
Dispatch a target reasserted event.

See Also:
Constant Field Values
Constructor Detail

UMLChangeDispatch

public UMLChangeDispatch(Container uic,
                         int et)
Creates a UMLChangeDispatch. eventType is overriden if a call to one of the event functions is called.

Parameters:
uic - user interface container to which changes are dispatched.
et - -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
See Also:
UMLUserInterfaceComponent.targetReasserted()

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 Runnable

dispatch

private void dispatch(Container theAWTContainer)
Iterates through all children of this container. If a child is another container then calls dispatch iteratively, if a child supports UMLUserInterfaceComponent then calls the appropriate method.

Parameters:
theAWTContainer - AWT container

synchronizedDispatch

private void synchronizedDispatch(Container cont)


ArgoUML © 1996-2005ArgoUML HomepageArgoUML Developers' pageArgoUML Cookbook