|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.sshtools.ui.awt.UIUtil
public class UIUtil
Useful UI utilies for AWT.
| Field Summary | |
|---|---|
static int |
CENTER
The central position in an area. |
static int |
EAST
Compass-direction east (right). |
static int |
NORTH
Compass-direction North (up). |
static int |
NORTH_EAST
Compass-direction north-east (upper right). |
static int |
NORTH_WEST
Compass-direction north west (upper left). |
static int |
SOUTH
Compass-direction south (down). |
static int |
SOUTH_EAST
Compass-direction south-east (lower right). |
static int |
SOUTH_WEST
Compass-direction south-west (lower left). |
static int |
WEST
Compass-direction west (left). |
| Constructor Summary | |
|---|---|
UIUtil()
|
|
| Method Summary | |
|---|---|
static java.awt.Frame |
getFrameAncestor(java.awt.Component c)
Get the top level fra,e that contains the given component. |
static java.awt.Frame |
getSharedFrame()
|
static java.awt.Image |
getStockImage(java.lang.String id,
java.lang.Class clazz)
Get a stock image |
static java.awt.Window |
getWindowAncestor(java.awt.Component c)
Get the top level window that contains the given component. |
static void |
gridBagAdd(java.awt.Container parent,
java.awt.Component componentToAdd,
java.awt.GridBagConstraints constraints,
int pos)
Add a component to a container that is using a GridBagLayout, together with its constraints and the GridBagConstraints.gridwidth
value. |
static java.awt.Image |
loadImage(java.lang.Class clazz,
java.lang.String resource)
Load an image using the specified Classes ClassLoader
and the given resource name. |
static void |
positionComponent(int p,
java.awt.Component c)
Position a component on the screen (must be a java.awt.Window to
be useful) |
static void |
setCodeBase(java.net.URL codebase)
If images are to be loaded in an applet, the this method should be called during the applets initialisation so they can be located. |
static void |
setStockImage(java.lang.String id,
java.lang.String resource)
Set an alternative stock image resource. |
static java.awt.Image |
waitFor(java.awt.Image image,
java.awt.Component component)
Wait for an image to load. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CENTER
public static final int NORTH
public static final int NORTH_EAST
public static final int EAST
public static final int SOUTH_EAST
public static final int SOUTH
public static final int SOUTH_WEST
public static final int WEST
public static final int NORTH_WEST
| Constructor Detail |
|---|
public UIUtil()
| Method Detail |
|---|
public static java.awt.Image waitFor(java.awt.Image image,
java.awt.Component component)
image - image to wait forcomponent - image producer component
null if the image did not loadpublic static void setCodeBase(java.net.URL codebase)
codebase - applet codebase
public static java.awt.Image loadImage(java.lang.Class clazz,
java.lang.String resource)
Classes ClassLoader
and the given resource name. null will be returned if the image
could not be loaded.
clazz - class to get class loader fromresource - resource name
public static void gridBagAdd(java.awt.Container parent,
java.awt.Component componentToAdd,
java.awt.GridBagConstraints constraints,
int pos)
GridBagLayout, together with its constraints and the GridBagConstraints.gridwidth
value.
parent - parent containercomponentToAdd - component to addconstraints - contraintspos - grid width position
java.lang.IllegalArgumentExceptionpublic static java.awt.Window getWindowAncestor(java.awt.Component c)
c - component
public static java.awt.Frame getFrameAncestor(java.awt.Component c)
c - component
public static void positionComponent(int p,
java.awt.Component c)
java.awt.Window to
be useful)
p - postion from SwingConstantsc - componentpublic static java.awt.Frame getSharedFrame()
public static java.awt.Image getStockImage(java.lang.String id,
java.lang.Class clazz)
id - stock image id. See StockIcons for constants.clazz - the Class to derive a ClassLoader from to load the image with.
public static void setStockImage(java.lang.String id,
java.lang.String resource)
null
resource will remove any custom resource and rever to the default.
id - stock image id. See StockIcons for constants.resource - the resource path to use to load the image.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||