public boolean applySpeedTool(MouseEvent mouse, ui.Tool tool) {
        Object o = getObject(mouseGetX(mouse), mouseGetY(mouse), tool);
        if (o == null)
            return false;
        if (o instanceof Vertex) {
            for (Edge edge : ((Vertex) o).edges)
                edge.setSpeed(tool.value);
            return true;
        } else if (o instanceof Edge) {
            ((Edge) o).setSpeed(tool.value);
            return true;
        } else if (o instanceof Message) {
            return true;
        }
        return false;
    }