]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.modeling/src/org/simantics/modeling/SCLTypeUtils.java
Merge "Reading background color of a ICanvasContext with SCL"
[simantics/platform.git] / bundles / org.simantics.modeling / src / org / simantics / modeling / SCLTypeUtils.java
index d3c7310e4ccf23c47350224f99fc0b3a45574082..d0a777caa8ffbdf061c1f64b003ae24f2d4d3608 100644 (file)
@@ -16,8 +16,11 @@ import org.simantics.scl.compiler.types.TCon;
 import org.simantics.scl.compiler.types.Type;
 import org.simantics.scl.compiler.types.Types;
 import org.simantics.scl.compiler.types.kinds.Kinds;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 public class SCLTypeUtils {
+    private static final Logger LOGGER = LoggerFactory.getLogger(SCLTypeUtils.class);
     private static final THashMap<String, Type> TYPE_MAP = new THashMap<String, Type>();
     
     private static void add(TCon type) {
@@ -54,9 +57,12 @@ public class SCLTypeUtils {
         TYPE_MAP.put("Vector Float", Types.vector(Types.FLOAT));
         TYPE_MAP.put("Vector Double", Types.vector(Types.DOUBLE));
         TYPE_MAP.put("Vector String", Types.vector(Types.STRING));
+        TYPE_MAP.put("ByteArray", Types.BYTE_ARRAY);
         
-        add(Types.BYTE_ARRAY);
         add((TCon)Types.RESOURCE);
+        add(Types.con("Simantics/GUID", "GUID")); // L0.GUID
+        add(Types.con("Simantics/Variables", "StructuredProperty")); // L0.methods
+        add(Types.con("Simantics/Variables", "ValueAccessor")); // L0.ValueAccessor
         add(Types.con("Simantics/Variables", "VariableMap"));
     }
     
@@ -68,7 +74,7 @@ public class SCLTypeUtils {
     public static Type getType(String typeText) {
         Type type = TYPE_MAP.get(typeText);
         if(type == null) {
-            System.err.println("SCLTypeUtils.getType cannot transform '" + typeText + "' to type. Returns a as default.");
+            LOGGER.warn("SCLTypeUtils.getType cannot transform '" + typeText + "' to type. Returns a as default.");
             return Types.var(Kinds.STAR);
         }
         return type;
@@ -92,7 +98,7 @@ public class SCLTypeUtils {
         else if(dataType instanceof ArrayType)
             return Types.list(getType(((ArrayType)dataType).componentType));
         else {
-            System.err.println("SCLTypeUtils.getType cannot transform data type '" + dataType + "' to type. Returns a as default.");
+            LOGGER.warn("SCLTypeUtils.getType cannot transform data type '" + dataType + "' to type. Returns a as default.");
             return Types.var(Kinds.STAR);
         }
     }
@@ -103,7 +109,7 @@ public class SCLTypeUtils {
         else if(propertyInfo.requiredDatatype != null)
             return getType(propertyInfo.requiredDatatype);
         else {
-            System.err.println(propertyInfo.name + " doesn't have type information. Returns a as default.");
+            LOGGER.warn(propertyInfo.name + " doesn't have type information. Returns a as default.");
             return Types.var(Kinds.STAR);
         }
     }