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

public Class AndroidScreen

extends Object
implements NativeScreen
Class Inheritance
All Implemented Interfaces
com.sun.glass.ui.monocle.NativeScreen
Imports
com.sun.glass.ui.Pixels, java.nio.Buffer, .ByteBuffer

Field Summary

Modifier and TypeField and Description
private float
public static final Object
framebufferSwapLock

Hides com.sun.glass.ui.monocle.NativeScreen.framebufferSwapLock.

An Object to lock against when swapping screen buffers.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
pack-priv native float
pack-priv native int
pack-priv native long
pack-priv native ByteBuffer
pack-priv native int
pack-priv native void
pack-priv native void
pack-priv native void
_uploadPixels(Buffer b, int x, int y, int width, int height, float alpha)

public int
getDepth()

Implements com.sun.glass.ui.monocle.NativeScreen.getDepth.

Returns the bit depth of the screen/

public int
getDPI()

Implements com.sun.glass.ui.monocle.NativeScreen.getDPI.

Returns the number of pixels per inch in the screen.

public int
getHeight()

Implements com.sun.glass.ui.monocle.NativeScreen.getHeight.

Returns the pixel height of the screen.

public int
getNativeFormat()

Implements com.sun.glass.ui.monocle.NativeScreen.getNativeFormat.

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

public long
getNativeHandle()

Implements com.sun.glass.ui.monocle.NativeScreen.getNativeHandle.

Returns a native handle for the screen.

public float
getScale()

Implements com.sun.glass.ui.monocle.NativeScreen.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
()

Implements com.sun.glass.ui.monocle.NativeScreen.getScreenCapture.

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

public int
getWidth()

Implements com.sun.glass.ui.monocle.NativeScreen.getWidth.

Returns the pixel width of the screen.

public void
shutdown()

Implements com.sun.glass.ui.monocle.NativeScreen.shutdown.

Called during JavaFX shutdown to release the screen.

public void
swapBuffers()

Implements com.sun.glass.ui.monocle.NativeScreen.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
)

Implements com.sun.glass.ui.monocle.NativeScreen.uploadPixels.

Uploads a pixel buffer to the screen.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

densityback to summary
private float density
framebufferSwapLockback to summary
public static final Object framebufferSwapLock

Hides com.sun.glass.ui.monocle.NativeScreen.framebufferSwapLock.

An Object to lock against when swapping screen buffers.

Constructor Detail

AndroidScreenback to summary
public AndroidScreen()

Method Detail

_getDensityback to summary
pack-priv native float _getDensity()
_getHeightback to summary
pack-priv native int _getHeight()
_getNativeHandleback to summary
pack-priv native long _getNativeHandle()
_getScreenCaptureback to summary
pack-priv native ByteBuffer _getScreenCapture()
_getWidthback to summary
pack-priv native int _getWidth()
_shutdownback to summary
pack-priv native void _shutdown()
_swapBuffersback to summary
pack-priv native void _swapBuffers()
_uploadPixelsback to summary
pack-priv native void _uploadPixels(Buffer b, int x, int y, int width, int height, float alpha)
getDepthback to summary
public int getDepth()

Implements com.sun.glass.ui.monocle.NativeScreen.getDepth.

Doc from com.sun.glass.ui.monocle.NativeScreen.getDepth.

Returns the bit depth of the screen/

Annotations
@Override
getDPIback to summary
public int getDPI()

Implements com.sun.glass.ui.monocle.NativeScreen.getDPI.

Returns the number of pixels per inch in the screen.

Annotations
@Override
getHeightback to summary
public int getHeight()

Implements com.sun.glass.ui.monocle.NativeScreen.getHeight.

Returns the pixel height of the screen.

Annotations
@Override
getNativeFormatback to summary
public int getNativeFormat()

Implements com.sun.glass.ui.monocle.NativeScreen.getNativeFormat.

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

Annotations
@Override
getNativeHandleback to summary
public long getNativeHandle()

Implements com.sun.glass.ui.monocle.NativeScreen.getNativeHandle.

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

Annotations
@Override
getScaleback to summary
public float getScale()

Implements com.sun.glass.ui.monocle.NativeScreen.getScale.

Doc from com.sun.glass.ui.monocle.NativeScreen.getScale.

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

Annotations
@Override
getScreenCaptureback to summary
public ByteBuffer getScreenCapture()

Implements com.sun.glass.ui.monocle.NativeScreen.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

Annotations
@Override
getWidthback to summary
public int getWidth()

Implements com.sun.glass.ui.monocle.NativeScreen.getWidth.

Returns the pixel width of the screen.

Annotations
@Override
shutdownback to summary
public void shutdown()

Implements com.sun.glass.ui.monocle.NativeScreen.shutdown.

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

Annotations
@Override
swapBuffersback to summary
public void swapBuffers()

Implements com.sun.glass.ui.monocle.NativeScreen.swapBuffers.

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

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

Implements com.sun.glass.ui.monocle.NativeScreen.uploadPixels.

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

Annotations
@Override