Package com.google.gwt.query.client

Examples of com.google.gwt.query.client.Properties


    offset = convertPositionTo(true, position);
    absPosition = offset.add(margin.left, margin.top);
  }

  public void revertToOriginalPosition(Function function) {
    Properties oldPosition = Properties.create("{top:'"
        + String.valueOf(originalPosition.top) + "px',left:'"
        + String.valueOf(originalPosition.left) + "px'}");
    helper.as(Effects.Effects).animate(oldPosition,
        options.getRevertDuration(), Easing.LINEAR, function);
View Full Code Here


    }
    return r;
  }

  protected Properties getPropertiesBase(String n) {
    Properties r = p.getJavaScriptObject(n);
    return r != null ? r : Properties.create();
  }
View Full Code Here

    delay = p.getInt("delay");
    g = $(e).as(Transitions.Transitions);
  }

  private Properties getFxProperties(boolean isStart) {
    Properties p = $$();
    for (int i = 0; i < effects.length(); i++) {
      TransitFx fx = (TransitFx)effects.get(i);
      String val = isStart ? fx.transitStart : fx.transitEnd;
      if (!val.isEmpty()) {
        p.set(fx.cssprop, val + fx.unit);
      }
    }
    return p;
  }
View Full Code Here

  @Override
  public void run(int duration) {
    onStart();

    // Compute initial properties
    Properties p = getFxProperties(true);
    g.css(p)
      // Some browsers need after setting initial properties re-flow (FF 24.4.0).
      .offset();

    // Compute final properties
View Full Code Here

  /**
   * Returns a QueryString representation of a JavascriptObject.
   * TODO: jquery implementation accepts a second parameter (traditional)
   */
  public static String param(JavaScriptObject js) {
    Properties prop = js.cast();
    String ret = "";
    for (String k : prop.keys()) {
      ret += ret.isEmpty() ? "" : "&";
      JsCache o = prop.getArray(k).cast();
      if (o != null) {
        for (int i = 0, l = o.length(); i < l ; i++) {
          ret += i > 0 ? "&" : "";
          Properties p = o.<JsCache>cast().getJavaScriptObject(i);
          if (p != null) {
            ret += k + "[]=" + p.toJsonString();
          } else {
            ret += k + "[]=" + o.getString(i) ;
          }
        }
      } else {
        Properties p = prop.getJavaScriptObject(k);
        if (p != null) {
          ret += k + "=" + p.tostring();
        } else {
          String v = prop.getStr(k);
          if (v != null && !v.isEmpty() && !"null".equalsIgnoreCase(v)) {
            ret += k + "=" + v;
          }
View Full Code Here

    @Override
    public String JSON2String(JavaScriptObject js) {
      // This is a very basic implementation for IE6/IE7 of JSON.stringify
      // If many people demand a better one we could consider to use json2.js
      // @see https://github.com/douglascrockford/JSON-js/blob/master/json2.js
      Properties prop = js.cast();
      String ret = "";
      for (String k : prop.keys()){
        String ky = k.matches("\\d+") ? k : "\"" + k + "\"";
        JsCache o = prop.getArray(k).cast();
        if (o != null) {
          ret += ky + ":[";
          for (int i = 0, l = o.length(); i < l ; i++) {
            Properties p = o.<JsCache>cast().getJavaScriptObject(i);
            if (p != null) {
              ret += p.toJsonString() + ",";
            } else {
              ret += "\"" + o.getString(i) + "\",";
            }
          }
          ret += "],";
        } else {
          Properties p = prop.getJavaScriptObject(k);
          if (p != null) {
            ret += ky + ":" + p.toJsonString() + ",";
          } else {
            ret += ky + ":\"" + prop.getStr(k) + "\",";
          }
        }
      }
View Full Code Here

   * @param duration the duration in milliseconds of the animation
   * @param easing the easing function to use for the transition
   */
  public Effects animate(Object stringOrProperties, int duration, Easing easing, Function... funcs) {

    final Properties p = (stringOrProperties instanceof String)
        ? (Properties) $$((String) stringOrProperties)
        : (Properties) stringOrProperties;

    if (p.getStr("duration") != null) {
      duration = p.getInt("duration");
    }

    duration = Math.abs(duration);

    for (Element e: elements()) {
View Full Code Here

  public Transitions transition(Object stringOrProperties, final int duration, final Easing easing, final int delay, final Function... funcs) {
    if (isEmpty()) {
      return this;
    }

    final Properties cssProps = (stringOrProperties instanceof String)
      ? (Properties) $$((String) stringOrProperties)
      : (Properties) stringOrProperties;

    final String ease = easing == null ? "ease" : easing.toString();
    final List<String> transProps = filterTransitionPropertyNames(cssProps);
View Full Code Here

TOP

Related Classes of com.google.gwt.query.client.Properties

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.