com.jogamp.newt
Class MonitorDevice

java.lang.Object
  extended by com.jogamp.newt.MonitorDevice

public abstract class MonitorDevice
extends Object

Visual output device, i.e. a CRT, LED ..consisting of it's components:

  • Immutable
  • Mutable

  • Method Summary
     boolean contains(int x, int y)
              Returns true if given coordinates are contained by this viewport, otherwise false.
     float coverage(RectangleImmutable r)
              Returns the coverage of given rectangle w/ this this viewport, i.e.
     boolean equals(Object obj)
              Tests equality of two MonitorDevice objects by evaluating equality of it's components:
    nativeID
     MonitorMode getCurrentMode()
              Returns the cached current MonitorMode w/o native query.
     int getId()
               
     MonitorMode getOriginalMode()
              Returns the immutable original MonitorMode, as used at NEWT initialization.
     Screen getScreen()
              Returns the Screen owning this monitor.
     DimensionImmutable getSizeMM()
               
     List<MonitorMode> getSupportedModes()
              Returns a list of immutable MonitorModes supported by this monitor.
     RectangleImmutable getViewport()
              Returns the rectangular portion of the rotated virtual Screen size represented by this monitor.
     int hashCode()
              Returns a combined hash code of it's elements:
    nativeID
     boolean isModeChangedByUs()
              Returns true if the MonitorMode has been changed programmatic via this API only, otherwise false.
     boolean isOriginalMode()
               
    abstract  MonitorMode queryCurrentMode()
              Returns the current MonitorMode resulting from a native query.
    abstract  boolean setCurrentMode(MonitorMode mode)
              Set the current MonitorMode.
     String toString()
               
    static Rectangle unionOfViewports(Rectangle result, List<MonitorDevice> monitors)
              Returns the union of the given monitor's viewport.
     
    Methods inherited from class java.lang.Object
    getClass, notify, notifyAll, wait, wait, wait
     

    Method Detail

    getScreen

    public final Screen getScreen()
    Returns the Screen owning this monitor.


    equals

    public final boolean equals(Object obj)
    Tests equality of two MonitorDevice objects by evaluating equality of it's components:

    Overrides:
    equals in class Object

    hashCode

    public final int hashCode()
    Returns a combined hash code of it's elements:

    Overrides:
    hashCode in class Object

    getId

    public final int getId()
    Returns:
    the immutable unique native Id of this monitor device.

    getSizeMM

    public final DimensionImmutable getSizeMM()
    Returns:
    the immutable monitor size in millimeters.

    getOriginalMode

    public final MonitorMode getOriginalMode()
    Returns the immutable original MonitorMode, as used at NEWT initialization.

    The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().


    getSupportedModes

    public final List<MonitorMode> getSupportedModes()
    Returns a list of immutable MonitorModes supported by this monitor.

    Use w/ care, it's not a copy!


    getViewport

    public final RectangleImmutable getViewport()
    Returns the rectangular portion of the rotated virtual Screen size represented by this monitor.


    contains

    public final boolean contains(int x,
                                  int y)
    Returns true if given coordinates are contained by this viewport, otherwise false.


    coverage

    public final float coverage(RectangleImmutable r)
    Returns the coverage of given rectangle w/ this this viewport, i.e. between 0.0 and 1.0.

    Coverage is computed by:

        isect = viewport.intersection(r);
        coverage = area( isect ) / area( viewport ) ;
     


    unionOfViewports

    public static Rectangle unionOfViewports(Rectangle result,
                                             List<MonitorDevice> monitors)
    Returns the union of the given monitor's viewport.

    Parameters:
    result - storage for result, will be returned
    monitors - given list of monitors
    Returns:
    viewport representing the union of given monitor's viewport.

    isOriginalMode

    public final boolean isOriginalMode()

    isModeChangedByUs

    public final boolean isModeChangedByUs()
    Returns true if the MonitorMode has been changed programmatic via this API only, otherwise false.

    Note: We cannot guarantee that we won't interfere w/ another running application's screen mode change or vice versa.


    getCurrentMode

    public final MonitorMode getCurrentMode()
    Returns the cached current MonitorMode w/o native query.

    The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().


    queryCurrentMode

    public abstract MonitorMode queryCurrentMode()
    Returns the current MonitorMode resulting from a native query.

    The returned MonitorMode is element of the lists getSupportedModes() and Screen.getMonitorModes().


    setCurrentMode

    public abstract boolean setCurrentMode(MonitorMode mode)
    Set the current MonitorMode.

    Parameters:
    mode - to be made current, must be element of the list getSupportedModes() and Screen.getMonitorModes().
    Returns:
    true if successful, otherwise false

    toString

    public String toString()
    Overrides:
    toString in class Object


    Copyright 2010 JogAmp Community.