Class GraphicsConfiguration
java.lang.Object
vaadinx.awt.GraphicsConfiguration
Import-swap target for
GraphicsConfiguration — the browser
viewport's single display configuration (D_graphics_environment). Reached the
JDK way, through the environment and its default device:
GraphicsConfiguration gc = GraphicsEnvironment.getLocalGraphicsEnvironment()
.getDefaultScreenDevice().getDefaultConfiguration();
Rectangle screen = gc.getBounds(); // (0, 0, viewportWidth, viewportHeight)
Like Toolkit this does not extend the abstract JDK class —
it is the import-swap surface, not a platform configuration — so
getDevice() returns the vaadinx device rather than the JDK's
(R_no_vaadin_in_api limb 1). There is exactly one instance,
GraphicsDevice.getDefaultConfiguration(): a browser has one viewport.
Bounds track the live viewport through BrowserToolkitInfo, so a
value read before a browser resize goes stale — re-read rather than caching.
The image-creation and capability bodies are the JDK's own, which
are pure raster maths and run correctly headless. Only the
VolatileImage family is dropped: it needs a real accelerated
surface, which a server JVM has not got.
-
Method Summary
Modifier and TypeMethodDescriptioncreateCompatibleImage(int width, int height) createCompatibleImage(int width, int height, int transparency) createCompatibleVolatileImage(int width, int height) createCompatibleVolatileImage(int width, int height, int transparency) createCompatibleVolatileImage(int width, int height, ImageCapabilities caps) createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) The viewport rectangle, always origin-anchored — a browser has no multi-monitor offset.getColorModel(int transparency) The user-space-to-72dpi transform, scaled by the browser's reported resolution — so on a HiDPI client this is adevicePixelRatioscale, not the identity.boolean
-
Method Details
-
getDevice
-
getBounds
The viewport rectangle, always origin-anchored — a browser has no multi-monitor offset. -
getColorModel
-
getColorModel
- Returns:
- the model for
transparency, ornullif it is not one ofTransparency's three constants — the contractcreateCompatibleImage(int, int, int)turns into anIllegalArgumentException
-
getDefaultTransform
-
getNormalizingTransform
The user-space-to-72dpi transform, scaled by the browser's reported resolution — so on a HiDPI client this is adevicePixelRatioscale, not the identity. -
createCompatibleImage
-
createCompatibleImage
- Throws:
IllegalArgumentException- iftransparencyis not aTransparencyconstant
-
createCompatibleVolatileImage
- Returns:
- always
null— a server JVM has no accelerated surface to back one.
-
createCompatibleVolatileImage
- Returns:
- always
null— seecreateCompatibleVolatileImage(int, int).
-
createCompatibleVolatileImage
- Returns:
- always
null— seecreateCompatibleVolatileImage(int, int).
-
createCompatibleVolatileImage
public VolatileImage createCompatibleVolatileImage(int width, int height, ImageCapabilities caps, int transparency) - Returns:
- always
null— seecreateCompatibleVolatileImage(int, int).
-
getImageCapabilities
-
getBufferCapabilities
-
isTranslucencyCapable
public boolean isTranslucencyCapable()
-