gumbo.visualize.data
Class AspectModelMonitor

java.lang.Object
  |
  +--gumbo.visualize.data.AspectModelMonitor

public class AspectModelMonitor
extends java.lang.Object

Singleton (global) monitor for aspect models. All aspect models are responsible for adding and removing themselves from this monitor. This monitor is in addition to the base class monitor (see DataModelMonitor).

Version:
$Revision: 1.9 $
Author:
Jon Barrilleaux (jonb@jmbaai.com) of JMB and Associates Inc.

Field Summary
static AspectModelMonitor GLOBAL
           
 
Method Summary
 void addAspectModelListener(java.lang.Object target, AspectModelListener listener)
          Adds an aspect model event listener, which will be notified anytime a change affects the target child client model in any aspect model.
 java.util.Collection findAllAspectModels(java.util.Collection childIds, java.util.Collection retVal)
          Convenience method that finds the parent aspect models corresponding to a group of child client models.
 java.util.Collection findAspectModels(java.lang.Object childId, java.util.Collection retVal)
          Finds the parent aspect models corresponding to a given child client model.
 void removeAspectModelListener(AspectModelListener listener)
          Removes an aspect model event listener, for all child target client models.
 void syncAspectModelListener(AspectModelListener listener)
          Syncs an aspect model event listener with the dynamic model state related to all its registered child target models by sending appropriate "add" and events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GLOBAL

public static final AspectModelMonitor GLOBAL
Method Detail

findAspectModels

public java.util.Collection findAspectModels(java.lang.Object childId,
                                             java.util.Collection retVal)
Finds the parent aspect models corresponding to a given child client model. Non-active (disposed) objects are silently ignored. Use dispose() to immediately remove an aspect model from active use.

Parameters:
childId - The child model's client ID. Null if none.
retVal - Return value object. Set of aspect models (AspectModel). Never null. Empty if childId is null or none are found.
Returns:
Reference to retVal. Never null.

findAllAspectModels

public java.util.Collection findAllAspectModels(java.util.Collection childIds,
                                                java.util.Collection retVal)
Convenience method that finds the parent aspect models corresponding to a group of child client models. Non-active (disposed) objects are silently ignored.

Parameters:
childIds - The child models' client IDs (Object). Never null.
retVal - Return value object. Set of aspect models (AspectModel). Never null. Can be childIds.
Returns:
Reference to retVal. Never null.

addAspectModelListener

public void addAspectModelListener(java.lang.Object target,
                                   AspectModelListener listener)
Adds an aspect model event listener, which will be notified anytime a change affects the target child client model in any aspect model. The listener order is undefined.

Parameters:
target - The target child's client ID. If null, all targets and an add and remove event with a null child will be sent when a parent is created and disposed.
listener - The event listener. Never null. If the listener is a duplicate, the previous entry will be replaced.

removeAspectModelListener

public void removeAspectModelListener(AspectModelListener listener)
Removes an aspect model event listener, for all child target client models.

Parameters:
listener - The event listener. Silently ignores missing and null listeners.

syncAspectModelListener

public void syncAspectModelListener(AspectModelListener listener)
Syncs an aspect model event listener with the dynamic model state related to all its registered child target models by sending appropriate "add" and events. The order of targets and events is undefined.

Parameters:
listener - The event listener. Silently ignores missing and null listeners.