|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlisken.uitoolbox.UItoolbox
public class UItoolbox
Provides a set of convenience methods for user interfaces.
Constructor Summary | |
---|---|
UItoolbox()
|
Method Summary | |
---|---|
static void |
addExitOnEscape(javax.swing.RootPaneContainer container)
Registers an ActionListener with the root pane of a container
so that the program exits upon pressing the escape key. |
static void |
addLabel(javax.swing.JSlider slider,
int value)
|
static void |
centerOnScreen(java.awt.Component component)
Centers a component on the screen. |
static void |
focusWindow(java.awt.Window window)
Tries to focus a window. |
static java.lang.String |
getTitle(java.awt.Window window)
Returns the title of a window if it's a Frame or a Dialog
or null otherwise. |
static void |
invokeAndWait(java.lang.Runnable runner)
|
static void |
moveComponentNearComponent(java.awt.Component component,
java.awt.Component nearComponent)
Moves one component to another component. |
static void |
pack(java.awt.Component c)
Packs the window that contains a certain component. |
static void |
restrictScrollPaneToScreenPart(javax.swing.JScrollPane scrollPane,
float widthPart,
float heightPart)
|
static java.awt.Dimension |
restrictSizeToScreenPart(java.awt.Component component,
float widthPart,
float heightPart)
Returns the dimension of this component restricted to a certain percentage of the screen size. |
static java.awt.Dimension |
restrictSizeToScreenPart(java.awt.Dimension originalSize,
float widthPart,
float heightPart)
Restricts a dimension to a certain percentage of the screen size. |
static void |
setmaxToPref(javax.swing.JComponent component)
Sets the maximum size of a component to its preferred size. |
static void |
showTextInfo(java.lang.String title,
java.lang.String info)
Shows a dialog with info and the specified title. |
static void |
showTextInfo(java.lang.String title,
java.lang.String info,
boolean monospaced)
Shows a dialog with info, the specified title and the specified font type. |
static void |
showTextInfo(java.lang.String title,
java.lang.String info,
boolean monospaced,
java.awt.Component nearComponent)
Shows a dialog with info and the specified title near the given component. |
static void |
showTextInfo(java.lang.String title,
java.lang.String info,
java.awt.Component nearComponent)
Shows a dialog with info and the specified title near the given component. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public UItoolbox()
Method Detail |
---|
public static void addExitOnEscape(javax.swing.RootPaneContainer container)
ActionListener
with the root pane of a container
so that the program exits upon pressing the escape key.
container
- The container which should respond to the escape key.public static void showTextInfo(java.lang.String title, java.lang.String info)
title
- The title of the dialog.info
- The info to be shown.public static void showTextInfo(java.lang.String title, java.lang.String info, boolean monospaced)
title
- The title of the dialog.info
- The info to be shown.monospaced
- The font type of the info.public static void showTextInfo(java.lang.String title, java.lang.String info, java.awt.Component nearComponent)
title
- The title of the dialog.info
- The info to be shown.nearComponent
- The component in which proximity the dialog should be shown.public static void showTextInfo(java.lang.String title, java.lang.String info, boolean monospaced, java.awt.Component nearComponent)
title
- The title of the dialog.info
- The info to be shown.monospaced
- The font type of the info.nearComponent
- The component in which proximity the dialog should be shown.public static void moveComponentNearComponent(java.awt.Component component, java.awt.Component nearComponent)
component
- The component which will be moved.nearComponent
- The component to which will be moved.public static void centerOnScreen(java.awt.Component component)
component
- The component to be centered on the screen.public static void setmaxToPref(javax.swing.JComponent component)
component
- The component for which the maximum size must be set.public static void pack(java.awt.Component c)
c
- The component which parent window should be packed.public static java.awt.Dimension restrictSizeToScreenPart(java.awt.Dimension originalSize, float widthPart, float heightPart)
originalSize
- The dimension that needs to be restricted.widthPart
- The percentage of the screen width.heightPart
- The percentage of the screen height.
public static java.awt.Dimension restrictSizeToScreenPart(java.awt.Component component, float widthPart, float heightPart)
component
- The component for which the dimension needs to be restricted.widthPart
- The percentage of the screen width.heightPart
- The percentage of the screen height.
restrictSizeToScreenPart(java.awt.Dimension, float, float)
public static void restrictScrollPaneToScreenPart(javax.swing.JScrollPane scrollPane, float widthPart, float heightPart)
public static void addLabel(javax.swing.JSlider slider, int value)
public static void invokeAndWait(java.lang.Runnable runner)
public static java.lang.String getTitle(java.awt.Window window)
Frame
or a Dialog
or null otherwise.
window
- The window for which the title must be returned.
public static void focusWindow(java.awt.Window window)
window
- The window that needs to be focussed.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |