X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.interop.mapping%2Fsrc%2Forg%2Fsimantics%2Finterop%2Fmapping%2Fdata%2FGraphNode.java;h=cdebb512d33c4e25526cdbca9774be01ba29022e;hb=42badb1235a87eab88dc14caf579d1230c9d0560;hp=d9bbb5099c788927b11918e3920b9be716c6e96f;hpb=f353e9892e001df6d7d19a125c8309de511b57ec;p=simantics%2Finterop.git diff --git a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/data/GraphNode.java b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/data/GraphNode.java index d9bbb50..cdebb51 100644 --- a/org.simantics.interop.mapping/src/org/simantics/interop/mapping/data/GraphNode.java +++ b/org.simantics.interop.mapping/src/org/simantics/interop/mapping/data/GraphNode.java @@ -6,8 +6,8 @@ import java.util.HashSet; import java.util.List; import java.util.Set; -import org.simantics.interop.mapping.Logger; import org.simantics.utils.datastructures.hints.HintContext; +import org.slf4j.Logger; /** @@ -18,6 +18,9 @@ import org.simantics.utils.datastructures.hints.HintContext; * @param */ public class GraphNode extends HintContext { + + private static final Logger LOGGER = org.slf4j.LoggerFactory.getLogger(GraphNode.class); + protected T data; private List> nodes = new ArrayList>(); @@ -56,9 +59,9 @@ public class GraphNode extends HintContext { */ public Link addLink(String relationName, String inverseRelationName,GraphNode node) { _checkDisposed(); - Logger.defaultLogInfo("Node link " + data + " " + node.data + " " + relationName + " " + inverseRelationName +"\n"); + LOGGER.info("Node link " + data + " " + node.data + " " + relationName + " " + inverseRelationName +"\n"); if(containsLink(relationName, node) && node.containsLink(inverseRelationName, this)) { - Logger.defaultLogWarning("Node " + getData() + " has already given child " + node.getData() + " ,with name " + relationName + " / " + inverseRelationName); + LOGGER.warn("Node " + getData() + " has already given child " + node.getData() + " ,with name " + relationName + " / " + inverseRelationName); return null; } Link rel = _addLink(relationName,node); @@ -77,7 +80,7 @@ public class GraphNode extends HintContext { public Link addLink(String relationName,GraphNode node) { _checkDisposed(); if(containsLink(relationName, node)) { - Logger.defaultLogWarning("Node " + getData() + " has already given child " + node.getData() + " ,with name " + relationName ); + LOGGER.warn("Node " + getData() + " has already given child " + node.getData() + " ,with name " + relationName ); return null; } Link rel = _addLink(relationName,node); @@ -96,7 +99,7 @@ public class GraphNode extends HintContext { public Link addLink(Link link ,GraphNode node) { _checkDisposed(); if(containsLink(link.getName(), node) && node.containsLink(link.getInverseName(), this)) { - Logger.defaultLogWarning("Node " + getData() + " has already given child " + node.getData() + " ,with name " + link.getName() + " / " + link.getInverseName()); + LOGGER.warn("Node " + getData() + " has already given child " + node.getData() + " ,with name " + link.getName() + " / " + link.getInverseName()); return null; } Link rel = _addLink(link.getName(),node); @@ -718,7 +721,7 @@ public class GraphNode extends HintContext { public void destroy() { if (disposed) return; - Logger.defaultLogInfo("Node destroy " + data + " " + this); + LOGGER.info("Node destroy " + data + " " + this); Collection> coll = new ArrayList>(); coll.addAll(nodes); nodes.clear(); @@ -736,7 +739,7 @@ public class GraphNode extends HintContext { if (disposed) return; // FIXME: link.to may be *this. - Logger.defaultLogInfo("Node remove " + data + " " + this); + LOGGER.info("Node remove " + data + " " + this); if (nodes.size() == 1) { Link link = nodes.get(0); link.to().removeLink(link.getInverseName(), link.getName(), this); @@ -788,7 +791,7 @@ public class GraphNode extends HintContext { protected void _checkDisposed() { if (disposed) { - Logger.defaultLogError("Remove Node, disposed " + this); + LOGGER.error("Remove Node, disposed " + this); throw new RuntimeException("Node " + this + " is disposed."); } }