org.ascape.view.vis
Class OverheadRelative2DView
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
org.ascape.view.vis.Overhead2DView
org.ascape.view.vis.OverheadRelative2DView
- 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
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
- Author:
- Miles Parker
- See Also:
- Serialized Form
Methods inherited from class org.ascape.view.vis.Overhead2DView |
calculateAgentSizeForViewSize, calculateViewSizeForAgentSize, drawCellAt, drawCellAtIfUpdate, drawNeighborsFor, drawSelectedAgentAt, isDrawByFeature, isDrawFarNeighbors, isDrawNetwork, isDrawSelectedNeighbors, setDrawByFeature, setDrawFarNeighbors, setDrawNetwork, setDrawSelectedNeighbors |
Methods inherited from class org.ascape.view.vis.AgentView |
addDrawFeature, 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 |
Methods inherited from class org.ascape.model.event.DefaultScapeListener |
clone, environmentQuiting, getScape, isGraphic, isLifeOfScape, isNotifyScapeAutomatically, notifyScapeUpdated, scapeClosing, scapeDeserialized, scapeInitialized, scapeNotification, scapeRemoved, scapeSetup, scapeStopped, setName, setNotifyScapeAutomatically |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
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
getOrigin
public Coordinate2DDiscrete getOrigin()
- Gets the origin.
- Returns:
- the origin
setOffset
public void setOffset(Coordinate2DDiscrete origin)
- Sets the offset.
- Parameters:
origin
- the new offset
scapeStarted
public void scapeStarted(ScapeEvent scapeEvent)
- Description copied from class:
DefaultScapeListener
- Called immediatly after the scape is started.
- Specified by:
scapeStarted
in interface ScapeListener
- Overrides:
scapeStarted
in class DefaultScapeListener
- Parameters:
scapeEvent
- the scape event
drawCellAtIfUpdate
public void drawCellAtIfUpdate(org.eclipse.draw2d.Graphics graphics,
int x,
int y)
- Description copied from class:
Overhead2DView
- Draw cell at if update.
- Overrides:
drawCellAtIfUpdate
in class Overhead2DView
x
- the xy
- the y
drawCellAt
public void drawCellAt(org.eclipse.draw2d.Graphics graphics,
int x,
int y)
- Description copied from class:
Overhead2DView
- Draw cell at.
- Overrides:
drawCellAt
in class Overhead2DView
x
- the xy
- the y
updateScapeGraphics
public void updateScapeGraphics(org.eclipse.draw2d.Graphics graphics)
- On notification of a scape update, draws the actual overhead view.
- Overrides:
updateScapeGraphics
in class Overhead2DView
getAgentAtPixel
public Agent getAgentAtPixel(int x,
int y)
- Description copied from class:
AgentView
- Returns the cell at the given pixel in this view.
- Overrides:
getAgentAtPixel
in class Overhead2DView
- Parameters:
x
- the horizontal pixel locationy
- the vertical pixel location
- Returns:
- the agent at pixel
drawSelectedAgent
public void drawSelectedAgent(org.eclipse.draw2d.Graphics g,
LocatedAgent a)
- Description copied from class:
AgentView
- Draws a marker for the provided selected agent.
- Overrides:
drawSelectedAgent
in class Overhead2DView
a
- the agent to draw