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


Java BasicMapPanel类代码示例

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


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

示例1: createMapView

import com.bbn.openmap.gui.BasicMapPanel; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected IView<JComponent> createMapView(IMapViewDescriptor viewDescriptor, IActionHandler actionHandler,
                                          Locale locale) {
  BasicMapPanel viewComponent = createMapView();
  MapBean mapBean = viewComponent.getMapBean();
  mapBean.setScale(100000);

  MapHandler mapHandler = viewComponent.getMapHandler();
  // Add navigation tools over the map
  mapHandler.add(new EmbeddedNavPanel());
  // Add scale display widget over the map
  mapHandler.add(new EmbeddedScaleDisplayPanel());
  // Add MouseDelegator, which handles mouse modes (managing mouse
  // events)
  mapHandler.add(new MouseDelegator());
  // Add OMMouseMode, which handles how the map reacts to mouse
  // movements
  mapHandler.add(new OMMouseMode());

  mapHandler.add(new LayerHandler());
  MapTileLayer mapTileLayer = new MapTileLayer();
  Properties tileProperties = new Properties();
  tileProperties.setProperty("rootDir", "http://c.tile.openstreetmap.org/");
  mapTileLayer.setProperties(tileProperties);
  mapTileLayer.setVisible(true);

  mapHandler.add(mapTileLayer);

  IModelDescriptor modelDescriptor = viewDescriptor.getModelDescriptor();
  String connectorId;
  if (modelDescriptor instanceof IPropertyDescriptor) {
    connectorId = modelDescriptor.getName();
  } else {
    connectorId = ModelRefPropertyConnector.THIS_PROPERTY;
  }
  IValueConnector connector = new JMapViewConnector(connectorId, mapBean, viewDescriptor.getMapContentProperty());
  IView<JComponent> view = constructView(viewComponent, viewDescriptor, connector);
  return view;
}
 
开发者ID:jspresso,项目名称:jspresso-ce,代码行数:43,代码来源:DefaultSwingViewFactory.java

示例2: configureMapPanel

import com.bbn.openmap.gui.BasicMapPanel; //导入依赖的package包/类
protected void configureMapPanel(PropertyHandler propertyHandler) {
    BasicMapPanel basicMapPanel = new BasicMapPanel(propertyHandler, true);
    // Creates the components in the main application thread. If any of
    // these components need to update their GUI, they should hand a
    // Runnable object to the SwingUtilities.invokeLater(Runnable) method,
    // and it will be updated accordingly.
    basicMapPanel.create();
    mapPanel = basicMapPanel;
}
 
开发者ID:d2fn,项目名称:passage,代码行数:10,代码来源:OpenMap.java


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