X-Git-Url: https://mograsim.net/gitweb/?p=Mograsim.git;a=blobdiff_plain;f=plugins%2Fnet.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fsnippets%2Fhighlevelstatehandlers%2Fstandard%2Fsubcomponent%2FDelegatingSubcomponentHighLevelStateHandler.java;fp=plugins%2Fnet.mograsim.logic.model%2Fsrc%2Fnet%2Fmograsim%2Flogic%2Fmodel%2Fsnippets%2Fhighlevelstatehandlers%2Fstandard%2Fsubcomponent%2FDelegatingSubcomponentHighLevelStateHandler.java;h=a7f2c817a8f57446445bda046d86ebae191d0720;hp=6557787f84ab96e284c5222127bf7efbdfdf9822;hb=43a3e6fbdeef2b0926ee5302abaa04be65709799;hpb=ad3cfc5aa856c1329943f1aafbfd513b60636aaa diff --git a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/subcomponent/DelegatingSubcomponentHighLevelStateHandler.java b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/subcomponent/DelegatingSubcomponentHighLevelStateHandler.java index 6557787f..a7f2c817 100644 --- a/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/subcomponent/DelegatingSubcomponentHighLevelStateHandler.java +++ b/plugins/net.mograsim.logic.model/src/net/mograsim/logic/model/snippets/highlevelstatehandlers/standard/subcomponent/DelegatingSubcomponentHighLevelStateHandler.java @@ -54,9 +54,10 @@ public class DelegatingSubcomponentHighLevelStateHandler implements Subcomponent { if (delegateTarget == null) this.delegateTarget = parentComponent; - else if (parentComponent.submodel.getComponentsByName().get(delegateTarget.getName()) != delegateTarget) + else if (delegateTarget != parentComponent + && parentComponent.submodel.getComponentsByName().get(delegateTarget.getName()) != delegateTarget) throw new IllegalArgumentException( - "Can only set components belonging to the submodel of the parent component of this handler as the delegate target"); + "Can only set components belonging to the submodel of the parent component of this handler or the parent component itself as the delegate target"); this.delegateTarget = delegateTarget; }