visad.util
Class ResSwitcher

java.lang.Object
  extended by visad.util.DualRes
      extended by visad.util.ResSwitcher
All Implemented Interfaces:
ActivityHandler

public class ResSwitcher
extends DualRes
implements ActivityHandler

Handles automatic toggling between a high-resolution representation and a low-resolution one for a data object. When the display is busy, the low-resolution representation is used for faster response time. When the display is idle, the high-resolution representation is used for greater detail.


Field Summary
 
Fields inherited from class visad.util.DualRes
DEBUG, hi_ref, lo_ref
 
Constructor Summary
ResSwitcher(LocalDisplay d, DataReferenceImpl ref)
          Constructs a resolution switcher for swapping between high- and low- resolution representations for the referenced data on the given display.
ResSwitcher(LocalDisplay d, DataReferenceImpl ref, DataRenderer renderer, ConstantMap[] cmaps)
          Constructs a resolution switcher for swapping between high- and low- resolution representations for the referenced data on the given display.
 
Method Summary
 void busyDisplay(LocalDisplay d)
          Swaps in the low-resolution data when the display is busy.
 void idleDisplay(LocalDisplay d)
          Swaps in the high-resolution data when the display is idle.
static void main(String[] args)
          Run 'java visad.util.ResSwitcher data_file' to test ResSwitcher.
 void unlink()
          Unlinks the resolution switcher from its display.
 
Methods inherited from class visad.util.DualRes
getHighResReference, getLowResReference, getResolutionScale, rescale, rescale, setResolutionScale
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ResSwitcher

public ResSwitcher(LocalDisplay d,
                   DataReferenceImpl ref)
            throws VisADException,
                   RemoteException
Constructs a resolution switcher for swapping between high- and low- resolution representations for the referenced data on the given display.

Throws:
VisADException
RemoteException

ResSwitcher

public ResSwitcher(LocalDisplay d,
                   DataReferenceImpl ref,
                   DataRenderer renderer,
                   ConstantMap[] cmaps)
            throws VisADException,
                   RemoteException
Constructs a resolution switcher for swapping between high- and low- resolution representations for the referenced data on the given display.

Parameters:
renderer - The data renderer to be used for the low-res rendering.
cmaps - The ConstantMaps to be used for the low-res rendering.
Throws:
VisADException
RemoteException
Method Detail

unlink

public void unlink()
            throws VisADException
Unlinks the resolution switcher from its display.

Throws:
VisADException

busyDisplay

public void busyDisplay(LocalDisplay d)
Swaps in the low-resolution data when the display is busy.

Specified by:
busyDisplay in interface ActivityHandler
Parameters:
d - Busy Display.

idleDisplay

public void idleDisplay(LocalDisplay d)
Swaps in the high-resolution data when the display is idle.

Specified by:
idleDisplay in interface ActivityHandler
Parameters:
d - Idle Display.

main

public static void main(String[] args)
                 throws Exception
Run 'java visad.util.ResSwitcher data_file' to test ResSwitcher.

Throws:
Exception