Shapes
The Slate gives every item a shape, which is used to
manipulate the item in various ways. Each shape is an "uninstantiable"
class, with the root class of the hierarchy being the Shape class. Here is the list of
shapes, and for each, the aspects it supports. Each heading of
hyperlinked to the class documentation for the class that implements
that shape.
Note: some complex items choose to override the default aspects
given by its shape. Note also that (i) an item can be made to appear
rectangular when method such as aspect
and
reshape
are called, by supplying the flag
-region
; and (ii) an item is treated as a rectangle by
the region
method, which is like coords
but
queries or manipulates the rectangular region of the Slate covered by
the item.
Aspects are divided into primitive and
derived. Primitive aspects are those to which constraints
can be attached.
The item has two coordinates only. Generally, items of
"point" shape have a -anchor
option that positions
them relative to the point. Items with this shape include
text, bitmap, image, and Axis.
Primitive aspects
- origin: The coordinates of the item.
Derived aspects
None.
The item has four coordinates, being the left, top, right, and bottom
coordinates. Items with this shape include rectangle,
Frame, LabeledRect, and LabeledFrame.
Primitive aspects
- n: The center of the top edge.
- s: The center of the bottom edge.
- e: The center of the right edge.
- w: The center of the left edge.
Derived aspects
- ne: The top-right corner.
- nw: The top-left corner.
- se: The bottom-right corner.
- sw: The bottom-left corner.
- c or center: The center of the rectangle.
The item has four coordinates, being the left, top, right, and bottom
coordinates. Items with this shape include oval
and LabeledOval.
Primitive aspects
- hradius: The point at the right side of the oval; changing
this aspect changes the horizontal width of the oval.
- vradius: The point at the top side of the oval; changing
this aspect changes the vertical height of the oval.
Derived aspects
- c or center: The center of the oval.
- circumference-x-y: The point on the circumference that
intersects the vector (x, y) drawn from the center.
The item has four or more coordinates, each pair being one vertex
of the line. Items with this shape include line
and SmartLine.
Primitive aspects
- vertex-n: The n'th vertex of the line.
- start: The start of the line.
- end: The end of the line.
Derived aspects
- length: The number of edges in the line (number of
vertices less one).
The item has four or more coordinates, each pair being one vertex of
the polygon. The last pair must be identical to the first pair. Items
with this shape include polygon and Solid.
Primitive aspects
- vertex-n: The n'th vertex of the polygon.
Derived aspects
- c or center: The center of the polygon.
- edges: The number of edges in the polygon.
Back up
Tycho Home Page
Copyright © 1996-1998, The Regents of the University of California.
All rights reserved.
Last updated: 04/07/97,
comments to: johnr@eecs.berkeley.edu