visad
Interface ActivityHandler

All Known Implementing Classes:
ResSwitcher

public interface ActivityHandler

Display activity handler supplied to DisplayImpl.addActivityHandler.

A trivial implementation which toggles between two Data objects in a Display would be:

    class SwitchGIFs implements ActivityHandler
    {
      SwitchGIFs(LocalDisplay d) { toggle(d, true); }
      public void busyDisplay(LocalDisplay d) { toggle(d, false); }
      public void idleDisplay(LocalDisplay d) { toggle(d, true); }
      private void toggle(LocalDisplay d, boolean first) {
        java.util.Vector v = d.getRenderers();
        ((DataRenderer )v.get(0)).toggle(first);
        ((DataRenderer )v.get(1)).toggle(!first);
      }
    }
 


Method Summary
 void busyDisplay(LocalDisplay dpy)
          Method called when the Display becomes busy.
 void idleDisplay(LocalDisplay dpy)
          Method called after the Display has been idle long enough.
 

Method Detail

busyDisplay

void busyDisplay(LocalDisplay dpy)
Method called when the Display becomes busy.

Parameters:
dpy - Busy Display.

idleDisplay

void idleDisplay(LocalDisplay dpy)
Method called after the Display has been idle long enough.

Parameters:
dpy - Idle Display.