1 | // License: GPL. For details, see LICENSE file.
|
---|
2 | package org.openstreetmap.josm.gui;
|
---|
3 |
|
---|
4 | import org.openstreetmap.josm.data.osm.INode;
|
---|
5 | import org.openstreetmap.josm.data.osm.IRelation;
|
---|
6 | import org.openstreetmap.josm.data.osm.IWay;
|
---|
7 |
|
---|
8 | /**
|
---|
9 | * Hooks that allow correcting the name of a OSM primitive
|
---|
10 | * @see DefaultNameFormatter
|
---|
11 | */
|
---|
12 | public interface NameFormatterHook {
|
---|
13 |
|
---|
14 | /**
|
---|
15 | * Check the relation type name. Return the corrected type name if needed, null otherwise.
|
---|
16 | * @param relation The relation.
|
---|
17 | * @param defaultName The default name generated by core.
|
---|
18 | * @return The corrected type name if needed, null otherwise.
|
---|
19 | */
|
---|
20 | String checkRelationTypeName(IRelation relation, String defaultName);
|
---|
21 |
|
---|
22 | /**
|
---|
23 | * Check the node format. Return the corrected format if needed, null otherwise.
|
---|
24 | * @param node The node.
|
---|
25 | * @param defaultName The default name generated by core.
|
---|
26 | * @return The corrected format if needed, null otherwise.
|
---|
27 | */
|
---|
28 | String checkFormat(INode node, String defaultName);
|
---|
29 |
|
---|
30 | /**
|
---|
31 | * Check the way format. Return the corrected format if needed, null otherwise.
|
---|
32 | * @param way The way.
|
---|
33 | * @param defaultName The default name generated by core.
|
---|
34 | * @return The corrected format if needed, null otherwise.
|
---|
35 | */
|
---|
36 | String checkFormat(IWay way, String defaultName);
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Check the relation format. Return the corrected format if needed, null otherwise.
|
---|
40 | * @param relation The relation.
|
---|
41 | * @param defaultName The default name generated by core.
|
---|
42 | * @return The corrected format if needed, null otherwise.
|
---|
43 | */
|
---|
44 | String checkFormat(IRelation relation, String defaultName);
|
---|
45 | }
|
---|