org.openstreetmap.josm.data.validation.util
Class NameVisitor

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.util.NameVisitor
All Implemented Interfaces:
Visitor
Direct Known Subclasses:
MultipleNameVisitor

public class NameVisitor
extends AbstractVisitor

Able to create a name and an icon for each data element.


Field Summary
 java.lang.String className
          The name of the item class
 java.lang.String classNamePlural
           
 javax.swing.Icon icon
          The icon of this item.
 java.lang.String name
          The name of this item.
 
Constructor Summary
NameVisitor()
           
 
Method Summary
 javax.swing.JLabel toLabel()
           
 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.
 
Methods inherited from class org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
visit
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

className

public java.lang.String className
The name of the item class


classNamePlural

public java.lang.String classNamePlural

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

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.

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.

Parameters:
w - The way to inspect.

visit

public void visit(Relation e)
Description copied from interface: Visitor
Visiting call for relations.

Parameters:
e - The relation to inspect.

toLabel

public javax.swing.JLabel toLabel()


JOSM