X-Git-Url: https://mograsim.net/gitweb/?a=blobdiff_plain;f=net.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fmodel%2Fcomponents%2Fatomic%2FSimpleRectangularHardcodedModelComponent.java;h=8971285a59b48b29fcae1c464b0caf1117bbc4fc;hb=4d3cc22893c8c7f43699f02af87c6cc40b133b46;hp=4314a4399338eadabe6b0b6a7d93a6c0b659f0b9;hpb=552986fd8718d5f2db00802015fdd1ecd58a5a2f;p=Mograsim.git diff --git a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java index 4314a439..8971285a 100644 --- a/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java +++ b/net.mograsim.logic.model/src/net/mograsim/logic/model/model/components/atomic/SimpleRectangularHardcodedModelComponent.java @@ -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