Package snap.swing
Class SwingUtils
java.lang.Object
snap.swing.SwingUtils
This class offers a number of useful general purpose Swing utilities.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiongetFiles
(Transferable aTrans) Returns a list of files from a given transferable.static GraphicsConfiguration
getGraphicsConfiguration
(Component aComp, int anX, int aY) Returns the GraphicsConfiguration for a point.static KeyStroke
getKeyStroke
(String aKey) This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke().static String
getKeyText
(KeyStroke aKeyStroke) This utility method returns key text for a key stroke and tries to make it more conforming.static <T> T
Returns the first parent of given component which is an instance of given class.static Rectangle
getScreenBounds
(Component aComp, int anX, int aY, boolean doInset) Returns the screen bounds for a component location (or screen location if component null).static Dimension
getScreenSizeAvailable
(Component aComp, int anX, int aY) Returns the size available from given point to in component to bottom right of component screen.static String
getString
(Transferable aTrans) Returns a string from given transferable.static Window
Returns the first parent of given component which is window.
-
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. -
getString
Returns a string from given transferable. -
getFiles
Returns a list of files from a given transferable. -
getKeyText
This utility method returns key text for a key stroke and tries to make it more conforming. -
getKeyStroke
This utility method tries to get a keystroke from a string and tries to be more forgiving than KeyStroke.getKeyStroke(). -
getScreenSizeAvailable
Returns the size available from given point to in component to bottom right of component screen. -
getScreenBounds
Returns the screen bounds for a component location (or screen location if component null). -
getGraphicsConfiguration
Returns the GraphicsConfiguration for a point.
-