public class PaintVisitor extends AbstractVisitor implements ValidatorVisitor
Modifier and Type | Class and Description |
---|---|
protected static class |
PaintVisitor.PaintedPoint |
protected static class |
PaintVisitor.PaintedSegment |
Modifier and Type | Field and Description |
---|---|
private Color |
color
The severity color
|
private Graphics |
g
The graphics
|
private MapView |
mv
The MapView
|
private Set<PaintVisitor.PaintedPoint> |
paintedPoints |
private Set<PaintVisitor.PaintedSegment> |
paintedSegments |
private boolean |
selected
Is the error selected ?
|
Constructor and Description |
---|
PaintVisitor(Graphics g,
MapView mv)
Constructor
|
Modifier and Type | Method and Description |
---|---|
void |
clearPaintedObjects()
Clears the internal painted objects collections.
|
protected void |
drawNode(Node n,
Color color)
Draws a circle around the node
|
protected void |
drawSegment(Node n1,
Node n2,
Color color)
Draws a line around the segment
|
protected void |
drawSegment(Point p1,
Point p2,
Color color)
Draws a line around the segment
|
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(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(TestError error) |
void |
visit(Way w)
Visiting call for lines.
|
void |
visit(WaySegment ws) |
visit
private boolean selected
private final Set<PaintVisitor.PaintedPoint> paintedPoints
private final Set<PaintVisitor.PaintedSegment> paintedSegments
public PaintVisitor(Graphics g, MapView mv)
g
- The graphicsmv
- The Mapviewpublic void visit(TestError error)
visit
in interface ValidatorVisitor
public void visit(OsmPrimitive p)
visit
in interface ValidatorVisitor
protected void drawNode(Node n, Color color)
n
- The nodecolor
- The circle colorprotected void drawSegment(Point p1, Point p2, Color color)
p1
- The first point of segmentp2
- The second point of segmentcolor
- The colorprotected void drawSegment(Node n1, Node n2, Color color)
n1
- The first node of segmentn2
- The second node of segmentcolor
- The colorpublic void visit(Node n)
public void visit(WaySegment ws)
visit
in interface ValidatorVisitor
public void visit(Relation r)
Visitor
protected boolean isNodeVisible(Node n)
n
- The node to check for visibilityprotected boolean isSegmentVisible(Node n1, Node n2)
n1
- The first point of the segment to checkn2
- The second point of the segment to checktrue
if the segment is visiblepublic void visit(List<Node> nodes)
visit
in interface ValidatorVisitor
public void clearPaintedObjects()