Class Align


  • public final class Align
    extends java.lang.Object
    A utility class for aligning rectangles.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int BOTTOM
      Bottom alignment.
      static int BOTTOM_LEFT
      Bottom/Left alignment.
      static int BOTTOM_RIGHT
      Bottom/Right alignment.
      static int CENTER
      Center alignment.
      static int EAST
      East alignment (same as RIGHT).
      static int FIT
      Complete fit.
      static int FIT_HORIZONTAL
      Horizontal fit.
      static int FIT_VERTICAL
      Vertical fit.
      static int LEFT
      Left alignment.
      static int NORTH
      North alignment (same as TOP).
      static int NORTH_EAST
      North/East alignment (same as TOP_RIGHT).
      static int NORTH_WEST
      North/West alignment (same as TOP_LEFT).
      static int RIGHT
      Right alignment.
      static int SOUTH
      South alignment (same as BOTTOM).
      static int SOUTH_EAST
      South/East alignment (same as BOTTOM_RIGHT).
      static int SOUTH_WEST
      South/West alignment (same as BOTTOM_LEFT).
      static int TOP
      Top alignment.
      static int TOP_LEFT
      Top/Left alignment.
      static int TOP_RIGHT
      Top/Right alignment.
      static int WEST
      West alignment (same as LEFT).
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private Align()
      Private constructor.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void align​(java.awt.geom.Rectangle2D rect, java.awt.geom.Rectangle2D frame, int align)
      Aligns one rectangle (rect) relative to another rectangle (frame).
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • Align

        private Align()
        Private constructor.
    • Method Detail

      • align

        public static void align​(java.awt.geom.Rectangle2D rect,
                                 java.awt.geom.Rectangle2D frame,
                                 int align)
        Aligns one rectangle (rect) relative to another rectangle (frame).
        Parameters:
        rect - the rectangle to be aligned (null not permitted).
        frame - the reference frame (null not permitted).
        align - the alignment code.