uchicago.src.sim.gui
Class HexaDisplay2D
java.lang.Object
uchicago.src.sim.gui.Display2D
uchicago.src.sim.gui.HexaDisplay2D
- All Implemented Interfaces:
- Displayable, Probeable
- Direct Known Subclasses:
- Object2DHexaDisplay, Value2DHexaDisplay
public abstract class HexaDisplay2D
- extends Display2D
- implements Probeable
Base class for two dimensional displays of hexagonal spaces. This
class takes care of calculating the hexagon sizes, but itself does
not do any drawing.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
view
protected boolean view
isFramed
protected boolean isFramed
frameColor
protected java.awt.Color frameColor
xTrans
protected static int xTrans
xTrans1q
protected static int xTrans1q
yTrans
protected static int yTrans
yTransHalf
protected static int yTransHalf
polyClip
protected static java.awt.Polygon polyClip
polyDraw
protected java.awt.Polygon polyDraw
HexaDisplay2D
public HexaDisplay2D(Discrete2DSpace hexagrid)
- Creates a HexaDisplay2D for the specifed Discrete2DSpace
setHexagons
protected void setHexagons()
getDisplayableInfo
public java.util.ArrayList getDisplayableInfo()
- Gets a list of the DisplayInfo objects associated with this
HexDisplay.
- 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
selectPolygon
protected java.awt.Dimension selectPolygon(int x,
int y,
int x1,
int y1,
int x2,
int y2)
getCoordinates
protected java.awt.Dimension getCoordinates(int x,
int y)
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 changedx - the x coordinate in pixelsy - the y coordinate in pixels
getFrameColor
public java.awt.Color getFrameColor()
setFrameColor
public void setFrameColor(java.awt.Color c)
isFramed
public boolean isFramed()
setFramed
public void setFramed(boolean b)
getSize
public java.awt.Dimension getSize()
- Description copied from class:
Display2D
- Gets the size of the display. The size of the display is the size of the
contained Discrete2DSpace * DisplayConstants.CELL_WIDTH/HEIGHT
- Specified by:
getSize in interface Displayable- Overrides:
getSize in class Display2D