@@ -0,0 +1,2101 @@
+package de.lmu.ifi.dbs.elki.visualization.batikutil;%0A%0Aimport java.awt.Component;%0Aimport java.awt.event.ComponentAdapter;%0Aimport java.awt.event.ComponentEvent;%0A%0A/**%0A * Class to lazily process canvas resize events by applying a threshold.%0A *  %0A * @author Erich Schubert%0A *%0A */%0Apublic abstract class LazyCanvasResizer extends ComponentAdapter %7B%0A  /**%0A   * Default threshold for resizing.%0A   */%0A  public static final double DEFAULT_THRESHOLD = 0.05;%0A%0A  /**%0A   * Active threshold%0A   */%0A  double threshold;%0A  %0A  /**%0A   * Last ratio of the Canvas applied%0A   */%0A  double activeRatio;%0A  %0A  /**%0A   * Component the ratio applies to.%0A   */%0A  Component component;%0A%0A  /**%0A   * Full constructor.%0A   * %0A   * @param component Component to track%0A   * @param threshold Threshold%0A   */%0A  public LazyCanvasResizer(Component component, double threshold) %7B%0A    super();%0A    this.threshold = threshold;%0A    this.component = component;%0A    this.activeRatio = getCurrentRatio();%0A  %7D%0A%0A  /**%0A   * Simplified constructor using the default threshold %7B@link #DEFAULT_THRESHOLD%7D%0A   * %0A   * @param component Component to track.%0A   */%0A  public LazyCanvasResizer(Component component) %7B%0A    this(component, DEFAULT_THRESHOLD);%0A  %7D%0A%0A  /**%0A   * React to a component resize event.%0A   */%0A  @Override%0A  public void componentResized(ComponentEvent e) %7B%0A    if (e.getComponent() == component) %7B%0A      double newRatio = getCurrentRatio();%0A      if (Math.abs(newRatio - activeRatio) %3E threshold) %7B%0A        activeRatio = newRatio;%0A        executeResize(newRatio);%0A      %7D%0A    %7D%0A  %7D%0A%0A  /**%0A   * Get the components current ratio.%0A   * %0A   * @return Current ratio.%0A   */%0A  public final double getCurrentRatio() %7B%0A    return (double) component.getWidth() / (double) component.getHeight();%0A  %7D%0A  %0A  /**%0A   * Callback function that needs to be overridden with actual implementations.%0A   * %0A   * @param newratio New ratio to apply.%0A   */%0A  public abstract void executeResize(double newratio);%0A%0A  /**%0A   * Get the components last applied ratio.%0A   * %0A   * @return Last applied ratio.%0A   */%0A  public double getActiveRatio() %7B%0A    return activeRatio;%0A  %7D%0A%7D%0A

Add a utility class to do lazy screen resizing.