edu.cmu.sun.controller
Class HoverEventAdapter

java.lang.Object
  extended by edu.cmu.sun.controller.HoverEventAdapter

public class HoverEventAdapter
extends java.lang.Object

Since Looking glass does not provide hover events, this simple class parses low level LgEvents an notifies a listener when a hover action occours. However, hover is done slightly differently than normal. In this implementation, we start a timer when a mouse enters a component. If the timer goes off before the mouse has exited the component, then we count it as a hover event. This is a very different behavior from normal hover actions which look for when the mosue has stopped moving for a set period of time.

Author:
Braden Kowitz, Jessica Smith

Nested Class Summary
static interface HoverEventAdapter.Listener
           
 class HoverEventAdapter.sendHover
           
 
Field Summary
private static int DEFAULT_HOVER_TIME
           
(package private)  HoverEventAdapter.Listener listener
           
(package private)  int time
           
(package private)  java.util.Timer timer
           
 
Constructor Summary
HoverEventAdapter(HoverEventAdapter.Listener listener)
           
HoverEventAdapter(HoverEventAdapter.Listener listener, int msec)
           
 
Method Summary
 java.lang.Class<LgEvent>[] getTargetEventClasses()
           
 void processEvent(LgEvent e)
           
private  void startTimer()
           
private  void stopTimer()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_HOVER_TIME

private static final int DEFAULT_HOVER_TIME
See Also:
Constant Field Values

listener

HoverEventAdapter.Listener listener

time

int time

timer

java.util.Timer timer
Constructor Detail

HoverEventAdapter

public HoverEventAdapter(HoverEventAdapter.Listener listener)

HoverEventAdapter

public HoverEventAdapter(HoverEventAdapter.Listener listener,
                         int msec)
Method Detail

processEvent

public void processEvent(LgEvent e)

startTimer

private void startTimer()

stopTimer

private void stopTimer()

getTargetEventClasses

public java.lang.Class<LgEvent>[] getTargetEventClasses()