A site represents a point on a figure. Sites are
used by manipulators so that they know where to attach grab-handles.
Application-specific figures may also provide sites that
allows clients to find attachment points and other key points
on the figure.
Get the x-coordinate of the site, in the enclosing
Get the y-coordinate of the site, in the enclosing
Test if this site has a "normal" to it. The normal
is accessible by the methods getNormal()
and isNormal(). Generally, sites on the boundary of
a shape will return true to this method, and sites
in the center of an object will return false.
boolean isNormal(int direction)
Test if this site has a normal in the given direction.
The direction is that given by one of the static constants
NORTH, SOUTH, EAST, or WEST, defined in
void setNormal(double normal)
Set the normal "out" of the site. If the site cannot
change its normal, it can ignore this call, so clients
that care should always check the normal after calling.
If the site can change its normal, it can also change
its position. For example, a site on the perimeter of a
figure may move to a different position.
void translate(double x,
Translate the site by the indicated distance, where distances
are in the local coordinates of the containing pane. Usually,
this will mean that the figure is reshaped so that the
site moves the given distance. If the site cannot
be moved the given distance, then either do nothing, or move
it part of the distance. Clients are expected to check the
new location of the site.