public class ScreenGeometry extends Object
Constructor and Description |
---|
ScreenGeometry() |
Modifier and Type | Method and Description |
---|---|
static void |
adjustComponentLocationOnScreen(Component component,
List<GraphicsConfiguration> availableGraphicsConfiguration)
Adjust the component location, if possible, so that it is completely inside the available graphic
configuration.
|
static void |
adjustWindowLocationOnScreen(Window window)
Check whether the given window is completely on screen.
|
static List<GraphicsConfiguration> |
getAvailableGraphicsConfigurations()
Gets the available
GraphicsConfiguration . |
static Rectangle |
getScreenBounds(GraphicsConfiguration gc)
Get the screen bounds for a given
GraphicsConfiguration respecting the screen insets. |
public static void adjustWindowLocationOnScreen(Window window)
Please note, Window
is the base class of all window types, such as JFrame
,
JDialog
and so on. So this method can be used for all subtypes of windows.
window
- the window to checkpublic static void adjustComponentLocationOnScreen(Component component, List<GraphicsConfiguration> availableGraphicsConfiguration)
component
- the component to adjustavailableGraphicsConfiguration
- all currently available screen graphic configurationspublic static List<GraphicsConfiguration> getAvailableGraphicsConfigurations()
GraphicsConfiguration
. In a headless environment the resulting list
will be empty.GraphicsConfiguration
public static Rectangle getScreenBounds(GraphicsConfiguration gc)
GraphicsConfiguration
respecting the screen insets.gc
- given GraphicsConfiguration
GraphicsConfiguration
respecting its screen insets
or the toolkit bounds if the parameter is null
.Copyright © 2024 levigo holding gmbh. All rights reserved.