Fixed a bug in Am2900; created dlatch8/80; relayouted some components
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / model / components / atomic / SimpleRectangularHardcodedModelComponent.java
index 4314a43..8971285 100644 (file)
@@ -7,7 +7,7 @@ import net.haspamelodica.swt.helper.gcs.GeneralGC;
 import net.haspamelodica.swt.helper.swtobjectwrappers.Rectangle;
 import net.mograsim.logic.core.wires.CoreWire.ReadEnd;
 import net.mograsim.logic.core.wires.CoreWire.ReadWriteEnd;
-import net.mograsim.logic.model.model.ViewModelModifiable;
+import net.mograsim.logic.model.model.LogicModelModifiable;
 import net.mograsim.logic.model.model.components.ModelComponent;
 import net.mograsim.logic.model.model.wires.Pin;
 import net.mograsim.logic.model.modeladapter.LogicCoreAdapter;
@@ -38,9 +38,14 @@ public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
 
        // creation and destruction
 
-       public SimpleRectangularHardcodedModelComponent(ViewModelModifiable model, String id, String name, String centerText)
+       public SimpleRectangularHardcodedModelComponent(LogicModelModifiable model, String id, String name, String centerText)
        {
-               super(model, name);
+               this(model, id, name, centerText, true);
+       }
+
+       public SimpleRectangularHardcodedModelComponent(LogicModelModifiable model, String id, String name, String centerText, boolean callInit)
+       {
+               super(model, name, false);
                this.id = id;
                this.outlineRenderer = new DefaultOutlineRenderer(this);
                CenteredTextParams centeredTextParams = new CenteredTextParams();
@@ -79,6 +84,9 @@ public abstract class SimpleRectangularHardcodedModelComponent extends ModelComp
                                recalculate.run();
                        }
                });
+
+               if (callInit)
+                       init();
        }
 
        // pins