dasher
Class CClickFilter

java.lang.Object
  extended by dasher.CDasherComponent
      extended by dasher.CDasherModule
          extended by dasher.CInputFilter
              extended by dasher.CClickFilter

public class CClickFilter
extends CInputFilter

This is an InputFilter implementation which accepts mouse clicks and causes Dasher to zoom to the location of successive clicks.

The filter does not pay any attention to the mouse position except for when the user clicks the display, and does not decorate the display in any way.

In order to zoom smoothly to a given location, it invokes CDasherModel.ScheduleZoom, which interpolates a number of points between the current crosshair location and the point clicked by the user, and jumps to these points on each successive frame.

This filter registers itself with the name Click Mode.


Field Summary
private  CDasherView DasherView
          Current DasherView, to be used in determining mouse co-ordinates.
 
Fields inherited from class dasher.CInputFilter
m_Interface
 
Fields inherited from class dasher.CDasherComponent
m_EventHandler, m_SettingsStore
 
Constructor Summary
CClickFilter(CEventHandler EventHandler, CSettingsStore SettingsStore, CDasherInterfaceBase Interface)
          Sole constructor.
 
Method Summary
 boolean DecorateView(CDasherView View)
          This filter does not decorate the view.
 void HandleEvent(CEvent Event)
          This class ignores all events.
 void KeyDown(long iTime, int iId, CDasherModel Model)
          KeyDown is to be called by the Interface when the user presses a key or clicks the mouse.
 boolean Timer(long Time, CDasherView m_DasherView, CDasherModel m_DasherModel)
          Timer simply calls the DasherModel's Tap_on_display method, causing it to move forward a frame if there is currently a zoom scheduled.
 
Methods inherited from class dasher.CInputFilter
Activate, Deactivate, KeyUp
 
Methods inherited from class dasher.CDasherModule
GetID, GetName, GetType, Ref, Unref
 
Methods inherited from class dasher.CDasherComponent
GetBoolParameter, GetLongParameter, GetParameterName, GetParameterType, GetStringParameter, InsertEvent, SetBoolParameter, SetLongParameter, SetStringParameter, UnregisterComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DasherView

private CDasherView DasherView
Current DasherView, to be used in determining mouse co-ordinates.

Constructor Detail

CClickFilter

public CClickFilter(CEventHandler EventHandler,
                    CSettingsStore SettingsStore,
                    CDasherInterfaceBase Interface)
Sole constructor. Calls the CInputFilter constructor with a type of 7, an ID of 1, and the name Click Mode.

Parameters:
EventHandler - Event handler.
SettingsStore - Settings repository.
Interface - Interface with which the filter should be registered.
Method Detail

DecorateView

public boolean DecorateView(CDasherView View)
This filter does not decorate the view.

Overrides:
DecorateView in class CInputFilter
Parameters:
View - Unused, may be null.
Returns:
False, indicating no work done.

Timer

public boolean Timer(long Time,
                     CDasherView m_DasherView,
                     CDasherModel m_DasherModel)
Timer simply calls the DasherModel's Tap_on_display method, causing it to move forward a frame if there is currently a zoom scheduled. In the event that no further destination is scheduled (ie. we are stationary and the user has not clicked a new destination), nothing is done.

Overrides:
Timer in class CInputFilter
Parameters:
Time - Current system time as a Unix timestamp
m_DasherView - View to be used for co-ordinate transforms
m_DasherModel - Model which will be instructed to advance a frame
Returns:
True if the model has changed, false otherwise.

KeyDown

public void KeyDown(long iTime,
                    int iId,
                    CDasherModel Model)
KeyDown is to be called by the Interface when the user presses a key or clicks the mouse. ClickFilter responds to: Left mouse button: Schedules a zoom to the clicked location.

Overrides:
KeyDown in class CInputFilter
Parameters:
iTime - Current system time as a UNIX timestamp.
iId - Key/button identifier.
Model - DasherModel which should be zoomed in response to clicks.

HandleEvent

public void HandleEvent(CEvent Event)
This class ignores all events.

Overrides:
HandleEvent in class CInputFilter
Parameters:
Event - Event to be processed.