uchicago.src.sim.gui
Class VectorDisplay

java.lang.Object
  extended by uchicago.src.sim.gui.VectorDisplay
All Implemented Interfaces:
Displayable, Probeable

public class VectorDisplay
extends java.lang.Object
implements Displayable, Probeable

Used to display VectorSpaces - non-discrete spaces.

Version:
$Revision: 1.5 $ $Date: 2004/11/03 19:50:59 $
Author:
Nick Collier

Field Summary
protected  VectorSpace space
           
protected  boolean view
           
 
Fields inherited from interface uchicago.src.sim.gui.Displayable
TOGGLE_LINKS, TOGGLE_NODES, TOGGLE_UPDATE_LAYOUT, TOGGLE_VIEW, TOGGLE_WRAP
 
Constructor Summary
VectorDisplay(java.util.List list, int width, int height)
          Constructs a VectorDisplay to display the specified list of objects with the specified with and height.
VectorDisplay(VectorSpace space, int width, int height)
          Constructs a VectorDisplay to display the specified space with the specified with and height.
 
Method Summary
 void drawDisplay(SimGraphics g)
          Draws this VectorDisplay.
 java.util.ArrayList getDisplayableInfo()
          Gets a list of the DisplayInfo object associated with this Object2DDisplay.
 java.util.ArrayList getObjectsAt(int x, int y)
          Gets a list of the objects that contain the specified screen coordinate.
 java.awt.Dimension getSize()
          Gets the size of this VectorDisplay.
 void reSize(int width, int height)
           
 void setMoveableXY(Moveable moveable, int x, int y)
          Sets the new coordinates for specified moveable.
 void viewEventPerformed(ViewEvent evt)
          Invoked when a viewEvent for this display is fired by the DisplaySurface.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

view

protected boolean view

space

protected VectorSpace space
Constructor Detail

VectorDisplay

public VectorDisplay(VectorSpace space,
                     int width,
                     int height)
Constructs a VectorDisplay to display the specified space with the specified with and height. Width and height should be in pixels. The space should contain NonGridDrawables.

Parameters:
space - the space to display
width - the width of the display
height - the height of the display
See Also:
NonGridDrawable

VectorDisplay

public VectorDisplay(java.util.List list,
                     int width,
                     int height)
Constructs a VectorDisplay to display the specified list of objects with the specified with and height. Width and height should be in pixels. This list should contain NonGridDrawables.

Parameters:
space - the space to display
width - the width of the display
height - the height of the display
See Also:
NonGridDrawable
Method Detail

getSize

public java.awt.Dimension getSize()
Gets the size of this VectorDisplay.

Specified by:
getSize in interface Displayable

drawDisplay

public void drawDisplay(SimGraphics g)
Draws this VectorDisplay.

Specified by:
drawDisplay in interface Displayable
Parameters:
g - the graphics context with which to draw

getDisplayableInfo

public java.util.ArrayList getDisplayableInfo()
Gets a list of the DisplayInfo object associated with this Object2DDisplay.

Specified by:
getDisplayableInfo in interface Displayable
See Also:
DisplayInfo

viewEventPerformed

public void viewEventPerformed(ViewEvent evt)
Invoked when a viewEvent for this display is fired by the DisplaySurface.

Specified by:
viewEventPerformed in interface Displayable

getObjectsAt

public java.util.ArrayList getObjectsAt(int x,
                                        int y)
Gets a list of the objects that contain the specified screen coordinate.

Specified by:
getObjectsAt in interface Probeable
Parameters:
x - the x coordinate
y - the y coordinate
Returns:
the object at the x, y coordinate.

setMoveableXY

public void setMoveableXY(Moveable moveable,
                          int x,
                          int y)
Sets the new coordinates for specified moveable. This goes through probeable as some translation between screen pixel coordinates and the simulation coordinates may be necessary.

Specified by:
setMoveableXY in interface Probeable
Parameters:
moveable - the moveable whose coordinates are changed
x - the x coordinate in pixels
y - the y coordinate in pixels

reSize

public void reSize(int width,
                   int height)