public final class Screen
extends java.lang.Object
Screen
objects are relative to the Screen.primary
.
For example:
Rectangle2D primaryScreenBounds = Screen.getPrimary().getVisualBounds();
//set Stage boundaries to visible bounds of the main screen
stage.setX(primaryScreenBounds.getMinX());
stage.setY(primaryScreenBounds.getMinY());
stage.setWidth(primaryScreenBounds.getWidth());
stage.setHeight(primaryScreenBounds.getHeight());
stage.show();
Modifier and Type | Field and Description |
---|---|
private static ScreenConfigurationAccessor |
accessor |
private Rectangle2D |
bounds
The bounds of this
Screen . |
private static java.util.concurrent.atomic.AtomicBoolean |
configurationDirty |
private double |
dpi
The resolution (dots per inch) of this
Screen . |
private float |
outputScaleX
The recommended output scale factor of this
Screen in the
X direction. |
private float |
outputScaleY
The recommended output scale factor of this
Screen in the
Y direction. |
private static Screen |
primary |
private static <any> |
screens |
private static <any> |
unmodifiableScreens |
private Rectangle2D |
visualBounds
The visual bounds of this
Screen . |
Modifier | Constructor and Description |
---|---|
private |
Screen() |
Modifier and Type | Method and Description |
---|---|
private static void |
checkDirty() |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.
|
Rectangle2D |
getBounds()
Gets the bounds of this
Screen . |
double |
getDpi()
Gets the resolution (dots per inch) of this
Screen . |
double |
getOutputScaleX()
Gets the recommended output scale factor of this
Screen in
the horizontal (X ) direction. |
double |
getOutputScaleY()
Gets the recommended output scale factor of this
Screen in
the vertical (Y ) direction. |
static Screen |
getPrimary()
The primary
Screen . |
(package private) static Screen |
getScreenForNative(java.lang.Object obj) |
static <any> |
getScreens()
The observable list of currently available
Screens . |
static <any> |
getScreensForRectangle(double x,
double y,
double width,
double height)
Returns a ObservableList of
Screens that intersects the provided rectangle. |
static <any> |
getScreensForRectangle(Rectangle2D r)
Returns a ObservableList of
Screens that intersects the provided rectangle. |
Rectangle2D |
getVisualBounds()
Gets the visual bounds of this
Screen . |
int |
hashCode()
Returns a hash code for this
Screen object. |
private static Screen |
nativeToScreen(java.lang.Object obj,
Screen screen) |
java.lang.String |
toString()
Returns a string representation of this
Screen object. |
private static void |
updateConfiguration() |
private static final java.util.concurrent.atomic.AtomicBoolean configurationDirty
private static final ScreenConfigurationAccessor accessor
private static Screen primary
private static final <any> screens
private static final <any> unmodifiableScreens
private Rectangle2D bounds
Screen
.private Rectangle2D visualBounds
Screen
.
These bounds account for objects in the native windowing system such as
task bars and menu bars. These bounds are contained by Screen.bounds
.private double dpi
Screen
.private float outputScaleX
Screen
in the
X direction.private float outputScaleY
Screen
in the
Y direction.private static void checkDirty()
private static void updateConfiguration()
static Screen getScreenForNative(java.lang.Object obj)
public static Screen getPrimary()
Screen
.public static <any> getScreens()
Screens
.public static <any> getScreensForRectangle(double x, double y, double width, double height)
Screens
that intersects the provided rectangle.x
- the x coordinate of the upper-left corner of the specified
rectangular areay
- the y coordinate of the upper-left corner of the specified
rectangular areawidth
- the width of the specified rectangular areaheight
- the height of the specified rectangular areaScreens
for which Screen.bounds
intersects the provided rectanglepublic static <any> getScreensForRectangle(Rectangle2D r)
Screens
that intersects the provided rectangle.r
- The specified Rectangle2D
Screens
for which Screen.bounds
intersects the provided rectanglepublic final Rectangle2D getBounds()
Screen
.
The bounds will be reported adjusted for the outputScale
so
that resizing a Window
with these bounds and the same
outputScale
as this Screen
will cover the entire
screen.Screen
public final Rectangle2D getVisualBounds()
Screen
.
These bounds account for objects in the native windowing system such as
task bars and menu bars. These bounds are contained by Screen.bounds
.Screen
public final double getDpi()
Screen
.Screen
public final double getOutputScaleX()
Screen
in
the horizontal (X
) direction.
This scale factor should be applied to a scene in order to compensate
for the resolution and viewing distance of the output device.
The visual bounds will be reported relative to this scale factor.public final double getOutputScaleY()
Screen
in
the vertical (Y
) direction.
This scale factor will be applied to the scene in order to compensate
for the resolution and viewing distance of the output device.
The visual bounds will be reported relative to this scale factor.public int hashCode()
Screen
object.hashCode
in class java.lang.Object
Screen
object.public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
obj
- the reference object with which to compare.true
if this object is equal to the obj
argument; false
otherwise.public java.lang.String toString()
Screen
object.toString
in class java.lang.Object
Screen
object.