Class ShapeUtils


  • public final class ShapeUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ShapeUtils()
      Creates a new instance of ShapeUtils
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.awt.Shape generatePolygon​(int sides, int outsideRadius, boolean normalize)  
      static java.awt.Shape generatePolygon​(int sides, int outsideRadius, int insideRadius)  
      static java.awt.Shape generatePolygon​(int sides, int outsideRadius, int insideRadius, boolean normalize)  
      static java.awt.Shape generateShapeFromText​(java.awt.Font font, char ch)  
      static java.awt.Shape generateShapeFromText​(java.awt.Font font, java.lang.String string)  
      static java.awt.Shape mergeClip​(java.awt.Graphics g, java.awt.Shape clip)
      Sets the clip on a graphics object by merging a supplied clip with the existing one.
      • Methods inherited from class java.lang.Object

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

      • ShapeUtils

        private ShapeUtils()
        Creates a new instance of ShapeUtils
    • Method Detail

      • generatePolygon

        public static java.awt.Shape generatePolygon​(int sides,
                                                     int outsideRadius,
                                                     boolean normalize)
      • generatePolygon

        public static java.awt.Shape generatePolygon​(int sides,
                                                     int outsideRadius,
                                                     int insideRadius,
                                                     boolean normalize)
      • generatePolygon

        public static java.awt.Shape generatePolygon​(int sides,
                                                     int outsideRadius,
                                                     int insideRadius)
      • generateShapeFromText

        public static java.awt.Shape generateShapeFromText​(java.awt.Font font,
                                                           char ch)
      • generateShapeFromText

        public static java.awt.Shape generateShapeFromText​(java.awt.Font font,
                                                           java.lang.String string)
      • mergeClip

        public static java.awt.Shape mergeClip​(java.awt.Graphics g,
                                               java.awt.Shape clip)
        Sets the clip on a graphics object by merging a supplied clip with the existing one. The new clip will be an intersection of the old clip and the supplied clip. The old clip shape will be returned. This is useful for resetting the old clip after an operation is performed.
        Parameters:
        g - the graphics object to update
        clip - a new clipping region to add to the graphics clip.
        Returns:
        the current clipping region of the supplied graphics object. This may return null if the current clip is null.
        Throws:
        java.lang.NullPointerException - if any parameter is null