Class ClientInfoData

java.lang.Object
org.zkoss.stateless.action.data.ClientInfoData
All Implemented Interfaces:
Serializable, ActionData

public class ClientInfoData extends 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:
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
     
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Returns the maximum number of colors the client's screen supports.
    int
    Returns the pixel height of the client's desktop.
    int
    Returns the pixel width of the client's desktop.
    int
    The the current horizontal pixel location of the top-left corner of the document in the window.
    int
    The the current vertical pixel location of the top-left corner of the document in the window.
    double
    Return the current device pixel ratio on tablet/mobile device, otherwise return 1.0 instead.
    Returns the serialized media query list which is the value of MatchMedia annotation.
    Return the current orientation.
    int
    Returns the pixel height of the client's screen.
    int
    Returns the pixel width of the client's screen.
    Returns the time-zone ID of the client.
    boolean
    Utility to check if the current orientation is landscape on tablet/mobile device.
    boolean
    Utility to check if the current orientation is landscape on tablet/mobile device.
    boolean
    Returns true if the serialized media query list is matched
    boolean
    Utility to check if the current orientation is portrait on tablet/mobile device.
    boolean
    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 Details

    • ClientInfoData

      protected ClientInfoData(Map data)
  • Method Details

    • 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 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:
    • 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:
    • getMedia

      public 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 ZoneId getZoneId()
      Returns the time-zone ID of the client.