Check out the new USENIX Web site. next up previous
Next: Complex item classes Up: The Tycho Slate: Complex Previous: Introduction

The core graphics framework

 

The Slate is implemented as a set of classes, organized around one key class called Slate. We have tried to make the Slate a plug-in replacement for the Tk canvas. A simple example:

  set slate [::tycho::slate .s -height 300 -width 400 -background white]
  pack $slate -fill both -expand 1

Figure 2 shows a conceptual representation, in the Object Modeling Notation [11], of the key classes. The diagram is conceptual only, because many of these classes do not in fact exist - in the implementation, they are faked using Tcl procedures, canvas item tags, and associative arrays.

The Slate class is wrapped around a Tk canvas. It contains an arbitrary number of Items, which are graphical elements that appear on the screen. An Item is either a ComplexItem, which is in turn an aggregation of Items, or a SimpleItem, which represents a single Tk canvas item such as a line or rectangle. Each item has a Shape (see section 2.3), and can be operated on by an arbitrary number of Interactors (see section 3.2).

 

  figure315


Figure 2: The key framework classes




next up previous
Next: Complex item classes Up: The Tycho Slate: Complex Previous: Introduction