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 JComponentgetDefaultFocusComponent(Component aComponent) Returns the default focus component.static IconReturns an icon for the given shape, color and size.static ImageIcongetImageIcon(Shape aShape, Color aColor, int aWidth, int aHeight) Returns an image icon for the given shape, color and size.static <T> TReturns the first parent of given component which is an instance of given class.static WindowReturns the first parent of given component which is window.static voidinvokeLater(Object anObj, String aMethod) Invokes an given method on a given object after delay.static voidinvokeLater(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 voidinvokeLater(Runnable aRunnable, int aCount) InvokesLater for a given count before running given runnable, in order to skip past events yet to be posted.static voidinvokeLaterOnce(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.
-