8.5.3 Attachment operations
Whereas a snap has an implied direction, with the source object jumping to the target
object, a physical attachment has none. Snap elements participating in such an
attachment are equals because no movement is involved and the relationship is bilateral.
This makes creating a physical attachment a lot simpler than performing a snap
because there is no need to differentiate source and target objects and snap elements.
As with snapping, the user can perform physical attachment operations directly
through dragging or indirectly through commands. Direct physical attachment is simply
a snap and attachment combined into a single drag operation. Indirect physical
attachment involves the user selecting one or more primed snap elements and commanding
them to be attached. A variation is for the user to select one or more objects
and to command that all of their primed snap elements be attached. Yet another variation
is to use an attachment tool or mode that creates an attachment upon selecting
the primed snap elements, directly with the mouse or indirectly in a list. Most of these
approaches could be used in the earlier dry fit scenario, where attachments are added
to an assembly after snapping all of its objects together.
Logical attachment operations must be handled a bit differently. Because the snap
elements do not have to touch, the user must explicitly designate the two snap elements
to attach. Such an operation is more akin to snapping than to physical attachment,
although no object movement is involved. As in snapping, the user can
designate source and target snap elements if the logical attachment is directional, and
proximity during drag can drive snap element autoselection. Selecting the objects to
be attached instead of their snap elements can work, but problems might arise if the
objects contain multiple snap elements.
8.5.4 Detachment operations
Unlike snapping, where no persistence is involved, attachments generally need to be
broken. One approach is suggested by PTF sticky drag, where overdragging or jerking
an attached object can break it free from its attachments. This is analogous to breaking
certain kinds of temporary attachments in the real world, such as those made with
Velcro. As is often the case with gesture-based actions, if the user is unsuspecting or
lacking in skill, he or she might end up with an unexpected result, such as dragging
only a single object when the intent was to drag the whole assembly. An alternative
approach that avoids this problem and which parallels one we saw for attachment
operations is to select the attachments and then to indirectly command their detachment.
A variation is to select one or more objects and command that any attachments
on them be broken. Another variation would be to use a detachment tool or mode to
break individual attachments when they are selected, on an object or in a list.
8.5.5 Gluing
The most common form of physical attachment and the easiest to implement and
control is where the participating objects are held rigidly together. This form of
attachment is called gluing. When attachments are glued, pulling on one object
would also pull any other objects attached to it, and any objects attached to those
objects, and so on. In other words, tugging on any part of a glued assembly of objects
results in the whole assembly moving without deformation.
New on the Java Boutique:
New Review:
Time Management Made Easy with the Quartz Enterprise Job Scheduler
Why not just use the Java timer API? This open source scheduling
API boasts simplicity, ease-of-integration, a well-rounded feature
set, and it's free!
New Applet:
Reverse Complement
Reverse Complement is a simple applet that converts DNA or RNA
sequences into three useful formats.
Elsewhere on internet.com:
WebDeveloper Java
Lots of Java information on webdeveloper.com
WDVL Java
Thorough Java resource at the Web Developer's Virtual Library.
ScriptSearch Java
Hundreds of free Java code files to download.
jGuru: Your View of the Java Universe
Customizable portal with online training, FAQs, regular news updates, and tutorials.
|