import net.haspamelodica.swt.helper.swtobjectwrappers.Point;
import net.mograsim.logic.ui.model.ViewModelModifiable;
-import net.mograsim.logic.ui.model.components.GUINandGate;
-import net.mograsim.logic.ui.model.components.SimpleRectangularSubmodelComponent;
+import net.mograsim.logic.ui.model.components.atomic.GUINandGate;
+import net.mograsim.logic.ui.model.components.submodels.SimpleRectangularSubmodelComponent;
import net.mograsim.logic.ui.model.wires.GUIWire;
import net.mograsim.logic.ui.model.wires.Pin;
import net.mograsim.logic.ui.model.wires.WireCrossPoint;
+import net.mograsim.logic.ui.serializing.IndirectGUIComponentCreator;
public class GUIAm2901SourceDecode extends SimpleRectangularSubmodelComponent
{
public GUIAm2901SourceDecode(ViewModelModifiable model)
{
- super(model, 1, "Am2901SourceDecode");
+ this(model, null);
+ }
+
+ public GUIAm2901SourceDecode(ViewModelModifiable model, String name)
+ {
+ super(model, 1, "Am2901SourceDecode", name);
setSubmodelScale(.25);
setInputPins("I2", "I1", "I0");
setOutputPins("SQ", "RA", "SB", "SA", "RD");
new GUIWire(submodelModifiable, cpI01, notI0.getPin("A"), new Point(7.5, 95));
new GUIWire(submodelModifiable, cpI01, cpI02, new Point[0]);
new GUIWire(submodelModifiable, cpI02, notI0.getPin("B"), new Point[0]);
- new GUIWire(submodelModifiable, cpI02, nand23.getPin("B"), new Point(7.5, 112.5), new Point(32.5, 112.5),
- new Point(32.5, 105));
+ new GUIWire(submodelModifiable, cpI02, nand23.getPin("B"), new Point(7.5, 112.5), new Point(32.5, 112.5), new Point(32.5, 105));
new GUIWire(submodelModifiable, notI2.getPin("Y"), cpNotI2, new Point(32.5, 20));
new GUIWire(submodelModifiable, cpNotI2, nand22.getPin("A"), new Point[0]);
new GUIWire(submodelModifiable, cpNotI2, nand23.getPin("A"), new Point(32.5, 95));
new GUIWire(submodelModifiable, nand41.getPin("Y"), SQ, new Point[0]);
new GUIWire(submodelModifiable, nand42.getPin("Y"), RD, new Point[0]);
}
+
+ static
+ {
+ IndirectGUIComponentCreator.setComponentSupplier(GUIAm2901SourceDecode.class.getCanonicalName(),
+ (m, p, n) -> new GUIAm2901SourceDecode(m, n));
+ }
}
\ No newline at end of file