Package org.jdesktop.application.utils
Class SwingHelper
java.lang.Object
org.jdesktop.application.utils.SwingHelper
Utility class for Swing Application Framework (BSAF)
- Since:
- 1.9
- Author:
- Illya Yalovyy, Eric Heumann
-
Method Summary
Modifier and TypeMethodDescriptionstatic Rectangle
Calculates virtual graphic bounds.static Point
defaultLocation
(Window window) Calculates default location for the specified window.static RootPaneContainer
Finds the nearest RootPaneContainer of the provided Component.static Rectangle
getWindowNormalBounds
(Window window) GetsWindow
bounds from the client propertystatic boolean
isResizable
(Window window) Checks whether the window supports resizingstatic void
putWindowNormalBounds
(Window window, Rectangle bounds) PutsWindow
bounds to client property.
-
Method Details
-
computeVirtualGraphicsBounds
Calculates virtual graphic bounds. On multiscreen systems all screens are united into one virtual screen.- Returns:
- the graphic bounds
-
isResizable
Checks whether the window supports resizing- Parameters:
window
- theWindow
to be checked- Returns:
- true if the window supports resizing
-
defaultLocation
Calculates default location for the specified window.- Parameters:
window
- the window location is calculated for. It should not be null.- Returns:
- default location for the window
-
findRootPaneContainer
Finds the nearest RootPaneContainer of the provided Component. Primarily, if a JPopupMenu (such as used by JMenus when they are visible) has no parent, the search continues with the JPopupMenu's invoker instead. Fixes BSAF-77- Parameters:
root
- the Component- Returns:
- a RootPaneContainer for the provided component
-
getWindowNormalBounds
GetsWindow
bounds from the client property- Parameters:
window
- the sourceWindow
- Returns:
- bounds from the client property
-
putWindowNormalBounds
PutsWindow
bounds to client property.- Parameters:
window
- the targetWindow
bounds
- bounds
-