List of usage examples for android.os Message Message
public Message()
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void activatePrefs() { // if (Navit.METHOD_DEBUG) Navit.my_func_name(0); activatePrefs(1);/*from w ww. ja va 2 s.com*/ if (p.PREF_save_zoomlevel) { // only if really started, but NOT if returning from our own child activities!! //System.out.println("3 restore zoom level: " + Navit.GlobalScaleLevel); //System.out.println("4 restore zoom level: " + PREF_zoomlevel_num); Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 33); b.putString("s", Integer.toString(p.PREF_zoomlevel_num)); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); Navit.GlobalScaleLevel = p.PREF_zoomlevel_num; //System.out.println("5 restore zoom level: " + PREF_zoomlevel_num); } catch (Exception e) { } } else { p.PREF_zoomlevel_num = Navit.GlobalScaleLevel; } // if (Navit.METHOD_DEBUG) Navit.my_func_name(1); }
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void set_TurnRestrictions_layers() { int on_ = 59; // on if (!p.PREF_show_turn_restrictions) { on_ = 60; // off }//from w w w . ja va2s . c o m Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", on_); b.putString("s", "TurnRestrictions"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); }
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void set_poi_layers() { int on_ = 59; int off_ = 60; // System.out.println("POI:1"); if (p.PREF_show_poi_on_map) { // System.out.println("POI:2"); on_ = 60;/*from w w w .j av a 2 s . co m*/ off_ = 59; } // toggle the normal POI layers (to avoid double POIs) Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", on_); b.putString("s", "POI Symbols"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); msg = new Message(); b = new Bundle(); b.putInt("Callback", on_); b.putString("s", "POI Labels"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // toggle full POI icons on/off msg = new Message(); b = new Bundle(); b.putInt("Callback", off_); b.putString("s", "Android-POI-Icons-full"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); msg = new Message(); b = new Bundle(); b.putInt("Callback", off_); b.putString("s", "Android-POI-Labels-full"); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); // draw_map(); }
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void activatePrefs(int dummy) { need_recalc_route = false; // do we need to recalc the route? // call some functions to activate the new settings if (p.PREF_follow_gps) { Navit.follow_current = Navit.follow_on; } else {/*from ww w . ja v a2s . c o m*/ Navit.follow_current = Navit.follow_off; } if (p.PREF_use_fast_provider) { NavitVehicle.turn_on_fast_provider(); } else { NavitVehicle.turn_off_fast_provider(); } if (p.PREF_show_sat_status) { NavitVehicle.turn_on_sat_status(); } else { // status always on ! // // NavitVehicle.turn_off_sat_status(); NavitVehicle.turn_on_sat_status(); } if (p.PREF_show_status_bar) { show_status_bar_wrapper(); } else { hide_status_bar_wrapper(); } if (p.PREF_allow_gui_internal) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 10); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 9); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } if (p.PREF_use_compass_heading_base) { // turn on compass msg_to_msg_handler(new Bundle(), 12); Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 11); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { // turn off compass msg_to_msg_handler(new Bundle(), 13); Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 12); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } if (p.PREF_show_maps_debug_view == true) { // show real gps pos Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 112); b.putString("s", "1"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 112); b.putString("s", "0"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } if (p.PREF_show_real_gps_pos == 1) { // show real gps pos Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 111); b.putString("s", "1"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 111); b.putString("s", "0"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } // search radius for housenumbers near streets ----------------- Message msg43 = new Message(); Bundle b43 = new Bundle(); b43.putInt("Callback", 89); b43.putString("s", "1500"); msg43.setData(b43); try { NavitGraphics.callback_handler.sendMessage(msg43); } catch (Exception e) { } // search radius for housenumbers near streets ----------------- // set routing profile ----------------- if (Navit_Largemap_DonateVersion_Installed == true) { Message msg43a = new Message(); Bundle b43a = new Bundle(); b43a.putInt("Callback", 90); b43a.putString("s", p.PREF_routing_profile); // set routing profile msg43a.setData(b43a); try { NavitGraphics.callback_handler.sendMessage(msg43a); } catch (Exception e) { } // need_recalc_route = true; } // set routing profile ----------------- Message msg99a = new Message(); Bundle b99a = new Bundle(); b99a.putInt("Callback", 98); // System.out.println("tracking_connected_pref=" + PREF_tracking_connected_pref); b99a.putString("s", "" + p.PREF_tracking_connected_pref); // set routing profile msg99a.setData(b99a); try { NavitGraphics.callback_handler.sendMessage(msg99a); } catch (Exception e) { } msg99a = new Message(); b99a = new Bundle(); b99a.putInt("Callback", 99); // System.out.println("tracking_angle_pref=" + PREF_tracking_angle_pref); b99a.putString("s", "" + p.PREF_tracking_angle_pref); // set routing profile msg99a.setData(b99a); try { NavitGraphics.callback_handler.sendMessage(msg99a); } catch (Exception e) { } // change road profile ----------------- if (Navit_Largemap_DonateVersion_Installed == true) { if (p.PREF_routing_profile.equals("bike-normal")) { Message msg43b = new Message(); Bundle b43b = new Bundle(); b43b.putInt("Callback", 91); System.out.println("road_priority_001=" + p.PREF_road_priority_001); b43b.putString("s", "" + p.PREF_road_priority_001); // set routing profile msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 92); System.out.println("road_priority_002=" + p.PREF_road_priority_002); b43b.putString("s", "" + p.PREF_road_priority_002); // set routing profile msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 93); System.out.println("road_priority_003=" + p.PREF_road_priority_003); b43b.putString("s", "" + p.PREF_road_priority_003); // set routing profile msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 94); System.out.println("road_priority_004=" + p.PREF_road_priority_004); b43b.putString("s", "" + p.PREF_road_priority_004); // set routing profile msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch off layers -------------------- msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 60); b43b.putString("s", "POI traffic lights"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch off layers -------------------- // switch ON layers -------------------- msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 59); b43b.putString("s", "POI bicycle"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch ON layers -------------------- } else { // switch off layers -------------------- Message msg43b = new Message(); Bundle b43b = new Bundle(); b43b.putInt("Callback", 60); b43b.putString("s", "POI bicycle"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch off layers -------------------- // switch ON layers -------------------- msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 59); b43b.putString("s", "POI traffic lights"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch ON layers -------------------- } } else { // switch off layers -------------------- Message msg43b = new Message(); Bundle b43b = new Bundle(); b43b.putInt("Callback", 60); b43b.putString("s", "POI bicycle"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch off layers -------------------- // switch ON layers -------------------- msg43b = new Message(); b43b = new Bundle(); b43b.putInt("Callback", 59); b43b.putString("s", "POI traffic lights"); msg43b.setData(b43b); try { NavitGraphics.callback_handler.sendMessage(msg43b); } catch (Exception e) { } // switch ON layers -------------------- } // change road profile ----------------- // -- debug -- change some prio weights -- // if ((!p.PREF_routing_profile.equals("bike-normal")) && (!p.PREF_routing_profile.equals("bike-no-oneway")) && (!p.PREF_routing_profile.equals("bike-avoid-roads"))) // { // Message msg93 = new Message(); // Bundle b93 = new Bundle(); // b93.putInt("Callback", 110); // b93.putString("s", "street_1_city#route_prio_weight:" + p.PREF_road_prio_weight_street_1_city); // msg93.setData(b93); // try // { // NavitGraphics.callback_handler.sendMessage(msg93); // } // catch (Exception e) // { // } // // if (p_old.PREF_road_prio_weight_street_1_city != p.PREF_road_prio_weight_street_1_city) // { // need_recalc_route = true; // } // } // -- debug -- change some prio weights -- if (NavitGraphics.navit_route_status == 0) { if (p.PREF_c_linedrawing) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 85); b.putString("s", "1"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 85); b.putString("s", "0"); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } } Message msg33 = new Message(); Bundle b33 = new Bundle(); b33.putInt("Callback", 103); if (p.PREF_show_vehicle_in_center) { b33.putString("s", "0"); } else { b33.putString("s", "" + NavitGraphics.lower_than_center_percent); } msg33.setData(b33); try { NavitGraphics.callback_handler.sendMessage(msg33); } catch (Exception e88) { } if (p.PREF_use_imperial) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 16); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 15); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } if (p.PREF_show_debug_messages) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 24); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 25); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } // if (PREF_show_3d_map) // { // Message msg = new Message(); // Bundle b = new Bundle(); // b.putInt("Callback", 31); // msg.setData(b); // try // { // N_NavitGraphics.callback_handler.sendMessage(msg); // } // catch (Exception e) // { // } // } // else // { // Message msg = new Message(); // Bundle b = new Bundle(); // b.putInt("Callback", 30); // msg.setData(b); // try // { // N_NavitGraphics.callback_handler.sendMessage(msg); // } // catch (Exception e) // { // } // } if (p.PREF_use_lock_on_roads) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 36); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 37); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } // if (PREF_draw_polyline_circles) // { // Message msg = new Message(); // Bundle b = new Bundle(); // b.putString("s", "0"); // b.putInt("Callback", 56); // msg.setData(b); // try // { // N_NavitGraphics.callback_handler.sendMessage(msg); // } // catch (Exception e) // { // } // } // else // { // Message msg = new Message(); // Bundle b = new Bundle(); // b.putString("s", "1"); // b.putInt("Callback", 56); // msg.setData(b); // try // { // N_NavitGraphics.callback_handler.sendMessage(msg); // } // catch (Exception e) // { // } // } if (p.PREF_use_route_highways) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 42); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 43); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } Message msg7 = new Message(); Bundle b7 = new Bundle(); b7.putInt("Callback", 57); b7.putString("s", "" + p.PREF_drawatorder); msg7.setData(b7); try { NavitGraphics.callback_handler.sendMessage(msg7); } catch (Exception e) { } msg7 = new Message(); b7 = new Bundle(); b7.putInt("Callback", 58); b7.putString("s", p.PREF_streetsearch_r); msg7.setData(b7); try { NavitGraphics.callback_handler.sendMessage(msg7); } catch (Exception e) { } if (p.PREF_speak_street_names) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 54); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } else { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 53); msg.setData(b); try { NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } } try { NavitGraphics.OverlayDrawThread_cancel_drawing_timeout = NavitGraphics.OverlayDrawThread_cancel_drawing_timeout__options[p.PREF_cancel_map_drawing_timeout]; NavitGraphics.OverlayDrawThread_cancel_thread_sleep_time = NavitGraphics.OverlayDrawThread_cancel_thread_sleep_time__options[p.PREF_cancel_map_drawing_timeout]; NavitGraphics.OverlayDrawThread_cancel_thread_timeout = NavitGraphics.OverlayDrawThread_cancel_thread_timeout__options[p.PREF_cancel_map_drawing_timeout]; } catch (Exception e) { } // route variant Message msg67 = new Message(); Bundle b67 = new Bundle(); // turn off 1 b67.putInt("Callback", 60); b67.putString("s", "route_001"); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // turn off 2 msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 60); b67.putString("s", "route_002"); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // turn off 3 msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 60); b67.putString("s", "route_003"); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // turn on the wanted route style msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 59); b67.putString("s", "route_00" + p.PREF_route_style); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // route variant // show route rectanlges ----- if (p.PREF_show_route_rects) { msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 76); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } } else { msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 77); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } } // show route rectanlges ----- // show route multipolygons ----- if (p.PREF_show_multipolygons) { msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 66); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } } else { msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 67); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } } // show route multipolygons ----- // traffic lights delay ---- msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 79); //System.out.println("traffic lights delay:" + PREF_trafficlights_delay); // (PREF_trafficlights_delay / 10) seconds delay for each traffic light b67.putString("s", p.PREF_trafficlights_delay); // (delay in 1/10 of a second) msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // traffic lights delay ---- // avoid sharp turns ---- msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 86); b67.putString("s", p.PREF_avoid_sharp_turns); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 87); b67.putString("s", "47"); // **DANGER** sharp turn max angle hardcoded here!! **DANGER** msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 88); b67.putString("s", "6000"); msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // avoid sharp turns ---- // autozoom flag ---- msg67 = new Message(); b67 = new Bundle(); b67.putInt("Callback", 80); if (p.PREF_autozoom_flag) { b67.putString("s", "1"); // (0 or 1) } else { b67.putString("s", "0"); // (0 or 1) } msg67.setData(b67); try { NavitGraphics.callback_handler.sendMessage(msg67); } catch (Exception e) { } // autozoom flag ---- if ((Navit.Navit_Largemap_DonateVersion_Installed) || (Navit.Navit_DonateVersion_Installed)) { // use pref } else { p.PREF_roadspeed_warning = false; } if ((Navit.Navit_Largemap_DonateVersion_Installed) || (Navit.Navit_DonateVersion_Installed)) { // use pref } else { p.PREF_lane_assist = false; } if (p.PREF_streets_only) { // ----------------------- streets only pref ------------------- // 59 -> enable // 60 -> disable Message msg31 = new Message(); Bundle b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "polygons001"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "polygons"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "POI Symbols"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "POI Labels"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "Android-POI-Icons-full"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "Android-POI-Labels-full"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets_1"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets_2"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets_1_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets_2_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); // ----------------------- streets only pref ------------------- } else { // ----------------------- streets only pref ------------------- // 59 -> enable // 60 -> disable Message msg31 = new Message(); Bundle b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "polygons001"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "polygons"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "POI Symbols"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "POI Labels"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "Android-POI-Icons-full"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "Android-POI-Labels-full"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets_1"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 59); b31.putString("s", "streets_2"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets_1_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); msg31 = new Message(); b31 = new Bundle(); b31.putInt("Callback", 60); b31.putString("s", "streets_2_STR_ONLY"); msg31.setData(b31); NavitGraphics.callback_handler.sendMessage(msg31); // ----------------------- streets only pref ------------------- } // ---------- set traffic factor for road speeds ------------ try { Message msg_ss1 = new Message(); Bundle b_ss1 = new Bundle(); b_ss1.putInt("Callback", 106); b_ss1.putString("s", Integer.toString(p.PREF_traffic_speed_factor)); msg_ss1.setData(b_ss1); NavitGraphics.callback_handler.sendMessage(msg_ss1); } catch (Exception e) { } // ---------- set traffic factor for road speeds ------------ // ------- PREF_show_poi_on_map --------------------------------- set_poi_layers(); // ------- PREF_show_poi_on_map --------------------------------- set_TurnRestrictions_layers(); // set vars for mapdir change (only really takes effect after restart!) getPrefs_mapdir(); if (need_recalc_route) { recalculate_route(); need_recalc_route = false; } }
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void activatePrefs_mapdir(Boolean at_startup) { // if (Navit.METHOD_DEBUG) Navit.my_func_name(0); // activate the new directory NavitDataDirectory_Maps = sanity_check_maps_dir(NavitDataDirectory_Maps); MAP_FILENAME_PATH = NavitDataDirectory_Maps; MAPMD5_FILENAME_PATH = NavitDataDirectory_Maps + "/../md5/"; CFG_FILENAME_PATH = NavitDataDirectory_Maps + "/../"; NAVIT_DATA_DEBUG_DIR = CFG_FILENAME_PATH + "../debug/"; //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); //System.out.println("xxxxxxxx************XXXXXXXXXXX"); Handler h_temp = null;// w w w .j a v a2 s .c om h_temp = NavitGraphics.callback_handler_s; //System.out.println("handler 1=" + h_temp.toString()); Message msg1 = new Message(); Bundle b1 = new Bundle(); b1.putInt("Callback", 47); b1.putString("s", MAP_FILENAME_PATH); msg1.setData(b1); h_temp.sendMessage(msg1); if (!at_startup) { Message msg2 = new Message(); Bundle b2 = new Bundle(); b2.putInt("Callback", 18); msg2.setData(b2); h_temp.sendMessage(msg2); } // if (Navit.METHOD_DEBUG) Navit.my_func_name(1); }
From source file:com.zoffcc.applications.zanavi.Navit.java
private static void activatePrefs_mapcache() { // if (Navit.METHOD_DEBUG) Navit.my_func_name(0); Handler h_temp2 = null;/*from w ww . ja v a 2 s . c o m*/ h_temp2 = NavitGraphics.callback_handler_s; System.out.println("activatePrefs_mapcache " + NavitGraphics.callback_handler_s); Message msg7 = new Message(); Bundle b7 = new Bundle(); b7.putInt("Callback", 55); b7.putString("s", String.valueOf(p.PREF_mapcache * 1024)); msg7.setData(b7); h_temp2.sendMessage(msg7); // if (Navit.METHOD_DEBUG) Navit.my_func_name(1); }
From source file:com.zoffcc.applications.zanavi.Navit.java
public void zoom_out_full() { // if (Navit.METHOD_DEBUG) Navit.my_func_name(0); System.out.println(""); System.out.println("*** Zoom out FULL ***"); System.out.println(""); Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 8); msg.setData(b);//w w w .java2 s.c o m NavitGraphics.callback_handler.sendMessage(msg); // if (Navit.METHOD_DEBUG) Navit.my_func_name(1); }
From source file:com.zoffcc.applications.zanavi.Navit.java
public static void zoom_to_route() { try {/*ww w . j a v a 2s .c om*/ //System.out.println(""); //System.out.println("*** Zoom to ROUTE ***"); //System.out.println(""); Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 17); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); set_map_position_to_screen_center(); } catch (Exception e) { } }
From source file:com.zoffcc.applications.zanavi.Navit.java
static void set_map_position_to_screen_center() { try {//from w w w. jav a 2s . co m Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 51); if (Navit.GFX_OVERSPILL) { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getWidth() / 2) + NavitGraphics.mCanvasWidth_overspill))); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * ((Navit.NG__map_main.view.getHeight() / 2) + NavitGraphics.mCanvasHeight_overspill))); } else { b.putInt("x", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getWidth() / 2)); b.putInt("y", (int) (NavitGraphics.Global_dpi_factor * Navit.NG__map_main.view.getHeight() / 2)); } msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); } catch (Exception e) { } }
From source file:com.zoffcc.applications.zanavi.Navit.java
public static void write_route_to_gpx_file() { final Thread write_route_to_gpx_file_001 = new Thread() { int wait = 1; int count = 0; int max_count = 300; // wait 2 minutes for route to be calculated @Override// w w w . ja v a 2 s .c o m public void run() { while (wait == 1) { try { if ((NavitGraphics.navit_route_status == 17) || (NavitGraphics.navit_route_status == 33)) { Message msg = new Message(); Bundle b = new Bundle(); b.putInt("Callback", 96); String date = new SimpleDateFormat("yyyy-MM-dd_HHmmss", Locale.GERMAN) .format(new Date()); String filename = Navit.NAVIT_DATA_DEBUG_DIR + "zanavi_route_" + date + ".gpx"; b.putString("s", filename); System.out.println("Debug:" + "file=" + filename); msg.setData(b); NavitGraphics.callback_handler.sendMessage(msg); Message msg7 = Navit_progress_h.obtainMessage(); Bundle b7 = new Bundle(); msg7.what = 2; // long Toast message b7.putString("text", Navit.get_text("saving route to GPX-file") + " " + filename); //TRANS msg7.setData(b7); Navit_progress_h.sendMessage(msg7); wait = 0; } else { wait = 1; } count++; if (count > max_count) { wait = 0; Message msg7 = Navit_progress_h.obtainMessage(); Bundle b7 = new Bundle(); msg7.what = 2; // long Toast message b7.putString("text", Navit.get_text("saving route to GPX-file failed")); //TRANS msg7.setData(b7); Navit_progress_h.sendMessage(msg7); } else { Thread.sleep(400); } } catch (Exception e) { } } } }; write_route_to_gpx_file_001.start(); }