Package arez.dom
Class WindowSize
java.lang.Object
arez.dom.WindowSize
Factory for getting observable models that sizing of windows.
A very simple example
import arez.Arez;
import arez.dom.EventDrivenValue;
import arez.dom.WindowSize;
import com.google.gwt.core.client.EntryPoint;
import akasha.Global;
import akasha.Window;
public class WindowSizeExample
implements EntryPoint
{
public void onModuleLoad()
{
final EventDrivenValue<Window, Integer> innerHeight = WindowSize.innerHeight( Global.window() );
final EventDrivenValue<Window, Integer> innerWidth = WindowSize.innerWidth( Global.window() );
Arez.context().observer( () -> Global.document().querySelector( "#status" ).textContent =
"Screen size: " + innerWidth.getValue() + " x " + innerHeight.getValue() );
}
}
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventDrivenValue<akasha.Window,
Dimension> inner
(akasha.Window window) Create an event driven observable component for window.innerWidth and window.innerHeight wrapped in dimension object.static EventDrivenValue<akasha.Window,
Integer> innerHeight
(akasha.Window window) Create an event driven observable component for window.innerHeight.static EventDrivenValue<akasha.Window,
Integer> innerWidth
(akasha.Window window) Create an event driven observable component for window.innerWidth.static EventDrivenValue<akasha.Window,
Integer> outerHeight
(akasha.Window window) Create an event driven observable component for window.outerHeight.static EventDrivenValue<akasha.Window,
Integer> outerWidth
(akasha.Window window) Create an event driven observable component for window.outerWidth.
-
Method Details
-
inner
@Nonnull public static EventDrivenValue<akasha.Window,Dimension> inner(@Nonnull akasha.Window window) Create an event driven observable component for window.innerWidth and window.innerHeight wrapped in dimension object.- Parameters:
window
- the window.- Returns:
- the event driven observable component.
-
innerHeight
@Nonnull public static EventDrivenValue<akasha.Window,Integer> innerHeight(@Nonnull akasha.Window window) Create an event driven observable component for window.innerHeight.- Parameters:
window
- the window.- Returns:
- the event driven observable component.
-
innerWidth
@Nonnull public static EventDrivenValue<akasha.Window,Integer> innerWidth(@Nonnull akasha.Window window) Create an event driven observable component for window.innerWidth.- Parameters:
window
- the window.- Returns:
- the event driven observable component.
-
outerHeight
@Nonnull public static EventDrivenValue<akasha.Window,Integer> outerHeight(@Nonnull akasha.Window window) Create an event driven observable component for window.outerHeight.- Parameters:
window
- the window.- Returns:
- the event driven observable component.
-
outerWidth
@Nonnull public static EventDrivenValue<akasha.Window,Integer> outerWidth(@Nonnull akasha.Window window) Create an event driven observable component for window.outerWidth.- Parameters:
window
- the window.- Returns:
- the event driven observable component.
-