本文整理汇总了Java中com.google.gwt.animation.client.Animation类的典型用法代码示例。如果您正苦于以下问题:Java Animation类的具体用法?Java Animation怎么用?Java Animation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Animation类属于com.google.gwt.animation.client包,在下文中一共展示了Animation类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void hideLoadingPopup() {
final Element e = RootPanel.get( "loading" ).getElement();
new Animation() {
@Override
protected void onUpdate( double progress ) {
e.getStyle().setOpacity( 1.0 - progress );
}
@Override
protected void onComplete() {
e.getStyle().setVisibility( Style.Visibility.HIDDEN );
}
}.run( 500 );
}
示例2: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void hideLoadingPopup() {
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate( double progress ) {
e.getStyle().setOpacity( 1.0 - progress );
}
@Override
protected void onComplete() {
e.getStyle().setDisplay(Style.Display.NONE);
}
}.run(500);
}
示例3: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void hideLoadingPopup() {
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate(double progress) {
e.getStyle().setOpacity(1.0 - progress);
}
@Override
protected void onComplete() {
e.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
}.run(500);
}
示例4: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void hideLoadingPopup() {
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate( double progress ) {
e.getStyle().setOpacity( 1.0 - progress );
}
@Override
protected void onComplete() {
e.getStyle().setVisibility( Style.Visibility.HIDDEN );
}
}.run( 500 );
}
示例5: limitArea
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void limitArea() {
reportTextArea.getElement().setAttribute("maxlength", String.valueOf(MAX_REPORT_LENGTH));
reportTextArea.addKeyPressHandler(new KeyPressHandler() {
@Override
public void onKeyPress(KeyPressEvent event) {
int size = reportTextArea.getText().length();
textLength.setText(String.valueOf(MAX_REPORT_LENGTH-size));
if(size == MAX_REPORT_LENGTH) {
Animation a = new Animation() {
@Override
protected void onUpdate(double progress) {
String rgbvalue = "rgb(" + ((int)((1-progress)*255)) + ",0,0)";
textLengthPanel.getElement().getStyle().setProperty("color", rgbvalue);
}
};
a.run(1000);
}
}
});
}
示例6: onClickMagnifier
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
@UiHandler("magnifier")
public void onClickMagnifier(ClickEvent event)
{
final Style bgstyle = fullscreen.getStyle();
final Style bgimgcontainerstyle = fullscreenimgcontainer.getStyle();
final Style bgimgstyle = fullscreenimg.getElement().getStyle();
bgstyle.setVisibility(Visibility.VISIBLE);
bgimgcontainerstyle.setVisibility(Visibility.VISIBLE);
bgimgstyle.setVisibility(Visibility.VISIBLE);
if(bgimgstyle.getBackgroundImage() == null || bgimgstyle.getBackgroundImage().trim().isEmpty())
{
bgimgstyle.setProperty("background",
"url(\"./data/influence_data/" + answer.getPath() + "\") no-repeat scroll center center / contain rgba(0,0,0,0)");
bgimgstyle.setWidth(100, Unit.PCT);
bgimgstyle.setHeight(90, Unit.PCT);
}
new Animation() {
@Override
protected void onUpdate(double progress) {
bgstyle.setOpacity(Math.min(0.9, progress*2));
bgimgstyle.setOpacity(Math.max(0, progress*2-0.8));
}
}.run(1600);
}
示例7: onFullscreenImgClicked
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
@UiHandler("fullscreenimg")
public void onFullscreenImgClicked(ClickEvent e) {
final Style bgstyle = fullscreen.getStyle();
final Style bgimgstyle = fullscreenimg.getElement().getStyle();
new Animation() {
@Override
protected void onUpdate(double progress) {
bgstyle.setOpacity(1-progress);
bgimgstyle.setOpacity(Math.max(0, 1-progress*2.5));
if(progress == 1)
{
fullscreen.getStyle().setVisibility(Visibility.HIDDEN);
fullscreenimg.getElement().getStyle().setVisibility(Visibility.HIDDEN);
fullscreenimgcontainer.getStyle().setVisibility(Visibility.HIDDEN);
}
}
}.run(1000);
}
示例8: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
@AfterInitialization
public void hideLoadingPopup() {
@SuppressWarnings("GwtToHtmlReferences")
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate(double progress) {
e.getStyle().setOpacity(1.0 - progress);
}
@Override
protected void onComplete() {
e.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
}.run(500);
}
示例9: show
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
public static void show(String text, int delayMillis, final boolean doReload){
final PopupPanel notificationPopup = new PopupPanel(false);
final Label label = new Label(text);
notificationPopup.setWidget(label);
notificationPopup.setPopupPosition(50, 20);
notificationPopup.setVisible(true);
notificationPopup.show();
Timer t = new Timer() {
@Override
public void run() {
Animation a = new Animation() {
@Override
protected void onUpdate(double progress) {
notificationPopup.getElement().getStyle().setProperty("opacity", String.valueOf(1-progress));
if(progress == 1) {
notificationPopup.hide();
if(doReload)
Location.reload();
}
}
};
a.run(500);
}
};
t.schedule(delayMillis);
}
示例10: animate
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
@Override
public void animate() {
Animation a = new Animation() {
@Override
protected void onUpdate(double progress) {
Composite c = InfluenceAnswerTextView.this;
c.getElement().getStyle().setProperty("opacity", String.valueOf(progress));
}
};
a.run(3000);
}
示例11: animate
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
@Override
public void animate() {
Animation a = new Animation() {
@Override
protected void onUpdate(double progress) {
Composite c = InfluenceAnswerAudioView.this;
c.getElement().getStyle().setProperty("opacity", String.valueOf(progress));
}
};
a.run(3000);
}
示例12: hideLoadingPopup
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
private void hideLoadingPopup() {
final Element e = RootPanel.get("loading").getElement();
new Animation() {
@Override
protected void onUpdate(double progress) {
e.getStyle().setOpacity(1.0 - progress);
}
@Override
protected void onComplete() {
e.getStyle().setVisibility(Style.Visibility.HIDDEN);
}
}.run(500);
}
示例13: animatedRedraw
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
/**
* Redraw the canvas with HTML5 animation
*
* @param old_width
* width of viewport in base coordinates before any zoom
* operations
* @param center
* optional (x, y) center coordinates. Coordinates are relative
* to the HTML5 canvas in the broswer.
*/
public void animatedRedraw(int old_width, int... center) {
CanvasElement canv = viewport_context.getCanvas();
int x = center.length == 2 ? center[0] : canv.getWidth() / 2;
int y = center.length == 2 ? center[1] : canv.getHeight() / 2;
Animation anim = new ZoomAnimation(viewport_context, canv, cb,
old_width, area.viewportBaseWidth(), x, y);
anim.run(400);
}
示例14: getAutoCloseAnimation
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
/**
* @return the autoCloseAnimation
*/
public Animation getAutoCloseAnimation() {
return autoCloseAnimation;
}
示例15: setAutoCloseAnimation
import com.google.gwt.animation.client.Animation; //导入依赖的package包/类
/**
* @param autoCloseAnimation the autoCloseAnimation to set
*/
public void setAutoCloseAnimation(Animation autoCloseAnimation) {
this.autoCloseAnimation = autoCloseAnimation;
}