edu.brook.ascape.view
Class OverheadRelative2DView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--edu.brook.ascape.view.CanvasView
                    |
                    +--edu.brook.ascape.view.BaseCellView
                          |
                          +--edu.brook.ascape.view.BaseAgentCellView
                                |
                                +--edu.brook.ascape.view.Overhead2DView
                                      |
                                      +--edu.brook.ascape.view.OverheadRelative2DView

public class OverheadRelative2DView
extends Overhead2DView

A scape view that draws a view of a 2-dimensional lattice with a relative origin.

Since:
1.1.1
Version:
1.1.2
See Also:
Serialized Form

Field Summary
protected  Coordinate2DDiscrete origin
           
 
Fields inherited from class edu.brook.ascape.view.Overhead2DView
drawNetwork
 
Fields inherited from class edu.brook.ascape.view.BaseAgentCellView
agentColorFeature, agentImageFeature, agents_fill_cells_draw_feature, agents_image_cells_draw_feature, agents_oval_cells_draw_feature
 
Fields inherited from class edu.brook.ascape.view.BaseCellView
borderSize, cellColorFeature, cellCustomizer, cells_fill_draw_feature, cells_fill_draw_inset_feature, cellSize, drawSelection, updateAllRequested, viewCustomizer
 
Fields inherited from class edu.brook.ascape.view.CanvasView
awaitingUpdate, bufferedGraphics, bufferedImage, currentUpdate, drawEveryNUpdates, frame, name, recorder, recordNext, scape
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Constructor Summary
OverheadRelative2DView()
          Constructs an overhead relative two-dimensional view.
OverheadRelative2DView(java.lang.String name)
          Constructs an overhead relative two-dimensional view.
 
Method Summary
 void addNotify()
          Override addNotify to build buffer.
 void addScape(Scape scape)
          Add a scape to this listener.
 Cell cellAtPixel(int x, int y)
           
 void drawCellAt(int x, int y)
           
 void drawCellAtIfUpdate(int x, int y)
           
protected  void drawSelectedCell(java.awt.Graphics g)
           
 Coordinate2DDiscrete getOrigin()
           
 void onStart()
           
 void onUpdate()
          On notification of a scape update, draws the actual overhead view.
 void setOffset(Coordinate2DDiscrete origin)
           
 java.lang.String toString()
          Returns a description of this view.
 
Methods inherited from class edu.brook.ascape.view.Overhead2DView
drawSelectedCellAt, getPreferredSize, setDrawNetwork
 
Methods inherited from class edu.brook.ascape.view.BaseAgentCellView
build, getAgentColorFeature, setAgentColorFeature, setAgentImageFeature
 
Methods inherited from class edu.brook.ascape.view.BaseCellView
displayCellCustomizer, displayViewCustomizer, getBorderSize, getCellColorFeature, getCellSize, getCustomizeCell, getDrawSelection, hideCellCustomizer, requestUpdateAll, setBorderSize, setCellColorFeature, setCellSize, setCustomizeCell
 
Methods inherited from class edu.brook.ascape.view.CanvasView
finalize, getDrawEveryNUpdates, getGraphicsRecorder, getName, getScape, getViewFrame, initializeBuffer, onIterate, onSetup, onStop, paint, removeScape, scapeUpdated, setDrawEveryNUpdates, setGraphicsRecorder, setName, setViewFrame, update, updated
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, bounds, checkImage, checkImage, coalesceEvents, contains, contains, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, doLayout, enable, enable, enableEvents, enableInputMethods, firePropertyChange, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont, getFontMetrics, getForeground, getGraphics, getHeight, getInputContext, getInputMethodRequests, getLocale, getLocation, getLocation, getLocationOnScreen, getMaximumSize, getMinimumSize, getParent, getPeer, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isFocusTraversable, isLightweight, isOpaque, 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, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, remove, removeComponentListener, removeFocusListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setSize, setSize, setVisible, show, show, size, transferFocus, validate
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

origin

protected Coordinate2DDiscrete origin
Constructor Detail

OverheadRelative2DView

public OverheadRelative2DView()
Constructs an overhead relative two-dimensional view.

OverheadRelative2DView

public OverheadRelative2DView(java.lang.String name)
Constructs an overhead relative two-dimensional view.
Parameters:
name - a user relevant name for this view
Method Detail

getOrigin

public Coordinate2DDiscrete getOrigin()

setOffset

public void setOffset(Coordinate2DDiscrete origin)

onStart

public void onStart()
Overrides:
onStart in class CanvasView

drawCellAtIfUpdate

public void drawCellAtIfUpdate(int x,
                               int y)
Overrides:
drawCellAtIfUpdate in class Overhead2DView

drawCellAt

public void drawCellAt(int x,
                       int y)
Overrides:
drawCellAt in class Overhead2DView

onUpdate

public void onUpdate()
On notification of a scape update, draws the actual overhead view.
Parameters:
scapeEvent - a scape event update, usually unspecified
Overrides:
onUpdate in class Overhead2DView

cellAtPixel

public Cell cellAtPixel(int x,
                        int y)
Overrides:
cellAtPixel in class Overhead2DView

drawSelectedCell

protected void drawSelectedCell(java.awt.Graphics g)
Overrides:
drawSelectedCell in class Overhead2DView

addNotify

public void addNotify()
Override addNotify to build buffer.
Overrides:
addNotify in class Overhead2DView

addScape

public void addScape(Scape scape)
              throws java.util.TooManyListenersException
Add a scape to this listener. A listener can be assigned only one scape.
Parameters:
scape - the scape to make this canvas the observer of
Throws:
java.util.TooManyListenersException - on attempt to add a scape when one is allready added
Overrides:
addScape in class CanvasView

toString

public java.lang.String toString()
Returns a description of this view.
Overrides:
toString in class CanvasView

(c) 1998-2000 The Brookings Insitution
Webpage