Class HexDrawUtilities

java.lang.Object
megamek.client.ui.clientGUI.boardview.HexDrawUtilities

public class HexDrawUtilities extends Object
Provides utility methods and constants for drawing hex-related shapes Internally all methods work as if the game hex was
- as wide as BoardView1.HEX_W (usually == 84)
- perfectly hex-shaped, i.e. slightly higher than BoardView1.HEX_H.
The methods named ...Full...Line() return closed shapes for all 6 faces. They can be used to both graph.draw() and graph.fill().
When a border line is moved inside the hex (inset > 0) and for all border areas, the cuttype parameter controls how the line/area is delimited.
CUT_BORDER extends the line/area out to the hex borders
CUT_VERT leaves the line/area with the length of the hex border
CUT_INSIDE shrinks the line/area to be inside the triangle between the hex face and the center point. CUT_LBORDER, CUT_RBORDER, CUT_LVERT, CUT_RVERT, CUT_LINSIDE, CUT_RINSIDE can be ORed to achieve different cuts left and right.
  • Field Details

  • Method Details

    • getHexBorderLine

      public static Shape getHexBorderLine(int hexFace, int cuttype, double inset)
    • getHexRotation

      public static AffineTransform getHexRotation(int facing)
    • getHexBorderLine

      public static Shape getHexBorderLine(int hexFace)
    • getHexFullBorderLine

      public static Shape getHexFullBorderLine(double inset)
    • getHexBorderArea

      public static Shape getHexBorderArea(int cuttype, double thickness)
    • getHexBorderArea

      public static Shape getHexBorderArea(int cuttype, double thickness, double inset)
    • getHexFullBorderArea

      public static Shape getHexFullBorderArea(double thickness)
    • getHexFullBorderArea

      public static Shape getHexFullBorderArea(double thickness, double inset)
    • getHexBorderArea

      public static Shape getHexBorderArea(int hexFace, int cuttype, double thickness)
    • getHexBorderArea

      public static Shape getHexBorderArea(int hexFace, int cuttype, double thickness, double inset)
    • getHexFull

      public static Shape getHexFull()
    • getHexFull

      public static Shape getHexFull(Point2D.Double p)
    • getHexFull

      public static Shape getHexFull(Point p)
    • getHexFull

      public static Shape getHexFull(Point p, float scale)
    • getHexBorderAreaMid

      public static Point2D.Double getHexBorderAreaMid(int hexFace, double thickness, double inset)
    • getHexCrossArea01

      public static Shape getHexCrossArea01(int hexFace, double thickness)
    • getHexCrossLine01

      public static Shape getHexCrossLine01(int hexFace, double thickness)
    • getHexCrossArea012

      public static Shape getHexCrossArea012(int hexFace, double thickness)
    • getHexCrossLine012

      public static Shape getHexCrossLine012(int hexFace, double thickness)
    • getHexCrossArea0123

      public static Shape getHexCrossArea0123(int hexFace, double thickness)
    • getHexCrossLine0123

      public static Shape getHexCrossLine0123(int hexFace, double thickness)
    • getHexCrossArea01234

      public static Shape getHexCrossArea01234(int hexFace, double thickness)
    • getHexCrossLine01234

      public static Shape getHexCrossLine01234(int hexFace, double thickness)