Class NameVisitor
- java.lang.Object
-
- org.openstreetmap.josm.data.validation.util.NameVisitor
-
- All Implemented Interfaces:
OsmPrimitiveVisitor
- Direct Known Subclasses:
MultipleNameVisitor
public class NameVisitor extends java.lang.Object implements OsmPrimitiveVisitor
Able to create a name and an icon for each data element.
-
-
Field Summary
Fields Modifier and Type Field Description java.lang.StringclassNameThe name of the item classjava.lang.StringclassNamePluralThe plural name of the item classjavax.swing.IconiconThe icon of this item.java.lang.StringnameThe name of this item.
-
Constructor Summary
Constructors Constructor Description NameVisitor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidsetIcon(OsmPrimitive p)javax.swing.JLabeltoLabel()Returns an horizontalJLabelwith icon and name.voidvisit(Node n)If the node has a name-key or id-key, this is displayed.voidvisit(Relation e)Visiting call for relations.voidvisit(Way w)If the way has a name-key or id-key, this is displayed.
-
-
-
Field Detail
-
className
public java.lang.String className
The name of the item class
-
classNamePlural
public java.lang.String classNamePlural
The plural name of the item class
-
name
public java.lang.String name
The name of this item.
-
icon
public javax.swing.Icon icon
The icon of this item.
-
-
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:
visitin 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:
visitin interfaceOsmPrimitiveVisitor- Parameters:
w- The way to inspect.
-
visit
public void visit(Relation e)
Description copied from interface:OsmPrimitiveVisitorVisiting call for relations.- Specified by:
visitin interfaceOsmPrimitiveVisitor- Parameters:
e- The relation to inspect.
-
toLabel
public javax.swing.JLabel toLabel()
Returns an horizontalJLabelwith icon and name.- Returns:
- horizontal
JLabelwith icon and name
-
-