All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.sencha.gxt.fx.client.animation.Slide Maven / Gradle / Ivy

/**
 * Ext GWT 3.0.0-beta2 - Ext for GWT
 * Copyright(c) 2007-2011, Sencha, Inc.
 * [email protected]
 *
 * http://sencha.com/license
 */
package com.sencha.gxt.fx.client.animation;

import com.google.gwt.dom.client.Style.Overflow;
import com.google.gwt.dom.client.Style.Unit;
import com.sencha.gxt.core.client.Style.Direction;
import com.sencha.gxt.core.client.dom.XElement;
import com.sencha.gxt.core.client.util.Rectangle;

public abstract class Slide extends BaseEffect {

  protected Direction dir;
  protected double from, to;
  protected Rectangle oBounds;
  protected Overflow overflow;
  protected XElement wrapEl;
  protected int marginTop;
  protected int marginLeft;

  public Slide(XElement el, Direction dir) {
    super(el);
    this.dir = dir;
  }

  public abstract void increase(int v);

  @Override
  public void onComplete() {
    wrapEl.unwrap(element, oBounds);
    element.getStyle().setMarginTop(marginTop, Unit.PX);
    element.getStyle().setMarginLeft(marginLeft, Unit.PX);
    if (overflow != null) {
      element.getStyle().setOverflow(overflow);
    }
    super.onComplete();
  }

  @Override
  public void onUpdate(double progress) {
    int v = (int) getValue(from, to, progress);
    increase(v);
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy