org.ascape.model.event
Interface ScapeListener

All Superinterfaces:
java.lang.Cloneable, java.util.EventListener, HasName
All Known Subinterfaces:
ComponentView, ScapeCustomizer
All Known Implementing Classes:
AbstractUIEnvironment, AgentCustomizer, AgentSelectionView, AgentSizedView, AgentView, AllOutputView, AllOutputViewElement, AntChartViewElement, AutoCustomizer, AutoCustomizerSwing, BaseCustomizer, BatchView, BufferView, CellView, ChartCustomizer, ChartView, ComponentViewDelegate, ConsoleOutView, ControlActionView, ControlBarView, DataOutputView, DataOutputViewElement, DataView, DefaultScapeListener, DesktopEnvironment, EntityRelationView, ERVViewCustomizer, FixedAgentStretchyView, FixedStretchyView, HostedAgentView, MapView, MenuBarView, ModelCustomizer, ModelCustomizerSwing, MovingStretchyView, Navigator, NonGraphicView, NonGraphicViewDelegate, Overhead2DContinuousView, Overhead2DView, OverheadRelative2DView, PanelView, ParameterControlView, Plot2DView, Query, RuntimeEnvironment, Scape, ScapeFromFileView, ScapeFromXMLView, ScapeListenerDelegate, ScapeOutputView, ScapeOutputViewElement, ScapeStateView, ScapeTime, ScapeTransitionListener, ScapeTransitionPanelView, Scrolling1DView, SearchView, SimpleControlView, SimplexView, SpeedSliderView, StandardOutView, StretchyView, SweepControlView, SwingEnvironment, ViewCustomizer

public interface ScapeListener
extends java.util.EventListener, HasName, java.lang.Cloneable

A listener to an agent scape. When a scape is updated, it is the listener's responsility to update itself, and then inform the scape that updating is finished, so that the scape can continue iterating through its rules.

Since:
1.0
Version:
2.9.1
Author:
Miles Parker
See Also:
DefaultScapeListener, ScapeListenerDelegate

Method Summary
 java.lang.Object clone()
          Require public access for clone.
 void environmentQuiting(ScapeEvent scapeEvent)
          Method called as the environment is about to quit.
 Scape getScape()
          Returns the Scape being viewed.
 boolean isGraphic()
          Returns true if the listener is a graphical user interface component.
 boolean isLifeOfScape()
          Returns true if the listener is intended to be used only for the current scape; typical of all but control related listeners.
 void scapeAdded(ScapeEvent scapeEvent)
          Notifies the listener that the scape has added it.
 void scapeClosing(ScapeEvent scapeEvent)
          Method called as the scape is about to be closed.
 void scapeDeserialized(ScapeEvent scapeEvent)
          Method called immediatly after a model is deserialized.
 void scapeInitialized(ScapeEvent scapeEvent)
          Called immediatly after the scape is initialized.
 void scapeIterated(ScapeEvent scapeEvent)
          Called immediatly after scape is iterated.
 void scapeNotification(ScapeEvent scapeEvent)
          Informs the listener that the agent scape has some kind of notification for the listener,.
 void scapeRemoved(ScapeEvent scapeEvent)
          Removes the scape from this view.
 void scapeSetup(ScapeEvent scapeEvent)
          Method called when the scape is ready for setup.
 void scapeStarted(ScapeEvent scapeEvent)
          Called immediatly after the scape is started.
 void scapeStopped(ScapeEvent scapeEvent)
          Called immediatly after the scape is stopped.
 
Methods inherited from interface org.ascape.util.HasName
getName
 

Method Detail

scapeInitialized

void scapeInitialized(ScapeEvent scapeEvent)
Called immediatly after the scape is initialized.

Parameters:
scapeEvent - the scape event

scapeStarted

void scapeStarted(ScapeEvent scapeEvent)
Called immediatly after the scape is started.

Parameters:
scapeEvent - the scape event

scapeStopped

void scapeStopped(ScapeEvent scapeEvent)
Called immediatly after the scape is stopped.

Parameters:
scapeEvent - the scape event

scapeIterated

void scapeIterated(ScapeEvent scapeEvent)
Called immediatly after scape is iterated.

Parameters:
scapeEvent - the scape event

scapeSetup

void scapeSetup(ScapeEvent scapeEvent)
Method called when the scape is ready for setup. That is, the scape has been created (or it has just finished its previous run) but it has not yet been initialized. This is an appropriate place to change model paramters, persent user's with options, etc.

Parameters:
scapeEvent - the scape event

scapeClosing

void scapeClosing(ScapeEvent scapeEvent)
Method called as the scape is about to be closed. Allows any final view cleanup.

Parameters:
scapeEvent - the scape event

environmentQuiting

void environmentQuiting(ScapeEvent scapeEvent)
Method called as the environment is about to quit. Note that this method may not actually be called by a scape at all. Allows any final view cleanup.

Parameters:
scapeEvent - the scape event

scapeDeserialized

void scapeDeserialized(ScapeEvent scapeEvent)
Method called immediatly after a model is deserialized.

Parameters:
scapeEvent - the scape event

scapeNotification

void scapeNotification(ScapeEvent scapeEvent)
Informs the listener that the agent scape has some kind of notification for the listener,.

Parameters:
scapeEvent - the scape setup event

scapeAdded

void scapeAdded(ScapeEvent scapeEvent)
                throws java.util.TooManyListenersException
Notifies the listener that the scape has added it. This is in affect a call back from the scape after adding the listener. At this point, the listener is responsible for responding back to the scape upon any notifications. A listener typically has one and only one scape, see below. A "good citizen" listener will typically make certain that it isn't added to more than one scape at a time, but one can also imagine cases where a listener might be interested in the activities of many scapes and this would be a perfectly legitimate usage pattern.

Parameters:
scapeEvent - the scape add event
Throws:
java.util.TooManyListenersException - the too many listeners exception

scapeRemoved

void scapeRemoved(ScapeEvent scapeEvent)
Removes the scape from this view. Typically there should ony be one scape to remove. This method must be called whenever a listener is destroyed or becomes unresponsive; otherwise the model will wait indefinetly for the listener's updated response.

Parameters:
scapeEvent - the scape removed event
See Also:
scapeAdded

isGraphic

boolean isGraphic()
Returns true if the listener is a graphical user interface component.

Returns:
true, if is graphic

isLifeOfScape

boolean isLifeOfScape()
Returns true if the listener is intended to be used only for the current scape; typical of all but control related listeners.

Returns:
true, if is life of scape

getScape

Scape getScape()
Returns the Scape being viewed.

Returns:
the scape

clone

java.lang.Object clone()
Require public access for clone.

Returns:
the object


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