Changeset 27750 in osm for applications/editors/josm
- Timestamp:
- 2012-02-12T07:08:03+01:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/utilsplugin2/src/utilsplugin2/dumbutils/ReplaceGeometryAction.java
r27710 r27750 54 54 OsmPrimitive firstObject = selection.get(0); 55 55 OsmPrimitive secondObject = selection.get(1); 56 56 57 try { 58 replace(firstObject, secondObject); 59 } catch (IllegalArgumentException ex) { 60 JOptionPane.showMessageDialog(Main.parent, 61 ex.getMessage(), TITLE, JOptionPane.INFORMATION_MESSAGE); 62 } 63 64 } 65 public void replace(OsmPrimitive firstObject, OsmPrimitive secondObject) { 57 66 if (firstObject instanceof Way && secondObject instanceof Way) { 58 67 replaceWayWithWay(Arrays.asList((Way) firstObject, (Way) secondObject)); 59 68 } else if (firstObject instanceof Node && secondObject instanceof Node) { 60 JOptionPane.showMessageDialog(Main.parent, 61 tr("To replace a node with a node, use the node merge tool."), 62 TITLE, JOptionPane.INFORMATION_MESSAGE); 63 return; 69 throw new IllegalArgumentException(tr("To replace a node with a node, use the node merge tool.")); 64 70 } else if (firstObject instanceof Node) { 65 71 replaceNode((Node) firstObject, secondObject); … … 67 73 replaceNode((Node) secondObject, firstObject); 68 74 } else { 69 JOptionPane.showMessageDialog(Main.parent, 70 tr("This tool can only replace a node with a way, a node with a multipolygon, or a way with a way."), 71 TITLE, JOptionPane.INFORMATION_MESSAGE); 72 return; 75 throw new IllegalArgumentException(tr("This tool can only replace a node with a way, a node with a multipolygon, or a way with a way.")); 73 76 } 74 77 }
Note:
See TracChangeset
for help on using the changeset viewer.