本文整理汇总了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();
}
示例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);
}
}
}
示例3: PrimitiveUserObject
import org.openstreetmap.josm.data.osm.PrimitiveId; //导入依赖的package包/类
public PrimitiveUserObject(PrimitiveId id, String label) {
this.id = id;
this.label = label;
}
示例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;
}
}
});
}
示例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;
}