org.ascape.view.vis
Class Overhead2DContinuousView

java.lang.Object
  extended by org.ascape.model.event.DefaultScapeListener
      extended by org.eclipse.amp.escape.ascape.view.ModelScapeView
          extended by org.eclipse.amp.escape.ascape.view.EditPartFactoryScapeView
              extended by org.eclipse.amp.escape.ascape.view.EditPartScapeView
                  extended by org.ascape.view.vis.GraphicsView
                      extended by org.ascape.view.vis.AgentView
                          extended by org.ascape.view.vis.Overhead2DContinuousView
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 Overhead2DContinuousView
extends AgentView

The Class Overhead2DContinuousView.

See Also:
Serialized Form

Field Summary
 DrawFeature agents_fill_draw_feature
          Draws the provided object, assumed to be a agent, by filling it using the agent color feature.
 DrawFeature agents_fill_draw_inset_feature
          Draws the provided object, assumed to be a agent, by filling it using the agent 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
Overhead2DContinuousView()
          Constructs a BaseAgentView, adding a listener to present a settings frame when the user double-clicks on the view.
Overhead2DContinuousView(java.lang.String name)
          Instantiates a new overhead2 D continuous view.
 
Method Summary
 void createFeatures()
           
 void drawAgentAt(org.eclipse.draw2d.Graphics graphics, LocatedAgent agent, int x, int y, DrawFeature feature)
          Draw agent at.
 void drawAgentAtIfUpdate(org.eclipse.draw2d.Graphics graphics, LocatedAgent agent, int x, int y)
          Draw agent at if update.
 void drawSelectedAgent(org.eclipse.draw2d.Graphics g, LocatedAgent a)
          Set the image feature that will be used for determining agent color.
 Agent getAgentAtPixel(int pixelX, int pixelY)
          Returns the agent at the given pixel in this view.
 ColorFeature getAgentColorFeature()
          Returns the color feature that will be used for determining agent color.
 org.eclipse.swt.graphics.Color getBackgroundColor()
           
 Coordinate getCoordinateAtPixel(int pixelX, int pixelY)
          Returns the agent at the given pixel in this view.
 int getNominalAgentSize()
          Gets the nominal agent size.
 org.eclipse.draw2d.geometry.Dimension getPreferredSize()
           
 org.eclipse.draw2d.geometry.Dimension getPreferredSizeWithin(org.eclipse.draw2d.geometry.Dimension d)
           
 ColorFeature getPrimaryAgentColorFeature()
          Returns the color feature that will be used for determining agent color.
 boolean isDrawSelectedNeighbors()
          Checks if is draw selected neighbors.
 void setAgentColorFeature(ColorFeature agentColorFeature)
          Set the color feature that will be used for determining agent color.
 void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)
           
 void setDrawSelectedNeighbors(boolean drawSelectedNeighbors)
          Sets the draw selected neighbors.
 void setNominalAgentSize(int nominalAgentSize)
          Sets the nominal agent size.
 void setPreferredSize(org.eclipse.draw2d.geometry.Dimension preferredSize)
           
 void setPrimaryAgentColorFeature(ColorFeature agentColorFeature)
          Set the color feature that will be used for determining agent color.
 void updateScapeGraphics(org.eclipse.draw2d.Graphics graphics)
          On notification of a scape update, draws the actual overhead view.
 
Methods inherited from class org.ascape.view.vis.AgentView
addDrawFeature, calculateAgentSizeForViewSize, calculateViewSizeForAgentSize, getAgentSize, getDrawFeatures, getDrawFeaturesObservable, getDrawSelection, getMiniumSizeWithin, removeDrawFeature, 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.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

agents_fill_draw_feature

public final DrawFeature agents_fill_draw_feature
Draws the provided object, assumed to be a agent, by filling it using the agent color feature.


agents_fill_draw_inset_feature

public final DrawFeature agents_fill_draw_inset_feature
Draws the provided object, assumed to be a agent, by filling it using the agent color feature.

Constructor Detail

