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


Java PrimitiveId类代码示例

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


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

示例1: fileChosen

import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
public void fileChosen(String[] fileString) {
	Set<PrimitiveId> prims0 = new HashSet<>();
	frame.getContentPane().removeAll();
	frame.getContentPane().invalidate();
	frame.getContentPane().add(panel);
	frame.getContentPane().revalidate();
	builder = new RelationsBuilder(fileString);
	for (SingleRelationBuilder rel : builder.getRelations()) {
		prims0.addAll(rel.getNecessaryPrimitives());
	}
	for(Long id1 : builder.getNecessaryRelations()) {
		PrimitiveId ggg = new SimplePrimitiveId(id1,
				OsmPrimitiveType.RELATION);
		prims0.add(ggg);
	}
	List <PrimitiveId> lis = new ArrayList<>();
	lis.addAll(prims0);
	DownloadNecessaryObjectsZtmToOsm dd = new DownloadNecessaryObjectsZtmToOsm(false, lis, false, false, "",
			null, this);
	dd.run();
}
 
开发者ID:ztmtoosm,项目名称:easy-routes,代码行数:22,代码来源:ZtmToOsmAction.java

示例2: onLoadTrackNodes

import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
void onLoadTrackNodes() {
	trackNodes = new ArrayList<Node>();
	for(long x : track) {
		PrimitiveId pid = new SimplePrimitiveId(x, OsmPrimitiveType.NODE);
		Node n = (Node) Main.main.getCurrentDataSet().getPrimitiveById(pid);
		if(n!=null) {
			trackNodes.add(n);
		}
	}
	
}
 
开发者ID:ztmtoosm,项目名称:easy-routes,代码行数:12,代码来源:SingleRelationBuilder.java

示例3: PrimitiveUserObject

import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
public PrimitiveUserObject(PrimitiveId id, String label) {
    this.id = id;
    this.label = label;
}
 
开发者ID:STEMLab,项目名称:JOSM-IndoorEditor,代码行数:5,代码来源:FloorsFilterDialog.java

示例4: GeoJsonDialog

import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
/**
 * Create the dialog. Wire the map and the list together so clicks on one selects the other.
 */
public GeoJsonDialog() {

    super("GeoJson object list", "activate-geojson", "Opens the GeoJson object list pane", null, 150);
    this.panel = new JPanel(new BorderLayout());
    this.panel.setName("GeoJson object list");
    add(this.panel, BorderLayout.CENTER);

    this.listModel = new DefaultListModel<>();
    final JList<PrintablePrimitive> list = new JList<>(listModel);
    this.panel.add(new JScrollPane(list), BorderLayout.CENTER);

    this.indexToIdentifier = new HashMap<>();
    this.identifierToIndex = new HashMap<>();

    list.addListSelectionListener(new ListSelectionListener() {
        @Override
        public void valueChanged(final ListSelectionEvent listSelectionEvent) {
            if (stopProcessingCallbacks) {
                return;
            }
            try {
                stopProcessingCallbacks = true;
                final JList<?> selectionModel = (JList<?>) listSelectionEvent.getSource();
                final int selectedIndex = selectionModel.getMinSelectionIndex();
                final PrimitiveId identifier = indexToIdentifier.get(selectedIndex);
                layer.data.setSelected(identifier);
                zoomTo(layer.data.getPrimitiveById(identifier));
            } finally {
                stopProcessingCallbacks = false;
            }
        }
    });
    // The listener for clicks on the map
    DataSet.addSelectionListener(new SelectionChangedListener() {
        @Override
        public void selectionChanged(final Collection<? extends OsmPrimitive> selection) {
            if (stopProcessingCallbacks) {
                return;
            }
            try {
                stopProcessingCallbacks = true;
                for (final OsmPrimitive feature : selection) {
                    if (identifierToIndex.containsKey(feature.getPrimitiveId())) {
                        final int idx = identifierToIndex.get(feature.getPrimitiveId());
                        list.setSelectedIndices(new int[]{idx});
                        list.ensureIndexIsVisible(idx);
                        break;
                    }
                }
            } finally {
                stopProcessingCallbacks = false;
            }
        }
    });
}
 
开发者ID:JOSM,项目名称:geojson,代码行数:59,代码来源:GeoJsonDialog.java

示例5: DownloadNecessaryObjectsZtmToOsm

import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
public DownloadNecessaryObjectsZtmToOsm(boolean newLayer, List<PrimitiveId> ids, boolean downloadReferrers,
           boolean full, String newLayerName, ProgressMonitor monitor, ZtmToOsmAction xxx) {
	super(newLayer, ids, downloadReferrers, full, newLayerName, monitor);
	this.xxx=xxx;
}
 
开发者ID:ztmtoosm,项目名称:easy-routes,代码行数:6,代码来源:DownloadNecessaryObjectsZtmToOsm.java


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