edu.brook.ascape.view
Class BaseAgentCellView

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--edu.brook.ascape.view.CanvasView
                    |
                    +--edu.brook.ascape.view.BaseCellView
                          |
                          +--edu.brook.ascape.view.BaseAgentCellView
Direct Known Subclasses:
Overhead2DView

public abstract class BaseAgentCellView
extends BaseCellView

A base class for drawing a collection of agents upon a collection of cells. By default, a base agent cell view draws agents as ovals, but any other draw behavior can be used by adding and selecting it.

Since:
1.0
Version:
1.2.6
See Also:
Serialized Form

Field Summary
protected  ColorFeature agentColorFeature
          The color feature used to set the agent draw color
protected  ImageFeature agentImageFeature
          The image feature used to draw the agent draw color
 DrawFeature agents_fill_cells_draw_feature
          Draws the provided object, assumed to be a cell with an occupant, by filling any unoccupied cells using the cell color feature interpretation, and filling any occupied cells using the agent color feature on the occupant.
 DrawFeature agents_image_cells_draw_feature
          Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color feature interpretation, and filling an oval using the agent color feature on the occupant.
 DrawFeature agents_oval_cells_draw_feature
          Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color feature interpretation, and filling an oval using the agent color feature on the occupant.
 
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
BaseAgentCellView()
           
 
Method Summary
 void build()
          Builds the view.
 ColorFeature getAgentColorFeature()
          Returns the color feature that will be used for determining agent color.
 void setAgentColorFeature(ColorFeature agentColorFeature)
          Set the color feature that will be used for determining agent color.
 void setAgentImageFeature(ImageFeature agentImageFeature)
          Set the image feature that will be used for determining agent image.
 
Methods inherited from class edu.brook.ascape.view.BaseCellView
cellAtPixel, displayCellCustomizer, displayViewCustomizer, drawSelectedCell, getBorderSize, getCellColorFeature, getCellSize, getCustomizeCell, getDrawSelection, hideCellCustomizer, onUpdate, requestUpdateAll, setBorderSize, setCellColorFeature, setCellSize, setCustomizeCell
 
Methods inherited from class edu.brook.ascape.view.CanvasView
addNotify, addScape, finalize, getDrawEveryNUpdates, getGraphicsRecorder, getName, getPreferredSize, getScape, getViewFrame, initializeBuffer, onIterate, onSetup, onStart, onStop, paint, removeScape, scapeUpdated, setDrawEveryNUpdates, setGraphicsRecorder, setName, setViewFrame, toString, 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

agentColorFeature

protected ColorFeature agentColorFeature
The color feature used to set the agent draw color

agentImageFeature

protected ImageFeature agentImageFeature
The image feature used to draw the agent draw color

agents_oval_cells_draw_feature

public final DrawFeature agents_oval_cells_draw_feature
Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color feature interpretation, and filling an oval using the agent color feature on the occupant.

agents_fill_cells_draw_feature

public final DrawFeature agents_fill_cells_draw_feature
Draws the provided object, assumed to be a cell with an occupant, by filling any unoccupied cells using the cell color feature interpretation, and filling any occupied cells using the agent color feature on the occupant.

agents_image_cells_draw_feature

public final DrawFeature agents_image_cells_draw_feature
Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color feature interpretation, and filling an oval using the agent color feature on the occupant.
Constructor Detail

BaseAgentCellView

public BaseAgentCellView()
Method Detail

build

public void build()
Builds the view. Sets the color feature defaults, adds the default oval and fill draw features, and selects the draw agents as ovals feature.
Overrides:
build in class BaseCellView

getAgentColorFeature

public ColorFeature getAgentColorFeature()
Returns the color feature that will be used for determining agent color. The default color feature is simply the getColor() method of the agent.

setAgentColorFeature

public void setAgentColorFeature(ColorFeature agentColorFeature)
Set the color feature that will be used for determining agent color. The default color feature is simply the getColor() method of the agent.
Parameters:
agentColorFeature - the color feature, whose object is assumed to be a cell living on this lattice

setAgentImageFeature

public void setAgentImageFeature(ImageFeature agentImageFeature)
Set the image feature that will be used for determining agent image. The default image feature is simply the getImage() method of the agent.
Parameters:
agentImageFeature - the image feature, whose object is assumed to be a cell living on this lattice

(c) 1998-2000 The Brookings Insitution
Webpage