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 RectangleCalculates virtual graphic bounds.static PointdefaultLocation(Window window) Calculates default location for the specified window.static RootPaneContainerFinds the nearest RootPaneContainer of the provided Component.static RectanglegetWindowNormalBounds(Window window) GetsWindowbounds from the client propertystatic booleanisResizable(Window window) Checks whether the window supports resizingstatic voidputWindowNormalBounds(Window window, Rectangle bounds) PutsWindowbounds 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- theWindowto 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
GetsWindowbounds from the client property- Parameters:
window- the sourceWindow- Returns:
- bounds from the client property
-
putWindowNormalBounds
PutsWindowbounds to client property.- Parameters:
window- the targetWindowbounds- bounds
-