dd.ui
Class HexView

java.lang.Object
  extended bydd.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


Field Summary
protected  java.awt.Polygon defaultShape
           
static boolean fillHexes
           
protected  int height
           
protected  boolean hilite
           
protected  javax.swing.ImageIcon[] icons
           
protected  MapCell myCell
           
protected  int width
           
protected  int xPosition
           
protected  int yPosition
           
 
Constructor Summary
HexView()
           
 
Method Summary
 void addIcon(javax.swing.ImageIcon i)
           
 java.awt.Point bottomCenter()
           
 void cellContentsChanged()
           
 java.awt.Point center()
           
 void clear()
           
 boolean contains(int xLoc, int yLoc)
           
 int defaultCellHeight()
           
 int defaultCellWidth()
           
 MapCell getCell()
           
 javax.swing.JComponent getParent()
           
 java.awt.Dimension getSize()
           
 java.awt.Point getVertex(int vertexNum)
          Returns the pixel coordinates of one of the corners of the cell.
 void hilite()
           
 void paint(java.awt.Graphics g)
           
 void propertyChange(java.beans.PropertyChangeEvent evt)
           
 void pulse()
           
 void removeIcon(javax.swing.ImageIcon i)
           
 void setCell(MapCell cell)
           
 void setLocation(int xLoc, int yLoc)
           
 void setMyColor(java.awt.Color color)
           
 void setParent(javax.swing.JComponent component)
           
 void setSize(int w, int h)
           
 void unhilite()
           
 void unpulse()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

HexView

public HexView()
Method Detail

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()