コード例 #1
0
 /**
  * Copies the tags of object to the clipboard. The output by this function looks similar to:
  * key=value\nkey=value
  *
  * @param source The OSM data layer source
  * @param primitives The OSM primitives to copy
  */
 public static void copy(OsmDataLayer source, Collection<OsmPrimitive> primitives) {
   Set<String> values = new TreeSet<>();
   for (OsmPrimitive p : primitives) {
     for (Entry<String, String> kv : p.getKeys().entrySet()) {
       values.add(new Tag(kv.getKey(), kv.getValue()).toString());
     }
   }
   if (!values.isEmpty()) Utils.copyToClipboard(Utils.join("\n", values));
 }
コード例 #2
0
ファイル: GeoImageLayer.java プロジェクト: codesman/josm
 public void copyCurrentPhotoPath() {
   if (data != null && !data.isEmpty() && currentPhoto >= 0 && currentPhoto < data.size()) {
     Utils.copyToClipboard(data.get(currentPhoto).getFile().toString());
   }
 }