org.jscience.architecture.traffic.simulation.statistics
Class StatisticsOverlay

java.lang.Object
  extended by org.jscience.architecture.traffic.simulation.statistics.StatisticsOverlay
All Implemented Interfaces:
java.util.Observer, Overlay, XMLSerializable

public class StatisticsOverlay
extends java.lang.Object
implements Overlay, java.util.Observer, XMLSerializable

Overlay for gld.View. Shows waiting queue lengths and relative average junction waiting times.


Constructor Summary
StatisticsOverlay(View _view, Infrastructure _infra)
          Creates a default StatisticsOverlay.
 
Method Summary
 java.lang.String getXMLName()
          DOCUMENT ME!
 void load(XMLElement myElement, XMLLoader loader)
          DOCUMENT ME!
 int overlayType()
          DOCUMENT ME!
 void paint(java.awt.Graphics g)
          DOCUMENT ME!
 void refreshData()
          Rereads the statistical data from the model.
 void saveChilds(XMLSaver saver)
          DOCUMENT ME!
 XMLElement saveSelf()
          DOCUMENT ME!
 void setInfrastructure(Infrastructure _infra)
          Sets a new infrastructure as the current one and rereads all data.
 void setParentName(java.lang.String parentName)
          DOCUMENT ME!
 void update(java.util.Observable obs, java.lang.Object obj)
          Updates the current data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StatisticsOverlay

public StatisticsOverlay(View _view,
                         Infrastructure _infra)
Creates a default StatisticsOverlay.

Parameters:
_view - DOCUMENT ME!
_infra - DOCUMENT ME!
Method Detail

setInfrastructure

public void setInfrastructure(Infrastructure _infra)
Sets a new infrastructure as the current one and rereads all data.

Parameters:
_infra - DOCUMENT ME!

update

public void update(java.util.Observable obs,
                   java.lang.Object obj)
Updates the current data.

Specified by:
update in interface java.util.Observer
Parameters:
obs - DOCUMENT ME!
obj - DOCUMENT ME!

refreshData

public void refreshData()
Rereads the statistical data from the model.


overlayType

public int overlayType()
DOCUMENT ME!

Specified by:
overlayType in interface Overlay
Returns:
DOCUMENT ME!

paint

public void paint(java.awt.Graphics g)
           throws TrafficException
DOCUMENT ME!

Specified by:
paint in interface Overlay
Parameters:
g - DOCUMENT ME!
Throws:
TrafficException - DOCUMENT ME!

load

public void load(XMLElement myElement,
                 XMLLoader loader)
          throws XMLTreeException,
                 java.io.IOException,
                 XMLInvalidInputException
DOCUMENT ME!

Specified by:
load in interface XMLSerializable
Parameters:
myElement - DOCUMENT ME!
loader - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLInvalidInputException - DOCUMENT ME!

saveSelf

public XMLElement saveSelf()
                    throws XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveSelf in interface XMLSerializable
Returns:
DOCUMENT ME!
Throws:
XMLCannotSaveException - DOCUMENT ME!

saveChilds

public void saveChilds(XMLSaver saver)
                throws XMLTreeException,
                       java.io.IOException,
                       XMLCannotSaveException
DOCUMENT ME!

Specified by:
saveChilds in interface XMLSerializable
Parameters:
saver - DOCUMENT ME!
Throws:
XMLTreeException - DOCUMENT ME!
java.io.IOException - DOCUMENT ME!
XMLCannotSaveException - DOCUMENT ME!

getXMLName

public java.lang.String getXMLName()
DOCUMENT ME!

Specified by:
getXMLName in interface XMLSerializable
Returns:
DOCUMENT ME!

setParentName

public void setParentName(java.lang.String parentName)
DOCUMENT ME!

Specified by:
setParentName in interface XMLSerializable
Parameters:
parentName - DOCUMENT ME!