Class ScreenDeviceImpl

  • All Implemented Interfaces:
    ScreenDevice

    public class ScreenDeviceImpl
    extends Object
    implements ScreenDevice
    Implementation of ScreenDevice.
    Author:
    Sebastien Vincent, Lyubomir Marinov
    • Constructor Detail

      • ScreenDeviceImpl

        protected ScreenDeviceImpl​(int index,
                                   GraphicsDevice screen)
        Constructor.
        Parameters:
        index - screen index
        screen - screen device
    • Method Detail

      • getAvailableScreenDevices

        public static ScreenDevice[] getAvailableScreenDevices()
        Returns all available ScreenDevices.
        Returns:
        an array of all available ScreenDevices
      • getDefaultScreenDevice

        public static ScreenDevice getDefaultScreenDevice()
        Gets the default ScreenDevice. The implementation attempts to return the ScreenDevice with the highest resolution.
        Returns:
        the default ScreenDevice
      • containsPoint

        public boolean containsPoint​(Point p)
        If the screen contains specified point.
        Specified by:
        containsPoint in interface ScreenDevice
        Parameters:
        p - point coordinate
        Returns:
        true if point belongs to screen, false otherwise
      • getBounds

        public Rectangle getBounds()
        Get bounds of the screen.
        Returns:
        bounds of the screen
      • getIndex

        public int getIndex()
        Get the screen index.
        Specified by:
        getIndex in interface ScreenDevice
        Returns:
        screen index
      • getName

        public String getName()
        Get the identifier of the screen.
        Returns:
        ID of the screen
      • getSize

        public Dimension getSize()
        Gets the (current) size/resolution of this ScreenDevice.
        Specified by:
        getSize in interface ScreenDevice
        Returns:
        the (current) size/resolution of this ScreenDevice