public void draw(Graphics2D g) {
        Tool tool = controls.getTool();
        // vykresli polhranu
        if (begin != null && graph.player.state == RunState.stopped
                && tool.compatible(ToolType.create) && tool.compatible(ToolTarget.edge)) {
            g.setColor(new Color(0, 0, 0));
            g.draw(new Line2D.Double(begin.getX(), begin.getY(), xlast, ylast));
        }
    }