Class ClientInfoData

  • All Implemented Interfaces:
    java.io.Serializable, ActionData

    public class ClientInfoData
    extends java.lang.Object
    implements ActionData
    The onClientInfo action is used to notify the client's information, such as time zone and screen resolutions.

    This action is sent if and only if it is registered to a root component.

    Author:
    jumperchen
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      protected ClientInfoData​(java.util.Map data)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getColorDepth()
      Returns the maximum number of colors the client's screen supports.
      int getDesktopHeight()
      Returns the pixel height of the client's desktop.
      int getDesktopWidth()
      Returns the pixel width of the client's desktop.
      int getDesktopXOffset()
      The the current horizontal pixel location of the top-left corner of the document in the window.
      int getDesktopYOffset()
      The the current vertical pixel location of the top-left corner of the document in the window.
      double getDevicePixelRatio()
      Return the current device pixel ratio on tablet/mobile device, otherwise return 1.0 instead.
      java.lang.String getMedia()
      Returns the serialized media query list which is the value of MatchMedia annotation.
      java.lang.String getOrientation()
      Return the current orientation.
      int getScreenHeight()
      Returns the pixel height of the client's screen.
      int getScreenWidth()
      Returns the pixel width of the client's screen.
      java.time.ZoneId getZoneId()
      Returns the time-zone ID of the client.
      boolean isHorizontal()
      Utility to check if the current orientation is landscape on tablet/mobile device.
      boolean isLandscape()
      Utility to check if the current orientation is landscape on tablet/mobile device.
      boolean isMediaMatched()
      Returns true if the serialized media query list is matched
      boolean isPortrait()
      Utility to check if the current orientation is portrait on tablet/mobile device.
      boolean isVertical()
      Utility to check if the current orientation is portrait on tablet/mobile device.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClientInfoData

        protected ClientInfoData​(java.util.Map data)
    • Method Detail

      • getScreenWidth

        public int getScreenWidth()
        Returns the pixel width of the client's screen.
      • getScreenHeight

        public int getScreenHeight()
        Returns the pixel height of the client's screen.
      • getColorDepth

        public int getColorDepth()
        Returns the maximum number of colors the client's screen supports.
      • getDesktopWidth

        public int getDesktopWidth()
        Returns the pixel width of the client's desktop.
      • getDesktopHeight

        public int getDesktopHeight()
        Returns the pixel height of the client's desktop.
      • getDesktopXOffset

        public int getDesktopXOffset()
        The the current horizontal pixel location of the top-left corner of the document in the window. It is changed by user when he scrolls the browser.

        To change it programmatically, use Clients.scrollTo(int, int).

      • getDesktopYOffset

        public int getDesktopYOffset()
        The the current vertical pixel location of the top-left corner of the document in the window. It is changed by user when he scrolls the browser.

        To change it programmatically, use Clients.scrollTo(int, int).

      • getDevicePixelRatio

        public double getDevicePixelRatio()
        Return the current device pixel ratio on tablet/mobile device, otherwise return 1.0 instead.
      • getOrientation

        public java.lang.String getOrientation()
        Return the current orientation. The orientation is portrait when the media feature height is greater than or equal to media feature width, otherwise is landscape.
      • isPortrait

        public boolean isPortrait()
        Utility to check if the current orientation is portrait on tablet/mobile device.
      • isVertical

        public boolean isVertical()
        Utility to check if the current orientation is portrait on tablet/mobile device.
        See Also:
        isPortrait()
      • isLandscape

        public boolean isLandscape()
        Utility to check if the current orientation is landscape on tablet/mobile device.
      • isHorizontal

        public boolean isHorizontal()
        Utility to check if the current orientation is landscape on tablet/mobile device.
        See Also:
        isLandscape()
      • getMedia

        public java.lang.String getMedia()
        Returns the serialized media query list which is the value of MatchMedia annotation.
      • isMediaMatched

        public boolean isMediaMatched()
        Returns true if the serialized media query list is matched
      • getZoneId

        public java.time.ZoneId getZoneId()
        Returns the time-zone ID of the client.