@JsType(isNative=true, namespace="Cesium", name="Animation") public class Animation extends Object
Constructor and Description |
---|
Animation(com.google.gwt.dom.client.Element container,
AnimationViewModel viewModel)
The Animation widget provides buttons for play, pause, and reverse, along with the current time and date,
surrounded by a "shuttle ring" for controlling the speed of animation.
|
Animation(String container,
AnimationViewModel viewModel)
The Animation widget provides buttons for play, pause, and reverse, along with the current time and date,
surrounded by a "shuttle ring" for controlling the speed of animation.
|
Modifier and Type | Method and Description |
---|---|
void |
applyThemeChanges()
Updates the widget to reflect any modified CSS rules for theming.
|
com.google.gwt.dom.client.Element |
container()
Gets parent container.
|
void |
destroy()
Destroys the animation widget.
|
boolean |
isDestroyed() |
boolean |
isHidden()
Request for visible of Animation widget.
|
void |
resize()
Resizes the widget to match the container size.
|
void |
setHidden(boolean hidden)
Method set visible of Animation widget
|
AnimationViewModel |
viewModel()
Gets the view model.
|
@JsConstructor public Animation(String container, AnimationViewModel viewModel)
Example:
SimplePanel animationPanel = new SimplePanel();
Clock clock = new Clock();
ClockViewModel clockViewModel = new ClockViewModel(clock);
AnimationViewModel viewModel = new AnimationViewModel(clockViewModel);
animationPanel.addAttachHandler(new AttachEvent.Handler() {
{@literal @}Override
public void onAttachOrDetach(AttachEvent attachEvent) {
if (attachEvent.isAttached()) {
Animation animation = new Animation(((SimplePanel) attachEvent.getSource()).getElement(), viewModel);
animation.resize();
Cesium.RequestAnimationFrameCallback tick = new Cesium.RequestAnimationFrameCallback() {
{@literal @}Override
public void Callback(Number timestamp) {
clock.tick();
Cesium.requestAnimationFrame(this);
}
};
Cesium.requestAnimationFrame(tick);
}
}
});
container
- The DOM element or ID that will contain the widget.viewModel
- The view model used by this widget.@JsConstructor public Animation(com.google.gwt.dom.client.Element container, AnimationViewModel viewModel)
Example:
SimplePanel animationPanel = new SimplePanel();
Clock clock = new Clock();
ClockViewModel clockViewModel = new ClockViewModel(clock);
AnimationViewModel viewModel = new AnimationViewModel(clockViewModel);
animationPanel.addAttachHandler(new AttachEvent.Handler() {
{@literal @}Override
public void onAttachOrDetach(AttachEvent attachEvent) {
if (attachEvent.isAttached()) {
Animation animation = new Animation(((SimplePanel) attachEvent.getSource()).getElement(), viewModel);
animation.resize();
Cesium.RequestAnimationFrameCallback tick = new Cesium.RequestAnimationFrameCallback() {
{@literal @}Override
public void Callback(Number timestamp) {
clock.tick();
Cesium.requestAnimationFrame(this);
}
};
Cesium.requestAnimationFrame(tick);
}
}
});
container
- The DOM element or ID that will contain the widget.viewModel
- The view model used by this widget.@JsProperty(name="container") public com.google.gwt.dom.client.Element container()
@JsProperty(name="viewModel") public AnimationViewModel viewModel()
@JsMethod public void applyThemeChanges()
@JsMethod public void destroy()
@JsMethod public boolean isDestroyed()
@JsMethod public void resize()
@JsOverlay public final void setHidden(boolean hidden)
hidden
- false to hide Animation widget, true widget is show.@JsOverlay public final boolean isHidden()
Copyright © 2019. All rights reserved.