Exemplo n.º 1
0
 public void setMiscState(Main main, Logic logic) {
   main.setImageFileName(savedImageFileName);
   logic.setLastComments(savedLastComments);
   logic.setLastSources(savedLastSources);
   Application.setTaskNotifications(main, savedTaskNotifications);
   Application.setOsmDataNotifications(main, savedOsmDataNotifications);
 }
Exemplo n.º 2
0
 public void setSelected(Logic logic) {
   logic.setMode(savedMode == null ? Mode.MODE_MOVE : savedMode);
   Log.d("EditState", "savedMode " + savedMode);
   if (savedNodes != null) {
     for (Node n : savedNodes) {
       Node nodeInStorage =
           (Node) Application.getDelegator().getOsmElement(Node.NAME, n.getOsmId());
       if (nodeInStorage != null) {
         logic.addSelectedNode(nodeInStorage);
       }
     }
   }
   if (savedWays != null) {
     for (Way w : savedWays) {
       Way wayInStorage = (Way) Application.getDelegator().getOsmElement(Way.NAME, w.getOsmId());
       if (wayInStorage != null) {
         logic.addSelectedWay(wayInStorage);
       }
     }
   }
   if (savedRelations != null) {
     for (Relation r : savedRelations) {
       Relation relationInStorage =
           (Relation) Application.getDelegator().getOsmElement(Relation.NAME, r.getOsmId());
       if (relationInStorage != null) {
         logic.addSelectedRelation(relationInStorage);
       }
     }
   }
   //
   logic.setSelectedBug(savedBug);
 }
Exemplo n.º 3
0
 public void setViewBox(Logic logic, Map map) {
   logic.getViewBox().setBorders(savedBox);
   try {
     logic.getViewBox().setRatio((float) map.getWidth() / (float) map.getHeight());
   } catch (OsmException e) {
     // shouldn't happen since we would have only stored a legal BB
   }
   map.setViewBox(logic.getViewBox());
   DataStyle.updateStrokes(Logic.STROKE_FACTOR / logic.getViewBox().getWidth());
   map.invalidate();
 }
Exemplo n.º 4
0
 public EditState(
     Context context, Logic logic, TileLayerServer osmts, String imageFileName, BoundingBox box) {
   savedMode = logic.getMode();
   savedNodes = logic.getSelectedNodes();
   savedWays = logic.getSelectedWays();
   savedRelations = logic.getSelectedRelations();
   savedBug = logic.getSelectedBug();
   savedTileServerID = osmts.getId();
   savedOffsets = osmts.getOffsets();
   savedMinZoom = osmts.getMinZoomLevel();
   savedImageFileName = imageFileName;
   savedBox = box;
   savedLastComments = logic.getLastComments();
   savedLastSources = logic.getLastSources();
   savedTaskNotifications = Application.getTaskNotifications(context);
   savedOsmDataNotifications = Application.getOsmDataNotifications(context);
 }