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 ObjectThe 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 voidalert(String message)Displays an alert box with a specified message and an OK button.static Stringatob(String encoded)Decode a base-64 encoded stringstatic Stringbtoa(String str)Encodes a string in base-64.static voidenableResizeOnBeforePrint()CSS media queries allow changing styles when printing a page.static doublegetDevicePixelRatio()Returns the device pixel ratiostatic intgetInnerHeight()The innerHeight property returns the inner height of a window's content area.static intgetInnerWidth()The innerWidth property returns the inner width of a window's content area.static intgetOuterHeight()The outerHeight property returns the outer height of a window, including all interface elements (like toolbars/scrollbars).static intgetOuterWidth()The outerWidth property returns the outer width of a window, including all interface elements (like toolbars/scrollbars).static <T> Tundefined()Returns anundefinedinstance.
-
-
-
Method Detail
-
undefined
@JsProperty(name="undefined") public static <T> T undefined()
Returns anundefinedinstance.- Type Parameters:
T- type of result object- Returns:
- the
undefinedinstance
-
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 theonbeforeprintevent and manually trigger resizing of each chart.
-
-