GUIComponents now serialize and deserialize parameters (where needed)
[Mograsim.git] / net.mograsim.logic.ui / src / net / mograsim / logic / ui / model / components / atomic / GUIOrGate.java
index fc88509..50050e0 100644 (file)
@@ -4,6 +4,7 @@ import net.mograsim.logic.core.components.gates.OrGate;
 import net.mograsim.logic.ui.model.ViewModelModifiable;
 import net.mograsim.logic.ui.modeladapter.ViewLogicModelAdapter;
 import net.mograsim.logic.ui.modeladapter.componentadapters.SimpleGateAdapter;
+import net.mograsim.logic.ui.serializing.IndirectGUIComponentCreator;
 
 public class GUIOrGate extends SimpleRectangularGUIGate
 {
@@ -16,5 +17,6 @@ public class GUIOrGate extends SimpleRectangularGUIGate
        static
        {
                ViewLogicModelAdapter.addComponentAdapter(new SimpleGateAdapter<>(GUIOrGate.class, OrGate::new));
+               IndirectGUIComponentCreator.setComponentProvider(GUIOrGate.class.getCanonicalName(), (m, p) -> new GUIOrGate(m, p.getAsInt()));
        }
 }
\ No newline at end of file