Made finding the ID of a JsonSerializable less ugly
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / GUINotGate.java
1 package net.mograsim.logic.model.model.components.atomic;
2
3 import net.mograsim.logic.core.components.gates.NotGate;
4 import net.mograsim.logic.model.model.ViewModelModifiable;
5 import net.mograsim.logic.model.modeladapter.ViewLogicModelAdapter;
6 import net.mograsim.logic.model.modeladapter.componentadapters.SimpleGateAdapter;
7 import net.mograsim.logic.model.serializing.IndirectGUIComponentCreator;
8
9 public class GUINotGate extends SimpleRectangularGUIGate
10 {
11         public GUINotGate(ViewModelModifiable model, int logicWidth)
12         {
13                 this(model, logicWidth, null);
14         }
15
16         public GUINotGate(ViewModelModifiable model, int logicWidth, String name)
17         {
18                 super(model, "GUINotGate", "1", true, logicWidth, name);
19                 setInputCount(1);
20         }
21
22         static
23         {
24                 ViewLogicModelAdapter.addComponentAdapter(new SimpleGateAdapter<>(GUINotGate.class, (t, p, o, i) -> new NotGate(t, p, i[0], o)));
25                 IndirectGUIComponentCreator.setComponentSupplier(GUINotGate.class.getCanonicalName(),
26                                 (m, p, n) -> new GUINotGate(m, p.getAsInt(), n));
27         }
28 }