Class Screen


  • public class Screen
    extends java.lang.Object
    This class represents a screen stored in the device. A screen is a collection of regions that are intended to be shown together.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int DO_NOTHING_ON_NEXT
      This constant can be used in setRegions() and addRegion() to indicate that nothing should happen when a button is pressed or the timeout is encountered.
    • Constructor Summary

      Constructors 
      Constructor Description
      Screen()
      Public constructor, used to create new blank screens.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addRegion​(int region)
      This method adds a region to the screen.
      void addRegion​(int region, int next)
      This method adds a region to a screen.
      boolean equals​(java.lang.Object o)  
      int getNumber()
      Gets the Screen number this class will be attributed to on the Device.
      int[] getRegionIndexes()
      Gets the Region indexes being featured on this Screen.
      java.util.Map<java.lang.Integer,​java.lang.Integer> getRegionMap()
      This function returns a map of region indexes (key) to next screens (value).
      int[] getReserved()
      Get the reserved values, these will be used at a later date.
      boolean getResetTimeoutOnActivity()
      Gets whether the Screen timer gets reset if there is any pen activity.
      int[] getScreenNextList()
      Gets the list of Screens the device will go to when this Region is interacted with.
      int getTimeout()
      Gets the timeout value in seconds.
      int getTimeoutNextScreen()
      Gets the Screen number the device goes to when this Screen times out.
      int hashCode()  
      void setNumber​(int number)
      Sets the Screen number this class will be attributed to on the Device.
      void setRegions​(java.util.Map<java.lang.Integer,​java.lang.Integer> regions)
      This method sets the indexes of the regions that will be included in this screen.
      void setResetTimeoutOnActivity​(boolean resetTimeoutOnActivity)
      Sets whether the Screen timer gets reset if there is any pen activity.
      void setTimeout​(int timeout)
      Sets the timeout to the new value.
      void setTimeoutNextScreen​(int timeoutNextScreen)
      Sets the Screen number the device goes to when this Screen times out.
      java.lang.String toString()
      Prints this object as a human readable string.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • DO_NOTHING_ON_NEXT

        public static final int DO_NOTHING_ON_NEXT
        This constant can be used in setRegions() and addRegion() to indicate that nothing should happen when a button is pressed or the timeout is encountered.
        See Also:
        Constant Field Values
    • Constructor Detail

      • Screen

        public Screen()
        Public constructor, used to create new blank screens.
    • Method Detail

      • equals

        public boolean equals​(java.lang.Object o)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Prints this object as a human readable string.
        Overrides:
        toString in class java.lang.Object
        Returns:
        Human readable string.
      • getNumber

        public int getNumber()
        Gets the Screen number this class will be attributed to on the Device.
        Returns:
        Screen number
      • setNumber

        public void setNumber​(int number)
        Sets the Screen number this class will be attributed to on the Device.
        Parameters:
        number - Screen number
      • getResetTimeoutOnActivity

        public boolean getResetTimeoutOnActivity()
        Gets whether the Screen timer gets reset if there is any pen activity.
        Returns:
        reset timeout on activity
      • setResetTimeoutOnActivity

        public void setResetTimeoutOnActivity​(boolean resetTimeoutOnActivity)
        Sets whether the Screen timer gets reset if there is any pen activity.
        Parameters:
        resetTimeoutOnActivity - reset timeout on activity
      • getReserved

        public int[] getReserved()
        Get the reserved values, these will be used at a later date.
        Returns:
        reserved values
      • getTimeout

        public int getTimeout()
        Gets the timeout value in seconds.
        Returns:
        timeout in seconds
      • setTimeout

        public void setTimeout​(int timeout)
        Sets the timeout to the new value.
        Parameters:
        timeout - timeout value in seconds
      • getTimeoutNextScreen

        public int getTimeoutNextScreen()
        Gets the Screen number the device goes to when this Screen times out.
        Returns:
        timeout next Screen
      • setTimeoutNextScreen

        public void setTimeoutNextScreen​(int timeoutNextScreen)
        Sets the Screen number the device goes to when this Screen times out.
        Parameters:
        timeoutNextScreen - timeout next Screen
      • setRegions

        public void setRegions​(java.util.Map<java.lang.Integer,​java.lang.Integer> regions)
        This method sets the indexes of the regions that will be included in this screen. The indexes (key) are paired with the screen (value) that should be switched to in the event that the region is activated (for instance if a button region is pressed). Use the DO_NOTHING_ON_NEXT constant to indicate nothing should happen. This method replaces the entire region list in the screen. Use addRegion() to add an individual region to the screen.
        Parameters:
        regions - Regions with screen pairings to set.
      • addRegion

        public void addRegion​(int region)
        This method adds a region to the screen. In order to take effect you'll still need to save the screen to the device. Sets the next screen to DO_NOTHING_ON_NEXT.
        Parameters:
        region - Region index to add to the screen.
      • addRegion

        public void addRegion​(int region,
                              int next)
        This method adds a region to a screen. In order to take effect you'll still need to save the screen to the device.
        Parameters:
        region - Region index to add to the screen.
        next - The next screen to progress to in the event the region activates (e.g. button press).
      • getRegionIndexes

        public int[] getRegionIndexes()
        Gets the Region indexes being featured on this Screen.
        Returns:
        region indexes
      • getScreenNextList

        public int[] getScreenNextList()
        Gets the list of Screens the device will go to when this Region is interacted with. '0' means stay on this Screen.
        Returns:
        Screen next list
      • getRegionMap

        public java.util.Map<java.lang.Integer,​java.lang.Integer> getRegionMap()
        This function returns a map of region indexes (key) to next screens (value).
        Returns:
        Map of region indexes to next screens.