当前位置: 首页>>代码示例>>Java>>正文


Java PreferencesFacade类代码示例

本文整理汇总了Java中org.mapsforge.map.model.common.PreferencesFacade的典型用法代码示例。如果您正苦于以下问题:Java PreferencesFacade类的具体用法?Java PreferencesFacade怎么用?Java PreferencesFacade使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


PreferencesFacade类属于org.mapsforge.map.model.common包,在下文中一共展示了PreferencesFacade类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: MapPanel

import org.mapsforge.map.model.common.PreferencesFacade; //导入依赖的package包/类
public MapPanel() {
    mapView = createMapView();
    String MapPath = SimulatorMain.prefs.get("loadedMap", "");
    try {
        addLayers(mapView, MapPath);
    } catch (Exception e) {

        e.printStackTrace();
    }
    PreferencesFacade preferencesFacade = new JavaPreferences(Preferences.userNodeForPackage(MapView.class));
    final Model model = mapView.getModel();
    model.init(preferencesFacade);

    this.setPreferredSize(new Dimension(610, 610));
    this.setBorder(BorderFactory.createTitledBorder("Map"));
    mapView.setPreferredSize(new Dimension(600, 500));
    this.add(mapView);
    mapView.setVisible(true);
    Button pushButton2 = new Button("Load Map");
    add(pushButton2);
    pushButton2.addActionListener(this); // listen for Button press

    LatLong pos = new LatLong(SimulatorMain.prefs.getDouble("lat", 0), SimulatorMain.prefs.getDouble("lon", 0));
    GPSData.setLatitude(pos.getLatitude());
    GPSData.setLongitude(pos.getLongitude());
    model.mapViewPosition.setCenter(pos);
    model.mapViewPosition.setZoomLevel((byte) SimulatorMain.prefs.getInt("zoom", 16));


    final GpsEventHelper eventHelper = new GpsEventHelper();
    GPSData.addChangeListener(new GPSDataListener() {

        @Override
        public void valueChanged() {
            eventHelper.newGpsPos(GPSData.getLatitude(), GPSData.getLongitude(), true,
                    GPSData.getAltitude(), GPSData.getSpeed()*3.6, GPSData.getCourse(),
                    (float) GPSData.getQuality());
        }
    });
}
 
开发者ID:Longri,项目名称:cachebox3.0,代码行数:41,代码来源:MapPanel.java

示例2: WindowCloseDialog

import org.mapsforge.map.model.common.PreferencesFacade; //导入依赖的package包/类
public WindowCloseDialog(JFrame jFrame, MapView mapView, PreferencesFacade preferencesFacade) {
	super();

	this.jFrame = jFrame;
	this.mapView = mapView;
	this.preferencesFacade = preferencesFacade;

	jFrame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
}
 
开发者ID:ianmalcolm,项目名称:DeadReckoning,代码行数:10,代码来源:WindowCloseDialog.java

示例3: initializeMapView

import org.mapsforge.map.model.common.PreferencesFacade; //导入依赖的package包/类
/**
 * initializes the map view
 *
 * @param mapView the map view
 */
protected void initializeMapView(MapView mapView, PreferencesFacade preferences) {
    mapView.getModel().init(preferences);
    mapView.setClickable(true);
    mapView.getMapScaleBar().setVisible(true);
}
 
开发者ID:monossido,项目名称:CoopTDMOrienteering,代码行数:11,代码来源:MapsActivity.java


注:本文中的org.mapsforge.map.model.common.PreferencesFacade类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。