de.lmu.ifi.dbs.elki.visualization.batikutil
Class LazyCanvasResizer

java.lang.Object
  extended by java.awt.event.ComponentAdapter
      extended by de.lmu.ifi.dbs.elki.visualization.batikutil.LazyCanvasResizer
All Implemented Interfaces:
ComponentListener, EventListener

public abstract class LazyCanvasResizer
extends ComponentAdapter

Class to lazily process canvas resize events by applying a threshold.


Field Summary
(package private)  double activeRatio
          Last ratio of the Canvas applied
(package private)  Component component
          Component the ratio applies to.
static double DEFAULT_THRESHOLD
          Default threshold for resizing.
(package private)  double threshold
          Active threshold
 
Constructor Summary
LazyCanvasResizer(Component component)
          Simplified constructor using the default threshold DEFAULT_THRESHOLD
LazyCanvasResizer(Component component, double threshold)
          Full constructor.
 
Method Summary
 void componentResized(ComponentEvent e)
          React to a component resize event.
abstract  void executeResize(double newratio)
          Callback function that needs to be overridden with actual implementations.
 double getActiveRatio()
          Get the components last applied ratio.
 double getCurrentRatio()
          Get the components current ratio.
 
Methods inherited from class java.awt.event.ComponentAdapter
componentHidden, componentMoved, componentShown
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_THRESHOLD

public static final double DEFAULT_THRESHOLD
Default threshold for resizing.

See Also:
Constant Field Values

threshold

double threshold
Active threshold


activeRatio

double activeRatio
Last ratio of the Canvas applied


component

Component component
Component the ratio applies to.

Constructor Detail

LazyCanvasResizer

public LazyCanvasResizer(Component component,
                         double threshold)
Full constructor.

Parameters:
component - Component to track
threshold - Threshold

LazyCanvasResizer

public LazyCanvasResizer(Component component)
Simplified constructor using the default threshold DEFAULT_THRESHOLD

Parameters:
component - Component to track.
Method Detail

componentResized

public void componentResized(ComponentEvent e)
React to a component resize event.

Specified by:
componentResized in interface ComponentListener
Overrides:
componentResized in class ComponentAdapter

getCurrentRatio

public final double getCurrentRatio()
Get the components current ratio.

Returns:
Current ratio.

executeResize

public abstract void executeResize(double newratio)
Callback function that needs to be overridden with actual implementations.

Parameters:
newratio - New ratio to apply.

getActiveRatio

public double getActiveRatio()
Get the components last applied ratio.

Returns:
Last applied ratio.

Release 0.4.0 (2011-09-20_1324)