Screen Updates: Difference between revisions

From ParaQ Wiki
Jump to navigationJump to search
No edit summary
No edit summary
Line 7: Line 7:
==Design==
==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:
UI components such as pqSMAdaptor 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.
* pqImmediateCommandDispatcher - immediately executes each command it receives, and updates the display.
Line 13: Line 13:
* pqExplicitCommandDispatcher - caches incoming commands until the user explicitly decides to execute them.
* pqExplicitCommandDispatcher - caches incoming commands until the user explicitly decides to execute them.


Commands are deleted by the owning dispatcher once executed.
Commands are deleted by the dispatcher once executed.

Revision as of 18:31, 2 November 2005

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 pqSMAdaptor 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 dispatcher once executed.