public class ClientInfoEvent extends Event
This event is sent if and only if it is registered to a root component.
Note: the information returned by this event is not stored in the server.
Thus, you might want to store in the session's attribute
(Session.setAttribute(java.lang.String, java.lang.Object)
).
Clients
,
Serialized FormConstructor and Description |
---|
ClientInfoEvent(java.lang.String name,
int timeZoneOfs,
int scrnwd,
int scrnhgh,
int colorDepth,
int dtwd,
int dthgh,
int dtx,
int dty,
double dpr,
java.lang.String orient,
java.lang.String zoneId,
boolean mediaMatched,
java.lang.String media)
Constructs an event to hold the client-info.
|
Modifier and Type | Method and Description |
---|---|
static ClientInfoEvent |
getClientInfoEvent(AuRequest request)
Converts an AU request to a client-info event.
|
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.util.TimeZone |
getTimeZone()
Deprecated.
getZoneId() is preferred since 9.0.0.
getTimeZone returns a TimeZone object, which is no longer the preferred option to identify time zones.
Instead, use #getZoneId(), which returns a ZoneId object, which better supports the current Instant and a LocalDateTime java APIs
|
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.
|
getData, getEvent, getName, getPage, getTarget, isPropagatable, stopPropagation, toString
public ClientInfoEvent(java.lang.String name, int timeZoneOfs, int scrnwd, int scrnhgh, int colorDepth, int dtwd, int dthgh, int dtx, int dty, double dpr, java.lang.String orient, java.lang.String zoneId, boolean mediaMatched, java.lang.String media)
Note: Event.getTarget()
will return null. It means it is a broadcast
event.
scrnwd
- the screen's widthscrnhgh
- the screen's heightdtwd
- the desktop's widthdthgh
- the desktop's heightdtx
- the desktop's the left offsetdty
- the desktop's the top offsetdpr
- the device's devicePixelRatioorient
- the device's orientationzoneId
- the client's zone idpublic static final ClientInfoEvent getClientInfoEvent(AuRequest request)
@Deprecated public java.util.TimeZone getTimeZone()
getZoneId()
public int getScreenWidth()
public int getScreenHeight()
public int getColorDepth()
public int getDesktopWidth()
public int getDesktopHeight()
public int getDesktopXOffset()
To change it programmatically, use Clients.scrollTo(int, int)
.
public int getDesktopYOffset()
To change it programmatically, use Clients.scrollTo(int, int)
.
public double getDevicePixelRatio()
public java.lang.String getOrientation()
public boolean isPortrait()
public boolean isVertical()
isPortrait()
public boolean isLandscape()
public boolean isHorizontal()
isLandscape()
public java.lang.String getMedia()
public boolean isMediaMatched()
public java.time.ZoneId getZoneId()
getTimeZone()
, the geographical region will be
used as a result.Copyright © 2005-2023 Potix Corporation. All Rights Reserved.