protected void handleAddRoute(HashMap routeMap) { Object routeArray = routeMap.get("points"); if (routeArray instanceof Object[]) { Object[] routes = (Object[]) routeArray; MapPoint[] pointsType = new MapPoint[routes.length]; for (int i = 0; i < routes.length; i++) { if (routes[i] instanceof HashMap) { HashMap tempRoute = (HashMap) routes[i]; MapPoint mp = new MapPoint( TiConvert.toDouble(tempRoute, "latitude"), TiConvert.toDouble(tempRoute, "longitude")); pointsType[i] = mp; } } MapRoute mr = new MapRoute( pointsType, TiConvert.toColor(routeMap, "color"), TiConvert.toInt(routeMap, "width"), TiConvert.toString(routeMap, "name")); if (mapView == null) { this.routes.add(mr); } else { mapView.addRoute(mr); } } }
private double getMax() { Object value = proxy.getProperty("max"); if (value == null) { return 0; } return TiConvert.toDouble(value); }
private double getValue() { Object value = proxy.getProperty(TiC.PROPERTY_VALUE); if (value == null) { return 0; } return TiConvert.toDouble(value); }
public Double optDouble(String key, Double defaultValue) { Double result = defaultValue; if (containsKey(key)) { result = TiConvert.toDouble(get(key), defaultValue); } return result; }
public double getDuration() { if (proxy.getDynamicValue("duration") != null) { return TiConvert.toDouble(proxy.getDynamicValue("duration")); } if (images != null) { return images.length * 33; } return 100; }
public double getDuration() { if (proxy.getProperty(TiC.PROPERTY_DURATION) != null) { double duration = TiConvert.toDouble(proxy.getProperty(TiC.PROPERTY_DURATION)); if (duration < MIN_DURATION) { return MIN_DURATION; } else { return duration; } } proxy.setProperty(TiC.PROPERTY_DURATION, DEFAULT_DURATION); return DEFAULT_DURATION; }
public double getDuration() { if (proxy.getProperty(TiC.PROPERTY_DURATION) != null) { double duration = TiConvert.toDouble(proxy.getProperty(TiC.PROPERTY_DURATION)); if (duration < MIN_DURATION) { return MIN_DURATION; } else { return duration; } } if (images != null) { return images.length * 33; } return 100; }
public Double getDouble(String key) { return TiConvert.toDouble(get(key)); }