Package org.nlogo.api

Examples of org.nlogo.api.Patch


      mouseState.xcor_$eq(xi);
      mouseState.ycor_$eq(yi);

      if (agents != null) {
        try {
          Patch patch = world.getPatchAt(xi, yi);
          agents.add(patch);
        } catch (AgentException e) {
          org.nlogo.util.Exceptions.ignore(e);
        }
      }
View Full Code Here


  protected void paintPatchLabels(GraphicsInterface g, double patchSize) {
    // then draw the patch labels
    if (world.patchesWithLabels() > 0) {
      int patchCount = world.patches().count();
      for (int i = 0; i < patchCount; i++) {
        Patch patch = world.getPatch(i);
        if (patch.hasLabel()) {
          drawPatchLabel(g, patch, patchSize);
        }
      }
    }
    if (outlineAgent instanceof Patch) {
      Patch patch = (Patch) outlineAgent;
      topology.drawWrappedRect(g,
          org.nlogo.api.Color.getComplement
              (org.nlogo.api.Color.getColor(patch.pcolor())),
          1.0f, patch.pxcor(), patch.pycor(), 1, patchSize, false);
    }
  }
View Full Code Here

      Link link = (Link) agent;
      spotlightSize = link.size();
      xcor = link.midpointX();
      ycor = link.midpointY();
    } else {
      Patch patch = (Patch) agent;
      spotlightSize = 2;
      xcor = patch.pxcor();
      ycor = patch.pycor();
    }

    return spotlightDrawer.getImage
        (topology, xcor, ycor, getWidth(settings.patchSize()), getHeight(settings.patchSize()),
            settings.patchSize(), spotlightSize, darkenPeripheral(settings), wrap);
View Full Code Here

TOP

Related Classes of org.nlogo.api.Patch

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.