//mark unit
MarkUnit markUnit = new MarkUnit(group, this.units.get(0));
markUnit.execute();
} else if (additionally) {
//unmark unit
UnmarkUnit unmarkUnit = new UnmarkUnit(group, this.units.get(0));
unmarkUnit.execute();
}
return;
}
//show dialog for selection of units
MarkDialog markDialog = new MarkDialog(prevMarked, prevNotMarked);
List<Long> markedList = markDialog.getMarkedUnitIDs();
if (additionally) {
//remove units that were marked before
markedList.removeAll(prevMarked);
}
Long[] marked = new Long[markedList.size()];
for (int i = 0; i < marked.length; i++) {
marked[i] = markedList.get(i);
}
if (marked.length > 0) {
MarkUnit markUnit = new MarkUnit(group, marked);
markUnit.execute();
}
if (additionally) {
List<Long> notMarkedList = markDialog.getNotMarkedUnitIDs();
//remove units that were not marked before
notMarkedList.removeAll(prevNotMarked);
Long[] notMarked = new Long[notMarkedList.size()];
for (int i = 0; i < notMarked.length; i++) {
notMarked[i] = notMarkedList.get(i);
}
//unmark units
UnmarkUnit unmarkUnit = new UnmarkUnit(group, notMarked);
unmarkUnit.execute();
}
}