Package com.codename1.ui

Examples of com.codename1.ui.Command


      return null;
    }
    try {
      double lat = Double.parseDouble(coords[0]);
      double lng = Double.parseDouble(coords[1]);
      return new Coord(lat, lng);
    } catch (NumberFormatException nfe) {
      return null;
    }
  }
View Full Code Here


    descriptions = new Hashtable();
    Vector v = kml.getAsArray("//Placemark");
    for (int i = 0; i < v.size(); i++) {
      Result marker = Result.fromContent(((Element) v.elementAt(i)).getChildAt(0));
      System.out.println("Name:" + marker.getAsString("name"));
      Coord coords = getMarkerCoordinates(marker);
      if (coords != null) {
        String name = marker.getAsString("name");
        String desc = marker.getAsString("description");
        if (desc != null) {
          descriptions.put(name, desc);
View Full Code Here

        String name = marker.getAsString("name");
        String desc = marker.getAsString("description");
        if (desc != null) {
          descriptions.put(name, desc);
        }
        PointLayer p = new PointLayer(coords, name, null);
        p.setDisplayName(true);
        String style = marker.getAsString("styleUrl");
        if (style == null) {
          style = "default";
        }
        setMarkerIcon(p, kml, style);
        addPoint(p);
      }
    }
    addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                PointLayer p = (PointLayer) evt.getSource();
                System.out.println("pressed " + p);
                String name = p.getName();
                final Dialog d = new Dialog(name);
                d.setLayout(new BorderLayout());
                WebBrowser wb = new WebBrowser();
                wb.setPage(getDescription(name), "http://localhost");
                d.addComponent(BorderLayout.CENTER, wb);
View Full Code Here

        String name = marker.getAsString("name");
        String desc = marker.getAsString("description");
        if (desc != null) {
          descriptions.put(name, desc);
        }
        PointLayer p = new PointLayer(coords, name, null);
        p.setDisplayName(true);
        String style = marker.getAsString("styleUrl");
        if (style == null) {
          style = "default";
        }
        setMarkerIcon(p, kml, style);
        addPoint(p);
      }
    }
    addActionListener(new ActionListener() {
            public void actionPerformed(ActionEvent evt) {
                PointLayer p = (PointLayer) evt.getSource();
                System.out.println("pressed " + p);
                String name = p.getName();
                final Dialog d = new Dialog(name);
                d.setLayout(new BorderLayout());
                WebBrowser wb = new WebBrowser();
                wb.setPage(getDescription(name), "http://localhost");
                d.addComponent(BorderLayout.CENTER, wb);
View Full Code Here

   * @see
   * com.codename1.io.services.TwitterRESTService#readResponse(java.io.InputStream
   * )
   */
  protected void readResponse(InputStream input) throws IOException {
    Result result = Result.fromContent(input, Result.JSON);
    Vector tweets = result.getAsArray("/root");
    if (tweets.size() > 0) {
      final Comparator cmp = new StringComparator();
      for (Enumeration e = tweets.elements(); e.hasMoreElements(); ) {
        Result tweet = Result.fromContent((Hashtable)e.nextElement());
        String id = tweet.getAsString("id_str");
        if ((since_id == null) || cmp.compare(id, since_id) > 0) {
          // this is currently causing twitter to response with no tweets.
          //setSinceId(id);
        }
        if ((max_id == null) || cmp.compare(id, max_id) < 0) {
View Full Code Here

   * @see
   * com.codename1.io.services.TwitterRESTService#readResponse(java.io.InputStream
   * )
   */
  protected void readResponse(InputStream input) throws IOException {
    Result result = Result.fromContent(input, Result.JSON);
    fireResponseListener(new ActionEvent(result));
  }
View Full Code Here

 
  KMLPointsLayer(Result kml) {
    descriptions = new Hashtable();
    Vector v = kml.getAsArray("//Placemark");
    for (int i = 0; i < v.size(); i++) {
      Result marker = Result.fromContent(((Element) v.elementAt(i)).getChildAt(0));
      System.out.println("Name:" + marker.getAsString("name"));
      Coord coords = getMarkerCoordinates(marker);
      if (coords != null) {
        String name = marker.getAsString("name");
        String desc = marker.getAsString("description");
        if (desc != null) {
          descriptions.put(name, desc);
        }
        PointLayer p = new PointLayer(coords, name, null);
        p.setDisplayName(true);
        String style = marker.getAsString("styleUrl");
        if (style == null) {
          style = "default";
        }
        setMarkerIcon(p, kml, style);
        addPoint(p);
View Full Code Here

 
  KMLPointsLayer(Result kml) {
    descriptions = new Hashtable();
    Vector v = kml.getAsArray("//Placemark");
    for (int i = 0; i < v.size(); i++) {
      Result marker = Result.fromContent(((Element) v.elementAt(i)).getChildAt(0));
      System.out.println("Name:" + marker.getAsString("name"));
      Coord coords = getMarkerCoordinates(marker);
      if (coords != null) {
        String name = marker.getAsString("name");
        String desc = marker.getAsString("description");
        if (desc != null) {
          descriptions.put(name, desc);
        }
        PointLayer p = new PointLayer(coords, name, null);
        p.setDisplayName(true);
        String style = marker.getAsString("styleUrl");
        if (style == null) {
          style = "default";
        }
        setMarkerIcon(p, kml, style);
        addPoint(p);
View Full Code Here

   */
  public void onDisplayLogin(final Form backForm, final WebBrowser webBrowser) {
    Form form = new Form("Login");
    form.setScrollableY(false);
    if (backForm != null) {
      Command cancel = new Command("Cancel") {
        public void actionPerformed(ActionEvent ev) {
          backForm.showBack();
        }
      };
      form.addCommand(cancel);
View Full Code Here

                d.setLayout(new BorderLayout());
                WebBrowser wb = new WebBrowser();
                wb.setPage(getDescription(name), "http://localhost");
                d.addComponent(BorderLayout.CENTER, wb);
                d.setDisposeWhenPointerOutOfBounds(true);
                Command backCommand = new Command("Back") {
          public void actionPerformed(ActionEvent evt) {
            d.dispose();
          }
                };
                d.addCommand(backCommand);
View Full Code Here

TOP

Related Classes of com.codename1.ui.Command

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.