Class GraphicsUtil


  • public class GraphicsUtil
    extends Object
    • Constructor Detail

      • GraphicsUtil

        public GraphicsUtil()
    • Method Detail

      • drawStringAlignCenter

        public static void drawStringAlignCenter​(Graphics2D g2d,
                                                 String s,
                                                 int x,
                                                 int y)
      • drawStringAlign

        public static void drawStringAlign​(Graphics2D g2d,
                                           String s,
                                           int x,
                                           int y,
                                           float anchorx,
                                           float anchory)
        Parameters:
        g2d -
        s -
        x -
        y -
        anchorx - value between 0 and 1 indicating anchor position along X
        anchory - value between 0 and 1 indicating anchor position along Y
      • drawStringAlign

        public static void drawStringAlign​(Graphics2D g2d,
                                           String s,
                                           int x,
                                           int y,
                                           float anchorx,
                                           float anchory,
                                           int offset)
        Parameters:
        g2d -
        s -
        x -
        y -
        anchorx - value between 0 and 1 indicating anchor position along X
        anchory - value between 0 and 1 indicating anchor position along Y
        offset - offset distance from anchor point