|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Object | +--com.denova.ui.UiLayoutUtilities
Utilties for laying out a Swing user interface.
| Field Summary | |
static java.lang.String |
CrossPlatformLookAndFeelName
|
static java.lang.String |
MotifLookAndFeelName
|
static java.lang.String |
WindowsLookAndFeelName
|
| Constructor Summary | |
UiLayoutUtilities()
|
|
| Method Summary | |
static javax.swing.JPanel |
addBevel(java.awt.Component c,
int style)
Thread safe way to add a beveled border to a component. |
static javax.swing.JPanel |
addBeveledBorder(java.awt.Component c)
Thread safe way to add a beveled border and an inside margin to a component. |
static javax.swing.JPanel |
addBorder(java.awt.Component c,
javax.swing.border.Border border)
Thread safe way to add a border to a component. |
static javax.swing.JPanel |
addDoubleBevel(java.awt.Component c,
int style)
Thread safe way to add a double beveled border to a component. |
static javax.swing.JPanel |
addMargin(java.awt.Component c)
Thread safe way to add a margin to a component. |
static javax.swing.JPanel |
addTitledBorder(java.awt.Component c,
java.lang.String title,
int titlePosition)
Thread safe way to add a titled border to a component. |
static void |
adjustBounds(javax.swing.JFrame frame)
Adjust the bounds of a frame so they aren't too large for the native environment or off screen. |
static void |
centerComponent(java.awt.Component c)
Center the component inside the parent's boundaries. |
static javax.swing.JPanel |
centerLabel(javax.swing.JLabel l)
Thread safe way to center a JLabel managing quirks of Swing. |
static void |
centerOnScreen(java.awt.Container c)
Center the container in the screen. |
static javax.swing.JFrame |
findJFrameParent(java.awt.Container c)
Thread safe way to find the parent of the container. |
static javax.swing.JFrame |
forceJFrameParent(java.awt.Container c)
Thread safe way to find the parent of the container. |
static void |
forceRepaint(java.awt.Component c)
|
static int |
getDefaultMargin()
Gets the default margin's value. |
static javax.swing.border.Border |
getMarginBorder()
Gets the default margin's value for a border. |
static javax.swing.border.Border |
getMarginBorder(int margin)
Sets an empty border with the margin surrounding it. |
static java.awt.Rectangle |
getParentBounds(java.awt.Component c)
Get the boundaries of the parent. |
static void |
pack(javax.swing.JFrame frame)
|
static void |
paintNow(javax.swing.JComponent c)
Thread safe way to paint the screen. |
static void |
redraw(java.awt.Component c)
Thread safe way to redraw the screen. |
static void |
setBackgroundColor(java.awt.Container mainContainer,
java.awt.Color backgroundColor)
Set the background color of a component. |
static void |
setDefaultMargin(int m)
Sets the default margin's value. |
static void |
setFocus(java.lang.Object field)
Set the focus to a particular field. |
static boolean |
setLookAndFeel()
Sets the look and feel to the platform's native L&F. |
static void |
unexpectedStartupError()
Display error message that Swing is required. |
static void |
update(java.awt.Component c,
boolean value)
Thread safe way to update Swing component. |
static void |
update(java.awt.Component c,
int value)
Thread safe way to update Swing component. |
static void |
update(java.awt.Component c,
java.lang.Object value)
Thread safe way to update Swing component. |
static void |
update(java.lang.Object c,
boolean value)
Thread safe way to update Swing object. |
static void |
update(java.lang.Object c,
int value)
Thread safe way to update Swing object. |
static void |
update(java.lang.Object c,
java.lang.Object value)
Thread safe way to update Swing object. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final java.lang.String CrossPlatformLookAndFeelName
public static final java.lang.String WindowsLookAndFeelName
public static final java.lang.String MotifLookAndFeelName
| Constructor Detail |
public UiLayoutUtilities()
| Method Detail |
public static boolean setLookAndFeel()
Returns true if successful.
public static void setBackgroundColor(java.awt.Container mainContainer,
java.awt.Color backgroundColor)
c: component to change
backgroundColor: new color to use in background
public static void update(java.awt.Component c,
int value)
c - the Swing component to updatevalue - the new integer value to set the component to
public static void update(java.lang.Object c,
int value)
c - the Swing object to updatevalue - the new integer value to set the component to
public static void update(java.awt.Component c,
boolean value)
c - the Swing component to updatevalue - the new boolean value to set the component to
public static void update(java.lang.Object c,
boolean value)
c - the Swing object to updatevalue - the new boolean value to set the component to
public static void update(java.awt.Component c,
java.lang.Object value)
c - the Swing component to updatevalue - the new object value to set the component to
public static void update(java.lang.Object c,
java.lang.Object value)
c - the Swing object to updatevalue - the new object value to set the component topublic static void adjustBounds(javax.swing.JFrame frame)
frame - frame to adjust.public static void setFocus(java.lang.Object field)
You should call this after you pack() the dialog box.
field - the field to set the focus and cursor.public static javax.swing.JPanel centerLabel(javax.swing.JLabel l)
l - the Swing label to center
public static javax.swing.JFrame findJFrameParent(java.awt.Container c)
c - the Swing container
public static javax.swing.JFrame forceJFrameParent(java.awt.Container c)
Creates a new JFrame if the container doesn't have a parent.
c - the Swing container
public static javax.swing.JPanel addBorder(java.awt.Component c,
javax.swing.border.Border border)
c - the Swing componentborder - the Swing border
public static javax.swing.JPanel addBevel(java.awt.Component c,
int style)
c - the Swing componentstyle - the style of the Swing beveled border
public static javax.swing.JPanel addBeveledBorder(java.awt.Component c)
c - the Swing component
public static javax.swing.JPanel addDoubleBevel(java.awt.Component c,
int style)
c - the Swing componentstyle - the style of the Swing beveled border
public static javax.swing.JPanel addTitledBorder(java.awt.Component c,
java.lang.String title,
int titlePosition)
c - the Swing componenttitle - titletitlePosition - horizontal position of title
public static javax.swing.JPanel addMargin(java.awt.Component c)
Uses the return value from getMarginBorder() to determine the maring to add.
c - the Swing component
public static int getDefaultMargin()
public static void setDefaultMargin(int m)
m - the new value of the default marginpublic static javax.swing.border.Border getMarginBorder()
public static javax.swing.border.Border getMarginBorder(int margin)
margin - the margin to use when creating the border
public static void paintNow(javax.swing.JComponent c)
c - the Swing component to paintpublic static void forceRepaint(java.awt.Component c)
public static void redraw(java.awt.Component c)
c - the Swing component to redrawpublic static void pack(javax.swing.JFrame frame)
public static void centerOnScreen(java.awt.Container c)
c - the Swing container to centerpublic static void centerComponent(java.awt.Component c)
c - the Swing component to centerpublic static java.awt.Rectangle getParentBounds(java.awt.Component c)
c - the Swing Component to get the parent's boundaries
public static void unexpectedStartupError()
No return value.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||