dd.ui
Class HexView
java.lang.Object
dd.ui.HexView
- All Implemented Interfaces:
- java.util.EventListener, java.beans.PropertyChangeListener
- Direct Known Subclasses:
- HurricaneHex, TestController.ColorHex
- public class HexView
- extends java.lang.Object
- implements java.beans.PropertyChangeListener
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
defaultShape
protected java.awt.Polygon defaultShape
icons
protected javax.swing.ImageIcon[] icons
myCell
protected MapCell myCell
xPosition
protected int xPosition
yPosition
protected int yPosition
width
protected int width
height
protected int height
hilite
protected boolean hilite
fillHexes
public static boolean fillHexes
HexView
public HexView()
getVertex
public java.awt.Point getVertex(int vertexNum)
- Returns the pixel coordinates of one of the corners of the cell.
The hexagon vertices are numbered as follows:
4--5
/ \
3 0
\ /
2--1
This method returns the coordinates (in the MapView's coordinate
system) if the specified vertex.
- Parameters:
vertexNum
- Index of the vertex, clockwise from the eastmost
vertex which is numbered 0.
- Returns:
- the pixel coordinates of the specified vertex.
bottomCenter
public java.awt.Point bottomCenter()
center
public java.awt.Point center()
hilite
public void hilite()
unhilite
public void unhilite()
pulse
public void pulse()
unpulse
public void unpulse()
clear
public void clear()
setCell
public void setCell(MapCell cell)
addIcon
public void addIcon(javax.swing.ImageIcon i)
removeIcon
public void removeIcon(javax.swing.ImageIcon i)
getSize
public java.awt.Dimension getSize()
setSize
public void setSize(int w,
int h)
setMyColor
public void setMyColor(java.awt.Color color)
setParent
public void setParent(javax.swing.JComponent component)
getParent
public javax.swing.JComponent getParent()
contains
public boolean contains(int xLoc,
int yLoc)
defaultCellWidth
public int defaultCellWidth()
defaultCellHeight
public int defaultCellHeight()
getCell
public MapCell getCell()
setLocation
public void setLocation(int xLoc,
int yLoc)
paint
public void paint(java.awt.Graphics g)
propertyChange
public void propertyChange(java.beans.PropertyChangeEvent evt)
- Specified by:
propertyChange
in interface java.beans.PropertyChangeListener
cellContentsChanged
public void cellContentsChanged()