6f1acd4b46e85eed00edc29a98b2334c680579bf
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / atomic / GUINotGate.java
1 package net.mograsim.logic.ui.model.components.atomic;
2
3 import net.mograsim.logic.core.components.gates.NotGate;
4 import net.mograsim.logic.ui.model.ViewModelModifiable;
5 import net.mograsim.logic.ui.modeladapter.ViewLogicModelAdapter;
6 import net.mograsim.logic.ui.modeladapter.componentadapters.SimpleGateAdapter;
7 import net.mograsim.logic.ui.serializing.IndirectGUIComponentCreator;
8
9 public class GUINotGate extends SimpleRectangularGUIGate
10 {
11         public GUINotGate(ViewModelModifiable model, int logicWidth)
12         {
13                 super(model, logicWidth, "1", true);
14                 setInputCount(1);
15         }
16
17         static
18         {
19                 ViewLogicModelAdapter.addComponentAdapter(new SimpleGateAdapter<>(GUINotGate.class, (t, p, o, i) -> new NotGate(t, p, i[0], o)));
20                 IndirectGUIComponentCreator.setComponentSupplier(GUINotGate.class.getCanonicalName(), (m, p) -> new GUINotGate(m, p.getAsInt()));
21         }
22 }