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

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Canvas
          extended by org.jscience.architecture.traffic.simulation.statistics.StatisticsView
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, java.util.Observer, javax.accessibility.Accessible
Direct Known Subclasses:
StatsBarView, StatsSummaryView, StatsTableView

public abstract class StatisticsView
extends java.awt.Canvas
implements java.util.Observer

The view of the statistics viewer, controlled by StatisticsController.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Nested classes/interfaces inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy
 
Field Summary
protected  int horScroll
          DOCUMENT ME!
protected  java.awt.Font infoFont
          DOCUMENT ME!
protected  java.awt.Rectangle paintArea
          DOCUMENT ME!
protected  StatisticsController parent
          DOCUMENT ME!
static java.lang.String SEP
          Separator used when saving data.
protected  StatisticsModel stats
          DOCUMENT ME!
protected  java.awt.Font tableFont
          DOCUMENT ME!
protected  java.awt.Font titleFont
          DOCUMENT ME!
protected  int verScroll
          DOCUMENT ME!
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
StatisticsView(StatisticsController _parent, StatisticsModel _stats)
          Creates a StatisticsView.
 
Method Summary
 int getHorScroll()
          Returns horScroll, the horizontal scrolling value.
protected  java.awt.Rectangle getPaintArea()
          Returns the extension-specific paint area of this view.
 StatisticsModel getStatisticsModel()
          Returns the StatisticsModel to be shown.
 int getVerScroll()
          Returns verScroll, the vertical scrolling value.
 void paint(java.awt.Graphics g)
          Paints the view.
protected abstract  void paintAreaChanged()
          Invoked when the paintArea is changed.
protected abstract  void paintStats(java.awt.Graphics g)
          Paints the statistics in Rectangle r on the view.
 void setBounds(int x, int y, int w, int h)
          Overrides default method to change paintArea accordingly.
 void setHorScroll(int hs)
          Sets horScroll, the horizontal scrolling value.
protected  void setPaintArea(java.awt.Rectangle r)
          Sets the extension-specific paint area of this view.
 void setStatisticsModel(StatisticsModel _stats)
          Sets the StatisticsModel to be shown.
 void setVerScroll(int vs)
          Sets verScroll, the vertical scrolling value.
 void update()
          Invoked when the view should be redone.
 void update(java.util.Observable obs, java.lang.Object obj)
          Invoked when the StatisticsModel is changed.
 
Methods inherited from class java.awt.Canvas
addNotify, createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeys, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusCycleRoot, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, layout, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeys, setFocusTraversalKeysEnabled, setFont, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

SEP

public static java.lang.String SEP
Separator used when saving data.


parent

protected StatisticsController parent
DOCUMENT ME!


stats

protected StatisticsModel stats
DOCUMENT ME!


horScroll

protected int horScroll
DOCUMENT ME!


verScroll

protected int verScroll
DOCUMENT ME!


paintArea

protected java.awt.Rectangle paintArea
DOCUMENT ME!


titleFont

protected final java.awt.Font titleFont
DOCUMENT ME!


infoFont

protected final java.awt.Font infoFont
DOCUMENT ME!


tableFont

protected final java.awt.Font tableFont
DOCUMENT ME!

Constructor Detail

StatisticsView

public StatisticsView(StatisticsController _parent,
                      StatisticsModel _stats)
Creates a StatisticsView.

Parameters:
_parent - TheSimModel statistics should be read from.
_stats - DOCUMENT ME!
Method Detail

update

public void update(java.util.Observable obs,
                   java.lang.Object obj)
Invoked when the StatisticsModel is changed.

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

update

public void update()
Invoked when the view should be redone.


paint

public void paint(java.awt.Graphics g)
Paints the view.

Overrides:
paint in class java.awt.Canvas
Parameters:
g - DOCUMENT ME!

setStatisticsModel

public void setStatisticsModel(StatisticsModel _stats)
Sets the StatisticsModel to be shown.

Parameters:
_stats - DOCUMENT ME!

getStatisticsModel

public StatisticsModel getStatisticsModel()
Returns the StatisticsModel to be shown.

Returns:
DOCUMENT ME!

setHorScroll

public void setHorScroll(int hs)
Sets horScroll, the horizontal scrolling value.

Parameters:
hs - DOCUMENT ME!

getHorScroll

public int getHorScroll()
Returns horScroll, the horizontal scrolling value.

Returns:
DOCUMENT ME!

setVerScroll

public void setVerScroll(int vs)
Sets verScroll, the vertical scrolling value.

Parameters:
vs - DOCUMENT ME!

getVerScroll

public int getVerScroll()
Returns verScroll, the vertical scrolling value.

Returns:
DOCUMENT ME!

setPaintArea

protected void setPaintArea(java.awt.Rectangle r)
Sets the extension-specific paint area of this view.

Parameters:
r - DOCUMENT ME!

getPaintArea

protected java.awt.Rectangle getPaintArea()
Returns the extension-specific paint area of this view.

Returns:
DOCUMENT ME!

setBounds

public void setBounds(int x,
                      int y,
                      int w,
                      int h)
Overrides default method to change paintArea accordingly.

Overrides:
setBounds in class java.awt.Component
Parameters:
x - DOCUMENT ME!
y - DOCUMENT ME!
w - DOCUMENT ME!
h - DOCUMENT ME!

paintAreaChanged

protected abstract void paintAreaChanged()
Invoked when the paintArea is changed.


paintStats

protected abstract void paintStats(java.awt.Graphics g)
Paints the statistics in Rectangle r on the view.

Parameters:
g - DOCUMENT ME!