Examples of GeoMap


Examples of com.google.gwt.visualization.client.visualizations.GeoMap

    dataTable.setValue(3, 0, "Brazil");
    dataTable.setValue(4, 0, "Canada");
    dataTable.setValue(5, 0, "France");
    dataTable.setValue(6, 0, "RU");
   
    final GeoMap geo = new GeoMap(dataTable, options);
    return geo;
  }
View Full Code Here

Examples of com.google.gwt.visualization.client.visualizations.GeoMap

    loadApi(new Runnable() {
      public void run() {
        GeoMap.Options options = GeoMap.Options.create();
        DataTable data = createDataTable();
        options.setRegion("world");
        GeoMap geoMap = new GeoMap(data, options);
        geoMap.setSize("300px", "300px");
        RootPanel.get().add(geoMap);
      }
    });
  }
View Full Code Here

Examples of com.google.gwt.visualization.client.visualizations.GeoMap

        options.setWidth(450);
        options.setShowLegend(true);
        options.setRegion("world");

        DataTable data = createDataTable();
        GeoMap geoMap = new GeoMap(data, options);
        RootPanel.get().add(geoMap);
      }
    });
  }
View Full Code Here

Examples of com.google.gwt.visualization.client.visualizations.GeoMap

  public void testRegionClick() {
    loadApi(new Runnable() {
      public void run() {
        GeoMap.Options options = GeoMap.Options.create();
        final GeoMap viz = new GeoMap(createDataTable(), options);
 
        // Add a region click handler
        viz.addRegionClickHandler(new RegionClickHandler() {
 
          @Override
          public void onRegionClick(RegionClickEvent event) {
            assertNotNull(event);
            assertEquals("Israel", event.getRegion());
            finishTest();
          }
        });
        RootPanel.get().add(viz);

        // Trigger a region click callback
        triggerRegionClick(viz.getJso(), "Israel");
      }
    }, false);
  }
View Full Code Here

