public void setMiscState(Main main, Logic logic) { main.setImageFileName(savedImageFileName); logic.setLastComments(savedLastComments); logic.setLastSources(savedLastSources); Application.setTaskNotifications(main, savedTaskNotifications); Application.setOsmDataNotifications(main, savedOsmDataNotifications); }
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); }
/** Implicit assumption that the list will be short and that it is OK to read in synchronously */ DiscardedTags() { Log.d("DiscardedTags", "Parsing configuration file"); AssetManager assetManager = Application.getCurrentApplication().getAssets(); try { InputStream is = assetManager.open("discarded.json"); JsonReader reader = new JsonReader(new InputStreamReader(is, "UTF-8")); try { try { reader.beginArray(); while (reader.hasNext()) { redundantTags.add(reader.nextString()); } reader.endArray(); Log.d("DiscardedTags", "Found " + redundantTags.size() + " tags."); } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } } finally { reader.close(); } } catch (IOException e) { // TODO Auto-generated catch block e.printStackTrace(); } }
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); }