|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sshtools.ui.swing.UIUtil
Useful UI utilies.
| Field Summary |
| Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
| Constructor Summary | |
UIUtil()
|
|
| Method Summary | |
static void |
jGridBagAdd(javax.swing.JComponent 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 javax.swing.KeyStroke |
parseAcceleratorString(java.lang.String string)
Parse a string in the format of [ALT+|CTRL+|SHIFT+] |
static java.lang.Integer |
parseMnemonicString(java.lang.String string)
Parse a string in the format of [character] to create an Integer that may be used for an action. |
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 java.lang.String |
rectangleToString(java.awt.Rectangle rectangle)
Convert a Rectangle object to a comma separated string
in the format of x,y,width,height. |
static void |
selectStringInList(java.lang.String string,
javax.swing.JComboBox list)
Select an item in a JComboBox given an items string value |
static void |
selectStringInList(java.lang.String string,
javax.swing.JList list)
Select an item in a JList given an items string value |
static java.awt.Rectangle |
stringToRectangle(java.lang.String string,
java.awt.Rectangle defaultValue)
Convert a string in the format of x,y,width,height in
to a Rectangle object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public UIUtil()
| Method Detail |
public static void selectStringInList(java.lang.String string,
javax.swing.JList list)
JList given an items string value
string - string to select in listlist - list
public static void selectStringInList(java.lang.String string,
javax.swing.JComboBox list)
JComboBox given an items string value
string - string to select in listlist - list
public static java.awt.Rectangle stringToRectangle(java.lang.String string,
java.awt.Rectangle defaultValue)
x,y,width,height in
to a Rectangle object. Suitable for
retrieving rectangles from property files, XML files etc. The supplied
default value will be returned if the string is not in the correct
format or is null.
string - string in format x,y,width,heightdefaultValue - default rectangle
public static java.lang.String rectangleToString(java.awt.Rectangle rectangle)
Rectangle object to a comma separated string
in the format of x,y,width,height. Suitable for
storing rectangles in property files, XML files etc.
rectangle - rectangle
public static java.lang.Integer parseMnemonicString(java.lang.String string)
[character] to create an Integer that may be used for an action.
public static javax.swing.KeyStroke parseAcceleratorString(java.lang.String string)
string - accelerator string
public static void jGridBagAdd(javax.swing.JComponent 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.IllegalArgumentException
public static void positionComponent(int p,
java.awt.Component c)
java.awt.Window to
be useful)
p - postion from SwingConstantsc - component
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||