public class GUIHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EMPTY_ICON
the empty icon name.
|
static java.lang.String |
IMAGE_DIR
the directory with the images.
|
static char |
MNEMONIC_INDICATOR
the mnemonic character indicator.
|
Constructor and Description |
---|
GUIHelper() |
Modifier and Type | Method and Description |
---|---|
static javax.swing.ImageIcon |
getEmptyIcon()
Returns the ImageIcon for the empty icon.
|
static javax.swing.ImageIcon |
getExternalIcon(java.lang.String filename)
Returns an ImageIcon from the given name.
|
static javax.swing.ImageIcon |
getIcon(java.lang.Class cls)
Returns an ImageIcon for the given class.
|
static javax.swing.ImageIcon |
getIcon(java.lang.String name)
Returns an ImageIcon from the given name.
|
static java.lang.String |
getImageFilename(java.lang.String name)
Adds the path of the images directory to the name of the image.
|
static javax.swing.ImageIcon |
getLogoIcon()
Returns an ImageIcon of the logo (icon sized image).
|
static javax.swing.ImageIcon |
getLogoImage()
Returns an ImageIcon of the logo (large image).
|
static char |
getMnemonic(java.lang.String caption)
Returns the mnemonic for this caption, preceded by an underscore "_".
|
static java.awt.Font |
getMonospacedFont()
Returns the system wide Monospaced font.
|
static java.lang.Object |
getParent(java.awt.Container cont,
java.lang.Class parentClass)
Tries to determine the parent this panel is part of.
|
static java.awt.Dialog |
getParentDialog(java.awt.Container cont)
Tries to determine the dialog this panel is part of.
|
static java.awt.Frame |
getParentFrame(java.awt.Container cont)
Tries to determine the frame the container is part of.
|
static boolean |
hasImageFile(java.lang.String name)
Checks whether the image is available.
|
public static final java.lang.String IMAGE_DIR
public static final java.lang.String EMPTY_ICON
public static final char MNEMONIC_INDICATOR
public static boolean hasImageFile(java.lang.String name)
name
- the name of the image (filename without path but with
extension)public static java.lang.String getImageFilename(java.lang.String name)
name
- the name of the image to add the path topublic static javax.swing.ImageIcon getIcon(java.lang.Class cls)
cls
- the class to get the icon for (gif, png or jpg)public static javax.swing.ImageIcon getIcon(java.lang.String name)
name
- the filename without pathpublic static javax.swing.ImageIcon getExternalIcon(java.lang.String filename)
filename
- the filenamepublic static javax.swing.ImageIcon getEmptyIcon()
public static javax.swing.ImageIcon getLogoImage()
public static javax.swing.ImageIcon getLogoIcon()
public static java.awt.Font getMonospacedFont()
public static java.lang.Object getParent(java.awt.Container cont, java.lang.Class parentClass)
cont
- the container to get the parent forparentClass
- the class of the parent to obtainpublic static java.awt.Frame getParentFrame(java.awt.Container cont)
cont
- the container to get the frame forpublic static java.awt.Dialog getParentDialog(java.awt.Container cont)
cont
- the container to get the dialog forpublic static char getMnemonic(java.lang.String caption)
caption
- the caption to extractMNEMONIC_INDICATOR