Overhead2DContinuousView

public Overhead2DContinuousView()
Constructs a BaseAgentView, adding a listener to present a settings frame when the user double-clicks on the view.


Overhead2DContinuousView

public Overhead2DContinuousView(java.lang.String name)
Instantiates a new overhead2 D continuous view.

Parameters:
name - the name
Method Detail

createFeatures

public void createFeatures()
Overrides:
createFeatures in class AgentView

updateScapeGraphics

public void updateScapeGraphics(org.eclipse.draw2d.Graphics graphics)
On notification of a scape update, draws the actual overhead view.

Overrides:
updateScapeGraphics in class GraphicsView

drawAgentAt

public void drawAgentAt(org.eclipse.draw2d.Graphics graphics,
                        LocatedAgent agent,
                        int x,
                        int y,
                        DrawFeature feature)
Draw agent at.

Parameters:
agent - the agent
x - the x
y - the y
feature - the feature

drawAgentAtIfUpdate

public void drawAgentAtIfUpdate(org.eclipse.draw2d.Graphics graphics,
                                LocatedAgent agent,
                                int x,
                                int y)
Draw agent at if update.

Parameters:
agent - the agent
x - the x
y - the y

getCoordinateAtPixel

public Coordinate getCoordinateAtPixel(int pixelX,
                                       int pixelY)
Returns the agent at the given pixel in this view.

Parameters:
pixelX - the horizontal pixel location
pixelY - the vertical pixel location
Returns:
the coordinate at pixel

getAgentAtPixel

public Agent getAgentAtPixel(int pixelX,
                             int pixelY)
Returns the agent at the given pixel in this view.

Overrides:
getAgentAtPixel in class AgentView
Parameters:
pixelX - the horizontal pixel location
pixelY - the vertical pixel location
Returns:
the agent at pixel

getPreferredSizeWithin

public org.eclipse.draw2d.geometry.Dimension getPreferredSizeWithin(org.eclipse.draw2d.geometry.Dimension d)
Overrides:
getPreferredSizeWithin in class AgentView

getPreferredSize

public org.eclipse.draw2d.geometry.Dimension getPreferredSize()

setPreferredSize

public void setPreferredSize(org.eclipse.draw2d.geometry.Dimension preferredSize)

getNominalAgentSize

public int getNominalAgentSize()
Gets the nominal agent size.

Returns:
the nominal agent size

setNominalAgentSize

public void setNominalAgentSize(int nominalAgentSize)
Sets the nominal agent size.

Parameters:
nominalAgentSize - the new nominal agent size

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.

Returns:
the primary agent color feature

setPrimaryAgentColorFeature

public void setPrimaryAgentColorFeature(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 agent populating this lattice

getAgentColorFeature

public ColorFeature getAgentColorFeature()
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:
getAgentColorFeature in class AgentView
Returns:
the agent color feature

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 getForegroundColor() method of the agent.

Overrides:
setAgentColorFeature in class AgentView
Parameters:
agentColorFeature - the color feature, whose object is assumed to be a agent populating this lattice

drawSelectedAgent

public void drawSelectedAgent(org.eclipse.draw2d.Graphics g,
                              LocatedAgent a)
Set the image feature that will be used for determining agent color. The default image feature is simply the getForegroundColor() method of the agent.

Overrides:
drawSelectedAgent in class AgentView
Parameters:
agentImageFeature - the color feature, whose object is assumed to be a agent populating this lattice

isDrawSelectedNeighbors

public boolean isDrawSelectedNeighbors()
Checks if is draw selected neighbors.

Returns:
true, if is draw selected neighbors

setDrawSelectedNeighbors

public void setDrawSelectedNeighbors(boolean drawSelectedNeighbors)
Sets the draw selected neighbors.

Parameters:
drawSelectedNeighbors - the new draw selected neighbors

getBackgroundColor

public org.eclipse.swt.graphics.Color getBackgroundColor()

setBackgroundColor

public void setBackgroundColor(org.eclipse.swt.graphics.Color backgroundColor)