1 package net.mograsim.logic.ui.model.components.params;
3 import java.io.IOException;
6 import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
7 import net.mograsim.logic.ui.model.components.SubmodelComponent;
10 * This class contains all the information necessary to create a new {@link SubmodelComponent}
12 public class SubmodelComponentParams
15 public double width, height;
16 public InterfacePinParams[] interfacePins;
17 public ComponentCompositionParams composition;
18 public Map<String, Object> specialized;
20 public static class InterfacePinParams
22 public Point location;
23 public int logicWidth;
26 public static class InnerWireParams
28 public InnerPinParams pin1, pin2;
32 public static class InnerPinParams
34 public int compId, pinIndex;
37 public static SubmodelComponentParams readJson(String path) throws IOException
39 return JsonHandler.readJson(path, SubmodelComponentParams.class);
43 * Writes this {@link SubmodelComponentParams} object into a file in json format. The correct file extension is important! Check
44 * {@link SubmodelComponentParams}.fileExtension
46 public void writeJson(String path)
50 JsonHandler.writeJson(this, path);
54 System.err.println("Failed to write SubComponentParams to file");