コード例 #1
0
ファイル: TestError.java プロジェクト: kuny/josm
 @Override
 public void primitivesRemoved(PrimitivesRemovedEvent event) {
   // Remove purged primitives (fix #8639)
   try {
     primitives.removeAll(event.getPrimitives());
   } catch (UnsupportedOperationException e) {
     if (event.getPrimitives().containsAll(primitives)) {
       primitives = Collections.emptyList();
     } else {
       Main.warn("Unable to remove primitives from " + this);
     }
   }
 }
コード例 #2
0
  @Override
  public void primitivesRemoved(PrimitivesRemovedEvent event) {
    List<? extends OsmPrimitive> prims = event.getPrimitives();
    for (OsmPrimitive p : prims) {
      // TODO: use hashmap
      for (SimpleMatch c : matches) {
        if (c.getReferenceObject().equals(p) || c.getSubjectObject().equals(p)) {
          matches.remove(c);
          break;
        }
      }

      referenceOnlyListModel.removeElement(p);
      subjectOnlyListModel.removeElement(p);
    }
  }