Package ca.cgjennings.ui
Class StyleUtilities
- java.lang.Object
-
- ca.cgjennings.ui.StyleUtilities
-
public class StyleUtilities extends java.lang.ObjectUtility methods to set style client properties.- Author:
- Chris Jennings
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidcolorWell(javax.swing.JButton button)static floatgetWindowOpacity(java.awt.Window window)Returns the opacity of the window.static booleanisOpacityChangeEnabled()static voidlarge(javax.swing.JComponent comp)static voidmini(javax.swing.JComponent comp)static voidregular(javax.swing.JComponent comp)static voidsetOpacityChangeEnabled(boolean enable)static voidsetWindowOpacity(java.awt.Window window, float alpha)Sets the translucency of a window if possible.static voidsize(javax.swing.JComponent comp, java.lang.Object sizeValue)static voidsizeTree(javax.swing.JComponent parent, java.lang.Object sizeValue)static voidsizeTree(javax.swing.JComponent parent, java.lang.Object sizeValue, boolean applyToParent)static voidsmall(javax.swing.JComponent comp)
-
-
-
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- ifwindowisnull
-
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 ofalpha- the new opacity value in the range [0..1]- Throws:
java.lang.NullPointerException- if window is nulljava.lang.IllegalArgumentException- if alpha is not in rangejava.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()
-
-