Package com.gwcworld.core.bean

Examples of com.gwcworld.core.bean.Map


    ModelAndView mav = null;
   
    int idMap = WebUtil.parameter2int(request.getParameter("mapId"));
   
    Map map = mapService.getById(idMap);
   
    MapJson mapJson = new MapJson();
    mapJson.setName(map.getName());
    mapJson.setDescription(map.getDescription());
    mapJson.setMilestone(map.isMilestone());
    List<Area> areaList = areaService.getAreaListByMap(map);
    List<AreaJson> areaJsonList = new ArrayList<AreaJson>();
    for (Iterator<Area> iterator = areaList.iterator(); iterator.hasNext();) {
      Area area = iterator.next();
     
View Full Code Here


  public void testMapService(){
    assertNotNull(service);
  }
 
  public void testFindById(){
    Map map = service.getById(51);
    logger.debug("Maps: "+map.getDescription());
    assertNotNull(map);
  }
View Full Code Here

   
    int idMap = WebUtil.parameter2int(request.getParameter("idMap"));
    int idProject = WebUtil.parameter2int(request.getParameter("idProject"));
   
    if(idMap!=0){
      Map map = mapService.getById(idMap);
      mav.addObject("map", map);
    }
   
    if(idProject!=0){
      Project project = projectService.getById(idProject);
View Full Code Here

   
    int idMap = WebUtil.parameter2int(request.getParameter("idMap"));
    int idstand = WebUtil.parameter2int(request.getParameter("idStand"));
   
    if(idMap!=0){
      Map map = mapService.getById(idMap);
      mav.addObject("map", map);
    }
   
    if(idstand!=0){
      Stand stand = standService.getById(idstand);
View Full Code Here

     
      try{
        Project project = projectService.getById(projectId);
        User user = userService.getById(userId);
       
        Map map = new Map();
        map.setName(mapJson.getName());
        map.setDescription(mapJson.getDescription());
        map.setMilestone(mapJson.isMilestone());
        map.setLastEdit(new Date());
        map.setProject(project);
        map.setUser(user);
        //mapService.save(map);
       
        List<AreaJson> areaJsonList = mapJson.getAreaList();
        List<Area> areaList = new ArrayList<Area>();
        for (Iterator<AreaJson> iterator = areaJsonList.iterator(); iterator.hasNext();) {
          AreaJson areaJson = iterator.next();
         
          Area area = new Area();
          area.setName(areaJson.getName());
          area.setGridsize(areaJson.getGridsize());
          area.setImgBackground(areaJson.getImgBackground());
         
          ShapeJson shapeJson = areaJson.getShapeJson();
          Shape shape = new Shape();
          shape.setColorRGBA(shapeJson.getColorRGBA());
          shape.setRotate(shapeJson.getRotate());
          shape.setScaleX(shapeJson.getScaleX());
          shape.setScaleY(shapeJson.getScaleY());
          ShapeType shapeType = shapeTypeService.getById(shapeJson.getShapeTypeId());
          shape.setType(shapeType);
          shape.setTranslateX(shapeJson.getTranslateX());
          shape.setTranslateY(shapeJson.getTranslateY());
          shape.setValues(shapeJson.getValues());
          //shapeService.save(shape);
         
          area.setShape(shape);
         
          List<LayerJson> layerJsonList = areaJson.getLayerList();
          List<Layer> layerList = new ArrayList<Layer>();
          for (Iterator<LayerJson> iterator2 = layerJsonList.iterator(); iterator2.hasNext();) {
            LayerJson layerJson = iterator2.next();
           
            Layer layer = new Layer();
            layer.setName(layerJson.getName());
            layer.setImgBackground(layerJson.getImgBackground());
            layer.setVisible(layerJson.isVisible());
            layer.setzIndex(layerJson.getzIndex());
           
            List<AreaElementJson> areaElementJsonList = layerJson.getAreaElementList();
            List<AreaElement> areaElementList = new ArrayList<AreaElement>();
            for (Iterator<AreaElementJson> iterator3 = areaElementJsonList.iterator(); iterator3.hasNext();) {
              AreaElementJson areaElementJson = iterator3.next();
             
              AreaElement areaElement = new AreaElement();
              AreaElementType areaElementType = areaElementTypeService.getById(areaElementJson.getAreaElementType());
              areaElement.setType(areaElementType);
              areaElement.setRotate(areaElementJson.getRotate());
              areaElement.setScaleX(areaElementJson.getScaleX());
              areaElement.setScaleY(areaElementJson.getScaleY());
              areaElement.setSurfaceTot(areaElementJson.getSurfaceTot());
              areaElement.setTranslateX(areaElementJson.getTranslateX());
              areaElement.setTranslateY(areaElementJson.getTranslateY());
              areaElement.setLayer(layer);
             
              areaElementList.add(areaElement);
            }
            layer.setAreaElements(areaElementList);
           
            List<ShapeJson> shapeJsonList = layerJson.getShapeList();
            List<Shape> shapeList = new ArrayList<Shape>();
            for (Iterator<ShapeJson> iterator4 = shapeJsonList.iterator(); iterator4.hasNext();) {
              ShapeJson layerShapeJson = iterator4.next();
             
              Shape layerShape = new Shape();
              layerShape.setColorRGBA(layerShapeJson.getColorRGBA());
              layerShape.setRotate(layerShapeJson.getRotate());
              layerShape.setScaleX(layerShapeJson.getScaleX());
              layerShape.setScaleY(layerShapeJson.getScaleY());
              ShapeType layerShapeType = shapeTypeService.getById(layerShapeJson.getShapeTypeId());
              layerShape.setType(layerShapeType);
              layerShape.setTranslateX(layerShapeJson.getTranslateX());
              layerShape.setTranslateY(layerShapeJson.getTranslateY());
              layerShape.setValues(layerShapeJson.getValues());
             
              shapeList.add(layerShape);
            }
            layer.setShapes(shapeList);
           
            List<StandJson> standJsonList = layerJson.getStandList();
            List<Stand> standList = new ArrayList<Stand>();
            for (Iterator<StandJson> iterator3 = standJsonList.iterator(); iterator3.hasNext();) {
              StandJson standJson = iterator3.next();
             
              Stand stand = new Stand();
              stand.setCode(standJson.getCode());
              stand.setDescription(standJson.getDescription());
              if(standJson.getExhibitorId()!=0){
                Exhibitor exhibitor = exhibitorService.getById(standJson.getExhibitorId());
                stand.setExhibitor(exhibitor);
              }
              stand.setLogo(standJson.getLogo());
              stand.setName(standJson.getName());
              stand.setOpenSides(standJson.getOpenSides());
             
              ShapeJson standShapeJson = standJson.getShape();
              Shape standShape = new Shape();
              standShape.setColorRGBA(standShapeJson.getColorRGBA());
              standShape.setRotate(standShapeJson.getRotate());
              standShape.setScaleX(standShapeJson.getScaleX());
              standShape.setScaleY(standShapeJson.getScaleY());
              ShapeType standShapeType = shapeTypeService.getById(standShapeJson.getShapeTypeId());
              standShape.setType(standShapeType);
              standShape.setTranslateX(standShapeJson.getTranslateX());
              standShape.setTranslateY(standShapeJson.getTranslateY());
              standShape.setValues(standShapeJson.getValues());
              stand.setShape(standShape);
              com.gwcworld.core.bean.StandStatus standStatus = standStatusService.getById(standJson.getStandStatusId());
              stand.setStatus(standStatus);
              stand.setSurfaceEffective(standJson.getSurfaceEffective());
              stand.setSurfaceTot(standJson.getSurfaceTot());
              stand.setOrientation(standJson.getOrientation());
              stand.setMoved(standJson.getMoved());
              stand.setLayer(layer);
              standList.add(stand);
            }
            layer.setStands(standList);
            layer.setArea(area);
           
            layerList.add(layer);
          }
          area.setLayers(layerList);
          area.setMap(map);
             
          areaList.add(area);
        }
        map.setAreaList(areaList);
       
        mapService.save(map);
        //List<Map> mapList = mapService.getMapsByProjectAndName(projectId, mapJson.getName(), 1);
       
       
View Full Code Here

TOP

Related Classes of com.gwcworld.core.bean.Map

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.