NodeMapping(TreeMapper treeMapper, Mapping mapping, Node targetLoopNode) {
this.treeMapper = treeMapper;
this.mapping = mapping;
this.targetLoopNode = targetLoopNode;
targetOrder = calculateTargetOrder();
Node node = treeMapper.findTargetNode(mapping.getTargetPath().toString());
// If this represents an invalid mapping, targetNode may be null. This can happen
// when loading in a transformation in which the target structure has been edited
// such that a mapped target node is no longer present in the structure.
if (node != null) {
node.setTargetMappedFlag(true);
treeMapper.m_targetTreeComponent.repaint();
}
}