Top Description Fields Constructors Methods
com.dlsc.gemsfx

public Class ScreensView

extends Control
Class Inheritance
Imports
com.dlsc.gemsfx.skins.ScreensViewSkin, javafx.beans.property.BooleanProperty, .ObjectProperty, .SimpleBooleanProperty, .SimpleObjectProperty, javafx.collections.FXCollections, .ObservableList, javafx.scene.Scene, javafx.scene.control.Control, .Skin, javafx.scene.effect.BlurType, .DropShadow, .Reflection, javafx.scene.image.Image, javafx.scene.shape.Shape, javafx.stage.Screen, .Stage, .StageStyle, javafx.util.Callback, java.util.Objects

A view for displaying the geometry of the currently available screens. This view displays each screen in its correct size. Big screens will be big, small ones will be smaller. In addition, the view can also display the currently showing windows of the application. For debugging purposes the view is also capable of showing arbitrary shapes inside the within the unified bounds of all screens.

Field Summary

Modifier and TypeField and Description
private static final Image
private final BooleanProperty
private final ObjectProperty<Reflection>
private final ObjectProperty<DropShadow>
private final ObservableList<Shape>
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final BooleanProperty
private final ObjectProperty<Callback<Screen, Image>>

Constructor Summary

AccessConstructor and Description
public
ScreensView()

Constructs a new view.

Method Summary

Modifier and TypeMethod and Description
protected Skin<?>
createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control.

public final BooleanProperty

Returns:

true if the user can modify the window positions
enableWindowDraggingProperty
()

A flag used to control whether the user will be able to drag the miniature windows on the miniature screens around or not.

public final Reflection
public final DropShadow
public final ObservableList<Shape>

Returns:

list of shapes to add to this view.
getShapes
()

A list of arbitrary shapes that can be added to this view.

public String
getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method.

public final Callback<Screen, Image>
public final boolean
public final boolean
public final boolean
public final boolean
public final boolean
public final ObjectProperty<Reflection>

Returns:

the reflection effect
reflectionProperty
()

Stores the instance of the Reflection effect that will be applied to the screens in this view.

public final void
setEnableWindowDragging(boolean enableWindowDragging)

public final void
public final void
public final void
setShowReflection(boolean showReflection)

public final void
setShowShadow(boolean showShadow)

public final void
setShowWallpaper(boolean showWallpaper)

public final void
setShowWindows(boolean showWindows)

public final void
public final ObjectProperty<DropShadow>

Returns:

the drop shadow effect
shadowProperty
()

Stores the instance of the DropShadow effect that will be applied to the screens in this view.

public static ScreensView

Returns:

the view that was created by the method call (can be used for further configuration)
show
()

Utility method to quickly bring up an instance of this view.

public final BooleanProperty

Returns:

true if a reflection effect shall be shown
showReflectionProperty
()

Determines if a reflection effect will be applied to the miniature screens.

public final BooleanProperty

Returns:

true if a shadow effect shall be shown
showShadowProperty
()

Determines if a shadow effect will be applied to the miniature screens.

public final BooleanProperty

Returns:

true if the view should display wallpapers on the miniature screens
showWallpaperProperty
()

Determines if the miniature screens should show a wallpaper or not.

public final BooleanProperty

Returns:

true if the windows should also be showing
showWindowsProperty
()

Determines if the view should also show the currently active windows of the running application.

public final ObjectProperty<Callback<Screen, Image>>

Returns:

a callback for determining which wallpaper to use for which screen
wallpaperProviderProperty
()

A callback used for looking up images that will be used as wallpapers on the miniature screens.

Inherited from javafx.scene.control.Control:
computeMaxHeightcomputeMaxWidthcomputeMinHeightcomputeMinWidthcomputePrefHeightcomputePrefWidthcontextMenuPropertyexecuteAccessibleActiongetBaselineOffsetgetClassCssMetaDatagetContextMenugetControlCssMetaDatagetCssMetaDatagetInitialFocusTraversablegetSkingetTooltipisResizablelayoutChildrenqueryAccessibleAttributesetContextMenusetSkinsetTooltipskinPropertytooltipProperty

Field Detail

DEFAULT_WALLPAPERback to summary
private static final Image DEFAULT_WALLPAPER
enableWindowDraggingback to summary
private final BooleanProperty enableWindowDragging
reflectionback to summary
private final ObjectProperty<Reflection> reflection
shadowback to summary
private final ObjectProperty<DropShadow> shadow
shapesback to summary
private final ObservableList<Shape> shapes
showReflectionback to summary
private final BooleanProperty showReflection
showShadowback to summary
private final BooleanProperty showShadow
showWallpaperback to summary
private final BooleanProperty showWallpaper
showWindowsback to summary
private final BooleanProperty showWindows
wallpaperProviderback to summary
private final ObjectProperty<Callback<Screen, Image>> wallpaperProvider

Constructor Detail

ScreensViewback to summary
public ScreensView()

Constructs a new view.

Method Detail

createDefaultSkinback to summary
protected Skin<?> createDefaultSkin()

Overrides javafx.scene.control.Control.createDefaultSkin.

Doc from javafx.scene.control.Control.createDefaultSkin.

Create a new instance of the default skin for this control. This is called to create a skin for the control if no skin is provided via CSS -fx-skin or set explicitly in a sub-class with setSkin(...).

