Class GUIGraphicsUtils


  • public class GUIGraphicsUtils
    extends java.lang.Object
    • Method Summary

      Modifier and Type Method Description
      static javax.swing.ImageIcon createImageIcon​(java.lang.String image)
      This routine will extract image resources from jar file and create an ImageIcon
      static void draw3DLeft​(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)  
      static void draw3DMiddle​(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)  
      static void draw3DOne​(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)  
      static void draw3DRight​(java.awt.Graphics g, int which, int x, int y, int fmWidth, int fmHeight)  
      static void drawBezel​(java.awt.Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)  
      static void drawDashedRect​(java.awt.Graphics g, int x, int y, int width, int height)  
      static void drawEtchedRect​(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)  
      static void drawGroove​(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color highlight)  
      static void drawLoweredBezel​(java.awt.Graphics g, int x, int y, int w, int h, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)  
      static void drawScrollBar​(java.awt.Graphics g, int which, int direction, int x, int y, int fmWidth, int fmHeight, java.awt.Color fg, java.awt.Color bg)  
      static void drawString​(java.awt.Graphics g, java.lang.String text, int underlinedChar, int x, int y)
      Draw a string with the graphics g at location (x,y) just like g.drawString() would.
      static void drawWinBottom​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinLeft​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinLowerLeft​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinLowerRight​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinRight​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinUpper​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinUpperLeft​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static void drawWinUpperRight​(java.awt.Graphics g, int which, java.awt.Color fill, int x, int y, int fmWidth, int fmHeight)  
      static java.util.List<java.awt.Image> getApplicationIcons()  
      static javax.swing.ImageIcon getClosedLockIcon()  
      static java.lang.String getDefaultFont()  
      static java.awt.Font getDerivedFont​(java.awt.Font font, int width, int height, int numRows, int numCols, float scaleHeight, float scaleWidth, float pointSize)  
      static java.awt.Insets getEtchedInsets()
      Returns the amount of space taken up by a border drawn by drawEtchedRect()
      static java.awt.Insets getGrooveInsets()
      Returns the amount of space taken up by a border drawn by drawGroove()
      static javax.swing.ImageIcon getOpenLockIcon()  
      static boolean isFontNameExists​(java.lang.String fontString)
      Checks to see if the font name exists within our environment
      static void positionPopup​(java.awt.Component component, javax.swing.JPopupMenu jpm, int xCoord, int yCoord)  
      • Methods inherited from class java.lang.Object

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

      • GUIGraphicsUtils

        public GUIGraphicsUtils()
    • Method Detail

      • draw3DLeft

        public static void draw3DLeft​(java.awt.Graphics g,
                                      int which,
                                      int x,
                                      int y,
                                      int fmWidth,
                                      int fmHeight)
      • draw3DMiddle

        public static void draw3DMiddle​(java.awt.Graphics g,
                                        int which,
                                        int x,
                                        int y,
                                        int fmWidth,
                                        int fmHeight)
      • draw3DRight

        public static void draw3DRight​(java.awt.Graphics g,
                                       int which,
                                       int x,
                                       int y,
                                       int fmWidth,
                                       int fmHeight)
      • draw3DOne

        public static void draw3DOne​(java.awt.Graphics g,
                                     int which,
                                     int x,
                                     int y,
                                     int fmWidth,
                                     int fmHeight)
      • drawScrollBar

        public static void drawScrollBar​(java.awt.Graphics g,
                                         int which,
                                         int direction,
                                         int x,
                                         int y,
                                         int fmWidth,
                                         int fmHeight,
                                         java.awt.Color fg,
                                         java.awt.Color bg)
      • drawWinUpperLeft

        public static void drawWinUpperLeft​(java.awt.Graphics g,
                                            int which,
                                            java.awt.Color fill,
                                            int x,
                                            int y,
                                            int fmWidth,
                                            int fmHeight)
      • drawWinUpper

        public static void drawWinUpper​(java.awt.Graphics g,
                                        int which,
                                        java.awt.Color fill,
                                        int x,
                                        int y,
                                        int fmWidth,
                                        int fmHeight)
      • drawWinUpperRight

        public static void drawWinUpperRight​(java.awt.Graphics g,
                                             int which,
                                             java.awt.Color fill,
                                             int x,
                                             int y,
                                             int fmWidth,
                                             int fmHeight)
      • drawWinLeft

        public static void drawWinLeft​(java.awt.Graphics g,
                                       int which,
                                       java.awt.Color fill,
                                       int x,
                                       int y,
                                       int fmWidth,
                                       int fmHeight)
      • drawWinRight

        public static void drawWinRight​(java.awt.Graphics g,
                                        int which,
                                        java.awt.Color fill,
                                        int x,
                                        int y,
                                        int fmWidth,
                                        int fmHeight)
      • drawWinLowerLeft

        public static void drawWinLowerLeft​(java.awt.Graphics g,
                                            int which,
                                            java.awt.Color fill,
                                            int x,
                                            int y,
                                            int fmWidth,
                                            int fmHeight)
      • drawWinBottom

        public static void drawWinBottom​(java.awt.Graphics g,
                                         int which,
                                         java.awt.Color fill,
                                         int x,
                                         int y,
                                         int fmWidth,
                                         int fmHeight)
      • drawWinLowerRight

        public static void drawWinLowerRight​(java.awt.Graphics g,
                                             int which,
                                             java.awt.Color fill,
                                             int x,
                                             int y,
                                             int fmWidth,
                                             int fmHeight)
      • drawEtchedRect

        public static void drawEtchedRect​(java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int w,
                                          int h,
                                          java.awt.Color shadow,
                                          java.awt.Color darkShadow,
                                          java.awt.Color highlight,
                                          java.awt.Color lightHighlight)
      • getEtchedInsets

        public static java.awt.Insets getEtchedInsets()
        Returns the amount of space taken up by a border drawn by drawEtchedRect()
        Returns:
        the inset of an etched rect
      • drawGroove

        public static void drawGroove​(java.awt.Graphics g,
                                      int x,
                                      int y,
                                      int w,
                                      int h,
                                      java.awt.Color shadow,
                                      java.awt.Color highlight)
      • getGrooveInsets

        public static java.awt.Insets getGrooveInsets()
        Returns the amount of space taken up by a border drawn by drawGroove()
        Returns:
        the inset of a groove border
      • drawBezel

        public static void drawBezel​(java.awt.Graphics g,
                                     int x,
                                     int y,
                                     int w,
                                     int h,
                                     boolean isPressed,
                                     boolean isDefault,
                                     java.awt.Color shadow,
                                     java.awt.Color darkShadow,
                                     java.awt.Color highlight,
                                     java.awt.Color lightHighlight)
      • drawLoweredBezel

        public static void drawLoweredBezel​(java.awt.Graphics g,
                                            int x,
                                            int y,
                                            int w,
                                            int h,
                                            java.awt.Color shadow,
                                            java.awt.Color darkShadow,
                                            java.awt.Color highlight,
                                            java.awt.Color lightHighlight)
      • drawString

        public static void drawString​(java.awt.Graphics g,
                                      java.lang.String text,
                                      int underlinedChar,
                                      int x,
                                      int y)
        Draw a string with the graphics g at location (x,y) just like g.drawString() would. The first occurence of underlineChar in text will be underlined. The matching is not case sensitive.
        Parameters:
        g - graphics object
        text - some text to draw
        underlinedChar - number ov char to underline
        x - x
        y - y
      • drawDashedRect

        public static void drawDashedRect​(java.awt.Graphics g,
                                          int x,
                                          int y,
                                          int width,
                                          int height)
      • getDerivedFont

        public static java.awt.Font getDerivedFont​(java.awt.Font font,
                                                   int width,
                                                   int height,
                                                   int numRows,
                                                   int numCols,
                                                   float scaleHeight,
                                                   float scaleWidth,
                                                   float pointSize)
      • positionPopup

        public static void positionPopup​(java.awt.Component component,
                                         javax.swing.JPopupMenu jpm,
                                         int xCoord,
                                         int yCoord)
      • getDefaultFont

        public static java.lang.String getDefaultFont()
      • isFontNameExists

        public static boolean isFontNameExists​(java.lang.String fontString)
        Checks to see if the font name exists within our environment
        Parameters:
        fontString - font to use
        Returns:
        whether the font passed exists or not.
      • createImageIcon

        public static javax.swing.ImageIcon createImageIcon​(java.lang.String image)
        This routine will extract image resources from jar file and create an ImageIcon
        Parameters:
        image - image to use
        Returns:
        an image icon
      • getOpenLockIcon

        public static javax.swing.ImageIcon getOpenLockIcon()
        Returns:
        an image that lock like a opened lock
      • getClosedLockIcon

        public static javax.swing.ImageIcon getClosedLockIcon()
        Returns:
        an image that lock like a closed lock
      • getApplicationIcons

        public static final java.util.List<java.awt.Image> getApplicationIcons()