Class GraphicsDevice
GraphicsDevice — the browser viewport
as the one screen a migrated app has (D_graphics_environment). Obtained from
the environment, and the usual reason to hold one is its display mode:
GraphicsDevice gd = GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice();
int w = gd.getDisplayMode().getWidth(); // viewport width
gd.setFullScreenWindow(frame); // windowed-mode fallback: fills the viewport
Full-screen exclusive mode is unsupported, exactly as on a JDK
device with no exclusive-mode capability — isFullScreenSupported() is
false, and setFullScreenWindow(Window) therefore takes the JDK's windowed-mode
path: it resizes the window to the viewport, shows it and raises it, restoring
the previous bounds when full-screen is later released. That is a working
effect, not a stub, so no WARN is logged.
Like Toolkit this does not extend the abstract JDK class, so
setFullScreenWindow(Window) takes a vaadinx.awt.Window
(R_no_vaadin_in_api limb 1). One instance; a browser has one viewport.
The full-screen window is held per UI, which is this runtime's
analogue of the JDK's per-AppContext scoping: two browser tabs
are two screens, and neither may see the other's full-screen window.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumKinds of per-window translucency a device may support; none are, here. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Method Summary
Modifier and TypeMethodDescriptionintintgetType()booleanbooleanbooleanisWindowTranslucencySupported(GraphicsDevice.WindowTranslucency translucencyKind) voidvoidEnters the JDK's windowed-mode emulation of full screen forw, or leaves it whenwisnull— restoring the bounds the window had on entry.
-
Field Details
-
TYPE_RASTER_SCREEN
public static final int TYPE_RASTER_SCREEN- See Also:
-
TYPE_PRINTER
public static final int TYPE_PRINTER- See Also:
-
TYPE_IMAGE_BUFFER
public static final int TYPE_IMAGE_BUFFER- See Also:
-
-
Method Details
-
getType
public int getType() -
getIDstring
-
getConfigurations
-
getDefaultConfiguration
-
getBestConfiguration
- Parameters:
gct- ignored — with a single configuration to choose from, the best match is it
-
isFullScreenSupported
public boolean isFullScreenSupported() -
setFullScreenWindow
Enters the JDK's windowed-mode emulation of full screen forw, or leaves it whenwisnull— restoring the bounds the window had on entry.- Parameters:
w- the window to fill the viewport with, ornullto release
-
getFullScreenWindow
- Returns:
- this UI's full-screen window, or
nullif it has none
-
isDisplayChangeSupported
public boolean isDisplayChangeSupported() -
setDisplayMode
- Throws:
UnsupportedOperationException- always — the browser viewport's size is the user's to change, matching a JDK device that cannot change display mode
-
getDisplayMode
- Returns:
- the viewport extents, at the default colour model's depth and unknown refresh rate
-
getDisplayModes
-
getAvailableAcceleratedMemory
public int getAvailableAcceleratedMemory()- Returns:
- always -1, the JDK's "unknown" — there is no accelerated surface to measure
-
isWindowTranslucencySupported
- Returns:
- always false —
Window.setShape(Shape)andWindow.setOpacity(float)have no browser counterpart, so no translucency kind is deliverable
-