org.ascape.view.vis
Class ComponentViewDelegate

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

public class ComponentViewDelegate
extends ScapeListenerDelegate

Manages the relationship between a component view and its scape, including determining when updates occur and managing the graphics recorder.

See Also:
Serialized Form

Field Summary
protected  int currentUpdate
          The update currently being drawn.
 
Fields inherited from class org.ascape.model.event.DefaultScapeListener
listeningToScape, name, scape
 
Constructor Summary
ComponentViewDelegate()
          Constructs the ComponentViewDelegate.
ComponentViewDelegate(ComponentView scapeView)
          Constructs the ComponentViewDelegate.
 
Method Summary
 void environmentQuiting(ScapeEvent scapeEvent)
          Called before the environment quits.
protected  void forceScapeNotify()
          Used to force a notification if the scape .
 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)
          Notifies the delegating view that something has happened on the scape.
 void scapeNotification(ScapeEvent scapeEvent)
          Notifies the delegating view that something has happened on the scape.
 void setGraphicsRecorder(MovieRecorder recorder)
          Sets the recorder that can be used to record the graphics of this view.
 void viewPainted()
          Handles anything that should occur when a componenent paint happens.
 
Methods inherited from class org.ascape.model.event.ScapeListenerDelegate
getScapeListener, notifyScapeUpdated, scapeRemoved, setScapeListener, toString
 
Methods inherited from class org.ascape.model.event.DefaultScapeListener
clone, getName, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, scapeInitialized, scapeIterated, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

currentUpdate

protected int currentUpdate
The update currently being drawn.

Constructor Detail

ComponentViewDelegate

public ComponentViewDelegate()
Constructs the ComponentViewDelegate.


ComponentViewDelegate

public ComponentViewDelegate(ComponentView scapeView)
Constructs the ComponentViewDelegate.

Parameters:
scapeView - the view this delegate is managing scape relationships for
Method Detail

scapeAdded

public void scapeAdded(ScapeEvent scapeEvent)
                throws java.util.TooManyListenersException
Notifies the listener that the scape has added it.

Specified by:
scapeAdded in interface ScapeListener
Overrides:
scapeAdded in class DefaultScapeListener
Parameters:
scapeEvent - the scape added notification event
Throws:
java.util.TooManyListenersException - the too many listeners exception
java.util.TooManyListenersException - on attempt to add this listener to another scape when one has already been assigned

scapeClosing

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

Specified by:
scapeClosing in interface ScapeListener
Overrides:
scapeClosing in class DefaultScapeListener
Parameters:
scapeEvent - the scape event

environmentQuiting

public void environmentQuiting(ScapeEvent scapeEvent)
Called before the environment quits. Allows any final view cleanup.

Specified by:
environmentQuiting in interface ScapeListener
Overrides:
environmentQuiting in class DefaultScapeListener
Parameters:
scapeEvent - the scape event

scapeNotification

public void scapeNotification(ScapeEvent scapeEvent)
Notifies the delegating view that something has happened on the scape. Manages recording and updating of views where appropriate, by calling repaint. When the paint subsequently occurs, the scape is notified.

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

scapeDeserialized

public void scapeDeserialized(ScapeEvent scapeEvent)
Notifies the delegating view that something has happened on the scape. Manages recording and updating of views where appropriate, by calling repaint. When the paint subsequently occurs, the scape is notified.

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

viewPainted

public void viewPainted()
Handles anything that should occur when a componenent paint happens. If recording, records. Notifes the scape. This method should be called from the component view paint methods.


forceScapeNotify

protected void forceScapeNotify()
Used to force a notification if the scape .


setGraphicsRecorder

public void setGraphicsRecorder(MovieRecorder recorder)
Sets the recorder that can be used to record the graphics of this view. If null, do not record.

Parameters:
recorder - the recorder


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