org.openstreetmap.josm.data.validation
Class TestError.PaintVisitor

java.lang.Object
  extended by org.openstreetmap.josm.data.osm.visitor.AbstractVisitor
      extended by org.openstreetmap.josm.data.validation.TestError.PaintVisitor
All Implemented Interfaces:
Visitor, ValidatorVisitor
Enclosing class:
TestError

 class TestError.PaintVisitor
extends AbstractVisitor
implements ValidatorVisitor

Visitor that highlights the primitives affected by this error


Field Summary
private  java.awt.Graphics g
          The graphics
private  MapView mv
          The MapView
 
Constructor Summary
TestError.PaintVisitor(java.awt.Graphics g, MapView mv)
          Constructor
 
Method Summary
 void drawNode(Node n, java.awt.Color color)
          Draws a circle around the node
 void drawSegment(Node n1, Node n2, java.awt.Color color)
          Draws a line around the segment
 void drawSegment(java.awt.Point p1, java.awt.Point p2, java.awt.Color color)
           
protected  boolean isNodeVisible(Node n)
          Checks if the given node is in the visible area.
protected  boolean isSegmentVisible(Node n1, Node n2)
          Checks if the given segment is in the visible area.
 void visit(java.util.List<Node> nodes)
           
 void visit(Node n)
          Draw a small rectangle.
 void visit(OsmPrimitive p)
           
 void visit(Relation r)
          Visiting call for relations.
 void visit(Way w)
          Visiting call for lines.
 void visit(WaySegment ws)
           
 
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

g

private final java.awt.Graphics g
The graphics


mv

private final MapView mv
The MapView

Constructor Detail

TestError.PaintVisitor

public TestError.PaintVisitor(java.awt.Graphics g,
                              MapView mv)
Constructor

Parameters:
g - The graphics
mv - The Mapview
Method Detail

visit

public void visit(OsmPrimitive p)
Specified by:
visit in interface ValidatorVisitor

drawNode

public void drawNode(Node n,
                     java.awt.Color color)
Draws a circle around the node

Parameters:
n - The node
color - The circle color

drawSegment

public void drawSegment(java.awt.Point p1,
                        java.awt.Point p2,
                        java.awt.Color color)

drawSegment

public void drawSegment(Node n1,
                        Node n2,
                        java.awt.Color color)
Draws a line around the segment

Parameters:
s - The segment
color - The color

visit

public void visit(Node n)
Draw a small rectangle. White if selected (as always) or red otherwise.

Specified by:
visit in interface Visitor
Parameters:
n - The node to draw.

visit

public void visit(Way w)
Description copied from interface: Visitor
Visiting call for lines.

Specified by:
visit in interface Visitor
Parameters:
w - The way to inspect.

visit

public void visit(WaySegment ws)
Specified by:
visit in interface ValidatorVisitor

visit

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

Specified by:
visit in interface Visitor
Parameters:
r - The relation to inspect.

isNodeVisible

protected boolean isNodeVisible(Node n)
Checks if the given node is in the visible area.

Parameters:
n - The node to check for visibility
Returns:
true if the node is visible

isSegmentVisible

protected boolean isSegmentVisible(Node n1,
                                   Node n2)
Checks if the given segment is in the visible area. NOTE: This will return true for a small number of non-visible segments.

Parameters:
ls - The segment to check
Returns:
true if the segment is visible

visit

public void visit(java.util.List<Node> nodes)
Specified by:
visit in interface ValidatorVisitor


JOSM