|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.util.IdleTracker
public abstract class IdleTracker
Used to track user idleness in an AWT application.
| Nested Class Summary | |
|---|---|
protected class |
IdleTracker.EventListener
|
| Field Summary | |
|---|---|
protected long |
_lastEvent
The time of the last mouse or keyboard event; used to track whether the user is idle. |
protected int |
_state
Whether the user is currently active, idle or abandoned. |
protected long |
_toAbandonTime
The duration after which we declare the user to have abandoned ship. |
protected long |
_toIdleTime
The duration after which we declare the user to be idle. |
protected static int |
ABANDONED
|
protected static int |
ACTIVE
|
protected static long |
EVENT_MASK
|
protected static int |
IDLE
|
| Constructor Summary | |
|---|---|
IdleTracker(long toIdleTime,
long toAbandonTime)
Creates an idle tracker that will report idleness (via idledOut()) after toIdleTime milliseconds have elapsed. |
|
| Method Summary | |
|---|---|
protected abstract void |
abandonedShip()
Called when the client has been idle for _toIdleTime plus
_toAbandonTime milliseconds. |
protected void |
checkIdle()
Checks the last user event time and posts a command to idle them out if they've been inactive for too long, or log them out if they've been idle for too long. |
protected abstract long |
getTimeStamp()
This should return a timestamp. |
protected void |
handleUserActivity()
Called with any keyboard or mouse events performed on the frame so as to note user activity as it pertains to tracking the client idle state. |
protected abstract void |
idledIn()
Called when the client becomes non-idle after we have previously reported their idleness. |
protected abstract void |
idledOut()
Called when the client has been idle for _toIdleTime
milliseconds. |
void |
start(KeyboardManager keymgr,
RunQueue rqueue)
|
void |
start(KeyboardManager keymgr,
Window root,
RunQueue rqueue)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected long _toIdleTime
protected long _toAbandonTime
protected long _lastEvent
protected int _state
protected static final int ACTIVE
protected static final int IDLE
protected static final int ABANDONED
protected static final long EVENT_MASK
| Constructor Detail |
|---|
public IdleTracker(long toIdleTime,
long toAbandonTime)
idledOut()) after toIdleTime milliseconds have elapsed.
After an additional toAbandonTime milliseconds have
elapsed, we will report that the user has abandonedShip().
| Method Detail |
|---|
public void start(KeyboardManager keymgr,
RunQueue rqueue)
public void start(KeyboardManager keymgr,
Window root,
RunQueue rqueue)
protected abstract void idledOut()
_toIdleTime
milliseconds.
protected abstract void idledIn()
protected abstract void abandonedShip()
_toIdleTime plus
_toAbandonTime milliseconds.
protected abstract long getTimeStamp()
System.currentTimeMillis() except that on Windows that sometimes does
strange things like leap forward in time causing immediate idleness.
protected void handleUserActivity()
protected void checkIdle()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||