jurpe.dungeon.hexmap
Class HexMapGeometry

java.lang.Object
  extended by jurpe.dungeon.hexmap.HexMapGeometry

public class HexMapGeometry
extends java.lang.Object

Geometry helper class for HexMap JComponent. In this class all hexparts calculation is handled. Also, matrix corrispondence between hexagons and physical hexagon representation is handles.


Field Summary
 HexMapDrawing drawing
           
 
Constructor Summary
HexMapGeometry(HexMap map)
           
 
Method Summary
 HexagonCalc getCurrentHexagon()
           
 HexagonCalc getHexagonCalc(java.awt.Point c)
          Convert hexagon geometry coordinates into HexMap physical coordinates
 HexMap getHexMap()
           
 ViewMapPoint getLogicalCoordinatesFromPhysical(MapView view, java.awt.Point c)
          Get logical hexagon center coordinates, given the hexagon physical coordinates
 java.awt.Point getPhysicalCenterCoordinates(int x, int y)
          Get physical hexagon center coordinates, given some physical coordinates inside the hexagon
 HexMapPoint getPhysicalCoordinatesFromLogical(ViewMapPoint vP)
          Get the physical center coordinates from logical coordinates
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

drawing

public HexMapDrawing drawing
Constructor Detail

HexMapGeometry

public HexMapGeometry(HexMap map)
Method Detail

getHexMap

public HexMap getHexMap()

getCurrentHexagon

public HexagonCalc getCurrentHexagon()

getPhysicalCenterCoordinates

public java.awt.Point getPhysicalCenterCoordinates(int x,
                                                   int y)
Get physical hexagon center coordinates, given some physical coordinates inside the hexagon

Parameters:
x - X logical coordinate of hexagon
y - Y logical coordinate of hexagon
Returns:
Physical center coordinates

getPhysicalCoordinatesFromLogical

public HexMapPoint getPhysicalCoordinatesFromLogical(ViewMapPoint vP)
Get the physical center coordinates from logical coordinates

Parameters:
vP - ViewMap point
Returns:
Physical center coordinates

getLogicalCoordinatesFromPhysical

public ViewMapPoint getLogicalCoordinatesFromPhysical(MapView view,
                                                      java.awt.Point c)
Get logical hexagon center coordinates, given the hexagon physical coordinates

Parameters:
view - Current viewmap
c - Physical Coordinates
Returns:
Logical coordinates in RpgMap

getHexagonCalc

public HexagonCalc getHexagonCalc(java.awt.Point c)
Convert hexagon geometry coordinates into HexMap physical coordinates

Parameters:
c - Coordinates of hexagon
Returns:
An hexagon calc object

Jurpe - Java Universal Role Playing Engine - http://jurpe.sourceforge.net