|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.atunes.gui.GuiUtils
public class GuiUtils
GUI related utility methods.
Constructor Summary | |
---|---|
GuiUtils()
|
Method Summary | |
---|---|
static void |
addCloseActionWithEscapeKey(javax.swing.JDialog dialog)
Adds the close action with escape key. |
static void |
addCloseActionWithEscapeKey(javax.swing.JFrame frame)
Adds the close action with escape key. |
static void |
addDisposeActionWithEscapeKey(javax.swing.JDialog dialog)
Adds the dispose action with escape key. |
static void |
addDisposeActionWithEscapeKey(javax.swing.JFrame frame)
Adds the dispose action with escape key. |
static void |
applyComponentOrientation(java.awt.Container... containers)
Applies Locale specific component orientation to containers. |
static void |
collapseTree(javax.swing.JTree tree)
Collapses all nodes in a tree. |
static void |
expandTree(javax.swing.JTree tree)
Expands all nodes in a tree. |
static java.awt.Color |
getBackgroundColor()
Returns background color for panels, as set by Look And Feel. |
static java.awt.Color |
getBorderColor()
Returns border color for panels, based on background color. |
static int |
getComponentHeightForResolution(int screenHeight,
int desiredHeight)
Returns a proportional height according to screenHeight and desiredHeight for the current screen resolution. |
static java.awt.ComponentOrientation |
getComponentOrientation()
Returns the component orientation. |
static int |
getComponentOrientationAsSwingConstant()
Returns the component orientation as a SwingConstant. |
static int |
getComponentWidthForResolution(int screenWidth,
int desiredWidth)
Returns a proportional width according to screenWidth and desiredSize for the current screen resolution. |
static int |
getDeviceHeight()
Returns the height in pixels of the main device |
static int |
getDeviceWidth()
Returns the width in pixels of the main device |
static java.awt.Color |
getForegroundColor()
Returns foreground color for labels, as set by Look And Feel |
static void |
setBorderColor(java.awt.Color borderColor)
Sets the border color. |
static void |
setLocation(java.awt.Window window)
Sets location of a window centered in main screen device. |
static void |
setUIFont(javax.swing.plaf.FontUIResource f)
Sets the default font for all Swing components. |
static void |
setWindowOpacity(java.awt.Window window,
float opacity)
Sets the window opacity if possible. |
static void |
setWindowOpaque(java.awt.Window window,
boolean opaque)
Sets the window opaque if possible. |
static void |
setWindowShape(java.awt.Window window,
java.awt.Shape mask)
Sets the window shape if possible. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GuiUtils()
Method Detail |
---|
public static int getDeviceWidth()
public static int getDeviceHeight()
public static void setLocation(java.awt.Window window)
window
- public static void addCloseActionWithEscapeKey(javax.swing.JDialog dialog)
dialog
- the dialogpublic static void addCloseActionWithEscapeKey(javax.swing.JFrame frame)
frame
- the framepublic static void addDisposeActionWithEscapeKey(javax.swing.JDialog dialog)
dialog
- the dialogpublic static void addDisposeActionWithEscapeKey(javax.swing.JFrame frame)
frame
- the framepublic static void applyComponentOrientation(java.awt.Container... containers)
containers
- One or more containerspublic static void collapseTree(javax.swing.JTree tree)
tree
- the treepublic static void expandTree(javax.swing.JTree tree)
tree
- A treepublic static java.awt.Color getBackgroundColor()
public static java.awt.Color getForegroundColor()
public static java.awt.Color getBorderColor()
public static java.awt.ComponentOrientation getComponentOrientation()
public static int getComponentOrientationAsSwingConstant()
public static int getComponentWidthForResolution(int screenWidth, int desiredWidth)
screenWidth
- the screen widthdesiredWidth
- the desired width
public static int getComponentHeightForResolution(int screenHeight, int desiredHeight)
screenHeight
- the screen heightdesiredHeight
- the desired height
public static void setBorderColor(java.awt.Color borderColor)
borderColor
- the borderColor to setpublic static void setUIFont(javax.swing.plaf.FontUIResource f)
f
- the fpublic static void setWindowShape(java.awt.Window window, java.awt.Shape mask)
window
- A mindowmask
- A maskpublic static void setWindowOpacity(java.awt.Window window, float opacity)
window
- A windowopacity
- Opacity from 0 to 1public static void setWindowOpaque(java.awt.Window window, boolean opaque)
window
- A windowopaque
- If the window should be opaque
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |