X-Git-Url: https://gerrit.simantics.org/r/gitweb?p=simantics%2Fplatform.git;a=blobdiff_plain;f=bundles%2Forg.simantics.modeling%2Fsrc%2Forg%2Fsimantics%2Fmodeling%2FuserComponent%2FComponentTypeCommands.java;h=0afdb03b7222c1f0d5f95fb8cc3c51c0d082bdb1;hp=cf6690c311f0bdda988e695dc848d38cafd56390;hb=1dfeb7d5c49b1391cd9d877e1eddab18995cb151;hpb=c13c4179bda758e77fe1f2032d3c4268bb9e3120 diff --git a/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/ComponentTypeCommands.java b/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/ComponentTypeCommands.java index cf6690c31..0afdb03b7 100644 --- a/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/ComponentTypeCommands.java +++ b/bundles/org.simantics.modeling/src/org/simantics/modeling/userComponent/ComponentTypeCommands.java @@ -44,9 +44,13 @@ import org.simantics.scl.runtime.tuple.Tuple3; import org.simantics.selectionview.SelectionViewResources; import org.simantics.structural.stubs.StructuralResource2; import org.simantics.structural2.utils.StructuralUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; public class ComponentTypeCommands { + private static final Logger LOGGER = LoggerFactory.getLogger(ComponentTypeCommands.class); + public static void applyCode(WriteGraph g, Resource componentType, String code) throws DatabaseException { StructuralResource2 STR = StructuralResource2.getInstance(g); g.claimLiteral(componentType, STR.ProceduralComponentType_code, code, Bindings.STRING); @@ -248,7 +252,7 @@ public class ComponentTypeCommands { Resource object = getAssertedObject(g, type, relation); if(object == null) { - System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + + LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + " in " + NameUtils.getSafeName(g, type) + "."); return; } @@ -262,7 +266,7 @@ public class ComponentTypeCommands { Resource object = getAssertedObject(g, type, relation); if(object == null) { - System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + + LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + " in " + NameUtils.getSafeName(g, type) + "."); return; } @@ -325,7 +329,7 @@ public class ComponentTypeCommands { public static void setUnit(WriteGraph graph, Resource type, Resource relation, String unit) throws DatabaseException { Resource object = getAssertedObject(graph, type, relation); if (object == null) { - System.err.println("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) + + LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) + " in " + NameUtils.getSafeName(graph, type) + "."); return; } @@ -360,7 +364,7 @@ public class ComponentTypeCommands { public static void setRange(WriteGraph graph, Resource type, Resource relation, String newRange) throws DatabaseException { Resource object = getAssertedObject(graph, type, relation); if (object == null) { - System.err.println("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) + + LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(graph, relation) + " in " + NameUtils.getSafeName(graph, type) + "."); return; } @@ -386,7 +390,7 @@ public class ComponentTypeCommands { Datatype newDatatype = TypeConversion.convertSCLTypeToDatatype(newSCLType); if(newDatatype == null) { - System.err.println("Couldn't convert default value to <" + newSCLType + ">."); + LOGGER.warn("Couldn't convert default value to <" + newSCLType + ">."); return null; } Binding newBinding = Bindings.getBinding(newDatatype); @@ -415,7 +419,7 @@ public class ComponentTypeCommands { Resource type, Resource relation, String newSCLType) throws DatabaseException { Resource object = getAssertedObject(g, type, relation); if(object == null) { - System.err.println("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + + LOGGER.warn("Didn't find assertion for " + NameUtils.getSafeName(g, relation) + " in " + NameUtils.getSafeName(g, type) + "."); return; }