Class SwingUtils
java.lang.Object
com.inductiveautomation.snap.swing.SwingUtils
This class offers a number of useful general purpose utilities used by ribs classes.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic JComponent
getDefaultFocusComponent
(Component aComponent) Returns the default focus component.static Icon
Returns an icon for the given shape, color and size.static ImageIcon
getImageIcon
(Shape aShape, Color aColor, int aWidth, int aHeight) Returns an image icon for the given shape, color and size.static <T> T
Returns the first parent of given component which is an instance of given class.static Window
Returns the first parent of given component which is window.static void
invokeLater
(Object anObj, String aMethod) Invokes an given method on a given object after delay.static void
invokeLater
(Object anObj, String aMethod, Object anArg, Class anArgClass) Invokes an given method on a given object after delay, with given arg and arg class.static void
invokeLater
(Runnable aRunnable, int aCount) InvokesLater for a given count before running given runnable, in order to skip past events yet to be posted.static void
invokeLaterOnce
(String aName, Runnable aRunnable) Invokes the given runnable for name once (cancels unexecuted previous invokeLater registered with same name).
-
Constructor Details
-
SwingUtils
public SwingUtils()
-
-
Method Details
-
getWindow
Returns the first parent of given component which is window. -
getParent
Returns the first parent of given component which is an instance of given class. -
invokeLater
Invokes an given method on a given object after delay. -
invokeLater
Invokes an given method on a given object after delay, with given arg and arg class. -
invokeLater
InvokesLater for a given count before running given runnable, in order to skip past events yet to be posted. -
invokeLaterOnce
Invokes the given runnable for name once (cancels unexecuted previous invokeLater registered with same name). -
getIcon
Returns an icon for the given shape, color and size. -
getImageIcon
Returns an image icon for the given shape, color and size. -
getDefaultFocusComponent
Returns the default focus component.
-