Package com.chap.links.client

Examples of com.chap.links.client.DataTable$Icon


  public void onModuleLoad() {
    // Create a callback to be called when the visualization API
    // has been loaded.
    Runnable onLoadCallback = new Runnable() {
      public void run() {
        DataTable dataTable = new DataTable () {
          @Override
          public void onEvent(String event, JavaScriptObject items) {
            JSONArray jsonItems = new JSONArray(items);
            System.out.println("event=" + event +
                ", items=" + jsonItems.toString());
          }
        };

        for (int i = 0; i < 100; i++) {
          dataTable.setField(i, "name", "Truck " + i);
          dataTable.setField(i, "capacity", 100 * Math.round(Math.random() * 20));
          dataTable.setField(i, "store", (Math.random() > 0.1) ? "main" : "spare");

          Action action = new Action("edit");
          dataTable.addAction(i, action);
          action = new Action("delete");
          dataTable.addAction(i, action);

          DataTable childTable = new DataTable();
          for (int j = 0; j < 5; j++) {
            String priority = Math.random() > 0.2 ? "normal" : "high";
            childTable.setField(j, "name", "Item " + j);
            childTable.setField(j, "priority", priority);
          }
          dataTable.setChilds(i, childTable);
        }
       
        // set options (optional)
View Full Code Here


          data.set(i, item);
        }
        //*/
       
        //*
        DataTable data = new DataTable () {
          @Override
          public void onEvent(String event, JavaScriptObject items) {
            JSONArray jsonItems = new JSONArray(items);
            System.out.println("event=" + event +
                ", items=" + jsonItems.toString());
          }
        };

        for (int i = 0; i < 100; i++) {
          data.setField(i, "name", "Truck " + i);
          data.setField(i, "capacity", 100 * Math.round(Math.random() * 20));
          data.setField(i, "store", (Math.random() > 0.1) ? "main" : "spare");

          DataTable.Action action = new DataTable.Action("edit");
          data.addAction(i, action);
          action = new DataTable.Action("delete");
          data.addAction(i, action);

          DataTable childTable = new DataTable();
          for (int j = 0; j < 5; j++) {
            String priority = Math.random() > 0.2 ? "normal" : "high";
            childTable.setField(j, "name", "Item " + j);
            childTable.setField(j, "priority", priority);
          }
          data.setChilds(i, childTable);
        }
        //*/

 
View Full Code Here

        .withName(worksheet.getTitle()).withOpen(true);

    Style style = folder.createAndAddStyle().withId("karma");
   
    if(randomCounter++%2 == 0)
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/blue-pushpin.png"));
    else
      style.createAndSetIconStyle().withScale(1.399999976158142).withIcon(new Icon().withHref("http://maps.google.com/mapfiles/ms/icons/red-pushpin.png"));

    for (edu.isi.karma.geospatial.Point point : points) {
      folder.createAndAddPlacemark()
          .withDescription(point.getHTMLDescription())
          .withVisibility(true)
View Full Code Here

            go.setName("Legend");
            go.setOverlayXY(createPixelsVec(0, 0));
            go.setScreenXY(createPixelsVec(10, 20));

            // build the href
            Icon icon = go.createAndSetIcon();
            String legendOptions = (String) context.getRequest().getRawKvp().get("LEGEND_OPTIONS");
            String[] kvpArray = null;
            if (legendOptions != null) {
                kvpArray = new String[] { "LEGEND_OPTIONS", legendOptions };
            }
            List<Layer> layerList = context.getMapContent().layers();
            Layer[] layers = (Layer[]) layerList.toArray(new Layer[layerList.size()]);
            icon.setHref(WMSRequests.getGetLegendGraphicUrl(context.getRequest(),
                    layers, kvpArray));
           
            return feature;
        }
View Full Code Here

            if (line || poly) {
                is.setScale(0.4);
            }
            String imageURL = "http://icons.opengeo.org/markers/icon-"
                    + (poly ? "poly.1" : "line.1") + ".png";
            Icon icon = is.createAndSetIcon();
            icon.setHref(imageURL);
            icon.setViewBoundScale(1);
        }
View Full Code Here

            }
            if (scale != null) {
                is.setScale(scale);
            }

            Icon icon = is.createAndSetIcon();
            icon.setHref(path);
        }
View Full Code Here

                context.getWms().getCatalog().getStyleByName(sld.getName()).getWorkspace();
            String wsName = null;
            if(ws!=null) wsName = ws.getName();

           
            Icon icon = is.createAndSetIcon();
            icon.setHref(properties.href(context.getMapContent().getRequest().getBaseUrl(),
                wsName, sld.getName()));
        }
View Full Code Here

    }

    void encodeGroundOverlay(Folder container, Layer layer, int drawOrder, Envelope box) {
        GroundOverlay go = container.createAndAddGroundOverlay();
        go.setDrawOrder(drawOrder);
        Icon icon = go.createAndSetIcon();
        String href = WMSRequests.getGetMapUrl(request, layer, 0, box, new String[] { "width",
                "256", "height", "256", "format", "image/png", "transparent", "true" });
        icon.setHref(href);
        LOGGER.fine(href);

        // make sure the ground overlay disappears as the lower tiles activate
        addRegion(go, box, 128, 512);
View Full Code Here

            int mapLayerOrder = context.getMapContent().layers().indexOf(layer);

            GroundOverlay go = folder.createAndAddGroundOverlay();
            go.setName(layer.getTitle());
            go.setDrawOrder(mapLayerOrder);
            Icon icon = go.createAndSetIcon();
            icon.setHref(getGroundOverlayHRef(layer));
            icon.setViewRefreshMode(ViewRefreshMode.NEVER);
            icon.setViewBoundScale(0.75);

            ReferencedEnvelope box = new ReferencedEnvelope(context.getMapContent()
                    .getRenderingArea());
            boolean reprojectBBox = (box.getCoordinateReferenceSystem() != null)
                    && !CRS.equalsIgnoreMetadata(box.getCoordinateReferenceSystem(),
View Full Code Here

            case END_ELEMENT : {
               if (Connector16.Tag.forName(reader.getLocalName()) == Connector16.Tag.ICON)
               {
                  //building and returning object

                  return new Icon(smallIcon, largeIcon, lang, id);

               }
               else
               {
                  if (Icon.Tag.forName(reader.getLocalName()) == Icon.Tag.UNKNOWN)
View Full Code Here

TOP

Related Classes of com.chap.links.client.DataTable$Icon

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.