Annotations
@Override
enableWindowDraggingPropertyback to summary
public final BooleanProperty enableWindowDraggingProperty()

A flag used to control whether the user will be able to drag the miniature windows on the miniature screens around or not.

Returns:BooleanProperty

true if the user can modify the window positions

getReflectionback to summary
public final Reflection getReflection()
getShadowback to summary
public final DropShadow getShadow()
getShapesback to summary
public final ObservableList<Shape> getShapes()

A list of arbitrary shapes that can be added to this view.

Returns:ObservableList<Shape>

list of shapes to add to this view.

getUserAgentStylesheetback to summary
public String getUserAgentStylesheet()

Overrides javafx.scene.layout.Region.getUserAgentStylesheet.

Doc from javafx.scene.layout.Region.getUserAgentStylesheet.

An implementation may specify its own user-agent styles for this Region, and its children, by overriding this method. These styles are used in addition to whatever user-agent stylesheets are in use. This provides a mechanism for third parties to introduce styles for custom controls.

The URL is a hierarchical URI of the form [scheme:][//authority][path]. If the URL does not have a [scheme:] component, the URL is considered to be the [path] component only. Any leading '/' character of the [path] is ignored and the [path] is treated as a path relative to the root of the application's classpath.

Subclasses overriding this method should not assume any particular implementation approach as to the number and frequency with which it is called. For this reason, attempting any kind of dynamic implementation (i.e. returning different user agent stylesheet values) based on some state change is highly discouraged, as there is no guarantee when, or even if, this method will be called. Some JavaFX CSS implementations may choose to cache this response for an indefinite period of time, and therefore there should be no expectation around when this method is called.



package com.example.javafx.app;

import javafx.application.Application;
import javafx.scene.Group;
import javafx.scene.Scene;
import javafx.stage.Stage;

public class MyApp extends Application {

    @Override public void start(Stage stage) {
        Scene scene = new Scene(new Group());
        scene.getStylesheets().add("/com/example/javafx/app/mystyles.css");
        stage.setScene(scene);
        stage.show();
    }

    public static void main(String[] args) {
        launch(args);
    }
}
For additional information about using CSS with the scene graph, see the CSS Reference Guide.
Annotations
@Override
getWallpaperProviderback to summary
public final Callback<Screen, Image> getWallpaperProvider()
isEnableWindowDraggingback to summary
public final boolean isEnableWindowDragging()
isShowReflectionback to summary
public final boolean isShowReflection()
isShowShadowback to summary
public final boolean isShowShadow()
isShowWallpaperback to summary
public final boolean isShowWallpaper()
isShowWindowsback to summary
public final boolean isShowWindows()
reflectionPropertyback to summary
public final ObjectProperty<Reflection> reflectionProperty()

Stores the instance of the Reflection effect that will be applied to the screens in this view.

Returns:ObjectProperty<Reflection>

the reflection effect

setEnableWindowDraggingback to summary
public final void setEnableWindowDragging(boolean enableWindowDragging)
setReflectionback to summary
public final void setReflection(Reflection reflection)
setShadowback to summary
public final void setShadow(DropShadow shadow)
setShowReflectionback to summary
public final void setShowReflection(boolean showReflection)
setShowShadowback to summary
public final void setShowShadow(boolean showShadow)
setShowWallpaperback to summary
public final void setShowWallpaper(boolean showWallpaper)
setShowWindowsback to summary
public final void setShowWindows(boolean showWindows)
setWallpaperProviderback to summary
public final void setWallpaperProvider(Callback<Screen, Image> wallpaperProvider)
shadowPropertyback to summary
public final ObjectProperty<DropShadow> shadowProperty()

Stores the instance of the DropShadow effect that will be applied to the screens in this view.

Returns:ObjectProperty<DropShadow>

the drop shadow effect

showback to summary
public static ScreensView show()

Utility method to quickly bring up an instance of this view.

Returns:ScreensView

the view that was created by the method call (can be used for further configuration)

showReflectionPropertyback to summary
public final BooleanProperty showReflectionProperty()

Determines if a reflection effect will be applied to the miniature screens.

Returns:BooleanProperty

true if a reflection effect shall be shown

showShadowPropertyback to summary
public final BooleanProperty showShadowProperty()

Determines if a shadow effect will be applied to the miniature screens.

Returns:BooleanProperty

true if a shadow effect shall be shown

showWallpaperPropertyback to summary
public final BooleanProperty showWallpaperProperty()

Determines if the miniature screens should show a wallpaper or not. The wallpapers are controlled via the wallpaperProviderProperty(). If no wallpapers are shown then the appearance of the miniature screens solely depends on CSS.

Returns:BooleanProperty

true if the view should display wallpapers on the miniature screens

showWindowsPropertyback to summary
public final BooleanProperty showWindowsProperty()

Determines if the view should also show the currently active windows of the running application.

Returns:BooleanProperty

true if the windows should also be showing

wallpaperProviderPropertyback to summary
public final ObjectProperty<Callback<Screen, Image>> wallpaperProviderProperty()

A callback used for looking up images that will be used as wallpapers on the miniature screens.

Returns:ObjectProperty<Callback<Screen, Image>>

a callback for determining which wallpaper to use for which screen