|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--one.gui.GuiUtilities
Implementation of utility methods for creating and managing user interfaces.
| Field Summary | |
static String |
ACTION_CANCEL
The cancel action command. |
static String |
ACTION_OK
The OK action command. |
static int |
ENTRY_COMBO_BOX
The entry code for a combo box. |
static int |
ENTRY_PASSWORD_FIELD
The entry code for a password field. |
static int |
ENTRY_TEXT_FIELD
The entry code for a text field. |
static Icon |
FLAG_ICON
The flag icon. |
| Method Summary | |
static void |
addUserPopup(Component c,
Environment env)
Add a user popup to the specified component. |
static void |
beep()
Emit an audible beep. |
static JLabel |
createLocationSource(Guid id)
Create a label that serves as the drag and drop source for location changes of the environment with the specified ID. |
static JComponent[] |
createSimpleGrid(String[] labels,
int[] types,
int columns)
Create a simple grid. |
static void |
layout(JDialog dialog,
Component content,
ActionListener okListener,
ActionListener cancelListener)
Create the layout for the specified dialog. |
static void |
place(Component component,
int x,
int y)
Place the specified component at the specified location on the default screen. |
static void |
turnIntoEnvironmentSource(Component c,
Guid id)
Turn the specified component into a drag and drop source for environment selections for the environment with the specified ID. |
static void |
turnIntoEnvironmentTarget(JLabel label,
EventHandler handler)
Turn the specified label into a drag and drop target for environment selections. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String ACTION_OK
public static final String ACTION_CANCEL
public static final Icon FLAG_ICON
public static final int ENTRY_TEXT_FIELD
public static final int ENTRY_PASSWORD_FIELD
public static final int ENTRY_COMBO_BOX
| Method Detail |
public static JLabel createLocationSource(Guid id)
FLAG_ICON and transfers
environment selections for the
specified environment.id - The environment ID.NullPointerException - Signals that id is null.addUserPopup(java.awt.Component, one.world.core.Environment)
public static void turnIntoEnvironmentSource(Component c,
Guid id)
c - The component.id - The environment ID.NullPointerException - Signals that c or id
is null.EnvironmentSelection
public static void turnIntoEnvironmentTarget(JLabel label,
EventHandler handler)
Note that this method adds a border to the specified label, which must not be changed.
label - The label.handler - The environment drop event handler.NullPointerException - Signals that label or
handler is null.turnIntoEnvironmentSource(java.awt.Component, one.util.Guid),
EnvironmentSelection,
EnvironmentDropEvent
public static void addUserPopup(Component c,
Environment env)
By user interface convention, this method should be invoked on the label returned by {link #createLocationSource} before adding the label to the application's UI.
c - The component to add the user popup to.env - The environment in which the component's
application is running in.NullPointerException - Signals that env is null.
public static JComponent[] createSimpleGrid(String[] labels,
int[] types,
int columns)
The layout created by this method adds some filler space
between the labels and the entries. It aligns the first
column to the left. Entries in the second column are stretched
across the entire column. If columns is positive,
test fields and password fields are set to the specified
number of character columns.
labels and types must be valid
arrays of the same length. Each entry of types must
be ENTRY_TEXT_FIELD, ENTRY_PASSWORD_FIELD, or
ENTRY_COMBO_BOX.
labels - The labels.types - The entry types.columns - The positive minimum number of character columns
for text and password fields, or a non-positive
number if text and password fields should be
arbitrarily stretched.types.
public static void layout(JDialog dialog,
Component content,
ActionListener okListener,
ActionListener cancelListener)
ACTION_OK command. The
second button is the "Cancel" button. It notifies the specified
cancel listener with the ACTION_CANCEL command.dialog - The dialog.content - The main dialog contents.okListener - The action listener for the OK button.cancelListener - The action listener for the cancel button.
public static void place(Component component,
int x,
int y)
component - The component to place.x - The x coordinate of the location.y - The y coordinate of the location.public static void beep()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||