org.ascape.view.vis
Class HostedAgentView
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
org.ascape.view.vis.HostedAgentView
- 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:
- Overhead2DView
public abstract class HostedAgentView
- extends CellView
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
- Author:
- Miles Parker
- See Also:
- Serialized Form
Field Summary |
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_oval_cells_boundary_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_desc_draw_feature
Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color
feature interpretation, filling an oval using the agent color feature on the occupant, and printing a descriptive
string next to any agents. |
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. |
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.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 |
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_oval_cells_boundary_draw_feature
public final DrawFeature agents_oval_cells_boundary_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_oval_cells_desc_draw_feature
public final DrawFeature agents_oval_cells_desc_draw_feature
- Draws the provided object, assumed to be a cell with an occupant, by filling the cell using the cell color
feature interpretation, filling an oval using the agent color feature on the occupant, and printing a descriptive
string next to any agents.
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.
HostedAgentView
public HostedAgentView(java.lang.String name)
createFeatures
public void createFeatures()
- 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.
- Overrides:
createFeatures
in class CellView
getPrimaryAgentColorFeature
public ColorFeature getPrimaryAgentColorFeature()
- Returns the color feature that will be used for determining agent color. The default color feature is simply the
getForegroundColor() method of the agent.
- Overrides:
getPrimaryAgentColorFeature
in class CellView
- Returns:
- the primary agent color feature
setPrimaryAgentColorFeature
public void setPrimaryAgentColorFeature(ColorFeature cellColorFeature)
- Set the color feature that will be used for determining agent color. The default color feature is simply the
getForegroundColor() method of the agent.
- Overrides:
setPrimaryAgentColorFeature
in class CellView
- Parameters:
cellColorFeature
- the color feature, whose object is assumed to be a cell living on this lattice
getHostedAgentColorFeature
public ColorFeature getHostedAgentColorFeature()
- Returns the color feature that will be used for determining agent color. The default color feature is simply the
getForegroundColor() method of the agent.
- Returns:
- the hosted agent color feature
setHostedAgentColorFeature
public void setHostedAgentColorFeature(ColorFeature agentColorFeature)
- Set the color feature that will be used for determining agent color. The default color feature is simply the
getForegroundColor() method of the agent.
- Parameters:
agentColorFeature
- the color feature, whose object is assumed to be a cell living on this lattice