Top Description Fields Methods
com.jogamp.nativewindow

public Interface ScalableSurface

Known Direct Subinterfaces
com.jogamp.newt.Window
Known Direct Implementers
com.jogamp.nativewindow.awt.JAWTWindow, com.jogamp.opengl.awt.GLCanvas, com.jogamp.opengl.awt.GLJPanel, jogamp.nativewindow.WrappedSurface

Adding mutable surface pixel scale property to implementing class, usually to a NativeSurface implementation, see setSurfaceScale(float[]).

Field Summary

Modifier and TypeField and Description
public static final float
AUTOMAX_PIXELSCALE

Setting surface-pixel-scale of , results in maximum platform dependent pixel-scale, i.e. pixel-units >> window-units where available.

public static final float
IDENTITY_PIXELSCALE

Setting surface-pixel-scale of , results in same pixel- and window-units.

Method Summary

Modifier and TypeMethod and Description
public float[]

Returns:

the passed storage containing the current pixelScale for chaining
getCurrentSurfaceScale
(final float[]
float[2] storage for the result
result
)

Returns the current pixel scale of the associated NativeSurface.

public float[]

Returns:

the passed storage containing the maximum pixelScale for chaining
getMaximumSurfaceScale
(final float[]
float[2] storage for the result
result
)

Returns the maximum pixel scale of the associated NativeSurface.

public float[]

Returns:

the passed storage containing the minimum pixelScale for chaining
getMinimumSurfaceScale
(final float[]
float[2] storage for the result
result
)

Returns the minimum pixel scale of the associated NativeSurface.

public float[]

Returns:

the passed storage containing the current pixelScale for chaining
getRequestedSurfaceScale
(final float[]
float[2] storage for the result
result
)

Returns the requested pixel scale of the associated NativeSurface.

public boolean

Returns:

true if the current pixel scale has changed, otherwise false.
setSurfaceScale
(final float[]
requested surface pixel scale float[2] values for x- and y-direction.
pixelScale
)

Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_units = pixel_scale * size_in_window_units.

Field Detail

AUTOMAX_PIXELSCALEback to summary
public static final float AUTOMAX_PIXELSCALE

Setting surface-pixel-scale of , results in maximum platform dependent pixel-scale, i.e. pixel-units >> window-units where available.

IDENTITY_PIXELSCALEback to summary
public static final float IDENTITY_PIXELSCALE

Setting surface-pixel-scale of , results in same pixel- and window-units.

Method Detail

getCurrentSurfaceScaleback to summary
public float[] getCurrentSurfaceScale(final float[] result)

Returns the current pixel scale of the associated NativeSurface.

Parameters
result:float[]

float[2] storage for the result

Returns:float[]

the passed storage containing the current pixelScale for chaining

getMaximumSurfaceScaleback to summary
public float[] getMaximumSurfaceScale(final float[] result)

Returns the maximum pixel scale of the associated NativeSurface.

The maximum pixel scale maybe used to determine the proper dpi value of the monitor displaying this NativeSurface.

   surfacePpMM = monitorPpMM * currentSurfaceScale / nativeSurfaceScale,
   with PpMM == pixel per millimeter

Parameters
result:float[]

float[2] storage for the result

Returns:float[]

the passed storage containing the maximum pixelScale for chaining

getMinimumSurfaceScaleback to summary
public float[] getMinimumSurfaceScale(final float[] result)

Returns the minimum pixel scale of the associated NativeSurface.

Parameters
result:float[]

float[2] storage for the result

Returns:float[]

the passed storage containing the minimum pixelScale for chaining

getRequestedSurfaceScaleback to summary
public float[] getRequestedSurfaceScale(final float[] result)

Returns the requested pixel scale of the associated NativeSurface.

Parameters
result:float[]

float[2] storage for the result

Returns:float[]

the passed storage containing the current pixelScale for chaining

See Also
setSurfaceScale(float[])
setSurfaceScaleback to summary
public boolean setSurfaceScale(final float[] pixelScale)

Request a pixel scale in x- and y-direction for the associated NativeSurface, where size_in_pixel_units = pixel_scale * size_in_window_units.

Default pixel scale request for both directions is AUTOMAX_PIXELSCALE.

In case platform only supports uniform pixel scale, i.e. one scale for both directions, either AUTOMAX_PIXELSCALE or the maximum requested pixel scale component is used.

The requested pixel scale will be validated against platform limits before native scale-setup, i.e. clipped to IDENTITY_PIXELSCALE if not supported or clipped to the platform maximum. It can be queried via getRequestedSurfaceScale(float[]).

The actual realized pixel scale values of the NativeSurface can be queried via getCurrentSurfaceScale(float[]) or computed via surface.convertToPixelUnits(new int[] { 1, 1 })

Parameters
pixelScale:float[]

requested surface pixel scale float[2] values for x- and y-direction.

Returns:boolean

true if the current pixel scale has changed, otherwise false.

See Also
getRequestedSurfaceScale(float[])