/** * This will search for a specified address and return the found results * * @param address * @param maxResults number of results * @return a {@link GeoGraph} with maxResults many {@link GeoObj}s as specified */ public GeoGraph getLocationListForAddress(String address, int maxResults) { try { List<Address> addresses = myGeoCoder.getFromLocationName(address, maxResults); if (addresses.size() > 0) { GeoGraph result = new GeoGraph(); for (int i = 0; i < addresses.size(); i++) { result.add(new GeoObj(addresses.get(i))); } return result; } } catch (IOException e) { e.printStackTrace(); } return null; }
@Override public boolean addNodeToGraph(final GeoGraph targetGraph, GeoObj newNode) { newNode.setComp(getNodeMesh()); /* * its a geoObj so the diamond will automatically surrounded by a * mesh-group. change the color of this group: */ setNormalTransformations(newNode.getGraphicsComponent()); Log.d( LOG_TAG, "Adding obj " + newNode + " to graph with number of nodes=" + targetGraph.getAllItems().myLength); return targetGraph.add(newNode); }
@Override public boolean addFirstNodeToGraph(final GeoGraph targetGraph, GeoObj newNode) { newNode.setComp(getNodeMesh()); newNode.setComp(newProxiSensor(targetGraph)); setNormalTransformations(newNode.getGraphicsComponent()); Log.d(LOG_TAG, "First node will be added now.."); Log.d( LOG_TAG, "Adding obj " + newNode + " to graph with number of nodes=" + targetGraph.getAllItems().myLength); Log.d(LOG_TAG, "Setting special props for first node."); setHighlightNodeTransformations(newNode.getGraphicsComponent()); return targetGraph.add(newNode); }