Examples of com.google.gwt.visualization.client.visualizations.GeoMap

  public void testSelection() {
    loadApi(new Runnable() {
      public void run() {
        GeoMap.Options options = GeoMap.Options.create();
        final GeoMap viz = new GeoMap(createDataTable(), options);
 
        // Add a selection handler
        viz.addSelectHandler(new SelectHandler() {
 
          @Override
          public void onSelect(SelectEvent event) {
            assertNotNull(event);
            JsArray<Selection> s = viz.getSelections();
            assertEquals("Expected 1 element in the selection", 1,
                s.length());
            assertEquals("Expected row 1 to be selected", 1, s.get(0).getRow());
            assertEquals("Expected column 0 to be selected", 0, s.get(0).getColumn());
            finishTest();
          }
        });
        RootPanel.get().add(viz);
 
        JsArray<Selection> s =
          ArrayHelper.toJsArray(Selection.createCellSelection(1, 0));
        assertEquals("Expected 1 element in the selection", 1, s.length());
        assertEquals("Expected row 1 to be selected", 1, s.get(0).getRow());
        assertEquals("Expected column 0 to be selected", 0, s.get(0).getColumn());
        viz.setSelections(s);
        s = viz.getSelections();
        assertEquals("Expected 1 element in the selection", 1, s.length());
        assertEquals("Expected row 1 to be selected", 1, s.get(0).getRow());
        assertEquals("Expected column 0 to be selected", 0, s.get(0).getColumn());
        // Trigger a selection callback
        triggerSelection(viz, s);
View Full Code Here

Examples of com.google.gwt.visualization.client.visualizations.GeoMap

    VisualizationUtils.loadVisualizationApi(new Runnable() {
      public void run() {
        GeoMap.Options options = GeoMap.Options.create();
        options.setShowZoomOut(true);
       
        final GeoMap viz = new GeoMap(createDataTable(), options);
 
        // Add a zoom out handler
        viz.addZoomOutHandler(new ZoomOutHandler() {
 
          @Override
          public void onZoomOut(ZoomOutEvent event) {
            assertNotNull(event);
            finishTest();
          }
        });
        RootPanel.get().add(viz);

        // Trigger a zoom out callback
        triggerZoomOut(viz.getJso());
      }
    }, GeoMap.PACKAGE);
    delayTestFinish(ASYNC_DELAY_MS);
  }
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.bo.GeoMap

* @param response The response Source Bean
* @throws EMFUserError If an exception occurs
*/  
private void getDetailMap(SourceBean request, SourceBean response) throws EMFUserError {
  try {                      
    GeoMap map = DAOFactory.getSbiGeoMapsDAO().loadMapByID(new Integer((String)request.getAttribute("ID")));   
    getTabDetails(request, response);   
    this.modalita = SpagoBIConstants.DETAIL_MOD;
    if (request.getAttribute("SUBMESSAGEDET") != null &&
      ((String)request.getAttribute("SUBMESSAGEDET")).equalsIgnoreCase(MOD_SAVEBACK))
    {
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.bo.GeoMap

    SessionContainer permSess = sessCont.getPermanentContainer();
    IEngUserProfile profile = (IEngUserProfile)permSess.getAttribute(IEngUserProfile.ENG_USER_PROFILE);
    ISbiGeoMapsDAO daoGeoMaps=DAOFactory.getSbiGeoMapsDAO();
    daoGeoMaps.setUserProfile(profile);
   
    GeoMap mapNew = recoverMapDetails(serviceRequest);
   
    EMFErrorHandler errorHandler = getErrorHandler();
    
    // if there are some validation errors into the errorHandler does not write into DB
    Collection errors = errorHandler.getErrors();
    if (errors != null && errors.size() > 0) {
      Iterator iterator = errors.iterator();
      while (iterator.hasNext()) {
        Object error = iterator.next();
        if (error instanceof EMFValidationError) {
          serviceResponse.setAttribute("mapObj", mapNew);
          serviceResponse.setAttribute("modality", mod);
          return;
        }
      }
    }
   
    if (mod.equalsIgnoreCase(SpagoBIConstants.DETAIL_INS)) {     
      //if a map with the same name not exists on db ok else error
      if (daoGeoMaps.loadMapByName(mapNew.getName()) != null){
        HashMap params = new HashMap();
        params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
        EMFUserError error = new EMFUserError(EMFErrorSeverity.ERROR, 5005, new Vector(), params );
        getErrorHandler().addError(error);
        return;
      }      
      /* The activity INSERT consists in:
       * - insert a map (SBI_GEO_MAPS),
       * - insert of the features (SBI_GEO_FEATURES) through the   method 'loadUpdateMapFeatures'
       * - insert of the relations (SBI_GEO_MAP_FEATURES) through the method 'loadUpdateMapFeatures'
       * (all objects are had taken from the template file)
       */
      //DAOFactory.getSbiGeoMapsDAO().insertMap(mapNew);
      daoGeoMaps.insertMap(mapNew, content);
      loadUpdateMapFeatures(mapNew,profile);
      GeoMap tmpMap = daoGeoMaps.loadMapByName(mapNew.getName());
      mapNew.setMapId(tmpMap.getMapId());
      mapNew.setBinId(tmpMap.getBinId());
      serviceResponse.setAttribute("mapObj", mapNew);
      serviceResponse.setAttribute("modality", SpagoBIConstants.DETAIL_MOD);
     
      getTabDetails(serviceRequest, serviceResponse);
     
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.bo.GeoMap

        GeoMapFeature tmpMapFeature = DAOFactory.getSbiGeoMapFeaturesDAO().loadMapFeatures(new Integer(id), new Integer(featureId));       
        DAOFactory.getSbiGeoMapFeaturesDAO().eraseMapFeatures(tmpMapFeature);
      }
    }
    //delete the map
    GeoMap map = DAOFactory.getSbiGeoMapsDAO().loadMapByID(new Integer(id));
    DAOFactory.getSbiGeoMapsDAO().eraseMap(map);
  }   catch (EMFUserError e){
      HashMap params = new HashMap();     
      params.put(AdmintoolsConstants.PAGE, ListMapsModule.MODULE_PAGE);
      throw new EMFUserError(EMFErrorSeverity.ERROR, 5010, new Vector(), params);
View Full Code Here

Examples of it.eng.spagobi.mapcatalogue.bo.GeoMap

    ISbiGeoMapFeaturesDAO dao=DAOFactory.getSbiGeoMapFeaturesDAO();
    dao.setUserProfile(profile);
   
    String mapId = (String) request.getAttribute("MAP_ID");
    String featureId = (String)request.getAttribute("FEATURE_ID")
    GeoMap map = DAOFactory.getSbiGeoMapsDAO().loadMapByID(new Integer(mapId));
    EMFErrorHandler errorHandler = getErrorHandler();
   
    // if there are some validation errors into the errorHandler does not write into DB
    Collection errors = errorHandler.getErrors();
    if (errors != null && errors.size() > 0) {
      Iterator iterator = errors.iterator();
      while (iterator.hasNext()) {
        Object error = iterator.next();
        if (error instanceof EMFValidationError) {
          response.setAttribute("mapObj", map);
          response.setAttribute("modality", SpagoBIConstants.DETAIL_MOD);
          return;
        }
      }
    }

    //inserts the relation
    GeoMapFeature mapFeature = dao.loadMapFeatures(new Integer(mapId), new Integer(featureId));
    if (mapFeature == null){
      mapFeature = new  GeoMapFeature();
      mapFeature.setMapId(new Integer(mapId).intValue());
      mapFeature.setFeatureId(new Integer(featureId).intValue());
      mapFeature.setSvgGroup(null);
      mapFeature.setVisibleFlag(null);   
      dao.insertMapFeatures(mapFeature);
    }
    //create a List of features
    List lstAllFeatures = dao.loadFeatureNamesByMapId(new Integer(map.getMapId()));
    List lstMapFeatures = new ArrayList();

    for (int i=0; i < lstAllFeatures.size(); i ++){     
      GeoFeature aFeature = DAOFactory.getSbiGeoFeaturesDAO().loadFeatureByName((String)lstAllFeatures.get(i));
      lstMapFeatures.add(aFeature);
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.