|
Last change
on this file was 298, checked in by imi, 19 years ago |
- added license description to head of each source file
|
|
File size:
937 bytes
|
| Line | |
|---|
| 1 | // License: GPL. Copyright 2007 by Immanuel Scholz and others
|
|---|
| 2 | package org.openstreetmap.josm.data.conflict;
|
|---|
| 3 |
|
|---|
| 4 | import static org.openstreetmap.josm.tools.I18n.tr;
|
|---|
| 5 |
|
|---|
| 6 | import org.openstreetmap.josm.data.osm.Node;
|
|---|
| 7 | import org.openstreetmap.josm.data.osm.OsmPrimitive;
|
|---|
| 8 |
|
|---|
| 9 | public class PositionConflict extends ConflictItem {
|
|---|
| 10 |
|
|---|
| 11 | @Override public boolean hasConflict(OsmPrimitive key, OsmPrimitive value) {
|
|---|
| 12 | return key instanceof Node && !((Node)key).coor.equals(((Node)value).coor);
|
|---|
| 13 | }
|
|---|
| 14 |
|
|---|
| 15 | @Override protected String str(OsmPrimitive osm) {
|
|---|
| 16 | return osm instanceof Node ? ((Node)osm).coor.lat()+", "+((Node)osm).coor.lon() : null;
|
|---|
| 17 | }
|
|---|
| 18 |
|
|---|
| 19 | @Override public String key() {
|
|---|
| 20 | return "node|"+tr("position");
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | @Override public void apply(OsmPrimitive target, OsmPrimitive other) {
|
|---|
| 24 | if (target instanceof Node) {
|
|---|
| 25 | ((Node)target).coor = ((Node)other).coor;
|
|---|
| 26 | ((Node)target).eastNorth = ((Node)other).eastNorth;
|
|---|
| 27 | }
|
|---|
| 28 | }
|
|---|
| 29 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.