| java.lang.Object org.geotools.resources.SwingUtilities
SwingUtilities | final public class SwingUtilities (Code) | | A collection of utility methods for Swing. All show* methods delegate
their work to the corresponding method in
JOptionPane , with two differences:
-
SwingUtilities 's method may be invoked from any thread. If they
are invoked from a non-Swing thread, execution will be delegate to the Swing
thread and the calling thread will block until completion.
- If a parent component is a
JDesktopPane , dialogs will be rendered as
internal frames instead of frames.
since: 2.0 version: $Id: SwingUtilities.java 22443 2006-10-27 20:47:22Z desruisseaux $ author: Martin Desruisseaux |
Method Summary | |
public static Locale | getLocale(Component component) Returns the locale for the specified component, or a default one if the component
is not yet part of a container hierarchy. | public static JComponent | getMultilineLabelFor(JComponent owner, String text) Retourne une étiquette pour la composante spécifiée. | public static void | invokeAndWait(Runnable runnable) Causes runnable to have its run method called in the dispatch thread of
the event queue. | public static void | setTitle(Component component, String title) Set the title of the parent frame or internal frame of the specified component. | public static boolean | showConfirmDialog(Component owner, Object message, String title, int type) Brings up a confirmation dialog with "Yes/No" buttons. | public static void | showMessageDialog(Component owner, Object message, String title, int type) Brings up a message dialog with a "Ok" button. | public static boolean | showOptionDialog(Component owner, Object dialog, String title) Brings up a "Ok/Cancel" dialog with no icon. | public static boolean | showOptionDialog(Component owner, Object dialog, String title, ActionListener reset) Brings up a "Ok/Cancel/Reset" dialog with no icon. | public static Component | toFrame(Component owner, JComponent panel, String title, WindowListener listener) Insert a Swing component into a frame. |
getLocale | public static Locale getLocale(Component component)(Code) | | Returns the locale for the specified component, or a default one if the component
is not yet part of a container hierarchy.
|
getMultilineLabelFor | public static JComponent getMultilineLabelFor(JComponent owner, String text)(Code) | | Retourne une étiquette pour la composante spécifiée.
Le texte de l'étiquette pourra éventuellement être
distribué sur plusieurs lignes.
Parameters: owner - Composante pour laquelle on construit une étiquette.L'étiquette aura la même largeur que owner . Parameters: text - Texte à placer dans l'étiquette. |
invokeAndWait | public static void invokeAndWait(Runnable runnable)(Code) | | Causes runnable to have its run method called in the dispatch thread of
the event queue. This will happen after all pending events are processed.
The call blocks until this has happened.
|
setTitle | public static void setTitle(Component component, String title)(Code) | | Set the title of the parent frame or internal frame of the specified component.
|
showOptionDialog | public static boolean showOptionDialog(Component owner, Object dialog, String title)(Code) | | Brings up a "Ok/Cancel" dialog with no icon. This method can be invoked
from any thread and blocks until the user click on "Ok" or "Cancel".
Parameters: owner - The parent component. Dialog will apears on top of this owner. Parameters: dialog - The dialog content to show. Parameters: title - The title string for the dialog. true if user clicked "Ok", false otherwise. |
showOptionDialog | public static boolean showOptionDialog(Component owner, Object dialog, String title, ActionListener reset)(Code) | | Brings up a "Ok/Cancel/Reset" dialog with no icon. This method can be invoked
from any thread and blocks until the user click on "Ok" or "Cancel".
Parameters: owner - The parent component. Dialog will apears on top of this owner. Parameters: dialog - The dialog content to show. Parameters: title - The title string for the dialog. Parameters: reset - Action to execute when user press "Reset", or null if there is no "Reset" button. If reset is aninstance of Action, the button label will be setaccording the action's properties. true if user clicked "Ok", false otherwise. |
toFrame | public static Component toFrame(Component owner, JComponent panel, String title, WindowListener listener)(Code) | | Insert a Swing component into a frame. The kind of frame depends on the owner:
Parameters: owner - The frame's owner, or null if none. Parameters: panel - The panel to insert into a frame. Parameters: title - The frame's title. Parameters: listener - A listener to receives frame events. If non-null, then this listener willbe registered to whatever kind of frame this method will constructs. In the specialcase where this method constructs an andthe listener is not an instance of InternalFrameListener, thenthis method will wrap the listener into an InternalFrameListener . The frame. This frame is not initially visible. The method Component.setVisible(true) must be invoked in order to show the frame. |
|
|