Package org.zkoss.stateless.action.data
Class ClientInfoData
java.lang.Object
org.zkoss.stateless.action.data.ClientInfoData
- All Implemented Interfaces:
Serializable,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 -
Method Summary
Modifier and TypeMethodDescriptionintReturns the maximum number of colors the client's screen supports.intReturns the pixel height of the client's desktop.intReturns the pixel width of the client's desktop.intThe the current horizontal pixel location of the top-left corner of the document in the window.intThe the current vertical pixel location of the top-left corner of the document in the window.doubleReturn the current device pixel ratio on tablet/mobile device, otherwise return 1.0 instead.getMedia()Returns the serialized media query list which is the value of MatchMedia annotation.Return the current orientation.intReturns the pixel height of the client's screen.intReturns the pixel width of the client's screen.Returns the time-zone ID of the client.booleanUtility to check if the current orientation is landscape on tablet/mobile device.booleanUtility to check if the current orientation is landscape on tablet/mobile device.booleanReturns true if the serialized media query list is matchedbooleanUtility to check if the current orientation is portrait on tablet/mobile device.booleanUtility to check if the current orientation is portrait on tablet/mobile device.
-
Constructor Details
-
ClientInfoData
-
-
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
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
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
Returns the time-zone ID of the client.
-