Screen Updates
From ParaQ Wiki
Jump to navigationJump to search
Requirements
- The time required to update the visualization network and redraw the display(s) may vary widely.
- Thus, do not assume that all UI changes should cause an immediate screen update.
- Conversely, do not assume that all updates will be slow - for simple networks & data, don't make the user work harder than they have to.
- Support a wide variety of update policies - immediate update, update only when the user explicitly requests it, etc.
Design
UI components such as pqCheckBox and pqSpinBox do not update the visualization network directly - instead, they create pqCommand-derived "command" instances which encapsulate the changes to be made. These instances are handed-off to a pqCommandDispatcher-derived object, which is maintained by the pqCommandDispatcherManager singleton. pqCommandDispatcher is an abstract interface responsible for "executing" commands, and its different derivatives can provide a wide variety of different execution policies:
- pqImmediateCommandDispatcher - immediately executes each command it receives, and updates the display.
- pqTimeoutCommandDispatcher - caches incoming commands until a timeout expires, then executes the cached commands and updates the display.
- pqExplicitCommandDispatcher - caches incoming commands until the user explicitly decides to execute them.
Commands are deleted by the owning dispatcher once executed.