javax.media.nativewindow

## Interface ScalableSurface

- All Known Subinterfaces:
    Window
  All Known Implementing Classes:
    GLCanvas, GLJPanel, GLWindow, JAWTWindow

      public interface ScalableSurface

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

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `AUTOMAX_PIXELSCALE` Setting surface-pixel-scale of 0, results in maximum platform dependent pixel-scale, i.e.
    `static int` | `IDENTITY_PIXELSCALE` Setting surface-pixel-scale of 1, results in same pixel- and window-units.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `int[]` | `getCurrentSurfaceScale(int[] result)` Returns the current pixel scale of the associated `NativeSurface`.
    `int[]` | `getNativeSurfaceScale(int[] result)` Returns the native pixel scale of the associated `NativeSurface` reflecting it's currently bound monitor surface resolution in pixels.
    `int[]` | `getRequestedSurfaceScale(int[] result)` Returns the requested pixel scale of the associated `NativeSurface`.
    `void` | `setSurfaceScale(int[] pixelScale)` Request a pixel scale in x- and y-direction for the associated `NativeSurface`.

- - ### Field Detail

    - #### IDENTITY_PIXELSCALE

          static final int IDENTITY_PIXELSCALE

      Setting surface-pixel-scale of 1, results in same pixel- and window-units.
      See Also:
        Constant Field Values

    - #### AUTOMAX_PIXELSCALE

          static final int AUTOMAX_PIXELSCALE

      Setting surface-pixel-scale of 0, results in maximum platform dependent pixel-scale, i.e. pixel-units >> window-units where available.
      See Also:
        Constant Field Values

  - ### Method Detail

    - #### setSurfaceScale

          void setSurfaceScale(int[] pixelScale)

      Request a pixel scale in x- and y-direction for the associated `NativeSurface`.

      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(int[])`.

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

      Parameters:
        `pixelScale` - requested surface pixel scale int[2] values for x- and y-direction.

    - #### getRequestedSurfaceScale

          int[] getRequestedSurfaceScale(int[] result)

      Returns the requested pixel scale of the associated `NativeSurface`.
      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the requested pixelScale for chaining

    - #### getCurrentSurfaceScale

          int[] getCurrentSurfaceScale(int[] result)

      Returns the current pixel scale of the associated `NativeSurface`.
      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the current pixelScale for chaining

    - #### getNativeSurfaceScale

          int[] getNativeSurfaceScale(int[] result)

      Returns the native pixel scale of the associated `NativeSurface` reflecting it's currently bound monitor surface resolution in pixels.

      The native pixel scale maybe used to determine the proper dpi value of this `NativeSurface`:

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

      Parameters:
        `result` - int[2] storage for the result
      Returns:
        the passed storage containing the native pixelScale for chaining

Copyright 2010 JogAmp Community.