> > | Adding a PaintEvent is messy, and can't capture the right events in the queue. New class IdleThread extends runnable, can be attached to the EventQueue as the idle event (happens after all events are processed, not sure if it resides after running, but easy enough to reattach it on incomplete scenes). Can't set idle event to null: EventQueue.invokeLater(idleThread) . Perhaps setting invokeLater will enqueue an InvocationEvent ?
Replace occurances of requestRedraw flag with a function call that checks for anything in the redraw queue, state machines are bad!
InvocationEvent added to EventQueue when thread (or runnable) is started
Redraw types:
-
PaintEvent : includes window events that don't have explicit listeners
-
InvocationEvent : thread startup, seems to be followed by PaintEvent s for components, threads, and frames in hierarchy. Must distinguish between invocations on idle thread/frames and the actual components.
-
MouseEvent : nothing special, no extra code needed in mouse handlers, so far. Redraws as needed are called through requestRedraw
- ignore mouse clicks, mouse releases
-
KeyEvent : same as mouse handlers
|