Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

com.gentleware.services.util

Class SwingUtil

com.gentleware.services.util.SwingUtil

public class SwingUtil



 Attribute Summary
private static int  _optionPaneResult
 
arrow_up
 

 Constructor Summary
private   SwingUtil()
 
arrow_up
 

 Method Summary
public static void   centerOnScreen(Window window)
Center the given window on the (first) screen  
public static void   centerOnScreen(Window window, float percX, float percY)
Positions a window on the screen. 
public static void   expandCompleteTree(JTree tree)
expand all paths in the passed tree  
public static Component   findComponentByClass(Container container, Class clazz)
Finds the first component of a given class within a container. 
public static GraphicsDevice   getGraphicsDevice(Point p)
 
public static Rectangle   getPrimaryScreenBounds()
Gets the bounds of the primary screen. 
public static Dimension   getPrimaryScreenSize()
Get the size of the primary screen. 
public static Rectangle   getScreenBounds(int x, int y, boolean includeInsets)
 
public static void   invokeNowOrLater(Runnable runnable)
 
public static void   makePreferSameSize(JComponent[] components)
A little helper method to make a bunch of JComponent's all prefer the same size. 
public static void   registerEscapeKeystroke(AbstractButton button)
 
public static void   scrollByBlock(JScrollBar scrollbar, int direction)
 
public static void   scrollByUnits(JScrollBar scrollbar, int direction, int units)
 
public static void   setToolTipText(JComponent component, String text)
Sets the tooltip text for the given component. 
public static int   showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)
Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
public static int   showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)
Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait(), if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
public static int   showConfirmDialog(Component parentComponent, Object message, String title, int optionType)
Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
public static void   showMessageFrame(JFrame parent, String text, ResourceId titleResourceId)
 
public static void   showMessageFrame(Frame parent, String text, ResourceId titleResourcId, boolean modal)
Creates and shows a MessageFrame (...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself SwingUtilities.invokeAndWait() will not be used  
public static int   showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)
Calls JOptionPane.showOptionDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showOptionDialog(...)  
arrow_up
 

Tagged Values
static false
gentleware-imported-line-number 14
gentleware-imported-package-statement-line-number 1
 

 Attribute Detail

_optionPaneResult

private static int _optionPaneResult

arrow_up
 Constructor Detail

SwingUtil

private com.gentleware.services.util.SwingUtil SwingUtil()

Returns:
arrow_up
 Method Detail

centerOnScreen

public static void centerOnScreen(Window window)


Center the given window on the (first) screen  
Parameters:
window -
arrow_up


centerOnScreen

public static void centerOnScreen(Window window, float percX, float percY)


Positions a window on the screen. In a multi-screen environment the window is positioned on the same screen as the parent's center point is on (or the primary screen if the window has no parent).  
Parameters:
window -
percX -
percY -
arrow_up


expandCompleteTree

public static void expandCompleteTree(JTree tree)


expand all paths in the passed tree  
Parameters:
tree -
arrow_up


findComponentByClass

public static Component findComponentByClass(Container container, Class clazz)


Finds the first component of a given class within a container.  
Parameters:
container -
clazz -
Returns:
arrow_up


getGraphicsDevice

public static GraphicsDevice getGraphicsDevice(Point p)

Parameters:
p -
Returns:
arrow_up


getPrimaryScreenBounds

public static Rectangle getPrimaryScreenBounds()


Gets the bounds of the primary screen. Behaves correctly on multi-monitor systems.  
Returns:
arrow_up


getPrimaryScreenSize

public static Dimension getPrimaryScreenSize()


Get the size of the primary screen. Behaves correctly on multi-monitor systems.  
Returns:
arrow_up


getScreenBounds

public static Rectangle getScreenBounds(int x, int y, boolean includeInsets)

Parameters:
x -
y -
includeInsets -
Returns:
the screen bounds of the screen containing (or closest to) the point (x, y)
arrow_up


invokeNowOrLater

public static void invokeNowOrLater(Runnable runnable)

Parameters:
runnable -
arrow_up


makePreferSameSize

public static void makePreferSameSize(JComponent[] components)


A little helper method to make a bunch of JComponent's all prefer the same size.  
Parameters:
components -
arrow_up


registerEscapeKeystroke

public static void registerEscapeKeystroke(AbstractButton button)

Parameters:
button -
arrow_up


scrollByBlock

public static void scrollByBlock(JScrollBar scrollbar, int direction)

Parameters:
scrollbar -
direction -
arrow_up


scrollByUnits

public static void scrollByUnits(JScrollBar scrollbar, int direction, int units)

Parameters:
scrollbar -
direction -
units -
arrow_up


setToolTipText

public static void setToolTipText(JComponent component, String text)


Sets the tooltip text for the given component. Contains a work-around for a JDK bug. The bug should be fixed in JDK 1.4.2.  
Parameters:
component - The JComponent to set the tooltip text for.
text - The text to be set.
arrow_up


showConfirmDialog

public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon)


Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
Parameters:
parentComponent -
message -
title -
optionType -
messageType -
icon -
Returns:
arrow_up


showConfirmDialog

public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType, int messageType)


Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait(), if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
Parameters:
parentComponent -
message -
title -
optionType -
messageType -
Returns:
arrow_up


showConfirmDialog

public static int showConfirmDialog(Component parentComponent, Object message, String title, int optionType)


Calls JOptionPane.showConfirmDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showConfirmDialog(...)  
Parameters:
parentComponent -
message -
title -
optionType -
Returns:
arrow_up


showMessageFrame

public static void showMessageFrame(JFrame parent, String text, ResourceId titleResourceId)

Parameters:
parent -
text -
titleResourceId -
arrow_up


showMessageFrame

public static void showMessageFrame(Frame parent, String text, ResourceId titleResourcId, boolean modal)


Creates and shows a MessageFrame (...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself SwingUtilities.invokeAndWait() will not be used  
Parameters:
parent -
text -
titleResourcId -
modal -
arrow_up


showOptionDialog

public static int showOptionDialog(Component parentComponent, Object message, String title, int optionType, int messageType, Icon icon, Object[] options, Object initialValue)


Calls JOptionPane.showOptionDialog(...) using SwingUtilities.invokeAndWait() if it is the EventDispatchThread itself it calls only JOptionPane.showOptionDialog(...)  
Parameters:
parentComponent -
message -
title -
optionType -
messageType -
icon -
options -
initialValue -
Returns:
arrow_up
Created  2004 - 12 - 1

    Poseidon for UMLTM
  UMLdoc
 PREV  CLASSIFIER    NEXT  CLASSIFIER     FRAMES    NO FRAMES      
SUMMARY:   INNER | ATTR | ASSOC | CONSTR | METHOD     DETAIL:   INNER | ATTR | ASSOC | CONSTR | METHOD     DIAGRAMS:   COLLAB | SEQ | STATE | ACTIV

Generated with Poseidon for UMLTM.
Poseidon is a registered trademark of Gentleware AG in Germany, USA and other countries. Copyright 2003-2004 Gentleware AG, Schanzenstr. 70, 20357 Hamburg, Germany. All Rights Reserved.

UML is a trademark or registered trademark of Object Management Group, Inc. in the U.S. and other countries.