Package org.nlogo.prim.hubnet

Source Code of org.nlogo.prim.hubnet._hubnetmakeplotnarrowcast

// (C) Uri Wilensky. https://github.com/NetLogo/NetLogo

package org.nlogo.prim.hubnet;

import org.nlogo.api.LogoException;
import org.nlogo.api.Syntax;
import org.nlogo.nvm.Context;
import org.nlogo.nvm.EngineException;

public final strictfp class _hubnetmakeplotnarrowcast
    extends org.nlogo.nvm.Command {
  @Override
  public Syntax syntax() {
    return Syntax.commandSyntax
        (new int[]{Syntax.StringType()});
  }

  @Override
  public void perform(final Context context)
      throws LogoException {
    final String name = argEvalString(context, 0);

    workspace.waitFor
        (new org.nlogo.api.CommandRunnable() {
          public void run() throws LogoException {
            if (!workspace.getHubNetManager().addNarrowcastPlot(name)) {
              throw new EngineException
                  (context, _hubnetmakeplotnarrowcast.this,
                      "no such plot: \"" + name + "\"");
            }
          }
        });
    context.ip = next;
  }
}
TOP

Related Classes of org.nlogo.prim.hubnet._hubnetmakeplotnarrowcast

TOP
Copyright © 2018 www.massapi.com. 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.