X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2FSubmodelComponentParams.java;fp=net.mograsim.logic.ui%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fui%2Fmodel%2Fcomponents%2FSubmodelComponentParams.java;h=0000000000000000000000000000000000000000;hb=01c5d7035474a5eb58f216b6831b2c0d8c174efa;hp=1276d13050d5fe1c116a710d5aa190dff4a1e893;hpb=4ac977cb31feb34f24e05e9d5e7976951dccf557;p=Mograsim.git diff --git a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponentParams.java b/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponentParams.java deleted file mode 100644 index 1276d130..00000000 --- a/net.mograsim.logic.ui/src/net/mograsim/logic/ui/model/components/SubmodelComponentParams.java +++ /dev/null @@ -1,74 +0,0 @@ -package net.mograsim.logic.ui.model.components; - -import java.io.IOException; -import java.util.Map; - -import net.haspamelodica.swt.helper.swtobjectwrappers.Point; -import net.mograsim.logic.ui.util.JsonHandler; - -/** - * This class contains all the information necessary to create a new {@link SubmodelComponent} - */ -public class SubmodelComponentParams -{ - String type, name; - double width, height; - InterfacePinParams[] interfacePins; - ComponentCompositionParams composition; - Map specialized; - - public static class InterfacePinParams - { - Point location; - String name; - int logicWidth; - } - - public static class InnerWireParams - { - InnerPinParams pin1, pin2; - Point[] path; - } - - public static class InnerPinParams - { - int compId; - String pinName; - } - - public static class ComponentCompositionParams - { - double innerScale; - InnerComponentParams[] subComps; - InnerWireParams[] innerWires; - - public static class InnerComponentParams - { - Point pos; - String name; - Map params; - } - } - - public static SubmodelComponentParams readJson(String path) throws IOException - { - return JsonHandler.readJson(path, SubmodelComponentParams.class); - } - - /** - * Writes this {@link SubmodelComponentParams} object into a file in json format. The correct file extension is important! Check - * {@link SubmodelComponentParams}.fileExtension - */ - public void writeJson(String path) - { - try - { - JsonHandler.writeJson(this, path); - } - catch (IOException e) - { - System.err.println("Failed to write SubComponentParams to file"); - e.printStackTrace(); - } - } -} \ No newline at end of file