public void visit(Way w) { if (w.isIncomplete() || w.getNodesCount() < 2) return; c.setStrokeStyle(w.isSelected() ? "#ff0000" : "#000000"); c.beginPath(); Iterator<Node> it = w.getNodes().iterator(); if (it.hasNext()) { Point lastP = nc.getPoint(it.next()); c.moveTo(lastP.x, lastP.y); for (int orderNumber = 1; it.hasNext(); orderNumber++) { Point p = nc.getPoint(it.next()); c.lineTo(p.x, p.y); lastP = p; } c.stroke(); } }
public void visit(Node n) { Point p = nc.getPoint(n); int r = 3; c.setStrokeStyle(n.isSelected() ? "#ff0000" : "#000000"); c.strokeRect(p.x - r, p.y - r, 2 * r, 2 * r); }