- GUIComponent[] components = new GUIComponent[params.subComps.length];
- for (int i = 0; i < components.length; i++)
- {
- InnerComponentParams cParams = params.subComps[i];
- String path = cParams.type;
- if (path.startsWith("class:"))
- {
- path = path.substring(6);
- components[i] = createInnerComponentFromClass(comp, path, cParams.logicWidth);
- components[i].moveTo(cParams.pos.x, cParams.pos.y);
- } else if (path.startsWith("file:"))
- {
- path = path.substring(5);
- components[i] = create(comp.submodelModifiable, path);
- components[i].moveTo(cParams.pos.x, cParams.pos.y);
- } else
- throw new IllegalArgumentException("Invalid submodel type! Type was neither prefixed by 'class:' nor by 'file:'");
- }
+ Map<String, Object> m = params.specialized;
+ SimpleRectangularSubmodelComponent rect = new SimpleRectangularSubmodelComponent(model,
+ ((Number) m.get(SimpleRectangularSubmodelComponent.kLogicWidth)).intValue(),
+ (String) m.get(SimpleRectangularSubmodelComponent.kLabel));
+ rect.setSubmodelScale(params.composition.innerScale);
+
+ Object[] names = ((ArrayList<Object>) m.get(SimpleRectangularSubmodelComponent.kInCount)).toArray();
+ rect.setInputPins(Arrays.copyOf(names, names.length, String[].class));