## org.ascape.view.vis
Class CellView

    java.lang.Object
      org.ascape.model.event.DefaultScapeListener
          org.eclipse.amp.escape.ascape.view.ModelScapeView
              org.eclipse.amp.escape.ascape.view.EditPartFactoryScapeView
                  org.eclipse.amp.escape.ascape.view.EditPartScapeView
                      org.ascape.view.vis.GraphicsView
                          org.ascape.view.vis.AgentView
                              org.ascape.view.vis.CellView

All Implemented Interfaces:
  java.io.Serializable, java.lang.Cloneable, java.util.EventListener, java.util.Observer, ScapeListener, HasName, IDrawSelection, org.eclipse.core.runtime.IAdaptable, org.eclipse.gef.EditPartFactory, org.eclipse.jface.viewers.ISelectionProvider

Direct Known Subclasses:
  HostedAgentView, Scrolling1DView, StretchyView

    public abstract class CellView

extends AgentView

A generic base class for views that draw some kind of spatial view of a group of cells. Cell views have a default draw feature that draws a background for the cell, using the cell color feature.

Since:
  1.0
Version:
  3.0
Author:
  Miles Parker
See Also:
  Serialized Form

Field Summary
`protected int` `borderSize` Size of border around each cell.
`DrawFeature` `cells_fill_draw_feature` Draws the provided object, assumed to be a cell, by filling it using the cell color feature.
`DrawFeature` `cells_fill_draw_inset_feature` Draws the provided object, assumed to be a cell, by filling it using the cell color feature.

Fields inherited from class org.ascape.view.vis.AgentView
`agentColorFeature, drawSelection`

Fields inherited from class org.ascape.view.vis.GraphicsView
`agentSize, image, imageFigure, imageGC, imageGraphics`

Fields inherited from class org.ascape.model.event.DefaultScapeListener
`listeningToScape, scape`

Constructor Summary
`CellView(java.lang.String name)` Constructs a CellView, adding a listener to present a settings frame when the user double-clicks on the view.

Method Summary
`void` `createFeatures()`
`int` `getBorderSize()` Returns a one-dimension size in pixels of the cell border.
`ColorFeature` `getCellColorFeature()` Returns the color feature that will be used for determining cell color.
`int` `getCellSize()` Returns a one-dimension size of pixels used to represent each cell.
`ColorFeature` `getPrimaryAgentColorFeature()` Returns the color feature that will be used for determining cell color.
`void` `setBorderSize(int borderSize)` Sets the border size in pixels.
`void` `setCellColorFeature(ColorFeature agentColorFeature)` Set the color feature that will be used for determining cell color.
`void` `setCellSize(int cellSize)` Sets the number of pixels used to represent each cell.
`void` `setPrimaryAgentColorFeature(ColorFeature cellColorFeature)` Set the color feature that will be used for determining cell color.

Methods inherited from class org.ascape.view.vis.AgentView
`addDrawFeature, calculateAgentSizeForViewSize, calculateViewSizeForAgentSize, drawSelectedAgent, getAgentAtPixel, getAgentColorFeature, getAgentSize, getDrawFeatures, getDrawFeaturesObservable, getDrawSelection, getMiniumSizeWithin, getPreferredSizeWithin, removeDrawFeature, setAgentColorFeature, setAgentSize, update`

Methods inherited from class org.ascape.view.vis.GraphicsView
`addSelectionChangedListener, createEditPart, createImage, createImageFigure, getImage, getImageFigure, getMinimumSizeWithin, getSelection, getSize, refresh, removeSelectionChangedListener, scapeAdded, scapeIterated, setSelection, updateScapeGraphics`

Methods inherited from class org.eclipse.amp.escape.ascape.view.EditPartScapeView
`createInput`

Methods inherited from class org.eclipse.amp.escape.ascape.view.EditPartFactoryScapeView
`getAdapter, getRootPart`

Methods inherited from class org.eclipse.amp.escape.ascape.view.ModelScapeView
`getModel, getName, toString`

Methods inherited from class org.ascape.model.event.DefaultScapeListener
`clone, environmentQuiting, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, notifyScapeUpdated, scapeClosing, scapeDeserialized, scapeInitialized, scapeNotification, scapeRemoved, scapeSetup, scapeStarted, scapeStopped, setName, setNotifyScapeAutomatically`

Methods inherited from class java.lang.Object
`equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### cells_fill_draw_feature

    public final DrawFeature cells_fill_draw_feature

  Draws the provided object, assumed to be a cell, by filling it using the cell color feature.

### cells_fill_draw_inset_feature

    public final DrawFeature cells_fill_draw_inset_feature

  Draws the provided object, assumed to be a cell, by filling it using the cell color feature.

### borderSize

    protected int borderSize

  Size of border around each cell. 0 by default.

Constructor Detail

### CellView

    public CellView(java.lang.String name)

  Constructs a CellView, adding a listener to present a settings frame when the user double-clicks on the view.

Method Detail

### createFeatures

    public void createFeatures()

  Overrides:
    `createFeatures` in class `AgentView`

### getPrimaryAgentColorFeature

    public ColorFeature getPrimaryAgentColorFeature()

  Returns the color feature that will be used for determining cell color. The default color feature is simply the getForegroundColor() method of the cell.

### setPrimaryAgentColorFeature

    public void setPrimaryAgentColorFeature(ColorFeature cellColorFeature)

  Set the color feature that will be used for determining cell color. The default color feature is simply the getForegroundColor() method of the cell.

  Parameters:
    `cellColorFeature` - the color feature, whose object is assumed to be a cell populating this lattice

### getCellColorFeature

    public ColorFeature getCellColorFeature()

  Returns the color feature that will be used for determining cell color. Mirrors agent color feature. Essentially here for backward compatibility. The default color feature is simply the getForegroundColor() method of the cell.

  Returns:
    the cell color feature

### setCellColorFeature

    public void setCellColorFeature(ColorFeature agentColorFeature)

  Set the color feature that will be used for determining cell color. Mirrors agent color feature. Essentially here for backward compatibility. The default color feature is simply the getForegroundColor() method of the cell.

  Parameters:
    `agentColorFeature` - the color feature, whose object is assumed to be a cell populating this lattice

### getBorderSize

    public int getBorderSize()

  Returns a one-dimension size in pixels of the cell border.

  Returns:
    the border size

### setBorderSize

    public void setBorderSize(int borderSize)

  Sets the border size in pixels.

  Parameters:
    `borderSize` - number of pixels

### getCellSize

    public int getCellSize()

  Returns a one-dimension size of pixels used to represent each cell.

  Returns:
    the cell size

### setCellSize

    public void setCellSize(int cellSize)

  Sets the number of pixels used to represent each cell.

  Parameters:
    `cellSize` - number of pixels per edge