Package model.devscore.couplings

Examples of model.devscore.couplings.InvalidCouplingException


    ClassCoupling coupling =
        new ClassCoupling(model1, port1, model2, port2, selector);
    // only allow addition if models and ports are existent!
    if ((!subModels.contains(model1) && (this != model1))
        || !model1.hasPort(port1)) {
      throw new InvalidCouplingException(
          "Add coupling: Not existing model or port! " + model1.getName() + ":"
              + port1.getName());
    }
    couplings.addCoupling(coupling);
    changed();
View Full Code Here


      }
      if (!model2.hasPort(port2)) {
        notExist =
            notExist + " port " + model2.getName() + ":" + port2.getName();
      }
      throw new InvalidCouplingException(
          "Add coupling: Not existing model or port in " + this.getFullName()
              + "!\n Coupling (" + model1.getName() + ":" + port1.getName()
              + " [In: " + model1.hasInPort(port1) + " Out: "
              + model1.hasOutPort(port1) + "]" + " - " + model2.getName() + ":"
              + port2.getName() + " [In: " + model2.hasInPort(port2) + " Out: "
              + model2.hasOutPort(port2) + "])\n"
              + " This/these element(s) do not exist: [" + notExist + "]");
    }
    if (model1 == model2) {
      throw new InvalidCouplingException(
          "A model cannot be connected to itself!\n(" + model1.getName() + ":"
              + port1.getName() + " - " + model2.getName() + ":"
              + port2.getName() + ")");
    }
    couplings.addCoupling(coupling);
View Full Code Here

  private void addCoupling(ICouplingSet couplings, IBasicDEVSModel model1,
      IPort port1, MultiCouplingTargetList model2, String name,
      ISelector<IBasicDEVSModel> selector) {

    if (port1 == null) {
      throw new InvalidCouplingException(
          "Cannot use null as starting port of a coupling (" + name
              + ") starting model " + model1.getName() + "");
    }
    MultiCoupling coupling =
        new MultiCoupling(model1, port1, model2, name, selector);
    // only allow addition if models and ports are existent!
    if ((!subModels.contains(model1) && (this != model1))
        || !model1.hasPort(port1)) {
      throw new InvalidCouplingException(
          "Add coupling: Not existing model or port! " + model1.getName() + ":"
              + port1.getName());
    }
    couplings.addCoupling(coupling);
    changed();
View Full Code Here

TOP

Related Classes of model.devscore.couplings.InvalidCouplingException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.