Examples of optDouble()


Examples of org.json.JSONObject.optDouble()

            return null;
        }

        JSONObject formatJson = json.optJSONObject("format");
        if (formatJson != null) {
            Double duration = formatJson.optDouble("duration");
            if (!Double.isNaN(duration)) {
                return duration;
            }
        }
View Full Code Here

Examples of org.json.JSONObject.optDouble()

        JSONArray streamsJson = json.optJSONArray("streams");
        if (streamsJson != null) {
            for (int i = 0; i < streamsJson.length(); i++) {
                JSONObject streamsIndexJson = streamsJson.optJSONObject(i);
                if (streamsIndexJson != null) {
                    Double optionalDimension = streamsIndexJson.optDouble(dimension);
                    if (!Double.isNaN(optionalDimension)) {
                        return optionalDimension.intValue();
                    }
                }
            }
View Full Code Here

Examples of org.json.JSONObject.optDouble()

    JSONObject payload = request.getPayload();

    String js = template.generate(
        request.getSession(),
        request.getVariableValue(":reference"),
        payload.optDouble("xstart"),
        payload.optDouble("ystart"),
        payload.optDouble("xend"),
        payload.optDouble("yend"),
        payload.optInt("touchCount"));
    setJS(js);
View Full Code Here

Examples of org.json.JSONObject.optDouble()

    String js = template.generate(
        request.getSession(),
        request.getVariableValue(":reference"),
        payload.optDouble("xstart"),
        payload.optDouble("ystart"),
        payload.optDouble("xend"),
        payload.optDouble("yend"),
        payload.optInt("touchCount"));
    setJS(js);
  }
View Full Code Here

Examples of org.json.JSONObject.optDouble()

    String js = template.generate(
        request.getSession(),
        request.getVariableValue(":reference"),
        payload.optDouble("xstart"),
        payload.optDouble("ystart"),
        payload.optDouble("xend"),
        payload.optDouble("yend"),
        payload.optInt("touchCount"));
    setJS(js);
  }
View Full Code Here

Examples of org.json.JSONObject.optDouble()

        request.getSession(),
        request.getVariableValue(":reference"),
        payload.optDouble("xstart"),
        payload.optDouble("ystart"),
        payload.optDouble("xend"),
        payload.optDouble("yend"),
        payload.optInt("touchCount"));
    setJS(js);
  }

  @Override
View Full Code Here

Examples of org.json.JSONObject.optDouble()

    JSONObject payload = request.getPayload();
    Dimension screenSize = getNativeDriver().getScreenSize();
    String elementId = payload.optString("element");
    if (!payload.isNull("element") && !elementId.equals("")) {
      Point offset = new Point(payload.getInt("xoffset"), payload.getInt("yoffset"));
      double speed = payload.optDouble("speed", 1.0);
      if (RemoteIOSWebDriver.isPlainElement(elementId)) {
        NodeId nodeId = RemoteIOSWebDriver.plainNodeId(elementId);
        plainFlickFromElement(request, screenSize, offset, speed, nodeId.getId());
      } else {
        nativeFlickFromElement(request, screenSize, offset, speed, elementId);
View Full Code Here

Examples of org.json.JSONObject.optDouble()

        plainFlickFromElement(request, screenSize, offset, speed, nodeId.getId());
      } else {
        nativeFlickFromElement(request, screenSize, offset, speed, elementId);
      }
    } else {
      double speedX = payload.optDouble("xspeed", 1.0);
      double speedY = payload.optDouble("yspeed", 1.0);
      flickFromCenter(request, screenSize, speedX, speedY);
    }
  }
View Full Code Here

Examples of org.json.JSONObject.optDouble()

      } else {
        nativeFlickFromElement(request, screenSize, offset, speed, elementId);
      }
    } else {
      double speedX = payload.optDouble("xspeed", 1.0);
      double speedY = payload.optDouble("yspeed", 1.0);
      flickFromCenter(request, screenSize, speedX, speedY);
    }
  }

  private void plainFlickFromElement(WebDriverLikeRequest request, Dimension screenSize, Point offset, double speed,
View Full Code Here

Examples of org.json.JSONObject.optDouble()

    super(driver, request);

    JSONObject payload = request.getPayload();
    String js = template.generate(
        request.getSession(),
        payload.optDouble("fromX"),
        payload.optDouble("fromY"),
        payload.optDouble("toX"),
        payload.optDouble("toY"),
        payload.optDouble("duration"));
    setJS(js);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.