uk.co.keang.hex.gui
Class HexBtnUtilities

java.lang.Object
  extended by uk.co.keang.hex.gui.HexBtnUtilities

public class HexBtnUtilities
extends java.lang.Object

A collection of utility methods for Hexagonal buttons

Version:
1.1
Author:
A.G.Docherty

Nested Class Summary
static class HexBtnUtilities.HexOrientation
           
 
Constructor Summary
HexBtnUtilities()
           
 
Method Summary
(package private) static void drawDashedPolygon(java.awt.Graphics g, java.awt.Polygon p)
          Draws a dashed polgon in the given graphics context
(package private) static java.awt.Polygon getHexagon(HexBtnUtilities.HexOrientation orientation, int originX, int originY, int w, int h)
          Creates a hexagon based on the given orientation, origin and size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexBtnUtilities

public HexBtnUtilities()
Method Detail

getHexagon

static java.awt.Polygon getHexagon(HexBtnUtilities.HexOrientation orientation,
                                   int originX,
                                   int originY,
                                   int w,
                                   int h)
Creates a hexagon based on the given orientation, origin and size

Parameters:
orientation - - the hexagons orientation
originX - - the x axis origin. This is the top left corner of an imaginary square enclosing the hexagon
originY - - the y axis origin. This is the top left corner of an imaginary square enclosing the hexagon
w - - the maximum width of the hexagon
h - - the maximum height of the hexagon
Returns:
the co-ordinates of the hexagon

drawDashedPolygon

static void drawDashedPolygon(java.awt.Graphics g,
                              java.awt.Polygon p)
Draws a dashed polgon in the given graphics context

Parameters:
g - the graphics context
p - the polygon to draw