while (linkIterator.hasNext()) {
final NodeLinkModel next = linkIterator.next();
if (!(next instanceof ConnectorModel)) {
continue;
}
final ConnectorModel ref = (ConnectorModel) next;
if (alreadyPaintedLinks.add(ref)) {
final NodeModel target = ref.getTarget();
if (target == null) {
continue;
}
final NodeModel source = ref.getSource();
final NodeView sourceView = getNodeView(source);
final NodeView targetView = getNodeView(target);
final ILinkView arrowLink;
if (sourceView != null && targetView != null
&& (Shape.EDGE_LIKE.equals(ref.getShape()) || sourceView.getMap().getLayoutType() == MapViewLayout.OUTLINE)
&& source.isVisible() && target.isVisible()) {
arrowLink = new EdgeLinkView(ref, getModeController(), sourceView, targetView);
}
else {
arrowLink = new ConnectorView(ref, sourceView, targetView, getBackground());