Class StyleUtilities


  • public class StyleUtilities
    extends java.lang.Object
    Utility methods to set style client properties.
    Author:
    Chris Jennings
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String LARGE  
      static java.lang.String MINI  
      static java.lang.String REGULAR  
      static java.lang.String SMALL  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void colorWell​(javax.swing.JButton button)  
      static float getWindowOpacity​(java.awt.Window window)
      Returns the opacity of the window.
      static boolean isOpacityChangeEnabled()  
      static void large​(javax.swing.JComponent comp)  
      static void mini​(javax.swing.JComponent comp)  
      static void regular​(javax.swing.JComponent comp)  
      static void setOpacityChangeEnabled​(boolean enable)  
      static void setWindowOpacity​(java.awt.Window window, float alpha)
      Sets the translucency of a window if possible.
      static void size​(javax.swing.JComponent comp, java.lang.Object sizeValue)  
      static void sizeTree​(javax.swing.JComponent parent, java.lang.Object sizeValue)  
      static void sizeTree​(javax.swing.JComponent parent, java.lang.Object sizeValue, boolean applyToParent)  
      static void small​(javax.swing.JComponent comp)  
      • Methods inherited from class java.lang.Object

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

      • MINI

        public static java.lang.String MINI
      • SMALL

        public static java.lang.String SMALL
      • REGULAR

        public static java.lang.String REGULAR
      • LARGE

        public static java.lang.String LARGE
    • Method Detail

      • colorWell

        public static void colorWell​(javax.swing.JButton button)
      • size

        public static void size​(javax.swing.JComponent comp,
                                java.lang.Object sizeValue)
      • sizeTree

        public static void sizeTree​(javax.swing.JComponent parent,
                                    java.lang.Object sizeValue)
      • sizeTree

        public static void sizeTree​(javax.swing.JComponent parent,
                                    java.lang.Object sizeValue,
                                    boolean applyToParent)
      • mini

        public static void mini​(javax.swing.JComponent comp)
      • small

        public static void small​(javax.swing.JComponent comp)
      • regular

        public static void regular​(javax.swing.JComponent comp)
      • large

        public static void large​(javax.swing.JComponent comp)
      • getWindowOpacity

        public static float getWindowOpacity​(java.awt.Window window)
        Returns the opacity of the window. This method can use either the JDK7 or JDK6u10 APIs for window opacity. If neither is available or opacity changes have been disabled, the method returns 1 (i.e., it assumes that the window is fully opaque).
        Parameters:
        window - the window to obtain the opacity of
        Throws:
        java.lang.NullPointerException - if window is null
      • setWindowOpacity

        public static void setWindowOpacity​(java.awt.Window window,
                                            float alpha)
        Sets the translucency of a window if possible. This method can use either the JDK7 or JDK6u10 APIs for setting window opacity. If neither is available, or if window translucency is unsupported or has been disabled, then this method has no effect.
        Parameters:
        window - the window to change the opacity of
        alpha - the new opacity value in the range [0..1]
        Throws:
        java.lang.NullPointerException - if window is null
        java.lang.IllegalArgumentException - if alpha is not in range
        java.awt.IllegalComponentStateException - if alpha < 1 is set on a full screen window
        See Also:
        setOpacityChangeEnabled(boolean)
      • setOpacityChangeEnabled

        public static void setOpacityChangeEnabled​(boolean enable)
      • isOpacityChangeEnabled

        public static boolean isOpacityChangeEnabled()