public class StaticSwingUtils extends Object
Modifier and Type | Class and Description |
---|---|
static class |
StaticSwingUtils.PopperUpper
Different platforms use different mouse gestures as pop-up triggers.
|
Modifier and Type | Method and Description |
---|---|
static void |
addHotKey(int key,
JComponent to,
String actionName,
Action action)
Adds a control hot key to the containing window of a component.
|
static JButton |
createButton16(ImageIcon icon) |
static JButton |
createButton16(ImageIcon icon,
String toolTip) |
static void |
dispatchToEDT(Runnable runnable)
Deprecated.
|
static void |
dispatchToEDTWait(Runnable runnable)
Deprecated.
|
Component |
findUltimateParent(Component c) |
static String |
getFromClipboard() |
static JFrame |
getTopFrame(Component comp)
Finds the top-level JFrame in the component tree containing a given
component.
|
static Rectangle |
getWorkSpaceBounds() |
static boolean |
isScrolledToBottom(JScrollPane scrollPane)
Checks whether the given
JScrollPane is currently scrolled to the
bottom of its view. |
static void |
locateCenter(Container component) |
static void |
locateLowerLeft(Container component) |
static void |
locateLowerRight(Container component) |
static void |
locateUpperLeft(Container component) |
static void |
locateUpperRight(Container component) |
static Point |
nextFramePosition() |
static void |
placeInClipboard(String str) |
static void |
scrollToBottom(JScrollPane scrollPane)
Scrolls the given
JScrollPane to its bottom left corner. |
public static void addHotKey(int key, JComponent to, String actionName, Action action)
key
- one of the KeyEvent keyboard constantsto
- component to map toactionName
- unique action name for the component's action mapaction
- callback to notify when control key is pressedpublic static JFrame getTopFrame(Component comp)
comp
- leaf component to search up frompublic static void placeInClipboard(String str)
public static String getFromClipboard()
public static void locateCenter(Container component)
public static void locateUpperRight(Container component)
public static void locateLowerRight(Container component)
public static void locateUpperLeft(Container component)
public static void locateLowerLeft(Container component)
public static Point nextFramePosition()
public static Rectangle getWorkSpaceBounds()
@Deprecated public static void dispatchToEDT(Runnable runnable)
ThreadService.queue(java.lang.Runnable)
.@Deprecated public static void dispatchToEDTWait(Runnable runnable)
ThreadService.invoke(java.lang.Runnable)
.public static void scrollToBottom(JScrollPane scrollPane)
JScrollPane
to its bottom left corner.public static boolean isScrolledToBottom(JScrollPane scrollPane)
JScrollPane
is currently scrolled to the
bottom of its view.Copyright © 2015–2022 SciJava. All rights reserved.