APIdia Launch Partner
Top Description Fields Methods
com.sun.glass.ui.monocle

public Interface NativeScreen

Known Direct Implementers
com.sun.glass.ui.monocle.X11Screen, com.sun.glass.ui.monocle.AndroidScreen, com.sun.glass.ui.monocle.EGLScreen, com.sun.glass.ui.monocle.EPDScreen, com.sun.glass.ui.monocle.FBDevScreen, com.sun.glass.ui.monocle.HeadlessScreen
Imports
java.nio.Buffer, .ByteBuffer

NativeScreen provides access to a device's screen

Field Summary

Modifier and TypeField and Description
public static final Object
framebufferSwapLock

An Object to lock against when swapping screen buffers.

Method Summary

Modifier and TypeMethod and Description
public int
getDepth()

Returns the bit depth of the screen/

public int
getDPI()

Returns the number of pixels per inch in the screen.

public int
getHeight()

Returns the pixel height of the screen.

public int
getNativeFormat()

Returns the native format of the screen, as a constant from the Pixels class.

public long
getNativeHandle()

Returns a native handle for the screen.

public default int
getOffsetX()

Returns the horizontal start position of this screen relative to the total combined screen size.

public default int
getOffsetY()

Returns the vertical start position of this screen relative to the total combined screen size.

public float
getScale()

Return the scale factor between the physical pixels and the logical pixels e.g. hdpi = 1.5, xhdpi = 2.0

public ByteBuffer

Returns:

ByteBuffer a read-only ByteBuffer containing the screen contents
getScreenCapture
()

Returns a read-only ByteBuffer in the native pixel format containing the screen contents.

public int
getWidth()

Returns the pixel width of the screen.

public void
shutdown()

Called during JavaFX shutdown to release the screen.

public void
swapBuffers()

Called on the JavaFX application thread when pixel data for all windows has been uploaded.

public void
uploadPixels(Buffer
Pixel data, in BYTE_BGRA_PRE format. The byte stride of the data is equal to width * 4.
b
,
int
The X offset of the pixel data on the screen
x
,
int
The Y offset of the pixel data on the screen
y
,
int
The pixel width of the data
width
,
int
The pixel height of the data
height
,
float
The alpha level to use to compose the data over existing pixels
alpha
)

Uploads a pixel buffer to the screen.

Field Detail

framebufferSwapLockback to summary
public static final Object framebufferSwapLock

An Object to lock against when swapping screen buffers.

Method Detail

getDepthback to summary
public int getDepth()

Returns the bit depth of the screen/

getDPIback to summary
public int getDPI()

Returns the number of pixels per inch in the screen.

getHeightback to summary
public int getHeight()

Returns the pixel height of the screen.

getNativeFormatback to summary
public int getNativeFormat()

Returns the native format of the screen, as a constant from the Pixels class.

getNativeHandleback to summary
public long getNativeHandle()

Returns a native handle for the screen. The handle is platform-specific.

getOffsetXback to summary
public default int getOffsetX()

Returns the horizontal start position of this screen relative to the total combined screen size.

getOffsetYback to summary
public default int getOffsetY()

Returns the vertical start position of this screen relative to the total combined screen size.

getScaleback to summary
public float getScale()

Return the scale factor between the physical pixels and the logical pixels e.g. hdpi = 1.5, xhdpi = 2.0

getScreenCaptureback to summary
public ByteBuffer getScreenCapture()

Returns a read-only ByteBuffer in the native pixel format containing the screen contents.

Returns:ByteBuffer

ByteBuffer a read-only ByteBuffer containing the screen contents

getWidthback to summary
public int getWidth()

Returns the pixel width of the screen.

shutdownback to summary
public void shutdown()

Called during JavaFX shutdown to release the screen. Called only once.

swapBuffersback to summary
public void swapBuffers()

Called on the JavaFX application thread when pixel data for all windows has been uploaded.

uploadPixelsback to summary
public void uploadPixels(Buffer b, int x, int y, int width, int height, float alpha)

Uploads a pixel buffer to the screen. Called on the JavaFX application thread.

Parameters
b:Buffer

Pixel data, in BYTE_BGRA_PRE format. The byte stride of the data is equal to width * 4.

x:int

The X offset of the pixel data on the screen

y:int

The Y offset of the pixel data on the screen

width:int

The pixel width of the data

height:int

The pixel height of the data

alpha:float

The alpha level to use to compose the data over existing pixels