org.ascape.model.event
Class ScapeListenerDelegate

java.lang.Object
  extended by org.ascape.model.event.DefaultScapeListener
      extended by org.ascape.model.event.ScapeListenerDelegate
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.EventListener, ScapeListener, HasName
Direct Known Subclasses:
ComponentViewDelegate, NonGraphicViewDelegate

public class ScapeListenerDelegate
extends DefaultScapeListener

Manages the relationship between a listener and its scape, including listener registeration and managing calling appopriate view methods for scape events.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.ascape.model.event.DefaultScapeListener
listeningToScape, name, scape
 
Constructor Summary
ScapeListenerDelegate()
          Constructs the ScapeListenerDelegate.
ScapeListenerDelegate(ScapeListener scapeListener)
          Constructs the ScapeListenerDelegate.
 
Method Summary
 ScapeListener getScapeListener()
          Returns the scape view that this delegate is responsible for.
 void notifyScapeUpdated()
          Calls the observed scape and notifies it that the view has finished updating its state.
 void scapeNotification(ScapeEvent scapeEvent)
          Notifies the delegating view that something has happened on the scape.
 void scapeRemoved(ScapeEvent scapeEvent)
          Notifies the listener that the scape has removed it.
 void setScapeListener(ScapeListener scapeListener)
          Sets the scape view that this delegate is responsible for.
 java.lang.String toString()
          Returns a description of the deleaget and is delegating view.
 
Methods inherited from class org.ascape.model.event.DefaultScapeListener
clone, environmentQuiting, getName, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, scapeAdded, scapeClosing, scapeDeserialized, scapeInitialized, scapeIterated, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ScapeListenerDelegate

public ScapeListenerDelegate()
Constructs the ScapeListenerDelegate.


ScapeListenerDelegate

public ScapeListenerDelegate(ScapeListener scapeListener)
Constructs the ScapeListenerDelegate.

Parameters:
scapeListener - the scape listener
Method Detail

scapeRemoved

public void scapeRemoved(ScapeEvent scapeEvent)
Notifies the listener that the scape has removed it. The scape event must be from the scape that this listener is listening to.

Specified by:
scapeRemoved in interface ScapeListener
Overrides:
scapeRemoved in class DefaultScapeListener
Parameters:
scapeEvent - the scape removed notification event
See Also:
scapeAdded

scapeNotification

public void scapeNotification(ScapeEvent scapeEvent)
Notifies the delegating view that something has happened on the scape. Calls the onIterate, onSetup, onStart, onStop, onClose, or onDeserialized method as appropriate. If isNotifyScapeAutomatically property is true (default), notifies scape when finished.

Specified by:
scapeNotification in interface ScapeListener
Overrides:
scapeNotification in class DefaultScapeListener
Parameters:
scapeEvent - a scape event update

notifyScapeUpdated

public void notifyScapeUpdated()
Calls the observed scape and notifies it that the view has finished updating its state. This method must be called after receiving any scapeNotification event or the model will stall.

Overrides:
notifyScapeUpdated in class DefaultScapeListener

getScapeListener

public ScapeListener getScapeListener()
Returns the scape view that this delegate is responsible for.

Returns:
the scape listener

setScapeListener

public void setScapeListener(ScapeListener scapeListener)
Sets the scape view that this delegate is responsible for.

Parameters:
scapeListener - the scape listener

toString

public java.lang.String toString()
Returns a description of the deleaget and is delegating view.

Overrides:
toString in class DefaultScapeListener
Returns:
the string


Copyright © 1998-2008 The Brookings Institution, NuTech Solutions, Metascape, LLC All Rights Reserved.