65031a6040b06f73c48bd95c2b13fa43c47368d9
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / GUIOrGate.java
1 package net.mograsim.logic.model.model.components.atomic;
2
3 import net.mograsim.logic.core.components.gates.OrGate;
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 GUIOrGate extends SimpleRectangularGUIGate
10 {
11         public GUIOrGate(ViewModelModifiable model, int logicWidth)
12         {
13                 this(model, logicWidth, null);
14         }
15
16         public GUIOrGate(ViewModelModifiable model, int logicWidth, String name)
17         {
18                 super(model, "\u22651", false, logicWidth, name);// ">=1"
19                 setInputCount(2);
20         }
21
22         static
23         {
24                 ViewLogicModelAdapter.addComponentAdapter(new SimpleGateAdapter<>(GUIOrGate.class, OrGate::new));
25                 IndirectGUIComponentCreator.setComponentSupplier(GUIOrGate.class.getCanonicalName(),
26                                 (m, p, n) -> new GUIOrGate(m, p.getAsInt(), n));
27         }
28 }