public synchronized boolean singlestep() {
    if (Events.Events == null || (double) XPos < Events.Events.x) XPos++;

    while (Events.Events != null && (double) XPos >= Events.Events.x) {
      EventPoint eventpoint = Events.pop();
      XPos = Math.max(XPos, (int) eventpoint.x);
      eventpoint.action(this);
      Arcs.checkBounds(this, XPos);
    }

    if (XPos > getBounds().width && Events.Events == null) Arcs.checkBounds(this, XPos);

    repaint();
    return Events.Events != null || XPos < 1000 + getBounds().width;
  }
 public synchronized void step() {
   EventPoint eventpoint = Events.pop();
   if (eventpoint != null) {
     XPos = Math.max(XPos, (int) eventpoint.x);
     eventpoint.action(this);
   } else if (XPos < getBounds().width) {
     XPos = getBounds().width;
   } else {
     init();
   }
   Arcs.checkBounds(this, XPos);
   repaint();
 }
 public synchronized void paint(Graphics g) {
   g.setColor(Color.white);
   g.fillRect(0, 0, getBounds().width, getBounds().height);
   g.setColor(Color.blue);
   Voronoi.paint(g, drawVoronoiLines);
   g.setColor(Color.red);
   g.drawLine(XPos, 0, XPos, getBounds().height);
   if (Events != null && Arcs != null) {
     g.setColor(Color.black);
     Events.paint(g, drawCircles);
     Arcs.paint(g, XPos, drawVoronoiLines, drawBeach);
   }
   if (drawDelaunay) {
     g.setColor(Color.gray);
     Delaunay.paint(g);
   }
 }