// calculates progress units count
int max = 0;
if (graph.showNodes()) {
max += graph.countNodes();
}
if (graph.showEdges()) {
max += graph.countUnidirectionalEdges() + graph.countBidirectionalEdges();
if (graph.showSelfLoops()) {
max += graph.countSelfLoops();
}
}