Class NameVisitor
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.util.NameVisitor
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Direct Known Subclasses:
MultipleNameVisitor
public class NameVisitor extends Object implements OsmPrimitiveVisitor
Able to create a name and an icon for each data element.
-
-
Constructor Summary
Constructors Constructor Description NameVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
setIcon(OsmPrimitive p)
JLabel
toLabel()
Returns an horizontalJLabel
with icon and name.void
visit(Node n)
If the node has a name-key or id-key, this is displayed.void
visit(Relation e)
Visiting call for relations.void
visit(Way w)
If the way has a name-key or id-key, this is displayed.
-
-
-
Constructor Detail
-
NameVisitor
public NameVisitor()
-
-
Method Detail
-
setIcon
protected void setIcon(OsmPrimitive p)
-
visit
public void visit(Node n)
If the node has a name-key or id-key, this is displayed. If not, (lat,lon) is displayed.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
n
- The node to inspect.
-
visit
public void visit(Way w)
If the way has a name-key or id-key, this is displayed. If not, (x nodes) is displayed with x being the number of nodes in the way.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
w
- The way to inspect.
-
visit
public void visit(Relation e)
Description copied from interface:OsmPrimitiveVisitor
Visiting call for relations.- Specified by:
visit
in interfaceOsmPrimitiveVisitor
- Parameters:
e
- The relation to inspect.
-
-