mergeLabel method
To merge labels for two nodes, the merged location for each LabelElement is computed. The location for the corresponding node LabelElement is set to the result, as long as the location is non-null.
Implementation
void mergeLabel(Label label2) {
for (int i = 0; i < 2; i++) {
int loc = computeMergedLocation(label2, i);
int thisLoc = label!.getLocation(i);
if (thisLoc == Location.NONE) label!.setLocationWithIndex(i, loc);
}
}