* @param relation The relation to generate the label for.
* @return A <class>String</class> with the label.
* @generated NOT
*/
protected String getLabel(Relation relation) {
Element source = relation.getSource();
String sourceName = source == null ? "" : source.getName();
Element target = relation.getTarget();
String targetName = target == null ? "" : target.getName();
String label = "\"" + (sourceName == null || sourceName.isEmpty() && source != null ? source.eClass().getName() : sourceName) + "\" ";
if (relation instanceof Impact) {
Object weight = ((Impact)relation).getWeight();
label += "-(" + (weight == null ? "" : weight.toString()) + ")";
} else
if (relation instanceof Offset) {
Object offset = ((Offset)relation).getValue();
label += "-(" + (offset == null ? "" : offset.toString()) + ")";
}
label += "-> \""+ (targetName == null || targetName.isEmpty() && target != null ? target.eClass().getName() : targetName) + "\"";
return label;
}