Package org.pepstock.charba.client.utils
Class Window
- java.lang.Object
-
- org.pepstock.charba.client.utils.Window
-
@JsType(isNative=true, namespace="<global>", name="window") public final class Window extends Object
The window object represents an open window in a browser.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
alert(String message)
Displays an alert box with a specified message and an OK button.static String
atob(String encoded)
Decode a base-64 encoded stringstatic String
btoa(String str)
Encodes a string in base-64.static void
enableResizeOnBeforePrint()
CSS media queries allow changing styles when printing a page.static double
getDevicePixelRatio()
Returns the device pixel ratiostatic int
getInnerHeight()
The innerHeight property returns the inner height of a window's content area.static int
getInnerWidth()
The innerWidth property returns the inner width of a window's content area.static int
getOuterHeight()
The outerHeight property returns the outer height of a window, including all interface elements (like toolbars/scrollbars).static int
getOuterWidth()
The outerWidth property returns the outer width of a window, including all interface elements (like toolbars/scrollbars).static <T> T
undefined()
Returns anundefined
instance.
-
-
-
Method Detail
-
undefined
@JsProperty(name="undefined") public static <T> T undefined()
Returns anundefined
instance.- Type Parameters:
T
- type of result object- Returns:
- the
undefined
instance
-
getDevicePixelRatio
@JsProperty public static double getDevicePixelRatio()
Returns the device pixel ratio- Returns:
- The device pixel ratio
-
getInnerWidth
@JsProperty public static int getInnerWidth()
The innerWidth property returns the inner width of a window's content area.- Returns:
- The inner width of a window's content area.
-
getInnerHeight
@JsProperty public static int getInnerHeight()
The innerHeight property returns the inner height of a window's content area.- Returns:
- The inner height of a window's content area.
-
getOuterWidth
@JsProperty public static int getOuterWidth()
The outerWidth property returns the outer width of a window, including all interface elements (like toolbars/scrollbars).- Returns:
- The outer width of a window, including all interface elements (like toolbars/scrollbars).
-
getOuterHeight
@JsProperty public static int getOuterHeight()
The outerHeight property returns the outer height of a window, including all interface elements (like toolbars/scrollbars).- Returns:
- The outer height of a window, including all interface elements (like toolbars/scrollbars).
-
alert
public static void alert(String message)
Displays an alert box with a specified message and an OK button.- Parameters:
message
- The text to display in the alert box
-
atob
public static String atob(String encoded)
Decode a base-64 encoded string- Parameters:
encoded
- Required. The string which has been encoded by the btoa() method- Returns:
- Decoded a base-64 encoded string
-
btoa
public static String btoa(String str)
Encodes a string in base-64. This method uses the "A-Z", "a-z", "0-9", "+", "/" and "=" characters to encode the string.- Parameters:
str
- Required. The string to be encoded- Returns:
- A String, representing the base-64 encoded string
-
enableResizeOnBeforePrint
@JsOverlay public static void enableResizeOnBeforePrint()
CSS media queries allow changing styles when printing a page. The CSS applied from these media queries may cause charts to need to resize. However, the resize won't happen automatically. To support resizing charts when printing, one needs to hook theonbeforeprint
event and manually trigger resizing of each chart.
-
-