Tracking the mouse
The most numerous and best-developed set of interactors in Tycho are
those that "track" movement of the mouse in some way. These interactors
can all be cascaded -- for example, cascading a Bounder with a
Stepper will move an item in discrete steps and keep it within
a region of the Slate.
Follower just follows the mouse exactly. It is the most basic
kind of mouse tracker, and is the superclass of all other mouse
trackers. It has no options other than those in the Interactor
superclass.
Enhancements: (none)
Bounder moves an item, but keeps it within a rectangular region of the
Slate. It has the following options
- -bounds. A four-list giving the rectangular coordinates in
which to keep the target item. If it is the empty list, then the
Bounder keeps the target item within the coordinates of the slate. By
default, it is the empty list. (Note that bounds do not have to be
constant: the
-activatemandcommand
script can be used to
dynamically choose the bounds.)
Note that the bounds enforced by this interactor apply to the target
item, not to the cursor. That is, the interactor keeps the target
within the specified region, which usually means that the cursor is
restricted to any even smaller region. If the target item is outside
the bounds when the interactor is activated, the first movement will
move it inside the bounds.
Enhancements: It is uncertain what will happen if the
bounds is smaller than the target item.
Alonger is similar to Bounder, but moves the
target item in one axis only. It has the following options
- -bounds. If this is a two-list, then it is the coordinates
along the chosen axis within which to keep the target item. If it
is a four-list, then it is the rectangular coordinates within
which to keep the target item. If it is the empty list, then the
Alonger keeps the target item within the coordinates of the slate.
By default, this option is the empty list.
- -along. The axis along which to move the target item. This
can be x or y, and defaults to x.
The remarks made about Bounder keeping the target item, not the
cursor, within the bounds also apply to Alonger.
Enhancements: This interactor needs a better name.
Gridder and Stepper quantize the mouse movement. They
have the following option:
- -gridsize. The quantization step size. The default is 12.
Gridder and Stepper are almost the same, except that
Gridder forces the cursor to multiples of the gridsize, while
Stepper quantizes the cursor movement to steps equal to
that amount. For example, suppose gridsize
were 10 and
the start position of the cursor was (15,15). Gridder would
move the cursor to say (20,20) and then (30,20), while Stepper
would move it to say (25,25) and then (35,25).
Enhancements: Merge Gridder into Stepper, and
provide a flag that selects no quantization, gridding, or stepping.
Back up
Tycho Home Page
Copyright © 1996, The Regents of the University of California.
All rights reserved.
Last updated: 96/12/11,
comments to: johnr@eecs.berkeley.edu