Exemplo n.º 1
0
 private static void draw(Quad quad, EventsManager em) {
   RectEvent re =
       new RectEvent(
           0,
           quad.getEnvelope().getMinX(),
           quad.getEnvelope().getMaxY(),
           quad.getEnvelope().getWidth(),
           quad.getEnvelope().getHeight(),
           false);
   em.processEvent(re);
 }
Exemplo n.º 2
0
  private static void draw(LinkedList<Quad> path, EventsManager em) {
    if (path.size() == 0) {
      return;
    }
    for (Quad q : path) {
      draw(q, em);
    }

    Quad start = path.get(0);
    double x = start.getEnvelope().getMinX() + start.getEnvelope().getWidth() / 2;
    double y = start.getEnvelope().getMinY() + start.getEnvelope().getHeight() / 2;

    for (int i = 1; i < path.size(); i++) {
      Quad next = path.get(i);
      LineSegment ls = new LineSegment();
      ls.x0 = x;
      ls.y0 = y;
      x = next.getEnvelope().getMinX() + next.getEnvelope().getWidth() / 2;
      y = next.getEnvelope().getMinY() + next.getEnvelope().getHeight() / 2;
      ls.x1 = x;
      ls.y1 = y;
      em.processEvent(new LineEvent(0, ls, false, 0, 255, 255, 255, 0));
    }
  }