package gvs.business.logic;

import java.util.TimerTask;

import gvs.business.logic.physics.helpers.Area;

/**
 * Guarantees that the layout is not endlessly calculated.
 * 
 * Once scheduled, this LayoutGuard will set the area to stable, which will stop
 * the calculation.
 * 
 * The {@link Layouter} schedules an instance of this class according to
 * the default delay.
 * 
 * @author mwieland
 *
 */
public class LayoutGuard extends TimerTask {

  private Area currentArea = null;

  public LayoutGuard(Area area) {
    currentArea = area;
  }

  /**
   * Stabilize stored area.
   */
  public void run() {
    currentArea.setIsStable(true);
  }
}

@@ -51,16 +51,74 @@
 rTask;%0A%0A
+import org.slf4j.Logger;%0Aimport org.slf4j.LoggerFactory;%0A%0A
 import g
@@ -402,23 +402,23 @@
 rding to
-%0A *
  the
+%0A *
  default
@@ -537,16 +537,187 @@
 = null;%0A
+  private static final Logger logger = LoggerFactory%0A      .getLogger(LayoutGuard.class);%0A%0A  /**%0A   * Constructor.%0A   * %0A   * @param area%0A   *          area to guard%0A   */
 %0A  publi
@@ -830,24 +830,104 @@
 oid run() %7B%0A
+    logger.info(%22Layout Guard activated. Layouting took more than 10 seconds%22);%0A
     currentA

add logger to layout guard