public void draw(Graphics2D g) {
        g.setColor(new Color((speed >= 0) ? 0 : (speed == -1) ? 160 : 240, (speed <= 0) ? 0
                : (speed == 1) ? 120 : 160, 0));
        Line2D line = new Line2D.Double(from.getX(), from.getY(), to.getX(), to.getY());
        if (selected)
            g.setStroke(Canvas.boldStroke);
        g.draw(line);
        g.setStroke(Canvas.normalStroke);
    }